From 0881cefeb2c58cb6e44657031dcfcf99dd429121 Mon Sep 17 00:00:00 2001 From: SheerExpanse Date: Tue, 16 Jul 2019 18:08:51 -0400 Subject: [PATCH] Added stealth strike availability method --- CalamityPlayer.cs | 21 ++++++++++++------- .../ScarletDevil.cs | 5 ----- Projectiles/Rogue/ScarletDevilBullet.cs | 11 ---------- Projectiles/Rogue/ScarletDevilProjectile.cs | 5 +---- 4 files changed, 15 insertions(+), 27 deletions(-) diff --git a/CalamityPlayer.cs b/CalamityPlayer.cs index 3d8815cacd..2afa0ea739 100644 --- a/CalamityPlayer.cs +++ b/CalamityPlayer.cs @@ -2857,13 +2857,20 @@ namespace CalamityMod { player.ClearBuff(BuffID.WindPushed); } - } - #endregion - - #region PostUpdate - - #region PostUpdateBuffs - public override void PostUpdateBuffs() + } + #endregion + + #region RogueStealthStrike + public bool StealthStrikeAvailable() + { + return rogueStealth >= rogueStealthMax && rogueStealthMax > 0f; + } + #endregion + + #region PostUpdate + + #region PostUpdateBuffs + public override void PostUpdateBuffs() { if (CalamityWorld.defiled) Defiled(); diff --git a/Items/CalamityCustomThrowingDamage/ScarletDevil.cs b/Items/CalamityCustomThrowingDamage/ScarletDevil.cs index f525426025..aab8a52936 100644 --- a/Items/CalamityCustomThrowingDamage/ScarletDevil.cs +++ b/Items/CalamityCustomThrowingDamage/ScarletDevil.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Items; namespace CalamityMod.Items.CalamityCustomThrowingDamage { diff --git a/Projectiles/Rogue/ScarletDevilBullet.cs b/Projectiles/Rogue/ScarletDevilBullet.cs index 9f74348404..4bfd99a629 100644 --- a/Projectiles/Rogue/ScarletDevilBullet.cs +++ b/Projectiles/Rogue/ScarletDevilBullet.cs @@ -1,8 +1,6 @@ using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue @@ -80,15 +78,6 @@ namespace CalamityMod.Projectiles.Rogue public override Color? GetAlpha(Color lightColor) { return new Color(250, 250, 250); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - CalamityPlayer modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (target.type == NPCID.TargetDummy || modPlayer.rogueStealth <= 0f) - { - return; - } } } } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index 5b25a009f9..e3e83b466f 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -1,11 +1,8 @@ using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Graphics.Shaders; -using Terraria.GameContent.Achievements; using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Rogue @@ -40,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 130, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.85f); projectile.ai[0] += 1f; - if(projectile.ai[0] == 1f && modPlayer.rogueStealth >= modPlayer.rogueStealthMax && modPlayer.rogueStealthMax > 0f) + if(projectile.ai[0] == 1f && modPlayer.StealthStrikeAvailable()) lifesteal = true; if ((projectile.ai[0] %= 5f) == 0f) {