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/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) 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) { 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 0000000000..ad379318cf Binary files /dev/null and b/Projectiles/Ranged/MistArrowFrostMist.png differ diff --git a/Projectiles/Ranged/MistArrowFrostMist2.png b/Projectiles/Ranged/MistArrowFrostMist2.png new file mode 100644 index 0000000000..547436de59 Binary files /dev/null and b/Projectiles/Ranged/MistArrowFrostMist2.png differ diff --git a/Projectiles/Ranged/MistArrowFrostMist3.png b/Projectiles/Ranged/MistArrowFrostMist3.png new file mode 100644 index 0000000000..f73594760f Binary files /dev/null and b/Projectiles/Ranged/MistArrowFrostMist3.png differ