-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
34 lines (31 loc) · 905 Bytes
/
Plugin.cs
File metadata and controls
34 lines (31 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using BepInEx;
using HarmonyLib;
[BepInPlugin("ant2357.tithe_tax_mod", "Tithe Tax Mod", "1.2.0")]
public class Plugin : BaseUnityPlugin
{
private void Awake()
{
var harmony = new Harmony("ant2357.tithe_tax_mod");
harmony.PatchAll();
}
}
// 基礎税金を常に 0 にするパッチ
[HarmonyPatch(typeof(Faction), "GetBaseTax")]
public static class GetBaseTaxPatch
{
private static void Postfix(ref int __result, bool evasion)
{
__result = 0;
}
}
// 有名税をプレイヤー所持金の10分の1に変更するパッチ
[HarmonyPatch(typeof(Faction), "GetFameTax")]
public static class GetFameTaxPatch
{
private static void Postfix(ref int __result, bool evasion)
{
float playerMoney = EClass.pc.GetCurrency();
__result = Math.Max(1, (int)Math.Floor(playerMoney / 10f));
}
}