-
Notifications
You must be signed in to change notification settings - Fork 0
/
VillagerPatch.cs
23 lines (21 loc) · 912 Bytes
/
VillagerPatch.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Eremite.Characters.Villagers;
using Eremite.Model.Sound;
using HarmonyLib;
using System;
namespace Ryguy9999.ATS.ATSForAP {
[HarmonyPatch(typeof(Villager))]
class VillagerPatch {
[HarmonyPostfix]
[HarmonyPatch(nameof(Villager.Die))]
[HarmonyPatch(new Type[] { typeof(VillagerLossType), typeof(string), typeof(bool), typeof(float), typeof(SoundModel) })]
private static void DiePostfix(VillagerLossType lossType, string reasonKey, bool showDying = true, float duration = 25f, SoundModel extraSound = null) {
ArchipelagoService.HandleVillagerDeath(lossType, reasonKey);
}
[HarmonyPostfix]
[HarmonyPatch(nameof(Villager.Leave))]
//[HarmonyPatch(new Type[] { typeof(string) })]
private static void LeavePostfix() {
ArchipelagoService.HandleVillagerDeath(VillagerLossType.Leave, "");
}
}
}