diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 7a286ffd9d..231a8faf1e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -31,6 +31,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Collections.Generic; using Terraria; using Terraria.GameContent.Events; using Terraria.GameInput; @@ -3180,13 +3181,12 @@ namespace CalamityMod.CalPlayer player.hasPaladinShield = true; if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) { - int myPlayer = Main.myPlayer; - if (Main.player[myPlayer].team == player.team && player.team != 0) + if (Main.LocalPlayer.team == player.team && player.team != 0) { - Vector2 otherPlayerPos = player.position - Main.player[myPlayer].position; + Vector2 otherPlayerPos = player.position - Main.LocalPlayer.position; if (otherPlayerPos.Length() < 800f) - Main.player[myPlayer].AddBuff(BuffID.PaladinsShield, 20, true); + Main.LocalPlayer.AddBuff(BuffID.PaladinsShield, 20, true); } } } @@ -3250,7 +3250,7 @@ namespace CalamityMod.CalPlayer { float ai1 = I * 120; Projectile.NewProjectile(player.Center.X + (float)(Math.Sin(I * 120) * 550), player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, - ModContent.ProjectileType(), (int)((modPlayer.auricSet ? 15000f : 5000f) * player.MinionDamage()), 1f, player.whoAmI, ai1, 0f); + ModContent.ProjectileType(), (int)((modPlayer.auricSet ? 15000 : 5000) * player.MinionDamage()), 1f, player.whoAmI, ai1, 0f); } } } @@ -3423,7 +3423,7 @@ namespace CalamityMod.CalPlayer player.npcTypeNoAggro[ModContent.NPCType()] = true; player.npcTypeNoAggro[ModContent.NPCType()] = true; player.npcTypeNoAggro[ModContent.NPCType()] = true; - // LATER -- When Wulfrum Slimes start being definitely robots, remove this immunity. + // NOTE: These don't even spawn anymore. player.npcTypeNoAggro[ModContent.NPCType()] = true; } @@ -3594,32 +3594,31 @@ namespace CalamityMod.CalPlayer } } - int brimmy = ModContent.ProjectileType(); - int siren = ModContent.ProjectileType(); - int healer = ModContent.ProjectileType(); - int sandy = ModContent.ProjectileType(); - int cloudy = ModContent.ProjectileType(); - int fungal = ModContent.ProjectileType(); - int howl = ModContent.ProjectileType(); - int calcifer = ModContent.ProjectileType(); - int turnip = ModContent.ProjectileType(); - if (player.ownedProjectileCounts[brimmy] > 1 || player.ownedProjectileCounts[siren] > 1 || - player.ownedProjectileCounts[healer] > 1 || player.ownedProjectileCounts[sandy] > 1 || - player.ownedProjectileCounts[cloudy] > 1 || player.ownedProjectileCounts[fungal] > 1 || - player.ownedProjectileCounts[howl] > 1 || player.ownedProjectileCounts[calcifer] > 1 || - player.ownedProjectileCounts[turnip] > 1) + List summonDeleteList = new List() { - for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() + }; + for (int i = 0; i < summonDeleteList.Count; i++) + { + if (player.ownedProjectileCounts[summonDeleteList[i]] > 1) { - if (Main.projectile[projIndex].active && Main.projectile[projIndex].owner == player.whoAmI) + for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) { - if (Main.projectile[projIndex].type == brimmy || Main.projectile[projIndex].type == siren || - Main.projectile[projIndex].type == healer || Main.projectile[projIndex].type == sandy || - Main.projectile[projIndex].type == cloudy || Main.projectile[projIndex].type == fungal || - Main.projectile[projIndex].type == howl || Main.projectile[projIndex].type == calcifer || - Main.projectile[projIndex].type == turnip) + Projectile proj = Main.projectile[projIndex]; + if (proj.active && proj.owner == player.whoAmI) { - Main.projectile[projIndex].Kill(); + if (summonDeleteList.Contains(proj.type)) + { + proj.Kill(); + } } } } diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 75a1075f72..dc6e75e2a0 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Items.Weapons.Rogue public class Hypothermia : RogueWeapon { private int counter = 0; - private bool stealthChunks = false; public override void SetStaticDefaults() { @@ -46,30 +45,23 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (player.Calamity().StealthStrikeAvailable()) //setting up the stealth strikes + if (player.Calamity().StealthStrikeAvailable() && counter == 0) //setting up the stealth strikes { - stealthChunks = true; - } - if (stealthChunks) - { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; } - else + int projAmt = Main.rand.Next(1, 3); + for (int index = 0; index < projAmt; ++index) { - int projAmt = Main.rand.Next(1, 3); - for (int index = 0; index < projAmt; ++index) - { - float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4), 0f); - } + float SpeedX = speedX + Main.rand.NextFloat(-2f, 2f); + float SpeedY = speedY + Main.rand.NextFloat(-2f, 2f); + Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, damage, knockBack, player.whoAmI, Main.rand.Next(4), 0f); } + counter++; if (counter >= 7) { counter = 0; - stealthChunks = false; } return false; } diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs index 9a54e251b1..c6a5b04f96 100644 --- a/UI/StealthUI.cs +++ b/UI/StealthUI.cs @@ -39,7 +39,7 @@ namespace CalamityMod.UI Texture2D barTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/StealthMeterBar"); Texture2D fullBarTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/StealthMeterBarFull"); spriteBatch.Draw(edgeTexture, DrawPosition, null, Color.White * modPlayer.stealthUIAlpha, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - if (modPlayer.rogueStealth >= modPlayer.rogueStealthMax * (modPlayer.stealthStrikeHalfCost ? 0.5f : 1f)) + if (modPlayer.StealthStrikeAvailable()) { spriteBatch.Draw(indicatorTexture, DrawPosition, null, Color.White * modPlayer.stealthUIAlpha, 0f, indicatorTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); }