diff --git a/Buffs/Summon/WulfrumDroidBuff.png b/Buffs/Summon/WulfrumDroidBuff.png index 34b1c798e4..bec3e3f78c 100644 Binary files a/Buffs/Summon/WulfrumDroidBuff.png and b/Buffs/Summon/WulfrumDroidBuff.png differ diff --git a/Items/Accessories/WulfrumBattery.png b/Items/Accessories/WulfrumBattery.png index 3bc19a4875..ada5ddef24 100644 Binary files a/Items/Accessories/WulfrumBattery.png and b/Items/Accessories/WulfrumBattery.png differ diff --git a/Items/Armor/WulfrumArmor.png b/Items/Armor/WulfrumArmor.png index 6b588b347a..f99eacd3b0 100644 Binary files a/Items/Armor/WulfrumArmor.png and b/Items/Armor/WulfrumArmor.png differ diff --git a/Items/Armor/WulfrumArmor_Arms.png b/Items/Armor/WulfrumArmor_Arms.png index f4658bd88d..d746fc89f8 100644 Binary files a/Items/Armor/WulfrumArmor_Arms.png and b/Items/Armor/WulfrumArmor_Arms.png differ diff --git a/Items/Armor/WulfrumArmor_Body.png b/Items/Armor/WulfrumArmor_Body.png index 44e60bb227..0122566d95 100644 Binary files a/Items/Armor/WulfrumArmor_Body.png and b/Items/Armor/WulfrumArmor_Body.png differ diff --git a/Items/Armor/WulfrumArmor_FemaleBody.png b/Items/Armor/WulfrumArmor_FemaleBody.png index 44e60bb227..0122566d95 100644 Binary files a/Items/Armor/WulfrumArmor_FemaleBody.png and b/Items/Armor/WulfrumArmor_FemaleBody.png differ diff --git a/Items/Armor/WulfrumHeadgear.png b/Items/Armor/WulfrumHeadgear.png index 671c39b7f4..e6d08596e8 100644 Binary files a/Items/Armor/WulfrumHeadgear.png and b/Items/Armor/WulfrumHeadgear.png differ diff --git a/Items/Armor/WulfrumHeadgear_Head.png b/Items/Armor/WulfrumHeadgear_Head.png index 4ea3156130..cf9ef4f3ac 100644 Binary files a/Items/Armor/WulfrumHeadgear_Head.png and b/Items/Armor/WulfrumHeadgear_Head.png differ diff --git a/Items/Armor/WulfrumHelm.png b/Items/Armor/WulfrumHelm.png index 500b44d32a..b2611d63d1 100644 Binary files a/Items/Armor/WulfrumHelm.png and b/Items/Armor/WulfrumHelm.png differ diff --git a/Items/Armor/WulfrumHelm_Head.png b/Items/Armor/WulfrumHelm_Head.png index 1498d2b0be..9c56efc53a 100644 Binary files a/Items/Armor/WulfrumHelm_Head.png and b/Items/Armor/WulfrumHelm_Head.png differ diff --git a/Items/Armor/WulfrumHelmet.png b/Items/Armor/WulfrumHelmet.png index a531fdf4a6..e549a7c76e 100644 Binary files a/Items/Armor/WulfrumHelmet.png and b/Items/Armor/WulfrumHelmet.png differ diff --git a/Items/Armor/WulfrumHelmet_Head.png b/Items/Armor/WulfrumHelmet_Head.png index a62f01cf1d..50ce885f3f 100644 Binary files a/Items/Armor/WulfrumHelmet_Head.png and b/Items/Armor/WulfrumHelmet_Head.png differ diff --git a/Items/Armor/WulfrumHood.png b/Items/Armor/WulfrumHood.png index 73ea374b5a..82655fd91e 100644 Binary files a/Items/Armor/WulfrumHood.png and b/Items/Armor/WulfrumHood.png differ diff --git a/Items/Armor/WulfrumHood_Head.png b/Items/Armor/WulfrumHood_Head.png index dc5bcd550e..6b273ef5e1 100644 Binary files a/Items/Armor/WulfrumHood_Head.png and b/Items/Armor/WulfrumHood_Head.png differ diff --git a/Items/Armor/WulfrumLeggings.png b/Items/Armor/WulfrumLeggings.png index 6ed06d8882..ba9f776ea1 100644 Binary files a/Items/Armor/WulfrumLeggings.png and b/Items/Armor/WulfrumLeggings.png differ diff --git a/Items/Armor/WulfrumLeggings_Legs.png b/Items/Armor/WulfrumLeggings_Legs.png index 56268cf5de..9b96d20767 100644 Binary files a/Items/Armor/WulfrumLeggings_Legs.png and b/Items/Armor/WulfrumLeggings_Legs.png differ diff --git a/Items/Armor/WulfrumMask.png b/Items/Armor/WulfrumMask.png index 81852ac847..07edc75dce 100644 Binary files a/Items/Armor/WulfrumMask.png and b/Items/Armor/WulfrumMask.png differ diff --git a/Items/Armor/WulfrumMask_Head.png b/Items/Armor/WulfrumMask_Head.png index 77d7eabf9f..56756bdf03 100644 Binary files a/Items/Armor/WulfrumMask_Head.png and b/Items/Armor/WulfrumMask_Head.png differ diff --git a/Items/Fishing/FishingRods/WulfrumRod.png b/Items/Fishing/FishingRods/WulfrumRod.png index 3371287464..593ae2bc0c 100644 Binary files a/Items/Fishing/FishingRods/WulfrumRod.png and b/Items/Fishing/FishingRods/WulfrumRod.png differ diff --git a/Items/Materials/WulfrumShard.cs b/Items/Materials/WulfrumShard.cs index e7975c53b3..bcdec89051 100644 --- a/Items/Materials/WulfrumShard.cs +++ b/Items/Materials/WulfrumShard.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Items.Materials { public override void SetStaticDefaults() { - DisplayName.SetDefault("Wulfrum Shard"); + DisplayName.SetDefault("Wulfrum Metal Scrap"); } public override void SetDefaults() diff --git a/Items/Materials/WulfrumShard.png b/Items/Materials/WulfrumShard.png index ffe827c29e..384f3c9372 100644 Binary files a/Items/Materials/WulfrumShard.png and b/Items/Materials/WulfrumShard.png differ diff --git a/Items/Tools/WulfrumAxe.cs b/Items/Tools/WulfrumAxe.cs index 457e96fb4f..0e2b0fa44c 100644 --- a/Items/Tools/WulfrumAxe.cs +++ b/Items/Tools/WulfrumAxe.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Tools { item.damage = 5; item.melee = true; - item.width = 62; - item.height = 58; + item.width = 30; + item.height = 38; item.useTime = 26; item.useAnimation = 26; item.useTurn = true; diff --git a/Items/Tools/WulfrumAxe.png b/Items/Tools/WulfrumAxe.png index edac3515c0..7bd72fbc30 100644 Binary files a/Items/Tools/WulfrumAxe.png and b/Items/Tools/WulfrumAxe.png differ diff --git a/Items/Tools/WulfrumHammer.cs b/Items/Tools/WulfrumHammer.cs index c4643b22ca..57a0d6a014 100644 --- a/Items/Tools/WulfrumHammer.cs +++ b/Items/Tools/WulfrumHammer.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Tools { item.damage = 7; item.melee = true; - item.width = 56; - item.height = 56; + item.width = 28; + item.height = 38; item.useTime = 29; item.useAnimation = 29; item.useTurn = true; diff --git a/Items/Tools/WulfrumHammer.png b/Items/Tools/WulfrumHammer.png index 030ee2396b..05741786eb 100644 Binary files a/Items/Tools/WulfrumHammer.png and b/Items/Tools/WulfrumHammer.png differ diff --git a/Items/Tools/WulfrumPickaxe.cs b/Items/Tools/WulfrumPickaxe.cs index 7c5faf290a..0d8c6a3592 100644 --- a/Items/Tools/WulfrumPickaxe.cs +++ b/Items/Tools/WulfrumPickaxe.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Tools { item.damage = 5; item.melee = true; - item.width = 48; - item.height = 48; + item.width = 46; + item.height = 38; item.useTime = 16; item.useAnimation = 16; item.useTurn = true; diff --git a/Items/Tools/WulfrumPickaxe.png b/Items/Tools/WulfrumPickaxe.png index dcb359dd90..2dc3379335 100644 Binary files a/Items/Tools/WulfrumPickaxe.png and b/Items/Tools/WulfrumPickaxe.png differ diff --git a/Items/Weapons/Magic/WulfrumStaff.cs b/Items/Weapons/Magic/WulfrumStaff.cs index 9341c3853b..8f9810e226 100644 --- a/Items/Weapons/Magic/WulfrumStaff.cs +++ b/Items/Weapons/Magic/WulfrumStaff.cs @@ -7,47 +7,46 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Magic { - public class WulfrumStaff : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wulfrum Staff"); - Tooltip.SetDefault("Casts a wulfrum bolt"); - Item.staff[item.type] = true; - } + public class WulfrumStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wulfrum Staff"); + Tooltip.SetDefault("Casts a wulfrum bolt"); + //Item.staff[item.type] = true; + } - public override void SetDefaults() - { - item.damage = 12; - item.magic = true; - item.mana = 4; - item.width = 44; - item.height = 46; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 3; - item.value = Item.buyPrice(0, 1, 0, 0); - item.rare = 1; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 9f; - } + public override void SetDefaults() + { + item.damage = 12; + item.magic = true; + item.mana = 4; + item.width = 44; + item.height = 46; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 3; + item.value = Item.buyPrice(0, 1, 0, 0); + item.rare = 1; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 9f; + } - public override Vector2? HoldoutOrigin() - { - return new Vector2(10, 25); - } + //public override Vector2? HoldoutOrigin() => new Vector2(8, 15); - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override Vector2? HoldoutOffset() => new Vector2(-3, 0); + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Magic/WulfrumStaff.png b/Items/Weapons/Magic/WulfrumStaff.png index 6c20e25a5c..bd38ecf2cd 100644 Binary files a/Items/Weapons/Magic/WulfrumStaff.png and b/Items/Weapons/Magic/WulfrumStaff.png differ diff --git a/Items/Weapons/Melee/WulfrumBlade.cs b/Items/Weapons/Melee/WulfrumBlade.cs index 7dbf7198ae..34b3bbbbb0 100644 --- a/Items/Weapons/Melee/WulfrumBlade.cs +++ b/Items/Weapons/Melee/WulfrumBlade.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,7 +15,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 46; + item.width = 32; + item.height = 46; item.damage = 12; item.melee = true; item.useAnimation = 20; @@ -24,11 +26,15 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 3.75f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 54; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 1; } + public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) + { + hitbox = CalamityUtils.FixSwingHitbox(39, 39); + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/WulfrumBlade.png b/Items/Weapons/Melee/WulfrumBlade.png index d607dcf424..121c4cfe6e 100644 Binary files a/Items/Weapons/Melee/WulfrumBlade.png and b/Items/Weapons/Melee/WulfrumBlade.png differ diff --git a/Items/Weapons/Ranged/WulfrumBow.cs b/Items/Weapons/Ranged/WulfrumBow.cs index 6462f3e949..0e94240971 100644 --- a/Items/Weapons/Ranged/WulfrumBow.cs +++ b/Items/Weapons/Ranged/WulfrumBow.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Weapons.Ranged { item.damage = 10; item.ranged = true; - item.width = 34; - item.height = 56; + item.width = 27; + item.height = 38; item.useTime = 25; item.useAnimation = 25; item.useStyle = ItemUseStyleID.HoldingOut; diff --git a/Items/Weapons/Ranged/WulfrumBow.png b/Items/Weapons/Ranged/WulfrumBow.png index 3cf54d70b3..ad309cc5e0 100644 Binary files a/Items/Weapons/Ranged/WulfrumBow.png and b/Items/Weapons/Ranged/WulfrumBow.png differ diff --git a/Items/Weapons/Rogue/WulfrumKnife.png b/Items/Weapons/Rogue/WulfrumKnife.png index aab1bf448c..94ca6dcea6 100644 Binary files a/Items/Weapons/Rogue/WulfrumKnife.png and b/Items/Weapons/Rogue/WulfrumKnife.png differ diff --git a/Items/Weapons/Summon/WulfrumController.png b/Items/Weapons/Summon/WulfrumController.png index c419f9b6ac..7222b843e5 100644 Binary files a/Items/Weapons/Summon/WulfrumController.png and b/Items/Weapons/Summon/WulfrumController.png differ diff --git a/Projectiles/Rogue/WulfrumKnifeProj.png b/Projectiles/Rogue/WulfrumKnifeProj.png index aab1bf448c..94ca6dcea6 100644 Binary files a/Projectiles/Rogue/WulfrumKnifeProj.png and b/Projectiles/Rogue/WulfrumKnifeProj.png differ diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index cbc19cb5d6..1f0624e0fa 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -15,19 +15,18 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Wulfrum Droid"); - Main.projFrames[projectile.type] = 3; + Main.projFrames[projectile.type] = 12; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } public override void SetDefaults() { - projectile.width = 30; - projectile.height = 30; + projectile.width = 26; + projectile.height = 32; projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - //projectile.aiStyle = 62; projectile.minionSlots = 1f; projectile.timeLeft = 18000; projectile.penetrate = -1; @@ -44,24 +43,23 @@ namespace CalamityMod.Projectiles.Summon { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) + int dustAmt = 36; + for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 61, vector7.X * 1.1f, vector7.Y * 1.1f, 100, default, 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; + Vector2 source = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + source = source.RotatedBy((double)((float)(dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + projectile.Center; + Vector2 dustVel = source - projectile.Center; + int green = Dust.NewDust(source + dustVel, 0, 0, 61, dustVel.X * 1.1f, dustVel.Y * 1.1f, 100, default, 1.4f); + Main.dust[green].noGravity = true; + Main.dust[green].noLight = true; + Main.dust[green].velocity = dustVel; } dust += 1f; } if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); + projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); projectile.damage = damage2; } projectile.frameCounter++; @@ -70,13 +68,13 @@ namespace CalamityMod.Projectiles.Summon projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame >= 3) + if (projectile.frame >= Main.projFrames[projectile.type]) { projectile.frame = 0; } - bool flag64 = projectile.type == ModContent.ProjectileType(); + bool correctMinion = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + if (correctMinion) { if (player.dead) { @@ -88,135 +86,132 @@ namespace CalamityMod.Projectiles.Summon } } projectile.MinionAntiClump(); - Vector2 vector2_3 = projectile.position; - float num7 = 450f; - bool flag = false; - int num8 = -1; + Vector2 targetVector = projectile.position; + float range = 450f; + bool foundTarget = false; + int targetIndex = -1; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy((object) this, false)) { - float num1 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag && num1 < num7) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if ((!foundTarget && targetDist < range) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num7 = num1; - vector2_3 = npc.Center; - flag = true; - num8 = npc.whoAmI; + range = targetDist; + targetVector = npc.Center; + foundTarget = true; + targetIndex = npc.whoAmI; } } } - if (!flag) + if (!foundTarget) { - for (int index2 = 0; index2 < Main.npc.Length; ++index2) + for (int npcIndex = 0; npcIndex < Main.npc.Length; ++npcIndex) { - NPC npc = Main.npc[index2]; + NPC npc = Main.npc[npcIndex]; if (npc.CanBeChasedBy((object) this, false)) { - float num1 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag && num1 < num7) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if ((!foundTarget && targetDist < range) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num7 = num1; - vector2_3 = npc.Center; - flag = true; - num8 = index2; + range = targetDist; + targetVector = npc.Center; + foundTarget = true; + targetIndex = npcIndex; } } } } - int num9 = 500; - if (flag) - num9 = 1000; - if ((double) Vector2.Distance(player.Center, projectile.Center) > (double) num9) + float separationAnxietyDist = 500f; + if (foundTarget) + separationAnxietyDist = 1000f; + if (Vector2.Distance(player.Center, projectile.Center) > separationAnxietyDist) { projectile.ai[0] = 1f; projectile.netUpdate = true; } - if ((double) projectile.ai[0] == 1.0) + if (projectile.ai[0] == 1f) projectile.tileCollide = false; - if (flag && (double) projectile.ai[0] == 0.0) + if (foundTarget && projectile.ai[0] == 0f) { - Vector2 vector2_1 = vector2_3 - projectile.Center; - float num1 = vector2_1.Length(); - vector2_1.Normalize(); - if ((double) num1 > 200.0) + Vector2 targetPos = targetVector - projectile.Center; + float targetDist = targetPos.Length(); + targetPos.Normalize(); + if (targetDist > 200f) { - float num2 = 6f; - Vector2 vector2_2 = vector2_1 * num2; - projectile.velocity.X = (float) (((double) projectile.velocity.X * 40.0 + (double) vector2_2.X) / 41.0); - projectile.velocity.Y = (float) (((double) projectile.velocity.Y * 40.0 + (double) vector2_2.Y) / 41.0); + float speed = 6f; + Vector2 goToTarget = targetPos * speed; + projectile.velocity.X = (projectile.velocity.X * 40f + goToTarget.X) / 41f; + projectile.velocity.Y = (projectile.velocity.Y * 40f + goToTarget.Y) / 41f; } - else if ((double) projectile.velocity.Y > -1.0) + else if (projectile.velocity.Y > -1f) projectile.velocity.Y -= 0.1f; } else { if (!Collision.CanHitLine(projectile.Center, 1, 1, player.Center, 1, 1)) projectile.ai[0] = 1f; - float num1 = 6f; - if ((double) projectile.ai[0] == 1.0) - num1 = 15f; - Vector2 center = projectile.Center; - Vector2 vector2_1 = player.Center - center + new Vector2(0.0f, -60f); - float num3 = vector2_1.Length(); - if ((double) num3 > 200.0 && (double) num1 < 9.0) - num1 = 9f; - if ((double) num3 < 100.0 && (double) projectile.ai[0] == 1.0 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + float returnSpeed = 6f; + if (projectile.ai[0] == 1f) + returnSpeed = 15f; + Vector2 playerVec = player.Center - projectile.Center + new Vector2(0f, -60f); + float playerDist = playerVec.Length(); + if (playerDist > 200f && returnSpeed < 9f) + returnSpeed = 9f; + if (playerDist < 100f && projectile.ai[0] == 1f && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { - projectile.ai[0] = 0.0f; + projectile.ai[0] = 0f; projectile.netUpdate = true; } - if ((double) num3 > 2000.0) + if (playerDist > 2000f) { projectile.position.X = player.Center.X - (float) (projectile.width / 2); projectile.position.Y = player.Center.Y - (float) (projectile.width / 2); + projectile.netUpdate = true; } - else if ((double) num3 > 70.0) + else if (playerDist > 70f) { - vector2_1.Normalize(); - projectile.velocity = (projectile.velocity * 20f + vector2_1 * num1) / 21f; + playerVec.Normalize(); + projectile.velocity = (projectile.velocity * 20f + playerVec * returnSpeed) / 21f; } else { - if ((double) projectile.velocity.X == 0.0 && (double) projectile.velocity.Y == 0.0) + if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) { projectile.velocity.X = -0.15f; projectile.velocity.Y = -0.05f; } - projectile.velocity = projectile.velocity * 1.01f; + projectile.velocity *= 1.01f; } } projectile.rotation = projectile.velocity.X * 0.05f; - if ((double) projectile.velocity.X > 0.0) + if (projectile.velocity.X > 0f) projectile.spriteDirection = projectile.direction = 1; - else if ((double) projectile.velocity.X < 0.0) + else if (projectile.velocity.X < 0f) projectile.spriteDirection = projectile.direction = -1; - if ((double) projectile.ai[1] > 0.0) + if (projectile.ai[1] > 0f) projectile.ai[1] += (float) Main.rand.Next(1, 4); - if ((double) projectile.ai[1] > 90.0) + if (projectile.ai[1] > 90f) { projectile.ai[1] = 0.0f; projectile.netUpdate = true; } - if ((double) projectile.ai[1] != 0.0) + if (projectile.ai[1] != 0f) return; ++projectile.ai[1]; if (Main.myPlayer != projectile.owner) return; - if (!flag) + if (!foundTarget) return; - Vector2 vec = vector2_3 - projectile.Center; - vec.Normalize(); - Vector2 vec2 = vec * 10f; - int bolt = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vec2.X, vec2.Y, ModContent.ProjectileType(), projectile.damage, 0.0f, Main.myPlayer, 0.0f, 0.0f); + Vector2 velocity = targetVector - projectile.Center; + velocity.Normalize(); + velocity *= 10f; + int bolt = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); Main.projectile[bolt].netUpdate = true; projectile.netUpdate = true; } - public override bool CanDamage() - { - return false; - } + public override bool CanDamage() => false; } } diff --git a/Projectiles/Summon/WulfrumDroid.png b/Projectiles/Summon/WulfrumDroid.png index c227fdff07..fec767973b 100644 Binary files a/Projectiles/Summon/WulfrumDroid.png and b/Projectiles/Summon/WulfrumDroid.png differ diff --git a/Projectiles/Typeless/WulfrumBobber.cs b/Projectiles/Typeless/WulfrumBobber.cs index 2668a7b540..f178c2fbf2 100644 --- a/Projectiles/Typeless/WulfrumBobber.cs +++ b/Projectiles/Typeless/WulfrumBobber.cs @@ -24,8 +24,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDrawExtras(SpriteBatch spriteBatch) { - Player player = Main.player[projectile.owner]; - CalamityUtils.DrawFishingLine(projectile, ModContent.ItemType(), new Color(200, 200, 200, 100)); + CalamityUtils.DrawFishingLine(projectile, ModContent.ItemType(), new Color(200, 200, 200, 100), 38, 28f); return false; } } diff --git a/Projectiles/Typeless/WulfrumBobber.png b/Projectiles/Typeless/WulfrumBobber.png index 7d03394d6f..19d0f06aea 100644 Binary files a/Projectiles/Typeless/WulfrumBobber.png and b/Projectiles/Typeless/WulfrumBobber.png differ diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 203d628e24..21292f3f0b 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -2909,12 +2909,13 @@ namespace CalamityMod public static void DrawFishingLine(this Projectile projectile, int fishingRodType, Color poleColor, int xPositionAdditive = 45, float yPositionAdditive = 35f) { Player player = Main.player[projectile.owner]; - if (projectile.bobber && player.ActiveItem().holdStyle > 0) + Item item = Main.mouseItem.IsAir ? player.HeldItem : Main.mouseItem; + if (projectile.bobber && item.holdStyle > 0) { float pPosX = player.MountedCenter.X; float pPosY = player.MountedCenter.Y; pPosY += player.gfxOffY; - int type = player.ActiveItem().type; + int type = item.type; float gravDir = player.gravDir; if (type == fishingRodType)