mirror of
https://gitgud.io/amevarashi/rjw-sexperience-ideology.git
synced 2024-08-15 00:43:19 +00:00
Fix folders and namespaces (except for the Rituals)
This commit is contained in:
parent
17a8264b49
commit
075260f091
47 changed files with 46 additions and 138 deletions
56
Source/IdeologyAddon/Patches/Rimworld_Patch.cs
Normal file
56
Source/IdeologyAddon/Patches/Rimworld_Patch.cs
Normal file
|
@ -0,0 +1,56 @@
|
|||
using HarmonyLib;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using RJWSexperience.Ideology.HistoryEvents;
|
||||
using RJWSexperience.Ideology.Precepts;
|
||||
using System.Collections.Generic;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience.Ideology.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(MarriageCeremonyUtility), nameof(MarriageCeremonyUtility.Married))]
|
||||
public static class Rimworld_Patch_Marriage
|
||||
{
|
||||
public static void Postfix(Pawn firstPawn, Pawn secondPawn)
|
||||
{
|
||||
RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(firstPawn, secondPawn);
|
||||
RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(secondPawn, firstPawn);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(RitualOutcomeEffectWorker_FromQuality), "GiveMemoryToPawn")]
|
||||
public static class Rimworld_Patch_RitualOutcome_DontGiveMemoryToAnimals
|
||||
{
|
||||
public static bool Prefix(Pawn pawn)
|
||||
{
|
||||
return !pawn.IsAnimal();
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(IdeoFoundation), nameof(IdeoFoundation.CanAdd))]
|
||||
public static class Rimworld_Patch_IdeoFoundation
|
||||
{
|
||||
public static void Postfix(PreceptDef precept, ref IdeoFoundation __instance, ref AcceptanceReport __result)
|
||||
{
|
||||
DefExtension_MultipleMemesRequired extension = precept.GetModExtension<DefExtension_MultipleMemesRequired>();
|
||||
|
||||
if (extension == null)
|
||||
return;
|
||||
|
||||
if (extension.requiredAllMemes.NullOrEmpty())
|
||||
return;
|
||||
|
||||
for (int i = 0; i < extension.requiredAllMemes.Count; i++)
|
||||
{
|
||||
if (!__instance.ideo.memes.Contains(extension.requiredAllMemes[i]))
|
||||
{
|
||||
List<string> report = new List<string>();
|
||||
foreach (MemeDef meme in extension.requiredAllMemes) report.Add(meme.LabelCap);
|
||||
|
||||
__result = new AcceptanceReport("RequiresMeme".Translate() + ": " + report.ToCommaList());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue