Centralized Faction Goodwill Penalties in a single Helper

This commit is contained in:
Vegapnk 2024-07-05 15:20:09 +02:00
parent f5917052ab
commit 4623333605
7 changed files with 49 additions and 59 deletions

View file

@ -84,19 +84,8 @@ namespace RJW_Genes.Genes.Special
ModLog.Message($"[Sexual Age Drainer] {receiver} was too young ({receiver.ageTracker.AgeBiologicalYears}), and remains unchanged.");
}
HandleFactionGoodWillPenalties(receiver, giver);
FactionUtility.HandleFactionGoodWillPenalties(receiver, giver, "rjw_genes_GoodwillChangedReason_aged_pawn_with_sex_gene",FACTION_GOODWILL_CHANGE);
}
private static void HandleFactionGoodWillPenalties(Pawn actor, Pawn target)
{
if (
target.Faction != null && actor.Faction != null
&& target.Faction != actor.Faction
&& target.Faction != Faction.OfPlayer)
{
HistoryEventDef reason = DefDatabase<HistoryEventDef>.GetNamedSilentFail("rjw_genes_GoodwillChangedReason_youthed_pawn_with_sex_gene");
target.Faction.TryAffectGoodwillWith(actor.Faction, FACTION_GOODWILL_CHANGE, true, true, reason, target);
}
}
}
}