From 320508d408410bd421e97245dfab73155df8059e Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 24 Feb 2024 23:51:34 -0800 Subject: [PATCH] Napalm -> Cinder Arrows Also includes small changes to other arrow types --- Items/Ammo/{NapalmArrow.cs => CinderArrow.cs} | 12 +- Items/Ammo/CinderArrow.png | Bin 0 -> 383 bytes Items/Ammo/NapalmArrow.png | Bin 3674 -> 0 bytes .../en-US/Mods.CalamityMod.Items.Ammo.hjson | 32 ++-- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 2 +- Projectiles/Ranged/CinderArrowProj.cs | 137 ++++++++++++++++++ Projectiles/Ranged/NapalmArrowProj.cs | 83 ----------- 7 files changed, 160 insertions(+), 106 deletions(-) rename Items/Ammo/{NapalmArrow.cs => CinderArrow.cs} (75%) create mode 100644 Items/Ammo/CinderArrow.png delete mode 100644 Items/Ammo/NapalmArrow.png create mode 100644 Projectiles/Ranged/CinderArrowProj.cs delete mode 100644 Projectiles/Ranged/NapalmArrowProj.cs diff --git a/Items/Ammo/NapalmArrow.cs b/Items/Ammo/CinderArrow.cs similarity index 75% rename from Items/Ammo/NapalmArrow.cs rename to Items/Ammo/CinderArrow.cs index 0c00770236..9e88ef59e3 100644 --- a/Items/Ammo/NapalmArrow.cs +++ b/Items/Ammo/CinderArrow.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Ammo { - public class NapalmArrow : ModItem, ILocalizedModType + [LegacyName("NapalmArrow")] + public class CinderArrow : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Ammo"; public override void SetStaticDefaults() @@ -25,7 +26,7 @@ namespace CalamityMod.Items.Ammo Item.knockBack = 1.5f; Item.value = Item.sellPrice(copper: 12); Item.rare = ItemRarityID.LightRed; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 13f; Item.ammo = AmmoID.Arrow; } @@ -33,10 +34,9 @@ namespace CalamityMod.Items.Ammo public override void AddRecipes() { CreateRecipe(250). - AddIngredient(ItemID.WoodenArrow, 250). - AddIngredient(). - AddIngredient(ItemID.Torch). - AddTile(TileID.Anvils). + AddIngredient(ItemID.HellfireArrow, 250). + AddIngredient(). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Ammo/CinderArrow.png b/Items/Ammo/CinderArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..e7775584ab97059513bb4a60200c8bfab57f1322 GIT binary patch literal 383 zcmeAS@N?(olHy`uVBq!ia0vp^AhrSr8<5myefbthF%}28J29*~C-V}>miKgV46*24 zI(efXlcR|1`ANQSF0y!tsVcH1rMmRacg+98sino8yXM88roRkP!qMC&B4OL~cAezY zQWHyIX3aJ<*4~s;=AQrc)4j8EtM8wQ@T*i$;@l?@$*}q_lV#%Tr0tQ{Q&|G;++li9 z{OP0n(Wtdd2cG=R*1Z@LxVZER%Y$#v_$xhcYz6SjNn&J0Tx%Tn0Z&zP~gvodS@Kb8YuKT9vG6%{_RPvVmJ;hZF?M+M=c>P#zW?UD%Du;L{s=Z4O!6f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz}{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_46#!l9 z0Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%LdZt9g$j;($`3&Zthxi`{{&gM}5&R^+h%b~yM9Zd3AWW9ETgVfL z1(`yIK=_}U_z%PWq}jQaiQ4!P(3V&Nr6C$XejWfQDiI(Fdt@un?|lo#M+5oIi_w{w zo%_#%{(V=tO#a9gB!7-$M?^BX5>d|Vn*3S!?g~$*UQipUPL&zMmg;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flq`qOjPXW+eslM;65>&_eN zIA`GdYFA{Su|As5NJ%uAXNRJ!?r)q1zTe*swp@uuUpyRT*m9;U|C6A_f1PIv9|Vv5oT0XfD

Mj4z$l3@K^CE$(KF=>T!%E7=7VT^ZL!w9?1 zr*8lzF?!%6URxT*dGm$%L>Ng$qP~v~f%iK@ip__1{kOGS&cU0XSp?2z7bZtPI0*J; z8|)YaZ&(V__3z4z)E11Dwo{E|BG+$%AOufMn(?70-n+kci>{=i9myXMgm zXj)w}4z_*KdL1?%ZyA59`|<~VV0OF!Ha(F7Z++Dc_I5-=e=xPa09x92-T=xUIEhn_ sKbe8KUw`@k{$a@(IFTfgAaCHm0ji`8B4Oe(&Hw-a07*qoM6N<$f>?F%X#fBK diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index c80f030f1b..5fd661d7f9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -50,6 +50,11 @@ BubonicRound: { ''' } +CinderArrow: { + DisplayName: Cinder Arrow + Tooltip: Explosive arrows that burst into weak flaming shards that inflict Brimstone Flames +} + ElysianArrow: { DisplayName: Elysian Arrow Tooltip: @@ -88,6 +93,16 @@ HolyFireBullet: { ''' } +HailstormBullet: { + DisplayName: Hailstorm Bullet + Tooltip: + ''' + Bullets imbued with potent ice magic + These bullets rapidly decelerate after being fired + Critical hits cause a flash freeze, dealing additional damage + ''' +} + HyperiusBullet: { DisplayName: Hyperius Bullet Tooltip: @@ -107,16 +122,6 @@ IcicleArrow: { ''' } -HailstormBullet: { - DisplayName: Hailstorm Bullet - Tooltip: - ''' - Bullets imbued with potent ice magic - These bullets rapidly decelerate after being fired - Critical hits cause a flash freeze, dealing additional damage - ''' -} - MarksmanRound: { DisplayName: Marksman Round Tooltip: @@ -136,11 +141,6 @@ MortarRound: { ''' } -NapalmArrow: { - DisplayName: Napalm Arrow - Tooltip: Explodes into fire shards -} - RubberMortarRound: { DisplayName: Rubber Mortar Round Tooltip: @@ -156,7 +156,7 @@ TerraArrow: { Tooltip: ''' Fires an energy arrow that quickly splits into two arrows - These arrows ignore 25 points of defense + These arrows ignore 8 points of defense ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index ab16d1dab4..7dce625fae 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -45,6 +45,7 @@ ChargedBlast.DisplayName: Blast ChargedBlast2.DisplayName: Blast ChickenExplosion.DisplayName: Kentucky Fried Explosion ChickenRocket.DisplayName: Chicken Rocket +CinderArrowProj.DisplayName: Cinder Arrow ClamorRifleProj.DisplayName: Clamor Bolt ClamorRifleProjSplit.DisplayName: Clamor Bolt ClaretCannonProj.DisplayName: Claret Cannon @@ -129,7 +130,6 @@ MiniatureFolly.DisplayName: Miniature Folly MiniSharkron.DisplayName: Mini Sharkron MistArrow.DisplayName: Mist Arrow MortarRoundProj.DisplayName: Mortar -NapalmArrowProj.DisplayName: Napalm Arrow NeedlerProj.DisplayName: Needle NorfleetComet.DisplayName: Comet NorfleetExplosion.DisplayName: Explosion diff --git a/Projectiles/Ranged/CinderArrowProj.cs b/Projectiles/Ranged/CinderArrowProj.cs new file mode 100644 index 0000000000..fa836a8a11 --- /dev/null +++ b/Projectiles/Ranged/CinderArrowProj.cs @@ -0,0 +1,137 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; +using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Items.Ammo; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using CalamityMod.Buffs.DamageOverTime; +using System; + +namespace CalamityMod.Projectiles.Ranged +{ + public class CinderArrowProj : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Items/Ammo/CinderArrow"; + public bool isShrapnel = false; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + public override void SetDefaults() + { + Projectile.width = 10; + Projectile.height = 10; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.arrow = true; + Projectile.penetrate = 1; + Projectile.extraUpdates = 1; + Projectile.timeLeft = 600; + Projectile.aiStyle = ProjAIStyleID.Arrow; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + if (Projectile.ai[1] == 0) + { + isShrapnel = Projectile.ai[2] == 1; + if (isShrapnel) + { + Projectile.velocity *= 0.5f; + Projectile.timeLeft = 300; + } + } + Projectile.ai[1]++; + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + if (isShrapnel) + { + Projectile.arrow = false; + Projectile.extraUpdates = 3; + + if (Main.rand.NextBool(4)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.55f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.65f, 0.85f); + } + } + else + { + if (Projectile.ai[1] > 4 && Main.rand.NextBool(3)) + { + float velMulti = Main.rand.NextFloat(0.1f, 0.75f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(0.45) * velMulti); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.45f, 0.75f); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(-0.45) * velMulti); + dust2.noGravity = true; + dust2.scale = Main.rand.NextFloat(0.45f, 0.75f); + } + } + } + + public override void OnKill(int timeLeft) + { + if (!isShrapnel) + { + int Dusts = 9; + float radians = MathHelper.TwoPi / Dusts; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)); + for (int i = 0; i < Dusts; i++) + { + Vector2 dustVelocity = spinningPoint.RotatedBy(radians * i).RotatedBy(0.5f) * 6.5f; + Particle smoke = new HeavySmokeParticle(Projectile.Center, dustVelocity * Main.rand.NextFloat(1f, 2.6f),Color.Crimson, 18, Main.rand.NextFloat(0.9f, 1.6f), 0.35f, Main.rand.NextFloat(-1, 1), true); + GeneralParticleHandler.SpawnParticle(smoke); + } + SoundEngine.PlaySound(SoundID.Item69 with { Volume = 0.35f, Pitch = 1f, PitchVariance = 0.15f }, Projectile.Center); + + for (int b = 0; b < 3; b++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(0, -10).RotatedByRandom(0.8f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.05f), 0f, Projectile.owner, 0f, 0f, 1f); + } + + if (Projectile.owner == Main.myPlayer) + { + Projectile.damage = (int)(Projectile.damage * 0.3f); + Projectile.penetrate = -1; + Projectile.ExpandHitboxBy(110); + Projectile.Damage(); + } + } + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (isShrapnel) + { + target.AddBuff(ModContent.BuffType(), 180); + } + } + public override bool PreDraw(ref Color lightColor) + { + if (isShrapnel) + { + Texture2D texture = ModContent.Request("CalamityMod/Particles/DrainLine").Value; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Crimson * 0.35f, 1, texture); + return false; + } + else + { + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/BloodfireBulletProj").Value; + if (Projectile.ai[1] > 6) + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White * 0.3f, 1, texture); + return true; + } + } + + public override bool? CanDamage() => isShrapnel && Projectile.ai[1] < 20 ? false : null; + } +} diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs deleted file mode 100644 index 088b02947f..0000000000 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ /dev/null @@ -1,83 +0,0 @@ -using CalamityMod.Projectiles.Rogue; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Audio; -using Microsoft.Xna.Framework.Graphics; -using CalamityMod.Items.Ammo; -using CalamityMod.Dusts; -using CalamityMod.Particles; - -namespace CalamityMod.Projectiles.Ranged -{ - public class NapalmArrowProj : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Items/Ammo/NapalmArrow"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - } - public override void SetDefaults() - { - Projectile.width = 10; - Projectile.height = 10; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Ranged; - Projectile.arrow = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; - } - - public override void AI() - { - Projectile.ai[1]++; - Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; - if (Projectile.ai[1] > 4) - { - float velMulti = Main.rand.NextFloat(0.1f, 0.75f); - Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(0.45) * velMulti); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.45f, 0.75f); - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(-0.45) * velMulti); - dust2.noGravity = true; - dust2.scale = Main.rand.NextFloat(0.45f, 0.75f); - } - } - - public override void OnKill(int timeLeft) - { - for (int b = 0; b < 20; b++) - { - int dustType = Main.rand.NextBool() ? 90 : ModContent.DustType(); - float velMulti = Main.rand.NextFloat(0.1f, 0.75f); - Dust dust = Dust.NewDustPerfect(Projectile.Center, dustType, new Vector2(14, 14).RotatedByRandom(100) * velMulti); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.75f, 1.35f); - } - Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Crimson, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.5f, 15); - GeneralParticleHandler.SpawnParticle(pulse); - SoundEngine.PlaySound(SoundID.Item89 with { Volume = 0.45f, Pitch = -0.3f, PitchVariance = 0.15f }, Projectile.Center); - SoundEngine.PlaySound(SoundID.Item69 with { Volume = 0.35f, Pitch = 0.9f, PitchVariance = 0.15f }, Projectile.Center); - - if (Projectile.owner == Main.myPlayer) - { - Projectile.damage = (int)(Projectile.damage * 0.3f); - Projectile.penetrate = -1; - Projectile.ExpandHitboxBy(110); - Projectile.Damage(); - } - } - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/BloodfireBulletProj").Value; - if (Projectile.ai[1] > 6) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1, texture); - return true; - } - } -}