Made the tax collector useful
This commit is contained in:
1 parent
d92f16122d
commit
e3bc09b3d5
3 files changed
+30
-1
No files matched your search
@@ -55,6 +55,7 @@ namespace CalamityMod.ILEditing
|
||||
IL.Terraria.GameContent.Drawing.TileDrawing.DrawPartialLiquid += DrawCustomLava;
|
||||
IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw += DrawCustomLava2;
|
||||
IL.Terraria.Main.oldDrawWater += DrawCustomLava3;
|
||||
IL.Terraria.Player.CollectTaxes += MakeTaxCollectorUseful;
|
||||
|
||||
// TODO -- Revisit this. It's not an extremely important thing, but it'd be ideal to not just abandon it.
|
||||
// IL.Terraria.WaterfallManager.DrawWaterfall += DrawCustomLavafalls;
|
||||
@@ -151,7 +152,8 @@ namespace CalamityMod.ILEditing
|
||||
IL.Terraria.GameContent.Drawing.TileDrawing.DrawPartialLiquid -= DrawCustomLava;
|
||||
IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw -= DrawCustomLava2;
|
||||
IL.Terraria.Main.oldDrawWater -= DrawCustomLava3;
|
||||
IL.Terraria.WaterfallManager.DrawWaterfall -= DrawCustomLavafalls;
|
||||
IL.Terraria.Player.CollectTaxes -= MakeTaxCollectorUseful;
|
||||
// IL.Terraria.WaterfallManager.DrawWaterfall -= DrawCustomLavafalls;
|
||||
On.Terraria.NPC.Collision_DecideFallThroughPlatforms -= EnableCalamityBossPlatformCollision;
|
||||
IL.Terraria.Wiring.HitWireSingle -= AddTwinklersToStatue;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using CalamityMod.Cooldowns;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.FluidSimulation;
|
||||
using CalamityMod.Items.Dyes;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Astral;
|
||||
using CalamityMod.NPCs.AstrumAureus;
|
||||
using CalamityMod.NPCs.Crabulon;
|
||||
@@ -916,5 +917,27 @@ namespace CalamityMod.ILEditing
|
||||
throw new Exception("Hook location not found, switch(*) { case 54: ...");
|
||||
}
|
||||
#endregion Statue Additions
|
||||
|
||||
#region Make Tax Collector Worth it
|
||||
private static void MakeTaxCollectorUseful(ILContext il)
|
||||
{
|
||||
ILCursor cursor = new(il);
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall<Item>("buyPrice")))
|
||||
{
|
||||
LogFailure("Tax Collector Money Boosts", "Could not locate the amount of money to collect per town NPC.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Pop);
|
||||
cursor.Emit<CalamityGlobalNPC>(OpCodes.Ldsfld, "TotalTaxesPerNPC");
|
||||
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall<Item>("buyPrice")))
|
||||
{
|
||||
LogFailure("Tax Collector Money Boosts", "Could not locate the maximum amount of money to collect.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Pop);
|
||||
cursor.Emit<CalamityGlobalNPC>(OpCodes.Ldsfld, "TaxesToCollectLimit");
|
||||
}
|
||||
#endregion Make Tax Collector Worth it
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,10 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
public partial class CalamityGlobalNPC : GlobalNPC
|
||||
{
|
||||
public static readonly int TotalTaxesPerNPC = Item.buyPrice(0, 0, 3, 0);
|
||||
|
||||
public static readonly int TaxesToCollectLimit = Item.buyPrice(5, 0, 0, 0);
|
||||
|
||||
#region Town NPC Patreon Name Sets
|
||||
private const int AnglerVanillaNames = 22;
|
||||
private static readonly string[] AnglerNames =
|
||||
|
||||
Reference in new issue
Block a user