Skip to content

Commit

Permalink
Create TownPatches.cs (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettluskey committed Jun 11, 2023
1 parent 0dfa2a8 commit bfd13b6
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions source/GameInterface/Services/TownService/Patches/TownPatches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Text;
using TaleWorlds.CampaignSystem.Settlements;

namespace GameInterface.Services.TownService.Patches
{
/// <summary>
/// Disables all functionality for Town
/// </summary>
[HarmonyPatch(typeof(Town))]
internal class TownPatches
{
[HarmonyPatch("DailyTick")]
[HarmonyPrefix]
private static bool DailyTickPrefix()
{
return false;
}

[HarmonyPatch(nameof(Town.OwnerClan), MethodType.Setter)]
[HarmonyPrefix]
private static bool OwnerClanPrefix()
{
return false;
}

[HarmonyPatch(nameof(Town.Security), MethodType.Setter)]
[HarmonyPrefix]
private static bool SecurityPrefix()
{
return false;
}

[HarmonyPatch(nameof(Town.Loyalty), MethodType.Setter)]
[HarmonyPrefix]
private static bool LoyaltyPrefix()
{
return false;
}


[HarmonyPatch(nameof(Town.TradeTaxAccumulated), MethodType.Setter)]
[HarmonyPrefix]
private static bool TradeTaxAccumulatedPrefix()
{
return false;
}

[HarmonyPatch(nameof(Town.Governor), MethodType.Setter)]
[HarmonyPrefix]
private static bool GovernorPrefix()
{
return false;
}

[HarmonyPatch(nameof(Town.LastCapturedBy), MethodType.Setter)]
[HarmonyPrefix]
private static bool LastCapturedByPrefix()
{
return false;
}
}
}

0 comments on commit bfd13b6

Please sign in to comment.