Fix folders and namespaces (except for the Rituals)

This commit is contained in:
amevarashi 2022-10-14 21:35:31 +05:00
parent 17a8264b49
commit 075260f091
47 changed files with 46 additions and 138 deletions

View file

@ -0,0 +1,20 @@
using RimWorld;
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience.Ideology.Precepts
{
public class Comp_KnowsMemoryThought_Gendered : PreceptComp_KnowsMemoryThought
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public Gender doersGender;
public override void Notify_MemberWitnessedAction(HistoryEvent ev, Precept precept, Pawn member)
{
if (ev.args.TryGetArg(HistoryEventArgsNames.Doer, out Pawn doer) && doer.gender == doersGender)
{
base.Notify_MemberWitnessedAction(ev, precept, member);
}
}
}
}

View file

@ -0,0 +1,49 @@
using RimWorld;
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience.Ideology.Precepts
{
public class Comp_SelfTookMemoryThought_Gendered : PreceptComp_SelfTookMemoryThought
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public Gender gender;
public override void Notify_MemberTookAction(HistoryEvent ev, Precept precept, bool canApplySelfTookThoughts)
{
if (ev.args.TryGetArg(HistoryEventArgsNames.Doer, out Pawn doer) && doer.gender == gender)
{
TakeThought(ev, precept, canApplySelfTookThoughts, doer);
}
}
/// <summary>
/// This is a copy of base.Notify_MemberTookAction, but with partner handling
/// </summary>
protected void TakeThought(HistoryEvent ev, Precept precept, bool canApplySelfTookThoughts, Pawn doer)
{
if (ev.def != eventDef || !canApplySelfTookThoughts)
{
return;
}
Pawn partner = ev.args.GetArg<Pawn>(HistoryEvents.ArgsNamesCustom.Partner);
if (doer.needs?.mood != null && (!onlyForNonSlaves || !doer.IsSlave))
{
if (thought.minExpectationForNegativeThought != null && ExpectationsUtility.CurrentExpectationFor(doer).order < thought.minExpectationForNegativeThought.order)
{
return;
}
Thought_Memory thought_Memory = ThoughtMaker.MakeThought(thought, precept);
if (thought_Memory is Thought_KilledInnocentAnimal thought_KilledInnocentAnimal && ev.args.TryGetArg<Pawn>(HistoryEventArgsNames.Victim, out Pawn animal))
{
thought_KilledInnocentAnimal.SetAnimal(animal);
}
if (thought_Memory is Thought_MemoryObservation thought_MemoryObservation && ev.args.TryGetArg<Corpse>(HistoryEventArgsNames.Subject, out Corpse target))
{
thought_MemoryObservation.Target = target;
}
doer.needs.mood.thoughts.memories.TryGainMemory(thought_Memory, partner);
}
}
}
}

View file

@ -0,0 +1,6 @@
namespace RJWSexperience.Ideology.Precepts
{
public class DefExtension_ModifyBestialityMtb : DefExtension_ModifyMtb
{
}
}

View file

@ -0,0 +1,6 @@
namespace RJWSexperience.Ideology.Precepts
{
public class DefExtension_ModifyFappinMtb : DefExtension_ModifyMtb
{
}
}

View file

@ -0,0 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience.Ideology.Precepts
{
public abstract class DefExtension_ModifyMtb : DefModExtension
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public float multiplier = 1f;
}
}

View file

@ -0,0 +1,6 @@
namespace RJWSexperience.Ideology.Precepts
{
public class DefExtension_ModifyNecroMtb : DefExtension_ModifyMtb
{
}
}

View file

@ -0,0 +1,37 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience.Ideology.Precepts
{
public class DefExtension_ModifyPreference : DefModExtension
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public List<Rule> rules;
public void Apply(Pawn pawn, Pawn partner, ref float preference)
{
foreach (Rule rule in rules)
{
if (rule.Applies(pawn, partner))
preference *= rule.multiplier;
}
}
public class Rule
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public float multiplier = 1f;
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public TwoPawnFilter filter;
public bool Applies(Pawn pawn, Pawn partner)
{
if (filter == null)
return true;
return filter.Applies(pawn, partner);
}
}
}
}

View file

@ -0,0 +1,6 @@
namespace RJWSexperience.Ideology.Precepts
{
public class DefExtension_ModifyRapeCPMtb : DefExtension_ModifyMtb
{
}
}

View file

@ -0,0 +1,13 @@
using RimWorld;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience.Ideology.Precepts
{
public class DefExtension_MultipleMemesRequired : DefModExtension
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public List<MemeDef> requiredAllMemes = new List<MemeDef>();
}
}