using CalamityMod.Systems.Graphic.LiquidSystem; using Terraria; using Terraria.Graphics; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Systems { public abstract class ModLavaStyle : ModTexturedType { /// /// The ID of the lava style. /// public int Slot { get; private set; } = -1; public override string Name => base.Name; public override string Texture => base.Texture; public virtual string BlockTexture => Texture + "_Block"; public virtual string SlopeTexture => Texture + "_Slope"; public virtual string WaterfallTexture => Texture + "_Waterfall"; protected sealed override void Register() { Slot = ModLavaStyleLoader.Register(this); } public sealed override void SetupContent() { SetStaticDefaults(); } /// /// Allows you to determine how much light this lava emits.
/// It can also let you light up the block in front of this lava.
/// Keep in mind this also effects what color the lavafalls emit
/// See for vanilla tile light values to use as a reference.
///
/// The x position in tile coordinates. /// The y position in tile coordinates. /// The red component of light, usually a value between 0 and 1 /// The green component of light, usually a value between 0 and 1 /// The blue component of light, usually a value between 0 and 1 public virtual void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { r = 0.55f; g = 0.33f; b = 0.11f; } /// /// Allows water styles to manipulate what color the liquid is drawn to, this can allow waters to be see-throughable to see backgrounds (surface and underground backgrounds not walls) /// /// X position of the water /// Y position of the water /// The vertexColor of the water color, this is both used to get the current color and to set the color of the water public virtual void DrawColor(int x, int y, ref VertexColors liquidColor, bool isSlope) { } /// /// The ID of the dust that is created when anything splashes in lava. /// public virtual int GetSplashDust() { return DustID.Lava; } /// /// The ID of the gore that represents droplets of lava falling down from a block. Return (or another existing droplet gore). /// public virtual int GetDropletGore() { return GoreID.LavaDrip; } /// /// Return true if the player is in the correct zone to activate the lava. /// /// public virtual bool IsLavaActive() { return false; } /// /// Return false if the waterfall made by the lavastyle should have a glowmask /// /// public virtual bool LavafallGlowmask() { return true; } /// /// Allows your lavastyle to inflict debuffs to Players and NPCs when they enter your lava style /// /// The Player that is inflicted with the debuff apon entering the lavastyle /// The duration of the OnFire! debuff. This allows for easy replacement of OnFire public virtual void InflictDebuff(Player player, int onfireDuration) { } } }