From 507e413e0fe31cc954ffb463351cb04df453a7ff Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Mon, 22 Aug 2022 16:08:52 -0400 Subject: [PATCH] Town NPCs in the Bestiary have places to go --- NPCs/TownNPCs/DILF.cs | 4 ++++ NPCs/TownNPCs/FAP.cs | 4 ++++ NPCs/TownNPCs/SEAHOE.cs | 4 ++++ NPCs/TownNPCs/THIEF.cs | 4 ++++ NPCs/TownNPCs/WITCH.cs | 4 ++++ World/SulphurousSea.cs | 6 +++--- 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index b4b635d28d..c223adce87 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -40,6 +40,10 @@ namespace CalamityMod.NPCs.TownNPCs .SetNPCAffection(NPCID.Wizard, AffectionLevel.Like) .SetNPCAffection(NPCID.Cyborg, AffectionLevel.Dislike) ; + NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { + Velocity = 1f // Draws the NPC in the bestiary as if its walking +1 tiles in the x direction + }; + NPCID.Sets.NPCBestiaryDrawOffset.Add(NPC.type, drawModifiers); } public override void SetDefaults() diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index b35229f23b..0d81cf057a 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -44,6 +44,10 @@ namespace CalamityMod.NPCs.TownNPCs .SetNPCAffection(NPCID.GoblinTinkerer, AffectionLevel.Hate) .SetNPCAffection(NPCID.Angler, AffectionLevel.Hate) ; + NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { + Velocity = 1f // Draws the NPC in the bestiary as if its walking +1 tiles in the x direction + }; + NPCID.Sets.NPCBestiaryDrawOffset.Add(NPC.type, drawModifiers); } public override void SetDefaults() diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index 2e321acea5..2a1b524e19 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -37,6 +37,10 @@ namespace CalamityMod.NPCs.TownNPCs .SetNPCAffection(NPCID.Demolitionist, AffectionLevel.Dislike) .SetNPCAffection(NPCID.Angler, AffectionLevel.Hate) ; + NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { + Velocity = 1f // Draws the NPC in the bestiary as if its walking +1 tiles in the x direction + }; + NPCID.Sets.NPCBestiaryDrawOffset.Add(NPC.type, drawModifiers); } public override void SetDefaults() diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 5c2030ae90..c4012f5560 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -54,6 +54,10 @@ namespace CalamityMod.NPCs.TownNPCs .SetNPCAffection(NPCID.GoblinTinkerer, AffectionLevel.Like) .SetNPCAffection(NPCID.Dryad, AffectionLevel.Dislike) ; + NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { + Velocity = 1f // Draws the NPC in the bestiary as if its walking +1 tiles in the x direction + }; + NPCID.Sets.NPCBestiaryDrawOffset.Add(NPC.type, drawModifiers); } public override void SetDefaults() diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 5ef03936bd..bf3b8ba2df 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -37,6 +37,10 @@ namespace CalamityMod.NPCs.TownNPCs .SetNPCAffection(NPCID.Clothier, AffectionLevel.Like) .SetNPCAffection(NPCID.PartyGirl, AffectionLevel.Dislike) ; + NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { + Velocity = 1f // Draws the NPC in the bestiary as if its walking +1 tiles in the x direction + }; + NPCID.Sets.NPCBestiaryDrawOffset.Add(NPC.type, drawModifiers); } public override void SetDefaults() diff --git a/World/SulphurousSea.cs b/World/SulphurousSea.cs index bfc27b0afe..e2a6f0fa48 100644 --- a/World/SulphurousSea.cs +++ b/World/SulphurousSea.cs @@ -737,11 +737,11 @@ namespace CalamityMod.World if (YStartWhitelist.Contains(type) || OtherTilesForSulphSeaToDestroy.Contains(type)) { - Main.tile[trueX, y].Get().HasTile = false; + CalamityUtils.ParanoidTileRetrieval(trueX, y).Get().HasTile = false; } - if (WallsForSulphSeaToDestroy.Contains(Main.tile[trueX, y].WallType)) + if (WallsForSulphSeaToDestroy.Contains(CalamityUtils.ParanoidTileRetrieval(trueX, y).WallType)) { - Main.tile[trueX, y].WallType = 0; + CalamityUtils.ParanoidTileRetrieval(trueX, y).WallType = 0; } } }