Skip to content

Commit

Permalink
Disable Village Functionality (#636)
Browse files Browse the repository at this point in the history
* Create TownPatches.cs

* Added comment and fixed file name

* Update VillagePatches.cs
  • Loading branch information
garrettluskey committed Jun 11, 2023
1 parent b0f737f commit 0dfa2a8
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using HarmonyLib;
using TaleWorlds.CampaignSystem.Settlements;

namespace GameInterface.Services.VillageService.Patches;

/// <summary>
/// Disables all functionality for Town
/// </summary>
[HarmonyPatch(typeof(Village))]
internal class VillagePatches
{
[HarmonyPatch("DailyTick")]
[HarmonyPrefix]
private static bool DailyTickPrefix()
{
return false;
}

[HarmonyPatch(nameof(Village.VillageState), MethodType.Setter)]
[HarmonyPrefix]
private static bool VillageStatePrefix()
{
return false;
}

[HarmonyPatch(nameof(Village.Hearth), MethodType.Setter)]
[HarmonyPrefix]
private static bool HearthPrefix()
{
return false;
}

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

0 comments on commit 0dfa2a8

Please sign in to comment.