static void Postfix(bool __result, Recipe_Surgery __instance, Pawn surgeon, Pawn patient, List <Thing> ingredients, BodyPartRecord part, Bill bill) { if (!__result && IsClean(patient, part) && __instance.GetType().Name == "Recipe_RemoveBodyPart" && patient.RaceProps.Humanlike) { BadPeopleUtility.NotifyDoctorRemovedBodyPart(surgeon); } }
static void Postfix(Pawn __instance, TradeAction action, Pawn playerNegotiator, ITrader trader) { if (action == TradeAction.PlayerSells && __instance.RaceProps.Humanlike) { BadPeopleUtility.NotifyPawnSoldPrisoner(playerNegotiator); } }
static void Prefix(Pawn_GuestTracker __instance, Faction newHost, bool prisoner) { if (prisoner == true && newHost != null && (newHost != __instance.HostFaction || !__instance.IsPrisoner)) { var pawnProperty = typeof(Pawn_GuestTracker).GetField("pawn", BindingFlags.Instance | BindingFlags.NonPublic); BadPeopleUtility.NotifyPawnGetCaptured(pawnProperty.GetValue(__instance) as Pawn); } }
static void Postfix(Pawn __instance, Faction newFaction, Pawn recruiter) { if (BadPeopleUtility.CurrentRefugee != null && __instance == BadPeopleUtility.CurrentRefugee) { BadPeopleUtility.NotifyRefugeeAccepted(newFaction); BadPeopleUtility.CurrentRefugee = null; } }
static void Prefix(Faction __instance, Faction other, int goodwillChange, bool canSendMessage, bool canSendHostilityLetter, string reason, GlobalTargetInfo?lookTarget) { if (Prerequirments(__instance, other, goodwillChange)) { if (!__instance.HostileTo(other) && __instance.GoodwillWith(other) < -80) { BadPeopleUtility.NotifyLostAllies(other); } if (__instance.HostileTo(other) && __instance.GoodwillWith(other) > 0) { BadPeopleUtility.NotifyGainedAllies(other); } } }
static void Postfix(MemoryThoughtHandler __instance, Thought_Memory newThought, Pawn otherPawn) { BadPeopleUtility.NotifyPawnGotThought(__instance.pawn, newThought, otherPawn); }
static void Prefix(Pawn p) { BadPeopleUtility.NotifyPawnGetReleased(p); }
static void Prefix(Pawn __instance, DamageInfo?dinfo, Hediff exactCulprit = null) { BadPeopleUtility.NotifyPawnKilled(__instance, dinfo, exactCulprit); }
static void Prefix(Pawn p) { BadPeopleUtility.NotifyPawnGetReleased(p, p.guest.HostFaction); }