From ae6080f2ae471368ac65f8b47a0e23b406bc9601 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 12 Apr 2024 14:30:40 -0400 Subject: [PATCH 1/3] Hoarfrost Bow :boom: --- Items/Weapons/Ranged/HoarfrostBow.cs | 10 +-- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 2 +- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 1 + Projectiles/Ranged/MistArrow.cs | 12 ++- Projectiles/Ranged/MistArrowFrostMist.cs | 73 ++++++++++++++++++ Projectiles/Ranged/MistArrowFrostMist.png | Bin 0 -> 370 bytes Projectiles/Ranged/MistArrowFrostMist2.png | Bin 0 -> 366 bytes Projectiles/Ranged/MistArrowFrostMist3.png | Bin 0 -> 367 bytes 8 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 Projectiles/Ranged/MistArrowFrostMist.cs create mode 100644 Projectiles/Ranged/MistArrowFrostMist.png create mode 100644 Projectiles/Ranged/MistArrowFrostMist2.png create mode 100644 Projectiles/Ranged/MistArrowFrostMist3.png diff --git a/Items/Weapons/Ranged/HoarfrostBow.cs b/Items/Weapons/Ranged/HoarfrostBow.cs index 817ead5f09..cb2811f6d4 100644 --- a/Items/Weapons/Ranged/HoarfrostBow.cs +++ b/Items/Weapons/Ranged/HoarfrostBow.cs @@ -15,10 +15,10 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 26; Item.height = 70; - Item.damage = 37; + Item.damage = 36; Item.DamageType = DamageClass.Ranged; - Item.useTime = 25; - Item.useAnimation = 25; + Item.useTime = 29; + Item.useAnimation = 29; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4f; @@ -36,8 +36,8 @@ namespace CalamityMod.Items.Weapons.Ranged { for (int index = 0; index < 2; ++index) { - float SpeedX = velocity.X + Main.rand.Next(-30, 31) * 0.05f; - float SpeedY = velocity.Y + Main.rand.Next(-30, 31) * 0.05f; + float SpeedX = velocity.X + Main.rand.Next(-25, 26) * 0.05f; + float SpeedY = velocity.Y + Main.rand.Next(-25, 26) * 0.05f; if (CalamityUtils.CheckWoodenAmmo(type, player)) Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockback, player.whoAmI); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 6755615873..1f03c47b51 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -635,7 +635,7 @@ HoarfrostBow: { Tooltip: ''' Fires two arrows at once - Converts wooden arrows into mist arrows + Converts wooden arrows into mist arrows that spread frost mist on collision ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index db32cfeb93..4346231920 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -129,6 +129,7 @@ MineralMortarProjectile.DisplayName: Onyx Bomb MiniatureFolly.DisplayName: Miniature Folly MiniSharkron.DisplayName: Mini Sharkron MistArrow.DisplayName: Mist Arrow +MistArrowFrostMist.DisplayName: Frost Mist MortarRoundProj.DisplayName: Mortar NeedlerProj.DisplayName: Needle NorfleetComet.DisplayName: Comet diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index 3a8793d764..50b745512a 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -69,12 +69,22 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Smoke, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 100, new Color(237, 242, 242, 200), 1f); } + + int mistAmt = 2; + for (int m = 0; m < mistAmt; m++) + { + if (Main.myPlayer == Projectile.owner) + { + int frostMist = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f)), ModContent.ProjectileType(), (int)(Projectile.damage * 0.35f), (int)(Projectile.knockBack * 0.5f), Main.myPlayer, Main.rand.Next(3)); + Main.projectile[frostMist].rotation = Main.rand.NextFloat(-MathHelper.Pi, MathHelper.Pi); + } + } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Ranged/MistArrowFrostMist.cs b/Projectiles/Ranged/MistArrowFrostMist.cs new file mode 100644 index 0000000000..22b0dd8c5b --- /dev/null +++ b/Projectiles/Ranged/MistArrowFrostMist.cs @@ -0,0 +1,73 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class MistArrowFrostMist : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 24; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = -1; + Projectile.timeLeft = 60; + Projectile.alpha = 96; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.coldDamage = true; + } + + public override void AI() + { + if (Projectile.timeLeft < 20) + { + Projectile.alpha += 8; + if (Projectile.alpha >= 255) + { + Projectile.alpha = 255; + Projectile.Kill(); + } + } + + Projectile.velocity *= 0.975f; + + for (int i = 0; i < 2; i++) + { + Vector2 dustPosition = new Vector2(Projectile.position.X + Main.rand.NextFloat(0f, Projectile.width), Projectile.position.Y + Main.rand.NextFloat(0f, Projectile.height)); + Dust frostDust = Dust.NewDustPerfect(dustPosition, 16, Vector2.Zero, 0, default, 0.45f); + frostDust.noGravity = true; + } + Lighting.AddLight(Projectile.Center, 0.4f, 0.4f, 0.4f); + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + switch (Projectile.ai[0]) + { + case 0: + break; + case 1: + texture = ModContent.Request("CalamityMod/Projectiles/Ranged/MistArrowFrostMist2").Value; + break; + case 2: + texture = ModContent.Request("CalamityMod/Projectiles/Ranged/MistArrowFrostMist3").Value; + break; + default: + break; + } + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2, 1f, SpriteEffects.None); + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn2, 45); + } +} diff --git a/Projectiles/Ranged/MistArrowFrostMist.png b/Projectiles/Ranged/MistArrowFrostMist.png new file mode 100644 index 0000000000000000000000000000000000000000..ad379318cfc2dfe6a6a7a98e27a1141f2923ca50 GIT binary patch literal 370 zcmV-&0ge8NP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0S8G$K~zXf&6Tlg zgisJgO$vKO&|Xmd11mq?%2p6W!Cn!xw@KKGr`UnSP2t-dST3`Q%ysVgyuUIG!`I_? zmX~~d)U7BUtug`GrU|m;rx^0{4JkOu*8OKrAuQ~^J4(QzXebq3} zv(!4N>-s54RaNPF(=__OEKAky9FUSENmL)lA!QaodWxcuLff`doPhfj*}U7CEXyK| z<5-H*X_}8Z0GMw5zs*p1gh;UY`U06(|KUI*@5SM1FArkePwAP Q2mk;807*qoM6N<$g2+FmEdT%j literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/MistArrowFrostMist2.png b/Projectiles/Ranged/MistArrowFrostMist2.png new file mode 100644 index 0000000000000000000000000000000000000000..547436de595eabdac0c37bfc308b2f9030b05b47 GIT binary patch literal 366 zcmV-!0g?WRP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0Ru@yK~zXf#g$DC zL_idTduCxzBAkG@ftABs*;)xV5D9yU%;?fJ84r`$=>8HZ?I)`Gz19yUsH*B^PC=gM zyJxzt!~G;l4)31vGs-8OEAwfv}qbBiR0LuZLk(swXv6g zlx4Z=B07$u2uhf697kxHrl(2lB^ZVQUk<|%*V?wlI0ynQ%JV#^gh{4pg8IG><@o*t zbWVqIZkd3{Br*YUUjxFf;M_`>l(3tK{dGX(%I^CfO1LhTWr40qq4Mv0dxFCU^qlKs z?E>8i=IU01?>cDbbpH!?HIUsSyG7RIYQJ!ofXKh=l~X3RydNm_2JxeW0zGDr-2eap M07*qoM6N<$g1Il6P5=M^ literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/MistArrowFrostMist3.png b/Projectiles/Ranged/MistArrowFrostMist3.png new file mode 100644 index 0000000000000000000000000000000000000000..f73594760f355e707e3fbcf78090667eb954317b GIT binary patch literal 367 zcmV-#0g(QQP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0R%}zK~y+Ty_7Ku zgfJ9D-4*N=#RCY6H?Z>XRvy4c!4oLj3*zn{GXXzqw{aj$5~99LetdaG(=;98Ns`z( zQQNkd*Q%=OvQF!5{O`K`DoM+-#CY2___8eUbzR{kABF+z^E}7cJ+aO*3`2MnMR2V< za>^YsNwX}&L=XgUohii~kn}jtjcRgd#P-EPN?MWc`)HJqO5-{?1D?Y#xvz?EmY1rS z=h^g5rDr~e>37Ng# z(R0L_RA)(bT?eo0`f@J3xqO~C^|_3TqQG3!G#FDP)&E_J4;ybrA^exndSKH&fW N002ovPDHLkV1nW(ocRC% literal 0 HcmV?d00001 From 5f18ef51108111f116f641af17256125579ac325 Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Fri, 12 Apr 2024 19:55:02 -0600 Subject: [PATCH 2/3] Fixed Wizard money laundering with RoD by increasing its price to 12 gold 50 silver --- NPCs/CalamityGlobalTownNPC.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index ed815e8996..82c19d160b 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1183,7 +1183,7 @@ namespace CalamityMod.NPCs { shop.Add(ItemType()) .AddWithCustomValue(ItemID.MagicMissile, Item.buyPrice(gold: 5)) - .AddWithCustomValue(ItemID.RodofDiscord, Item.buyPrice(gold: 10), Condition.Hardmode, Condition.InHallow) + .AddWithCustomValue(ItemID.RodofDiscord, Item.buyPrice(gold: 12, silver: 50), Condition.Hardmode, Condition.InHallow) .AddWithCustomValue(ItemID.SpectreStaff, Item.buyPrice(gold: 25), Condition.DownedGolem) .AddWithCustomValue(ItemID.InfernoFork, Item.buyPrice(gold: 25), Condition.DownedGolem) .AddWithCustomValue(ItemID.ShadowbeamStaff, Item.buyPrice(gold: 25), Condition.DownedGolem) From 805041cdb9efd4355fb7c0bdb357c5dddef7645f Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Fri, 12 Apr 2024 20:17:16 -0600 Subject: [PATCH 3/3] attempted to fix the Yharon desyncs in multiplayer by adding a couple extra net updates --- NPCs/Yharon/Yharon.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 57d82c93ca..7387859b80 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -1691,7 +1691,10 @@ namespace CalamityMod.NPCs.Yharon // Despawn safety, make sure to target another player if the current player target is too far away if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + { NPC.TargetClosest(); + NPC.netUpdate = true; + } Player targetData = Main.player[NPC.target]; @@ -1700,6 +1703,7 @@ namespace CalamityMod.NPCs.Yharon if (targetData.dead || !targetData.active) { NPC.TargetClosest(); + NPC.netUpdate = true; targetData = Main.player[NPC.target]; if (targetData.dead || !targetData.active) {