Fixed name rerolls on License use. thank you windy.

This commit is contained in:
Altixal committed 2026-07-05 21:08:18 +07:00
1 parent cce38d6ad1
commit d08fefbb3d
2 files changed
+23

No files matched your search

+1
View File
@@ -63,6 +63,7 @@ namespace CalamityMod.ILEditing
// Mechanics / features
On_NPC.ApplyTileCollision += AllowFusionFeederToDigThroughSand;
On_NPC.RerollVariation += AllowPatronNameRerollsOnLicenseUse;
IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom;
IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments;
On_Player.PutHallowedArmorSetBonusOnCooldown += AddHolyProtectionCooldown;
+22
View File
@@ -30,6 +30,7 @@ using CalamityMod.Tiles;
using CalamityMod.Utilities.Daybreak;
using CalamityMod.Walls;
using CalamityMod.Walls.UnsafeWalls;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Mono.Cecil.Cil;
@@ -326,6 +327,27 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Allow Patron Name Rerolls on License Use
private static bool AllowPatronNameRerollsOnLicenseUse(On_NPC.orig_RerollVariation orig, NPC self)
{
bool success = orig(self);
if (success)
{
if (self.type == NPCID.TownBunny)
CalamityWorld.bunnyName = false;
if (self.type == NPCID.TownCat)
CalamityWorld.catName = false;
if (self.type == NPCID.TownDog)
CalamityWorld.dogName = false;
if (!self.TryGetGlobalNPC<CalamityGlobalTownNPC>(out var calGlobalTownNPC))
return success;
calGlobalTownNPC.setNewName = true;
}
return success;
}
#endregion
#region Prevent Diabolists from Dropping Stuff in GFB Before Plantera
private static void PreventDiabolistLootLogic(On_NPC.orig_NPCLoot orig, NPC self)
{