Added Basalt Gully lava style
Has no fountain because no sprites
This commit is contained in:
1 parent
7dc4d9ec2e
commit
9b5b1bbd5c
9 files changed
+215
No files matched your search
@@ -0,0 +1,178 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics.PackedVector;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Dusts.WaterSplash
|
||||
{
|
||||
public class BasaltGullyLavaSplash : ModDust
|
||||
{
|
||||
public override void OnSpawn(Dust dust)
|
||||
{
|
||||
dust.velocity *= 0.1f;
|
||||
dust.velocity.Y = -0.5f;
|
||||
}
|
||||
|
||||
public override bool Update(Dust dust)
|
||||
{
|
||||
if (dust.scale > 10f)
|
||||
{
|
||||
dust.active = false;
|
||||
}
|
||||
Dust.lavaBubbles++;
|
||||
dust.position += dust.velocity;
|
||||
if (!dust.noGravity)
|
||||
{
|
||||
dust.velocity.Y += 0.1f;
|
||||
}
|
||||
if (dust.noGravity)
|
||||
{
|
||||
dust.scale += 0.03f;
|
||||
if (dust.scale < 1f)
|
||||
{
|
||||
dust.velocity.Y += 0.075f;
|
||||
}
|
||||
dust.velocity.X *= 1.08f;
|
||||
if (dust.velocity.X > 0f)
|
||||
{
|
||||
dust.rotation += 0.01f;
|
||||
}
|
||||
else
|
||||
{
|
||||
dust.rotation -= 0.01f;
|
||||
}
|
||||
float num109 = dust.scale * 0.6f;
|
||||
if (num109 > 1f)
|
||||
{
|
||||
num109 = 1f;
|
||||
}
|
||||
Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f + 1f), num109 * (2.5f / 4), num109 * (1.3f / 4), num109 * (0.1f / 4));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Collision.WetCollision(new Vector2(dust.position.X, dust.position.Y - 8f), 4, 4))
|
||||
{
|
||||
dust.scale = 0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
dust.alpha += Main.rand.Next(2);
|
||||
if (dust.alpha > 255)
|
||||
{
|
||||
dust.scale = 0f;
|
||||
}
|
||||
dust.velocity.Y = -0.5f;
|
||||
dust.alpha++;
|
||||
dust.scale -= 0.01f;
|
||||
dust.velocity.Y = -0.2f;
|
||||
dust.velocity.X += (float)Main.rand.Next(-10, 10) * 0.002f;
|
||||
if ((double)dust.velocity.X < -0.25)
|
||||
{
|
||||
dust.velocity.X = -0.25f;
|
||||
}
|
||||
if ((double)dust.velocity.X > 0.25)
|
||||
{
|
||||
dust.velocity.X = 0.25f;
|
||||
}
|
||||
}
|
||||
float num3 = dust.scale * 0.3f + 0.4f;
|
||||
if (num3 > 1f)
|
||||
{
|
||||
num3 = 1f;
|
||||
}
|
||||
Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), num3 * (2.5f / 4), num3 * (1.3f / 4), num3 * (0.1f / 4));
|
||||
}
|
||||
dust.rotation += dust.velocity.X * 0.5f;
|
||||
if (dust.fadeIn > 0f && dust.fadeIn < 100f)
|
||||
{
|
||||
dust.scale += 0.03f;
|
||||
if (dust.scale > dust.fadeIn)
|
||||
{
|
||||
dust.fadeIn = 0f;
|
||||
}
|
||||
}
|
||||
dust.scale -= 0.01f;
|
||||
if (dust.noGravity)
|
||||
{
|
||||
dust.velocity *= 0.92f;
|
||||
if (dust.fadeIn == 0f)
|
||||
{
|
||||
dust.scale -= 0.04f;
|
||||
}
|
||||
}
|
||||
if (dust.position.Y > Main.screenPosition.Y + (float)Main.screenHeight)
|
||||
{
|
||||
dust.active = false;
|
||||
}
|
||||
float num17 = 0.1f;
|
||||
if ((double)Dust.dCount == 0.5)
|
||||
{
|
||||
dust.scale -= 0.001f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.6)
|
||||
{
|
||||
dust.scale -= 0.0025f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.7)
|
||||
{
|
||||
dust.scale -= 0.005f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.8)
|
||||
{
|
||||
dust.scale -= 0.01f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.9)
|
||||
{
|
||||
dust.scale -= 0.02f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.5)
|
||||
{
|
||||
num17 = 0.11f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.6)
|
||||
{
|
||||
num17 = 0.13f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.7)
|
||||
{
|
||||
num17 = 0.16f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.8)
|
||||
{
|
||||
num17 = 0.22f;
|
||||
}
|
||||
if ((double)Dust.dCount == 0.9)
|
||||
{
|
||||
num17 = 0.25f;
|
||||
}
|
||||
if (dust.scale < num17)
|
||||
{
|
||||
dust.active = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Dust dust, Color lightColor)
|
||||
{
|
||||
float num = (float)(255 - dust.alpha) / 255f;
|
||||
int num4;
|
||||
int num3;
|
||||
int num2;
|
||||
num = (num + 3f) / 4f;
|
||||
num4 = (int)((int)lightColor.R * num);
|
||||
num3 = (int)((int)lightColor.G * num);
|
||||
num2 = (int)((int)lightColor.B * num);
|
||||
int num6 = lightColor.A - dust.alpha;
|
||||
if (num6 < 0)
|
||||
{
|
||||
num6 = 0;
|
||||
}
|
||||
if (num6 > 255)
|
||||
{
|
||||
num6 = 255;
|
||||
}
|
||||
return new Color(num4, num3, num2, num6);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 242 B |
@@ -0,0 +1,11 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace CalamityMod.Gores.WaterDroplet
|
||||
{
|
||||
public class BasaltGullyLavaDroplet : LiquidDropletGore
|
||||
{
|
||||
public override bool lavaDroplet => true;
|
||||
|
||||
public override Vector3 lavaColor => new Vector3(2.5f, 1.3f, 0.1f);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
@@ -0,0 +1,26 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Waters
|
||||
{
|
||||
public class BasaltGullyLava : ModLavaStyle
|
||||
{
|
||||
public override string WaterfallTexture => "CalamityMod/Waters/BasaltGullyLavaflow";
|
||||
|
||||
public override int GetSplashDust() => ModContent.DustType<BasaltGullyLavaSplash>();
|
||||
|
||||
public override int GetDropletGore() => ModContent.GoreType<BasaltGullyLavaDroplet>();
|
||||
|
||||
public override bool IsLavaActive() => Main.LocalPlayer.Calamity().ZoneBasaltGully;
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
r = 2.48f / 4;
|
||||
g = 1.29f / 4;
|
||||
b = 0.48f / 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 109 B |
Binary file not shown.
|
After Width: | Height: | Size: 228 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in new issue
Block a user