From 63e48fd24a1cba04b696ad522bc4df4acdc9df73 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 20 Oct 2019 14:28:03 -0400 Subject: [PATCH] THIEF --- Items/CalamityGlobalItem.cs | 2 +- ModSupport/WeakReferenceSupport.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 2 +- NPCs/TownNPCs/{Bandit.cs => THIEF.cs} | 19 +++++++++++++++++- NPCs/TownNPCs/{Bandit.png => THIEF.png} | Bin NPCs/TownNPCs/{BanditAlt.png => THIEFAlt.png} | Bin .../{Bandit_Head.png => THIEF_Head.png} | Bin 7 files changed, 21 insertions(+), 4 deletions(-) rename NPCs/TownNPCs/{Bandit.cs => THIEF.cs} (94%) rename NPCs/TownNPCs/{Bandit.png => THIEF.png} (100%) rename NPCs/TownNPCs/{BanditAlt.png => THIEFAlt.png} (100%) rename NPCs/TownNPCs/{Bandit_Head.png => THIEF_Head.png} (100%) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index bb2849aa4f..7626e7c889 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2401,7 +2401,7 @@ namespace CalamityMod.Items #region Goblin Money Theft (PostReforge) public override void PostReforge(Item item) { - if (NPC.AnyNPCs(ModContent.NPCType())) + if (NPC.AnyNPCs(ModContent.NPCType())) { int value = item.value; ItemLoader.ReforgePrice(item, ref value, ref Main.LocalPlayer.discount); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 850584d9a4..3840d095f1 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -57,7 +57,7 @@ namespace CalamityMod if (censusMod != null) { censusMod.Call("TownNPCCondition", ModContent.NPCType(), "Defeat a Giant Clam"); - censusMod.Call("TownNPCCondition", ModContent.NPCType(), "Have a [i:" + ItemID.PlatinumCoin + "] in your inventory after defeating Skeletron"); + censusMod.Call("TownNPCCondition", ModContent.NPCType(), "Have a [i:" + ItemID.PlatinumCoin + "] in your inventory after defeating Skeletron"); censusMod.Call("TownNPCCondition", ModContent.NPCType(), "Have [i:" + ModContent.ItemType() + "] in your inventory in Hardmode"); censusMod.Call("TownNPCCondition", ModContent.NPCType(), "Defeat Cryogen"); } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index cccaa36f86..35d5b8a849 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3190,7 +3190,7 @@ namespace CalamityMod.NPCs break; case NPCID.GoblinTinkerer: - int banditIndex = NPC.FindFirstNPC(ModContent.NPCType()); + int banditIndex = NPC.FindFirstNPC(ModContent.NPCType()); if (Main.rand.NextBool(10) && banditIndex != -1 && Main.LocalPlayer.Calamity().reforges >= 10) { var thief = Main.npc[banditIndex]; diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/THIEF.cs similarity index 94% rename from NPCs/TownNPCs/Bandit.cs rename to NPCs/TownNPCs/THIEF.cs index 251b8b7c3b..8ec9f4ed34 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -10,7 +10,7 @@ using CalamityMod.Projectiles.Rogue; namespace CalamityMod.NPCs { [AutoloadHead] - public class Bandit : ModNPC + public class THIEF : ModNPC { public static List PossibleNames = new List() { @@ -273,6 +273,23 @@ namespace CalamityMod.NPCs } } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Bandit/Bandit"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Bandit/Bandit2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Bandit/Bandit3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Bandit/Bandit4"), 1f); + } + } + + // Make this Town NPC teleport to the King and/or Queen statue when triggered. + public override bool CanGoToStatue(bool toKingStatue) //I don't think you can differentiate male vs female with this. + { + return true; + } + public override void TownNPCAttackStrength(ref int damage, ref float knockback) { damage = 50; diff --git a/NPCs/TownNPCs/Bandit.png b/NPCs/TownNPCs/THIEF.png similarity index 100% rename from NPCs/TownNPCs/Bandit.png rename to NPCs/TownNPCs/THIEF.png diff --git a/NPCs/TownNPCs/BanditAlt.png b/NPCs/TownNPCs/THIEFAlt.png similarity index 100% rename from NPCs/TownNPCs/BanditAlt.png rename to NPCs/TownNPCs/THIEFAlt.png diff --git a/NPCs/TownNPCs/Bandit_Head.png b/NPCs/TownNPCs/THIEF_Head.png similarity index 100% rename from NPCs/TownNPCs/Bandit_Head.png rename to NPCs/TownNPCs/THIEF_Head.png