mirror of
				https://github.com/amevarashi/RJW-Sexperience.git
				synced 2024-08-14 23:54:08 +00:00 
			
		
		
		
	Remove code for tagged events
This commit is contained in:
		
							parent
							
								
									b0f6e1d5b7
								
							
						
					
					
						commit
						de3790315e
					
				
					 6 changed files with 0 additions and 126 deletions
				
			
		| 
						 | 
					@ -2,7 +2,6 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	public static class ArgsNamesCustom
 | 
						public static class ArgsNamesCustom
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		public const string Tag = "TAG";
 | 
					 | 
				
			||||||
		public const string Partner = "PARTNER";
 | 
							public const string Partner = "PARTNER";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,13 +0,0 @@
 | 
				
			||||||
using Verse;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace RJWSexperience.Ideology.HistoryEvents
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	public static class Tag
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		public const string BeenRaped = "[BeenRaped]";
 | 
					 | 
				
			||||||
		public const string Rape = "[Rape]";
 | 
					 | 
				
			||||||
		public const string NotSpouse = "[NotSpouse]";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		public static string Gender(Pawn pawn) => "[" + pawn.gender + "]";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,41 +0,0 @@
 | 
				
			||||||
using RimWorld;
 | 
					 | 
				
			||||||
using System.Diagnostics.CodeAnalysis;
 | 
					 | 
				
			||||||
using Verse;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace RJWSexperience.Ideology.Precepts
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	public class PreceptComp_KnowsMemoryThoughtTagged : PreceptComp_KnowsMemoryThought
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
 | 
					 | 
				
			||||||
		public string tag;
 | 
					 | 
				
			||||||
		[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
 | 
					 | 
				
			||||||
		public bool exclusive = false;
 | 
					 | 
				
			||||||
		[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
 | 
					 | 
				
			||||||
		public bool applyonpartner = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		public PreceptComp_KnowsMemoryThoughtTagged() { }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		public override void Notify_MemberWitnessedAction(HistoryEvent ev, Precept precept, Pawn member)
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if (!applyonpartner && ev.args.TryGetArg(HistoryEvents.ArgsNamesCustom.Partner, out Pawn pawn) && pawn == member)
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				return;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if (tag != null)
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				if (ev.args.TryGetArg(HistoryEvents.ArgsNamesCustom.Tag, out string tags))
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					if (IdeoUtility.ContainAll(tags, tag.Replace(" ", "").Split(',')) ^ exclusive) base.Notify_MemberWitnessedAction(ev, precept, member);
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				else if (exclusive)
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					base.Notify_MemberWitnessedAction(ev, precept, member);
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				base.Notify_MemberWitnessedAction(ev, precept, member);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,63 +0,0 @@
 | 
				
			||||||
using RimWorld;
 | 
					 | 
				
			||||||
using System.Diagnostics.CodeAnalysis;
 | 
					 | 
				
			||||||
using Verse;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace RJWSexperience.Ideology.Precepts
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	public class PreceptComp_SelfTookThoughtTagged : PreceptComp_SelfTookMemoryThought
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
 | 
					 | 
				
			||||||
		public string tag;
 | 
					 | 
				
			||||||
		[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
 | 
					 | 
				
			||||||
		public bool exclusive = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		public override void Notify_MemberTookAction(HistoryEvent ev, Precept precept, bool canApplySelfTookThoughts)
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if (tag != null)
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				if (ev.args.TryGetArg(HistoryEvents.ArgsNamesCustom.Tag, out string tags))
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					if (IdeoUtility.ContainAll(tags, tag.Replace(" ", "").Split(',')) ^ exclusive)
 | 
					 | 
				
			||||||
					{
 | 
					 | 
				
			||||||
						TookThought(ev, precept, canApplySelfTookThoughts);
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				else if (exclusive)
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					TookThought(ev, precept, canApplySelfTookThoughts);
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				TookThought(ev, precept, canApplySelfTookThoughts);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		protected virtual void TookThought(HistoryEvent ev, Precept precept, bool canApplySelfTookThoughts)
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if (ev.def != this.eventDef || !canApplySelfTookThoughts)
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				return;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			Pawn arg = ev.args.GetArg<Pawn>(HistoryEventArgsNames.Doer);
 | 
					 | 
				
			||||||
			Pawn partner = ev.args.GetArg<Pawn>(HistoryEvents.ArgsNamesCustom.Partner);
 | 
					 | 
				
			||||||
			if (arg.needs?.mood != null && (!this.onlyForNonSlaves || !arg.IsSlave))
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				if (this.thought.minExpectationForNegativeThought != null && ExpectationsUtility.CurrentExpectationFor(arg).order < this.thought.minExpectationForNegativeThought.order)
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					return;
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				Thought_Memory thought_Memory = ThoughtMaker.MakeThought(this.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;
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				arg.needs.mood.thoughts.memories.TryGainMemory(thought_Memory, partner);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -22,11 +22,6 @@ namespace RJWSexperience.Ideology
 | 
				
			||||||
			Find.HistoryEventsManager.RecordEvent(def.CreateEventWithPartner(pawn, partner));
 | 
								Find.HistoryEventsManager.RecordEvent(def.CreateEventWithPartner(pawn, partner));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public static HistoryEvent CreateTaggedEvent(this HistoryEventDef def, Pawn pawn, string tag, Pawn partner)
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			return new HistoryEvent(def, pawn.Named(HistoryEventArgsNames.Doer), tag.Named(ArgsNamesCustom.Tag), partner.Named(ArgsNamesCustom.Partner));
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		public static HistoryEvent CreateEvent(this HistoryEventDef def, Pawn pawn)
 | 
							public static HistoryEvent CreateEvent(this HistoryEventDef def, Pawn pawn)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			return new HistoryEvent(def, pawn.Named(HistoryEventArgsNames.Doer));
 | 
								return new HistoryEvent(def, pawn.Named(HistoryEventArgsNames.Doer));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -49,7 +49,6 @@
 | 
				
			||||||
    <Compile Include="Ideology\InteractionDefExtension_HistoryEvents.cs" />
 | 
					    <Compile Include="Ideology\InteractionDefExtension_HistoryEvents.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\GoodwillSituationWorker_MemeCompatibility.cs" />
 | 
					    <Compile Include="Ideology\GoodwillSituationWorker_MemeCompatibility.cs" />
 | 
				
			||||||
    <Compile Include="Harmony.cs" />
 | 
					    <Compile Include="Harmony.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\HistoryEvents\Tag.cs" />
 | 
					 | 
				
			||||||
    <Compile Include="Ideology\HistoryEvents\ArgsNamesCustom.cs" />
 | 
					    <Compile Include="Ideology\HistoryEvents\ArgsNamesCustom.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\IssueUtility.cs" />
 | 
					    <Compile Include="Ideology\IssueUtility.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\Keyed.cs" />
 | 
					    <Compile Include="Ideology\Keyed.cs" />
 | 
				
			||||||
| 
						 | 
					@ -65,11 +64,9 @@
 | 
				
			||||||
    <Compile Include="Ideology\Precepts\DefExtension_ModifyPreference.cs" />
 | 
					    <Compile Include="Ideology\Precepts\DefExtension_ModifyPreference.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\Precepts\DefExtension_MultipleMemesRequired.cs" />
 | 
					    <Compile Include="Ideology\Precepts\DefExtension_MultipleMemesRequired.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\PartnerFilter.cs" />
 | 
					    <Compile Include="Ideology\PartnerFilter.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\Precepts\PreceptComp_KnowsMemoryThoughtTagged.cs" />
 | 
					 | 
				
			||||||
    <Compile Include="Ideology\Rituals\JobGiver_GangbangConsensual.cs" />
 | 
					    <Compile Include="Ideology\Rituals\JobGiver_GangbangConsensual.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\Rituals\LordJob_Rituals.cs" />
 | 
					    <Compile Include="Ideology\Rituals\LordJob_Rituals.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\Patches\RJW_Patch_Ideo.cs" />
 | 
					    <Compile Include="Ideology\Patches\RJW_Patch_Ideo.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\Precepts\PreceptComp_SelftTookThoughtExtended.cs" />
 | 
					 | 
				
			||||||
    <Compile Include="Ideology\Patches\Sexperience_Patch.cs" />
 | 
					    <Compile Include="Ideology\Patches\Sexperience_Patch.cs" />
 | 
				
			||||||
    <Compile Include="Properties\AssemblyInfo.cs" />
 | 
					    <Compile Include="Properties\AssemblyInfo.cs" />
 | 
				
			||||||
    <Compile Include="Ideology\Patches\Rimworld_Patch.cs" />
 | 
					    <Compile Include="Ideology\Patches\Rimworld_Patch.cs" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue