From 7f0b29f48ca5c9dfa6e27d882f8bd80e59a92fe2 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 24 Apr 2020 18:48:08 -0400 Subject: [PATCH] added a telegraph for geysers and slightly buffed wyvern's call --- Items/Weapons/Magic/WyvernsCall.cs | 2 +- NPCs/Calamitas/Calamitas.cs | 9 +- NPCs/Calamitas/CalamitasRun.cs | 34 +--- NPCs/Calamitas/CalamitasRun2.cs | 24 +-- NPCs/Calamitas/CalamitasRun3.cs | 9 +- NPCs/Calamitas/LifeSeeker.cs | 2 +- NPCs/Calamitas/SoulSeeker.cs | 9 +- Projectiles/Boss/BrimstoneFire.cs | 34 ++-- Projectiles/Environment/BrimstoneGeyser.cs | 174 ++++++++++++++++++++ Projectiles/Environment/BrimstoneGeyser.png | Bin 0 -> 136 bytes Projectiles/Environment/GeyserTelegraph.cs | 53 ++++++ Projectiles/Environment/GeyserTelegraph.png | Bin 0 -> 136 bytes Projectiles/Environment/SmokeTelegraph.cs | 167 +++++++++++++++++++ Projectiles/Environment/SmokeTelegraph.png | Bin 0 -> 136 bytes Tiles/CalamityGlobalTile.cs | 11 +- 15 files changed, 448 insertions(+), 80 deletions(-) create mode 100644 Projectiles/Environment/BrimstoneGeyser.cs create mode 100644 Projectiles/Environment/BrimstoneGeyser.png create mode 100644 Projectiles/Environment/GeyserTelegraph.cs create mode 100644 Projectiles/Environment/GeyserTelegraph.png create mode 100644 Projectiles/Environment/SmokeTelegraph.cs create mode 100644 Projectiles/Environment/SmokeTelegraph.png diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index 0972fea8e5..1c7c5fbf54 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -19,7 +19,7 @@ Fires wyverns and colored feathers from the sky that stick to enemies and tiles public override void SetDefaults() { - item.damage = 30; + item.damage = 35; item.magic = true; item.mana = 10; item.width = 52; diff --git a/NPCs/Calamitas/Calamitas.cs b/NPCs/Calamitas/Calamitas.cs index 27d346b4d5..6031a3655b 100644 --- a/NPCs/Calamitas/Calamitas.cs +++ b/NPCs/Calamitas/Calamitas.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -156,7 +157,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f); } } else @@ -169,7 +170,7 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -179,10 +180,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index 2e011e69cc..6e5c28cf6f 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Boss; @@ -155,35 +156,16 @@ namespace CalamityMod.NPCs.Calamitas public override void NPCLoot() { - if (Main.rand.NextBool(10)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } - if (Main.expertMode) - { - if (Main.rand.NextBool(10)) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } - else if (Main.rand.NextBool(12)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } - if (Main.expertMode) - { - if (Main.rand.NextBool(10)) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } - else if (Main.rand.NextBool(12)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 10 : 12); + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 10 : 12); } public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -200,7 +182,7 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -210,10 +192,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index 8967a2c878..9ec03c6fcd 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Boss; @@ -155,26 +156,15 @@ namespace CalamityMod.NPCs.Calamitas public override void NPCLoot() { - if (Main.rand.NextBool(10)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } - if (Main.expertMode) - { - if (Main.rand.NextBool(10)) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } - else if (Main.rand.NextBool(15)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 10 : 12); } public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -191,7 +181,7 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -201,10 +191,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index ab88b1f886..908cd94261 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -236,7 +237,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -254,7 +255,7 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -264,10 +265,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Calamitas/LifeSeeker.cs b/NPCs/Calamitas/LifeSeeker.cs index bf44d3573d..0c4add9f14 100644 --- a/NPCs/Calamitas/LifeSeeker.cs +++ b/NPCs/Calamitas/LifeSeeker.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Calamitas npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index b3ea016b86..cf1bbcfdf6 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -128,7 +129,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -144,7 +145,7 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -154,10 +155,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index 3b902b5940..f9ff6f101c 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -27,42 +28,39 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, 0.3f, 0f, 0f); if (projectile.ai[0] > 7f) { - float num296 = 1f; + float scalar = 1f; if (projectile.ai[0] == 8f) { - num296 = 0.25f; + scalar = 0.25f; } else if (projectile.ai[0] == 9f) { - num296 = 0.5f; + scalar = 0.5f; } else if (projectile.ai[0] == 10f) { - num296 = 0.75f; + scalar = 0.75f; } projectile.ai[0] += 1f; - int num297 = 235; + int dustType = (int)CalamityDusts.Brimstone; if (Main.rand.NextBool(2)) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 100, default, 1f); + int fire = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 100, default, 1f); + Dust dust = Main.dust[fire]; if (Main.rand.NextBool(3)) { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 3f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 1.5f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 1.5f; + dust.noGravity = true; + dust.scale *= 3f; + dust.velocity.X *= 1.5f; + dust.velocity.Y *= 1.5f; } else { - Main.dust[num299].scale *= 1.5f; + dust.scale *= 1.5f; } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= scalar; } } else diff --git a/Projectiles/Environment/BrimstoneGeyser.cs b/Projectiles/Environment/BrimstoneGeyser.cs new file mode 100644 index 0000000000..1394d3dc25 --- /dev/null +++ b/Projectiles/Environment/BrimstoneGeyser.cs @@ -0,0 +1,174 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Environment +{ + public class BrimstoneGeyser : ModProjectile + { + private int dustType = (int)CalamityDusts.Brimstone; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Smoke"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 120; + projectile.hostile = true; + projectile.penetrate = -1; + projectile.trap = true; + } + + public override void AI() + { + int num1 = Math.Sign(projectile.velocity.Y); + int num2 = num1 == -1 ? 0 : 1; + if (projectile.ai[0] == 0f) + { + if (!Collision.SolidCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float) (projectile.height - 48) : 0f), projectile.width, 48) && !Collision.WetCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float) (projectile.height - 20) : 0f), projectile.width, 20)) + { + projectile.velocity = new Vector2(0f, (float) Math.Sign(projectile.velocity.Y) * (1f / 1000f)); + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.timeLeft = 60; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] >= 60f) + projectile.Kill(); + for (int index1 = 0; index1 < 3; ++index1) + { + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, new Color(), 1f); + Main.dust[index2].scale = 0.1f + Main.rand.Next(5) * 0.1f; + Main.dust[index2].fadeIn = 1.5f + Main.rand.Next(5) * 0.1f; + Main.dust[index2].noGravity = true; + Main.dust[index2].position = projectile.Center + new Vector2(0f, (float) (-projectile.height / 2)).RotatedBy((double)projectile.rotation, new Vector2()) * 1.1f; + } + } + if (projectile.ai[0] != 1f) + return; + projectile.velocity = new Vector2(0f, (float) Math.Sign(projectile.velocity.Y) * (1f / 1000f)); + if (num1 != 0) + { + int num3 = 16; + int num4 = 320; + while (num3 < num4 && !Collision.SolidCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float)(projectile.height - num3 - 16) : 0f), projectile.width, num3 + 16)) + num3 += 16; + if (num1 == -1) + { + projectile.position.Y += (float)projectile.height; + projectile.height = num3; + projectile.position.Y -= (float)num3; + } + else + projectile.height = num3; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] >= 60f) + projectile.Kill(); + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = 1f; + for (int index1 = 0; index1 < 60; ++index1) + { + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f); + Dust dust = Main.dust[index2]; + dust.alpha = 200; + dust.velocity *= new Vector2(0.3f, 2f); + dust.velocity.Y += (float)(2 * num1); + dust.scale += Main.rand.NextFloat(); + dust.position = new Vector2(projectile.Center.X, projectile.Center.Y + (float) projectile.height * 0.5f * (float) -num1); + dust.customData = (object) num2; + if (num1 == -1 && Main.rand.Next(4) != 0) + { + dust.velocity.Y -= 0.2f; + } + } + Main.PlaySound(SoundID.Item34, projectile.position); + } + if (num1 == 1) + { + for (int index1 = 0; index1 < 9; ++index1) + { + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f); + Dust dust = Main.dust[index2]; + dust.alpha = 200; + dust.velocity *= new Vector2(0.3f, 2f); + dust.velocity.Y += (float)(2 * num1); + dust.scale += Main.rand.NextFloat(); + dust.position = new Vector2(projectile.Center.X, projectile.Center.Y + (float) projectile.height * 0.5f * (float) -num1); + dust.customData = (object)num2; + if (num1 == -1 && Main.rand.Next(4) != 0) + { + Main.dust[index2].velocity.Y -= 0.2f; + } + } + } + int Height = (int)(projectile.ai[1] / 60f * (float)projectile.height) * 3; + if (Height > projectile.height) + Height = projectile.height; + Vector2 Position = projectile.position + (num1 == -1 ? new Vector2(0f, (float) (projectile.height - Height)) : Vector2.Zero); + Vector2 vector2 = projectile.position + (num1 == -1 ? new Vector2(0f, (float) projectile.height) : Vector2.Zero); + for (int index1 = 0; index1 < 6; ++index1) + { + if (Main.rand.Next(3) < 2) + { + int index2 = Dust.NewDust(Position, projectile.width, Height, dustType, 0f, 0f, 90, new Color(), 2.5f); + Dust dust = Main.dust[index2]; + dust.noGravity = true; + dust.fadeIn = 1f; + if (dust.velocity.Y > 0f) + { + dust.velocity.Y *= -1f; + } + if (Main.rand.Next(6) < 3) + { + dust.position.Y = MathHelper.Lerp(dust.position.Y, vector2.Y, 0.5f); + dust.velocity *= 5f; + dust.velocity.Y -= 3f; + dust.position.X = projectile.Center.X; + dust.noGravity = false; + dust.noLight = true; + dust.fadeIn = 0.4f; + dust.scale *= 0.3f; + } + else + Main.dust[index2].velocity = projectile.DirectionFrom(Main.dust[index2].position) * Main.dust[index2].velocity.Length() * 0.25f; + Main.dust[index2].velocity.Y *= (float)-num1; + Main.dust[index2].customData = (object)num2; + } + } + for (int index1 = 0; index1 < 6; ++index1) + { + if (Main.rand.NextFloat() >= 0.5f) + { + int index2 = Dust.NewDust(Position, projectile.width, Height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f); + Dust dust = Main.dust[index2]; + dust.alpha = 200; + dust.velocity *= new Vector2(0.6f, 1.5f); + dust.scale += Main.rand.NextFloat(); + if (num1 == -1 && Main.rand.Next(4) != 0) + { + dust.velocity.Y -= 0.2f; + } + dust.customData = (object)num2; + } + } + } + + public override bool CanDamage() => false; + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + } +} diff --git a/Projectiles/Environment/BrimstoneGeyser.png b/Projectiles/Environment/BrimstoneGeyser.png new file mode 100644 index 0000000000000000000000000000000000000000..a3192f94614dc2f6790aa57e1c0aa31cc0d6ee18 GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^Y#_`5A|IT2?*ZZ@dAqwX{0G4WdzViJif|TqL>4nJ z@ErkR#;MwT(m+A>5>H=O_6KY%{Dx*XIN1&Zg+x7F978y+C;$2X-=5j*z>x;#3(iao Y`*N8%pC){&2P$CjboFyt=akR{0HAOs6#xJL literal 0 HcmV?d00001 diff --git a/Projectiles/Environment/GeyserTelegraph.cs b/Projectiles/Environment/GeyserTelegraph.cs new file mode 100644 index 0000000000..1bb545e351 --- /dev/null +++ b/Projectiles/Environment/GeyserTelegraph.cs @@ -0,0 +1,53 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Environment +{ + public class GeyserTelegraph : ModProjectile + { + private bool initialized = false; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Geyser"); + } + + public override void SetDefaults() + { + projectile.width = 6; + projectile.height = 12; + projectile.hostile = true; + projectile.penetrate = -1; + projectile.timeLeft = 100; + projectile.trap = true; + } + + public override void AI() + { + if (!initialized) + { + int projectileType = ModContent.ProjectileType(); + float randomVelocity = Main.rand.NextFloat() + 0.5f; + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, -8f * randomVelocity, projectileType, 0, 0f, projectile.owner, 0f, 0f); + Main.projectile[proj].netUpdate = true; + initialized = true; + } + } + + public override void Kill(int timeLeft) + { + int projectileType = ProjectileID.GeyserTrap; + if (projectile.ai[0] == 1f) + { + projectileType = ModContent.ProjectileType(); + } + float randomVelocity = Main.rand.NextFloat() + 0.5f; + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, -8f * randomVelocity, projectileType, 20, 2f, projectile.owner, 0f, 0f); + Main.projectile[proj].friendly = false; + Main.projectile[proj].netUpdate = true; + } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; + } +} diff --git a/Projectiles/Environment/GeyserTelegraph.png b/Projectiles/Environment/GeyserTelegraph.png new file mode 100644 index 0000000000000000000000000000000000000000..ee4239cbf936c12f048e14db4d43e5e4b5676d0d GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJz0U{m4&**^!lDyqr82*Fcg1yTp14TFsJR*x3 z82FBWFymBhK53vJdx@v7EBixcF%}7{1csl=Kp|027sn8Z%gKNK|F>s0J8-0dxhIB` Yq4PDfXzLfQLqG)#p00i_>zopr00{RZSO5S3 literal 0 HcmV?d00001 diff --git a/Projectiles/Environment/SmokeTelegraph.cs b/Projectiles/Environment/SmokeTelegraph.cs new file mode 100644 index 0000000000..ac7af10c43 --- /dev/null +++ b/Projectiles/Environment/SmokeTelegraph.cs @@ -0,0 +1,167 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Environment +{ + public class SmokeTelegraph : ModProjectile + { + private int dustType = 31; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Smoke"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 120; + projectile.hostile = true; + projectile.penetrate = -1; + projectile.trap = true; + } + + public override void AI() + { + int num1 = Math.Sign(projectile.velocity.Y); + int num2 = num1 == -1 ? 0 : 1; + if (projectile.ai[0] == 0f) + { + if (!Collision.SolidCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float) (projectile.height - 48) : 0f), projectile.width, 48) && !Collision.WetCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float) (projectile.height - 20) : 0f), projectile.width, 20)) + { + projectile.velocity = new Vector2(0f, (float) Math.Sign(projectile.velocity.Y) * (1f / 1000f)); + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.timeLeft = 60; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] >= 60f) + projectile.Kill(); + for (int index1 = 0; index1 < 3; ++index1) + { + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, new Color(), 1f); + Main.dust[index2].scale = 0.1f + Main.rand.Next(5) * 0.1f; + Main.dust[index2].fadeIn = 1.5f + Main.rand.Next(5) * 0.1f; + Main.dust[index2].noGravity = true; + Main.dust[index2].position = projectile.Center + new Vector2(0f, (float) (-projectile.height / 2)).RotatedBy((double)projectile.rotation, new Vector2()) * 1.1f; + } + } + if (projectile.ai[0] != 1f) + return; + projectile.velocity = new Vector2(0f, (float) Math.Sign(projectile.velocity.Y) * (1f / 1000f)); + if (num1 != 0) + { + int num3 = 16; + int num4 = 320; + while (num3 < num4 && !Collision.SolidCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float)(projectile.height - num3 - 16) : 0f), projectile.width, num3 + 16)) + num3 += 16; + if (num1 == -1) + { + projectile.position.Y += (float)projectile.height; + projectile.height = num3; + projectile.position.Y -= (float)num3; + } + else + projectile.height = num3; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] >= 60f) + projectile.Kill(); + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = 1f; + for (int index1 = 0; index1 < 60; ++index1) + { + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f); + Dust dust = Main.dust[index2]; + dust.alpha = 200; + dust.velocity *= new Vector2(0.3f, 2f); + dust.velocity.Y += (float)(2 * num1); + dust.scale += Main.rand.NextFloat(); + dust.position = new Vector2(projectile.Center.X, projectile.Center.Y + (float) projectile.height * 0.5f * (float) -num1); + dust.customData = (object) num2; + if (num1 == -1 && Main.rand.Next(4) != 0) + { + dust.velocity.Y -= 0.2f; + } + } + Main.PlaySound(SoundID.Item34, projectile.position); + } + if (num1 == 1) + { + for (int index1 = 0; index1 < 9; ++index1) + { + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f); + Dust dust = Main.dust[index2]; + dust.alpha = 200; + dust.velocity *= new Vector2(0.3f, 2f); + dust.velocity.Y += (float)(2 * num1); + dust.scale += Main.rand.NextFloat(); + dust.position = new Vector2(projectile.Center.X, projectile.Center.Y + (float) projectile.height * 0.5f * (float) -num1); + dust.customData = (object)num2; + if (num1 == -1 && Main.rand.Next(4) != 0) + { + Main.dust[index2].velocity.Y -= 0.2f; + } + } + } + int Height = (int)(projectile.ai[1] / 60f * (float)projectile.height) * 3; + if (Height > projectile.height) + Height = projectile.height; + Vector2 Position = projectile.position + (num1 == -1 ? new Vector2(0f, (float) (projectile.height - Height)) : Vector2.Zero); + Vector2 vector2 = projectile.position + (num1 == -1 ? new Vector2(0f, (float) projectile.height) : Vector2.Zero); + for (int index1 = 0; index1 < 6; ++index1) + { + if (Main.rand.Next(3) < 2) + { + int index2 = Dust.NewDust(Position, projectile.width, Height, dustType, 0f, 0f, 90, new Color(), 2.5f); + Dust dust = Main.dust[index2]; + dust.noGravity = true; + dust.fadeIn = 1f; + if (dust.velocity.Y > 0f) + { + dust.velocity.Y *= -1f; + } + if (Main.rand.Next(6) < 3) + { + dust.position.Y = MathHelper.Lerp(dust.position.Y, vector2.Y, 0.5f); + dust.velocity *= 5f; + dust.velocity.Y -= 3f; + dust.position.X = projectile.Center.X; + dust.noGravity = false; + dust.noLight = true; + dust.fadeIn = 0.4f; + dust.scale *= 0.3f; + } + else + Main.dust[index2].velocity = projectile.DirectionFrom(Main.dust[index2].position) * Main.dust[index2].velocity.Length() * 0.25f; + Main.dust[index2].velocity.Y *= (float)-num1; + Main.dust[index2].customData = (object)num2; + } + } + for (int index1 = 0; index1 < 6; ++index1) + { + if (Main.rand.NextFloat() >= 0.5f) + { + int index2 = Dust.NewDust(Position, projectile.width, Height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f); + Dust dust = Main.dust[index2]; + dust.alpha = 200; + dust.velocity *= new Vector2(0.6f, 1.5f); + dust.scale += Main.rand.NextFloat(); + if (num1 == -1 && Main.rand.Next(4) != 0) + { + dust.velocity.Y -= 0.2f; + } + dust.customData = (object)num2; + } + } + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Environment/SmokeTelegraph.png b/Projectiles/Environment/SmokeTelegraph.png new file mode 100644 index 0000000000000000000000000000000000000000..a3192f94614dc2f6790aa57e1c0aa31cc0d6ee18 GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^Y#_`5A|IT2?*ZZ@dAqwX{0G4WdzViJif|TqL>4nJ z@ErkR#;MwT(m+A>5>H=O_6KY%{Dx*XIN1&Zg+x7F978y+C;$2X-=5j*z>x;#3(iao Y`*N8%pC){&2P$CjboFyt=akR{0HAOs6#xJL literal 0 HcmV?d00001 diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index ba38ea934b..2e164cbcd1 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Potions; -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Environment; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; @@ -485,10 +485,11 @@ namespace CalamityMod.Tiles } if (shootFlames && Main.netMode != NetmodeID.MultiplayerClient) { - int projectileType = (type != ModContent.TileType() && type != ModContent.TileType()) ? ProjectileID.GeyserTrap : ModContent.ProjectileType(); - float randomVelocity = Main.rand.NextFloat() + 0.5f; - int proj = Projectile.NewProjectile((float)(i * 16), (float)(j * 16), 0f, -8f * randomVelocity, projectileType, 20, 2f, Main.myPlayer, 0f, 0f); - Main.projectile[proj].friendly = false; + float ai0 = 0f; + if (type == ModContent.TileType() || type == ModContent.TileType()) + ai0 = 1f; + int projectileType = ModContent.ProjectileType(); + int proj = Projectile.NewProjectile((float)(i * 16), (float)(j * 16), 0f, 0f, projectileType, 0, 0f, Main.myPlayer, ai0, 0f); Main.projectile[proj].netUpdate = true; } }