From 36a7671a43da2f842437a7fa77ae9fe4ac50eb9a Mon Sep 17 00:00:00 2001 From: Heart-Plus-Up <85328817+Heart-Plus-Up@users.noreply.github.com> Date: Thu, 9 Feb 2023 07:22:29 -0700 Subject: [PATCH] Astral, Vines, and kelp effects --- CalPlayer/CalamityPlayerMiscEffects.cs | 15 ++++++++++++ Dusts/CinderBlossomDust.png | Bin 126 -> 150 bytes Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs | 13 +++++++++- Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs | 13 +++++++++- Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs | 13 +++++++++- Tiles/Abyss/SulphurousVines.cs | 11 +++++++++ Tiles/Ores/AstralOre.cs | 25 +++++++++++++------- 7 files changed, 79 insertions(+), 11 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 1af1af19be..091eac086e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -63,6 +63,7 @@ using Terraria.ID; using Terraria.ModLoader; using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence; using CalamityMod.Items.Armor.Wulfrum; +using CalamityMod.Tiles.Abyss.AbyssAmbient; namespace CalamityMod.CalPlayer { @@ -493,6 +494,7 @@ namespace CalamityMod.CalPlayer int astralOreID = ModContent.TileType(); int auricOreID = ModContent.TileType(); int chaotiOreID = ModContent.TileType(); + int abyssKelpID = ModContent.TileType(); int auricRejectionDamage = 300; float auricRejectionKB = Player.noKnockback ? 20f : 40f; @@ -503,6 +505,19 @@ namespace CalamityMod.CalPlayer if (!tile.HasTile || !tile.HasUnactuatedTile) continue; + if (tile.TileType == abyssKelpID) + { + if (Player.velocity.Length() == 0) + { return; } + + Dust dust; + dust = Main.dust[Dust.NewDust(Player.Center, 16, 16, 304, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)]; + dust.noGravity = true; + dust.noLight = true; + dust.fadeIn = 2.5813954f; + } + + // Ores below here // Astral Ore inflicts Astral Infection briefly on contact if (tile.TileType == astralOreID) Player.AddBuff(ModContent.BuffType(), 2); diff --git a/Dusts/CinderBlossomDust.png b/Dusts/CinderBlossomDust.png index aeb183ae7592a93686286c930f5db6a8c2cae15b..abfbb3911923bccffc718fc3f1e7cb189cb21e41 100644 GIT binary patch delta 120 zcmb=M#yCNxh_k>WvY3H^TL^?1FWs&C!@$7c;pyTSQgJIeVS(g?|NrJ6{QhG3e}`Z8 z9miG*EaPDLpw*_?#3(S|NO+>?<4}_|3_58EGd|5=^i*Kp!{yl}*_0mdKI;Vst0Lj5FrT_o{ delta 96 zcmV-m0H6Ps0e+AqS^;xXM?wIu&K&6g001^gL_t(IPh(^t5-<{}jsdPv{`>#`$eJE< zGNKqV7!(rn6zRSm3MP)m47OMr3~@agGZe)P0ELS%ALz%lfdBvi07*qoM6N<$f&c(( CdLb Main.worldSurface) + { + Dust dust; + dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, 304, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)]; + dust.noGravity = true; + dust.noLight = true; + dust.fadeIn = 2.5813954f; + } + } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs index f6939534ba..fad6775091 100644 --- a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs +++ b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -45,6 +45,17 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient b = 30f / 255f; } } + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer && Main.rand.NextBool(100) && j > Main.worldSurface) + { + Dust dust; + dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, 304, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)]; + dust.noGravity = true; + dust.noLight = true; + dust.fadeIn = 2.5813954f; + } + } public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs index 9dee8245d8..d74e225dce 100644 --- a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs +++ b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -45,6 +45,17 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient b = 30f / 255f; } } + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer && Main.rand.NextBool(100) && j > Main.worldSurface) + { + Dust dust; + dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, 304, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)]; + dust.noGravity = true; + dust.noLight = true; + dust.fadeIn = 2.5813954f; + } + } public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/Abyss/SulphurousVines.cs b/Tiles/Abyss/SulphurousVines.cs index bd15f7826a..3f19ec8a55 100644 --- a/Tiles/Abyss/SulphurousVines.cs +++ b/Tiles/Abyss/SulphurousVines.cs @@ -58,6 +58,17 @@ namespace CalamityMod.Tiles.Abyss } } } + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer && Main.rand.NextBool(200) && j > Main.worldSurface) + { + Dust dust; + dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, 304, 0.23255825f, 10f, 0, new Color(22, 255, 0), 1.5116279f)]; + dust.noGravity = true; + dust.noLight = true; + dust.fadeIn = 2.5813954f; + } + } // Ozzatron 01JUL2022: heavily refactored this code to not suck. also, sulphurous vines won't grow in honey anymore. private const int MaxVineHeight = 10; diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index 2e1bf72c59..85642511f6 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Tiles.Astral; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -40,6 +41,22 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true; } + public override void NearbyEffects(int i, int j, bool closer) + { + Tile tile = Main.tile[i, j]; + Tile up = Main.tile[i, j - 1]; + Tile up2 = Main.tile[i, j - 2]; + if (closer && Main.rand.NextBool(60) && !up.HasTile && !up2.HasTile && j < Main.worldSurface) + { + //Cyan Cinders below + Dust dust; + dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 16, 16, ModContent.DustType(), -0.4651165f, 0f, 17, new Color(0, 255, 244), 1.5f)]; + + //Orange Cinders below + dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 16, 16, ModContent.DustType(), -0.4651165f, 0f, 17, new Color(255, 255, 255), 1.5f)]; + + } + } public override bool CanKillTile(int i, int j, ref bool blockDamaged) { @@ -56,14 +73,6 @@ namespace CalamityMod.Tiles.Ores num = fail ? 1 : 3; } - public override void RandomUpdate(int i, int j) - { - if (Main.rand.Next(7) <= 2) - { - Dust.NewDust(new Vector2(i * 16f, j * 16f), 16, 16, 156, Main.rand.NextFloat(-0.05f, 0.05f), Main.rand.NextFloat(-0.05f, -0.001f)); - } - } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { float brightness = 0.7f;