mirror of
				https://github.com/amevarashi/RJW-Sexperience.git
				synced 2024-08-14 23:54:08 +00:00 
			
		
		
		
	Removed some code warnings
This commit is contained in:
		
							parent
							
								
									82e4224bed
								
							
						
					
					
						commit
						60b268695c
					
				
					 22 changed files with 90 additions and 149 deletions
				
			
		
							
								
								
									
										8
									
								
								RJWSexperience/IdeologyAddon/GlobalSuppressions.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								RJWSexperience/IdeologyAddon/GlobalSuppressions.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
// This file is used by Code Analysis to maintain SuppressMessage
 | 
			
		||||
// attributes that are applied to this project.
 | 
			
		||||
// Project-level suppressions either have no target or are given
 | 
			
		||||
// a specific target and scoped to a namespace, type, member, etc.
 | 
			
		||||
 | 
			
		||||
using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
 | 
			
		||||
[assembly: SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "Rimworld naming conventions")]
 | 
			
		||||
| 
						 | 
				
			
			@ -17,7 +17,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
 | 
			
		||||
			if (ModLister.HasActiveModWithName("RJW Sexperience"))
 | 
			
		||||
			{
 | 
			
		||||
				//Log.Message("[RJWSexperience.Ideology] Found RJWSexperience, patching");
 | 
			
		||||
				harmony.Patch(AccessTools.Method(typeof(PawnExtensions), nameof(PawnExtensions.IsIncest)),
 | 
			
		||||
					prefix: new HarmonyMethod(typeof(Sexperience_Patch_IsIncest), nameof(Sexperience_Patch_IsIncest.Prefix)),
 | 
			
		||||
					postfix: null
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,8 +30,7 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
            {
 | 
			
		||||
                if (mainideo.HasPrecept(VariousDefOf.BabyFaction_AlwaysFather))
 | 
			
		||||
                {
 | 
			
		||||
                    Pawn parent = baby.GetFather();
 | 
			
		||||
                    if (parent == null) baby.GetMother();
 | 
			
		||||
                    Pawn parent = baby.GetFather() ?? baby.GetMother();
 | 
			
		||||
 | 
			
		||||
                    ideo = parent.Ideo;
 | 
			
		||||
                    return parent.Faction;
 | 
			
		||||
| 
						 | 
				
			
			@ -162,7 +161,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
            bool isCoreLovin = props.isCoreLovin;
 | 
			
		||||
            xxx.rjwSextype sextype = props.sexType;
 | 
			
		||||
 | 
			
		||||
            //Log.Message("Aftersex " + pawn.Label + ": " + sextype);
 | 
			
		||||
            if (partner != null)
 | 
			
		||||
            {
 | 
			
		||||
                if (xxx.is_human(pawn)) AfterSexHuman(pawn, partner, usedCondom, rape, isCoreLovin, sextype);
 | 
			
		||||
| 
						 | 
				
			
			@ -227,12 +225,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
                    {
 | 
			
		||||
                        Find.HistoryEventsManager.RecordEvent(sexevent.TaggedEvent(human, tag + HETag.Gender(human), partner));
 | 
			
		||||
                        Find.HistoryEventsManager.RecordEvent(sexevent.TaggedEvent(partner, tag + HETag.Gender(partner), human));
 | 
			
		||||
                        //if (sexevent == VariousDefOf.PromiscuousSex)
 | 
			
		||||
                        //{
 | 
			
		||||
                        //    human.records.AddTo(SexperienceDefOf.Lust, 1.0f* RJWUtility.LustIncrementFactor(human.records.GetValue(SexperienceDefOf.Lust)));
 | 
			
		||||
                        //    partner.records.AddTo(SexperienceDefOf.Lust, 1.0f * RJWUtility.LustIncrementFactor(partner.records.GetValue(SexperienceDefOf.Lust)));
 | 
			
		||||
                        //}
 | 
			
		||||
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -302,7 +294,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
    {
 | 
			
		||||
        public static void Postfix(InteractionContext context, InteractionWithExtension interaction, IInteractionRule rule, ref float __result)
 | 
			
		||||
        {
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            Ideo ideo = context.Inputs.Initiator.Ideo;
 | 
			
		||||
            if (ideo != null) PreceptSextype(ideo, context.Inputs.Initiator.GetStatValue(xxx.sex_drive_stat), ref __result, 0, interaction);
 | 
			
		||||
| 
						 | 
				
			
			@ -312,7 +303,7 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public static List<String> promiscuousSexTypes = new List<String> { 
 | 
			
		||||
        private static readonly List<String> promiscuousSexTypes = new List<String> {
 | 
			
		||||
            "DoublePenetration",
 | 
			
		||||
            "Scissoring",
 | 
			
		||||
            "Sixtynine",
 | 
			
		||||
| 
						 | 
				
			
			@ -418,7 +409,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
        {
 | 
			
		||||
            if (!mother.IsAnimal())
 | 
			
		||||
            {
 | 
			
		||||
                //baby.SetFactionDirect(baby.GetFactionUsingPrecept());
 | 
			
		||||
                Faction faction = baby.GetFactionUsingPrecept(out Ideo ideo);
 | 
			
		||||
                if (baby.Faction != faction) baby.SetFaction(faction);
 | 
			
		||||
                baby.ideo?.SetIdeo(ideo);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,7 +64,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
 | 
			
		||||
		protected override IEnumerable<Toil> MakeNewToils()
 | 
			
		||||
		{
 | 
			
		||||
			//ModLog.Message("" + this.GetType().ToString() + "::MakeNewToils() called");
 | 
			
		||||
			setup_ticks();
 | 
			
		||||
			var PartnerJob = VariousDefOf.GettinDrugSex;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -74,19 +73,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
			this.FailOn(() => Partner == null);
 | 
			
		||||
			yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			//Toil findQuickieSpot = new Toil();
 | 
			
		||||
			//findQuickieSpot.defaultCompleteMode = ToilCompleteMode.PatherArrival;
 | 
			
		||||
			//findQuickieSpot.initAction = delegate
 | 
			
		||||
			//{
 | 
			
		||||
			//	var spot = Partner.Position.RandomAdjacentCell8Way();
 | 
			
		||||
			//	pawn.pather.StartPath(spot, PathEndMode.OnCell);
 | 
			
		||||
			//	Partner.jobs.StopAll();         //sometimes errors with stuff like vomiting
 | 
			
		||||
			//	Job job = JobMaker.MakeJob(JobDefOf.GotoMindControlled, spot);
 | 
			
		||||
			//	Partner.jobs.StartJob(job, JobCondition.InterruptForced);
 | 
			
		||||
			//};
 | 
			
		||||
			//yield return findQuickieSpot;
 | 
			
		||||
 | 
			
		||||
			Toil WaitForPartner = new Toil();
 | 
			
		||||
			WaitForPartner.defaultCompleteMode = ToilCompleteMode.Delay;
 | 
			
		||||
			WaitForPartner.initAction = delegate
 | 
			
		||||
| 
						 | 
				
			
			@ -167,8 +153,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
		{
 | 
			
		||||
			setup_ticks();
 | 
			
		||||
			parteners.Add(Partner);// add job starter, so this wont fail, before Initiator starts his job
 | 
			
		||||
								   //--ModLog.Message("JobDriver_GettinLoved::MakeNewToils is called");
 | 
			
		||||
								   //ModLog.Message("" + Partner.CurJob.def);
 | 
			
		||||
 | 
			
		||||
			// More/less hearts based on opinion.
 | 
			
		||||
			if (pawn.relations.OpinionOf(Partner) < 0)
 | 
			
		||||
| 
						 | 
				
			
			@ -195,9 +179,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
			get_loved.defaultCompleteMode = ToilCompleteMode.Never;
 | 
			
		||||
			get_loved.socialMode = RandomSocialMode.Off;
 | 
			
		||||
			get_loved.handlingFacing = true;
 | 
			
		||||
			//get_loved.initAction = delegate
 | 
			
		||||
			//{
 | 
			
		||||
			//};
 | 
			
		||||
			get_loved.tickAction = delegate
 | 
			
		||||
			{
 | 
			
		||||
			};
 | 
			
		||||
| 
						 | 
				
			
			@ -229,15 +210,11 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
		{
 | 
			
		||||
			setup_ticks();
 | 
			
		||||
 | 
			
		||||
			//this.FailOn(() => PawnUtility.PlayerForcedJobNowOrSoon(pawn));
 | 
			
		||||
			this.FailOn(() => pawn.health.Downed);
 | 
			
		||||
			this.FailOn(() => pawn.IsBurning());
 | 
			
		||||
			this.FailOn(() => pawn.IsFighting());
 | 
			
		||||
			this.FailOn(() => pawn.Drafted);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			//ModLog.Message(" Making new toil for QuickFap.");
 | 
			
		||||
 | 
			
		||||
			Toil SexToil = Toils_General.Wait(duration);
 | 
			
		||||
			SexToil.handlingFacing = true;
 | 
			
		||||
			SexToil.initAction = delegate
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,7 +48,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
 | 
			
		||||
		protected override IEnumerable<Toil> MakeNewToils()
 | 
			
		||||
		{
 | 
			
		||||
			//ModLog.Message("" + this.GetType().ToString() + "::MakeNewToils() called");
 | 
			
		||||
			setup_ticks();
 | 
			
		||||
 | 
			
		||||
			this.FailOnDespawnedNullOrForbidden(iTarget);
 | 
			
		||||
| 
						 | 
				
			
			@ -148,7 +147,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
					Job tobed = JobMaker.MakeJob(JobDefOf.Rescue, pawn, Bed);
 | 
			
		||||
					tobed.count = 1;
 | 
			
		||||
					Partner.jobs.jobQueue.EnqueueFirst(tobed);
 | 
			
		||||
					//Log.Message(xxx.get_pawnname(Initiator) + ": job tobed:" + tobed);
 | 
			
		||||
				}
 | 
			
		||||
				else if (pawn.HostileTo(Partner))
 | 
			
		||||
					pawn.health.AddHediff(xxx.submitting);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,13 +73,8 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
				if (dri == null)
 | 
			
		||||
				{
 | 
			
		||||
					Job gettin_raped = JobMaker.MakeJob(PartnerJob, pawn);
 | 
			
		||||
					//Building_Bed Bed = null;
 | 
			
		||||
					//if (Partner.GetPosture() == PawnPosture.LayingInBed)
 | 
			
		||||
					//	Bed = Partner.CurrentBed();
 | 
			
		||||
 | 
			
		||||
					Partner.jobs.StartJob(gettin_raped, JobCondition.InterruptForced, null, false, true, null);
 | 
			
		||||
					//if (Bed != null)
 | 
			
		||||
					//	(Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped)?.Set_bed(Bed);
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
			yield return StartPartnerJob;
 | 
			
		||||
| 
						 | 
				
			
			@ -93,17 +88,12 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
			{
 | 
			
		||||
				Partner.pather.StopDead();
 | 
			
		||||
				Partner.jobs.curDriver.asleep = false;
 | 
			
		||||
				//CondomUtility.GetCondomFromRoom(Partner);
 | 
			
		||||
				//Sexprops.usedCondom = CondomUtility.TryUseCondom(Partner);
 | 
			
		||||
 | 
			
		||||
				if (RJWSettings.DebugRape) ModLog.Message("JobDriver_RapeComfortPawn::MakeNewToils() - reserving prisoner");
 | 
			
		||||
				//pawn.Reserve(Partner, xxx.max_rapists_per_prisoner, 0);
 | 
			
		||||
				Start();
 | 
			
		||||
			};
 | 
			
		||||
			SexToil.tickAction = delegate
 | 
			
		||||
			{
 | 
			
		||||
				//if (pawn.IsHashIntervalTick(ticks_between_hearts))
 | 
			
		||||
				//	ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Heart);
 | 
			
		||||
				SexTick(pawn, Partner);
 | 
			
		||||
				SexUtility.reduce_rest(Partner, 1);
 | 
			
		||||
				SexUtility.reduce_rest(pawn, 2);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,8 +32,6 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
        {
 | 
			
		||||
            if (pawn.IsPrisonerOfColony || pawn.IsSlaveOfColony) return true;
 | 
			
		||||
            if (pawn.IsSubmissive()) return true;
 | 
			
		||||
            //if ((pawn.Ideo?.HasMeme(MemeDefOf.FemaleSupremacy) ?? false) && pawn.gender != Gender.Female) return true;
 | 
			
		||||
            //else if ((pawn.Ideo?.HasMeme(MemeDefOf.MaleSupremacy) ?? false) && pawn.gender != Gender.Male) return true;
 | 
			
		||||
            if (pawn.IsDesignatedComfort() || (pawn.guilt != null && pawn.guilt.IsGuilty) || (pawn.apparel != null && pawn.apparel.PsychologicallyNude)) return true;
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -99,11 +97,11 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
 | 
			
		||||
        public static bool CanBeBreeder(Pawn animal, Precept_Ritual precept)
 | 
			
		||||
        {
 | 
			
		||||
            if (precept != null)
 | 
			
		||||
            {
 | 
			
		||||
                if (precept.ideo.HasPrecept(VariousDefOf.Bestiality_OnlyVenerated) && !precept.ideo.IsVeneratedAnimal(animal)) return false;
 | 
			
		||||
            }
 | 
			
		||||
            if (!xxx.can_rape(animal)) return false;
 | 
			
		||||
			if (precept != null && precept.ideo.HasPrecept(VariousDefOf.Bestiality_OnlyVenerated) && !precept.ideo.IsVeneratedAnimal(animal))
 | 
			
		||||
			{
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			if (!xxx.can_rape(animal)) return false;
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,6 +57,7 @@
 | 
			
		|||
    </Reference>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <Compile Include="GlobalSuppressions.cs" />
 | 
			
		||||
    <Compile Include="Ideology\GoodwillSituationWorker_MemeCompatibility.cs" />
 | 
			
		||||
    <Compile Include="Harmony.cs" />
 | 
			
		||||
    <Compile Include="Ideology\Keyed.cs" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,12 +44,11 @@ namespace RJWSexperience
 | 
			
		|||
            int num = (int)storedcum;
 | 
			
		||||
 | 
			
		||||
            cum.stackCount = num;
 | 
			
		||||
            if (cum.stackCount > 0)
 | 
			
		||||
            {
 | 
			
		||||
                if (!GenPlace.TryPlaceThing(cum, PositionHeld, Map, ThingPlaceMode.Direct, out Thing res))
 | 
			
		||||
                    FilthMaker.TryMakeFilth(PositionHeld, Map, VariousDefOf.FilthCum, num);
 | 
			
		||||
            }
 | 
			
		||||
            storedcum -= num;
 | 
			
		||||
			if (cum.stackCount > 0 && !GenPlace.TryPlaceThing(cum, PositionHeld, Map, ThingPlaceMode.Direct, out Thing res))
 | 
			
		||||
			{
 | 
			
		||||
				FilthMaker.TryMakeFilth(PositionHeld, Map, VariousDefOf.FilthCum, num);
 | 
			
		||||
			}
 | 
			
		||||
			storedcum -= num;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,9 +2,6 @@
 | 
			
		|||
using UnityEngine;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience
 | 
			
		||||
{
 | 
			
		||||
	public class Configurations : ModSettings
 | 
			
		||||
| 
						 | 
				
			
			@ -35,7 +32,7 @@ namespace RJWSexperience
 | 
			
		|||
 | 
			
		||||
        public static bool SelectionLocked = false;
 | 
			
		||||
 | 
			
		||||
        public static void ResettoDefault()
 | 
			
		||||
        public void ResetToDefault()
 | 
			
		||||
        {
 | 
			
		||||
            MaxLustDeviation = MaxInitialLustDefault;
 | 
			
		||||
            AvgLust = AvgLustDefault;
 | 
			
		||||
| 
						 | 
				
			
			@ -52,7 +49,7 @@ namespace RJWSexperience
 | 
			
		|||
 | 
			
		||||
        public override void ExposeData()
 | 
			
		||||
        {
 | 
			
		||||
            Scribe_Values.Look(ref MaxLustDeviation, "MaxLustDeviation", MaxLustDeviation, true);
 | 
			
		||||
            Scribe_Values.Look(ref MaxLustDeviation, "MaxLustDeviation", MaxInitialLustDefault, true);
 | 
			
		||||
            Scribe_Values.Look(ref AvgLust, "AvgLust", AvgLust, true);
 | 
			
		||||
            Scribe_Values.Look(ref MaxSexCountDeviation, "MaxSexCountDeviation", MaxSexCountDeviation, true);
 | 
			
		||||
            Scribe_Values.Look(ref LustEffectPower, "LustEffectPower", LustEffectPower, true);
 | 
			
		||||
| 
						 | 
				
			
			@ -70,12 +67,13 @@ namespace RJWSexperience
 | 
			
		|||
 | 
			
		||||
    public class RjwSexperienceMod : Mod
 | 
			
		||||
    {
 | 
			
		||||
        private readonly Configurations config;
 | 
			
		||||
        private static Vector2 scroll;
 | 
			
		||||
        private Vector2 scroll;
 | 
			
		||||
 | 
			
		||||
        public RjwSexperienceMod(ModContentPack content) : base(content)
 | 
			
		||||
		public Configurations Settings { get; }
 | 
			
		||||
 | 
			
		||||
		public RjwSexperienceMod(ModContentPack content) : base(content)
 | 
			
		||||
        {
 | 
			
		||||
            config = GetSettings<Configurations>();
 | 
			
		||||
			Settings = GetSettings<Configurations>();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override string SettingsCategory()
 | 
			
		||||
| 
						 | 
				
			
			@ -97,7 +95,6 @@ namespace RJWSexperience
 | 
			
		|||
            listmain.Begin(mainRect);
 | 
			
		||||
            listmain.Gap(20f);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            LabelwithTextfield(listmain.GetRect(lineHeight), Keyed.Option_2_Label + " x" + Configurations.LustEffectPower, Keyed.Option_2_Desc, ref Configurations.LustEffectPower, 0f, 100f);
 | 
			
		||||
            Adjuster = (int)(Configurations.LustEffectPower * 1000);
 | 
			
		||||
            Adjuster = (int)listmain.Slider(Adjuster, 0, 2000);
 | 
			
		||||
| 
						 | 
				
			
			@ -123,7 +120,6 @@ namespace RJWSexperience
 | 
			
		|||
                Adjuster = (int)section.Slider(Adjuster, -1000, 1000);
 | 
			
		||||
                Configurations.AvgLust = Adjuster;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                LabelwithTextfield(section.GetRect(lineHeight), Keyed.Option_5_Label + " " + Configurations.MaxSexCountDeviation, Keyed.Option_5_Desc, ref Configurations.MaxSexCountDeviation, 0f, 2000f);
 | 
			
		||||
                Adjuster = (int)Configurations.MaxSexCountDeviation;
 | 
			
		||||
                Adjuster = (int)section.Slider(Adjuster, 0, 2000);
 | 
			
		||||
| 
						 | 
				
			
			@ -146,16 +142,14 @@ namespace RJWSexperience
 | 
			
		|||
                listmain.EndSection(section);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            if (listmain.ButtonText("reset to default"))
 | 
			
		||||
            {
 | 
			
		||||
                Configurations.ResettoDefault();
 | 
			
		||||
                Settings.ResetToDefault();
 | 
			
		||||
            }
 | 
			
		||||
            listmain.End();
 | 
			
		||||
            Widgets.EndScrollView();
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        public void LabelwithTextfield(Rect rect, string label, string tooltip, ref float value, float min, float max)
 | 
			
		||||
        {
 | 
			
		||||
            Rect textfieldRect = new Rect(rect.xMax - 100f, rect.y, 100f, rect.height);
 | 
			
		||||
| 
						 | 
				
			
			@ -164,7 +158,6 @@ namespace RJWSexperience
 | 
			
		|||
            Widgets.TextFieldNumeric(textfieldRect,ref value, ref valuestr, min, max);
 | 
			
		||||
            Widgets.DrawHighlightIfMouseover(rect);
 | 
			
		||||
            TooltipHandler.TipRegion(rect, tooltip);
 | 
			
		||||
            
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void SliderOption(Rect doublerect, string label, string tooltip, ref float value, float min, float max, float division)
 | 
			
		||||
| 
						 | 
				
			
			@ -175,7 +168,5 @@ namespace RJWSexperience
 | 
			
		|||
            Adjuster = (int)Widgets.HorizontalSlider(doublerect.BottomHalf(), Adjuster, 0, division);
 | 
			
		||||
            value = (Adjuster / division).Denormalization(min,max);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -90,11 +90,7 @@ namespace RJWSexperience
 | 
			
		|||
		public static bool HasHymen(this Pawn pawn)
 | 
			
		||||
		{
 | 
			
		||||
			Trait virgin = pawn.story?.traits?.GetTrait(VariousDefOf.Virgin);
 | 
			
		||||
			if (virgin != null)
 | 
			
		||||
			{
 | 
			
		||||
				if (virgin.Degree > 0) return true;
 | 
			
		||||
			}
 | 
			
		||||
			return false;
 | 
			
		||||
			return virgin?.Degree > 0;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
| 
						 | 
				
			
			@ -107,13 +103,10 @@ namespace RJWSexperience
 | 
			
		|||
				if (pawn.IsVirgin())
 | 
			
		||||
				{
 | 
			
		||||
					SexPartnerHistory history = pawn.GetPartnerHistory();
 | 
			
		||||
					if (history != null)
 | 
			
		||||
					{
 | 
			
		||||
						history.RecordFirst(partner, props);
 | 
			
		||||
					}
 | 
			
		||||
					history?.RecordFirst(partner, props);
 | 
			
		||||
					if (RJWUtility.RemoveVirginTrait(pawn, partner, props))
 | 
			
		||||
					{
 | 
			
		||||
						if (Configurations.EnableRecordRandomizer) Messages.Message(Keyed.RS_LostVirgin(pawn.LabelShort, partner.LabelShort), MessageTypeDefOf.NeutralEvent, true);
 | 
			
		||||
						Messages.Message(Keyed.RS_LostVirgin(pawn.LabelShort, partner.LabelShort), MessageTypeDefOf.NeutralEvent, true);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								RJWSexperience/RJWSexperience/GlobalSuppressions.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								RJWSexperience/RJWSexperience/GlobalSuppressions.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
// This file is used by Code Analysis to maintain SuppressMessage
 | 
			
		||||
// attributes that are applied to this project.
 | 
			
		||||
// Project-level suppressions either have no target or are given
 | 
			
		||||
// a specific target and scoped to a namespace, type, member, etc.
 | 
			
		||||
 | 
			
		||||
using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
 | 
			
		||||
[assembly: SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "Rimworld naming conventions")]
 | 
			
		||||
| 
						 | 
				
			
			@ -59,7 +59,6 @@ namespace RJWSexperience
 | 
			
		|||
            cleaning.WithProgressBar(TargetIndex.A, () => progress/CleaningTime);
 | 
			
		||||
 | 
			
		||||
            yield return cleaning;
 | 
			
		||||
            yield break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void CleaningInit()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ using Verse;
 | 
			
		|||
namespace RJWSexperience
 | 
			
		||||
{
 | 
			
		||||
	[HarmonyPatch(typeof(Pawn), "GetGizmos")]
 | 
			
		||||
	public class Pawn_GetGizmos
 | 
			
		||||
	public static class Pawn_GetGizmos
 | 
			
		||||
	{
 | 
			
		||||
		public static void Postfix(ref IEnumerable<Gizmo> __result, Pawn __instance)
 | 
			
		||||
		{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,10 +16,11 @@ namespace RJWSexperience
 | 
			
		|||
		{
 | 
			
		||||
			if (__instance.Sexprops.sexType != xxx.rjwSextype.Masturbation && !(__instance is JobDriver_Masturbate))
 | 
			
		||||
			{
 | 
			
		||||
				if (__instance.Sexprops.isRape)
 | 
			
		||||
				if (__instance.Sexprops.isRape && __instance.Sexprops.isReceiver)
 | 
			
		||||
				{
 | 
			
		||||
					__instance.pawn?.skills?.Learn(VariousDefOf.SexSkill, 0.05f, true);
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
				{
 | 
			
		||||
					__instance.pawn?.skills?.Learn(VariousDefOf.SexSkill, 0.35f, true);
 | 
			
		||||
				}
 | 
			
		||||
| 
						 | 
				
			
			@ -82,13 +83,16 @@ namespace RJWSexperience
 | 
			
		|||
 | 
			
		||||
			if (props.sexType != xxx.rjwSextype.Masturbation || props.partner != null)
 | 
			
		||||
			{
 | 
			
		||||
				lustDelta = Mathf.Clamp((satisfaction - base_sat_per_fuck) * RJWUtility.LustIncrementFactor(lust ?? 0), -0.5f, 0.5f); // If the sex is satisfactory, lust grows up. Declines at the opposite.
 | 
			
		||||
				lustDelta = Mathf.Clamp((satisfaction - base_sat_per_fuck) * RJWUtility.LustIncrementFactor((float)lust), -0.5f, 0.5f); // If the sex is satisfactory, lust grows up. Declines at the opposite.
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				lustDelta = Mathf.Clamp(satisfaction * satisfaction * RJWUtility.LustIncrementFactor(lust ?? 0), 0, 0.5f); // Masturbation always increases lust.
 | 
			
		||||
				lustDelta = Mathf.Clamp(satisfaction * satisfaction * RJWUtility.LustIncrementFactor((float)lust), 0, 0.5f); // Masturbation always increases lust.
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if (lustDelta == 0)
 | 
			
		||||
				return;
 | 
			
		||||
 | 
			
		||||
			rjw.Modules.Shared.Logs.LogManager.GetLogger<RjwSexperienceMod>().Message($"{props.pawn.NameShortColored}'s lust changed by {lustDelta} (from {lust})");
 | 
			
		||||
			props.pawn.records.AddTo(VariousDefOf.Lust, lustDelta);
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -178,7 +182,6 @@ namespace RJWSexperience
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	[HarmonyPatch(typeof(WorkGiver_CleanSelf), "JobOnThing")]
 | 
			
		||||
	public static class RJW_Patch_CleanSelf_JobOnThing
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			@ -192,27 +195,44 @@ namespace RJWSexperience
 | 
			
		|||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	[HarmonyPatch(typeof(JobGiver_Masturbate), "TryGiveJob")]
 | 
			
		||||
	public static class RJW_Patch_Masturabte_TryGiveJob
 | 
			
		||||
	[HarmonyPatch(typeof(CasualSex_Helper), nameof(CasualSex_Helper.FindSexLocation))]
 | 
			
		||||
	public static class RJW_Patch_CasualSex_Helper_FindSexLocation
 | 
			
		||||
	{
 | 
			
		||||
		public static void Postfix(Pawn pawn, ref Job __result)
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// If masturbation and current map has a bucket, return location near the bucket
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		/// <param name="pawn"></param>
 | 
			
		||||
		/// <param name="partner"></param>
 | 
			
		||||
		/// <param name="__result"></param>
 | 
			
		||||
		/// <returns></returns>
 | 
			
		||||
		public static bool Prefix(Pawn pawn, Pawn partner, ref IntVec3 __result)
 | 
			
		||||
		{
 | 
			
		||||
			if (RJWPreferenceSettings.FapEverywhere && (pawn.Faction?.IsPlayer ?? false) && __result != null)
 | 
			
		||||
			if (partner != null)
 | 
			
		||||
				return true; // Not masturbation
 | 
			
		||||
 | 
			
		||||
			Log.Message($"CasualSex_Helper.FindSexLocation for {pawn.NameShortColored}");
 | 
			
		||||
 | 
			
		||||
			if (!pawn.Faction?.IsPlayer ?? true)
 | 
			
		||||
			{
 | 
			
		||||
				Building_CumBucket bucket = pawn.FindClosestBucket();
 | 
			
		||||
				if (bucket != null)
 | 
			
		||||
				{
 | 
			
		||||
					__result.Clear();
 | 
			
		||||
					__result = JobMaker.MakeJob(xxx.Masturbate, null, null, bucket.RandomAdjacentCell8Way());
 | 
			
		||||
				}
 | 
			
		||||
				Log.Message("Not player faction");
 | 
			
		||||
				return true;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			Building_CumBucket bucket = pawn.FindClosestBucket();
 | 
			
		||||
 | 
			
		||||
			if (bucket == null)
 | 
			
		||||
			{
 | 
			
		||||
				Log.Message("Bucket not found");
 | 
			
		||||
				return true;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			__result = bucket.RandomAdjacentCell8Way();
 | 
			
		||||
			Log.Message($"Bucket location: {__result}");
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,7 +23,7 @@ namespace RJWSexperience
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	[HarmonyPatch(typeof(FloatMenuMakerMap), "AddHumanlikeOrders")]
 | 
			
		||||
	public class HumanlikeOrder_Patch
 | 
			
		||||
	public static class HumanlikeOrder_Patch
 | 
			
		||||
	{
 | 
			
		||||
		public static void Postfix(Vector3 clickPos, Pawn pawn, List<FloatMenuOption> opts)
 | 
			
		||||
		{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,6 +70,7 @@
 | 
			
		|||
    <Compile Include="DebugAction.cs" />
 | 
			
		||||
    <Compile Include="ExtensionMethods\PawnExtensions.cs" />
 | 
			
		||||
    <Compile Include="ExtensionMethods\SexPropsExtensions.cs" />
 | 
			
		||||
    <Compile Include="GlobalSuppressions.cs" />
 | 
			
		||||
    <Compile Include="Harmony.cs" />
 | 
			
		||||
    <Compile Include="IngestionOutcomeDoers.cs" />
 | 
			
		||||
    <Compile Include="JobDrivers.cs" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,13 +20,13 @@ namespace RJWSexperience
 | 
			
		|||
        public static readonly Texture2D Incest = ContentFinder<Texture2D>.Get("UI/Icon/Incest");
 | 
			
		||||
        public static readonly Texture2D Locked = ContentFinder<Texture2D>.Get("UI/Icon/RSLocked");
 | 
			
		||||
        public static readonly Texture2D Unlocked = ContentFinder<Texture2D>.Get("UI/Icon/RSUnlocked");
 | 
			
		||||
        public static Texture2D Slaanesh = SolidColorMaterials.NewSolidColorTexture(0.686f, 0.062f, 0.698f, 1.0f);
 | 
			
		||||
        public static Texture2D Khorne = SolidColorMaterials.NewSolidColorTexture(0.415f, 0.0f, 0.003f, 1.0f);
 | 
			
		||||
        public static Texture2D Tzeentch = SolidColorMaterials.NewSolidColorTexture(0.082f, 0.453f, 0.6f, 1.0f);
 | 
			
		||||
        public static Texture2D Nurgle = SolidColorMaterials.NewSolidColorTexture(0.6f, 0.83f, 0.35f, 1.0f);
 | 
			
		||||
        public static Texture2D Partners = SolidColorMaterials.NewSolidColorTexture(0.843f, 0.474f, 0.6f, 1.0f);
 | 
			
		||||
        public static Texture2D TotalSex = SolidColorMaterials.NewSolidColorTexture(0.878f, 0.674f, 0.411f, 1.0f);
 | 
			
		||||
        public static Texture2D Satisfaction = SolidColorMaterials.NewSolidColorTexture(0.325f, 0.815f, 0.729f,1.0f);
 | 
			
		||||
        public static readonly Texture2D Slaanesh = SolidColorMaterials.NewSolidColorTexture(0.686f, 0.062f, 0.698f, 1.0f);
 | 
			
		||||
        public static readonly Texture2D Khorne = SolidColorMaterials.NewSolidColorTexture(0.415f, 0.0f, 0.003f, 1.0f);
 | 
			
		||||
        public static readonly Texture2D Tzeentch = SolidColorMaterials.NewSolidColorTexture(0.082f, 0.453f, 0.6f, 1.0f);
 | 
			
		||||
        public static readonly Texture2D Nurgle = SolidColorMaterials.NewSolidColorTexture(0.6f, 0.83f, 0.35f, 1.0f);
 | 
			
		||||
        public static readonly Texture2D Partners = SolidColorMaterials.NewSolidColorTexture(0.843f, 0.474f, 0.6f, 1.0f);
 | 
			
		||||
        public static readonly Texture2D TotalSex = SolidColorMaterials.NewSolidColorTexture(0.878f, 0.674f, 0.411f, 1.0f);
 | 
			
		||||
        public static readonly Texture2D Satisfaction = SolidColorMaterials.NewSolidColorTexture(0.325f, 0.815f, 0.729f,1.0f);
 | 
			
		||||
        public static readonly Color HistoryColor = new Color(0.9f,0.5f,0.5f);
 | 
			
		||||
 | 
			
		||||
        public static readonly Texture2D[] SextypeColor = new Texture2D[]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -425,7 +425,6 @@ namespace RJWSexperience
 | 
			
		|||
				preferracepawncache = allpartners.FirstOrDefault(x => x.def == preferracecache);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			max = 0;
 | 
			
		||||
			for (int i = 0; i < sextypecount.Length; i++)
 | 
			
		||||
			{
 | 
			
		||||
				float avgsat = sextypesat[i] / sextypecount[i];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@ namespace RJWSexperience
 | 
			
		|||
        public RecordDef recordDef;
 | 
			
		||||
        public List<float> minimumValueforStage = new List<float>();
 | 
			
		||||
        public float increment;
 | 
			
		||||
    } 
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// Thought class using record.
 | 
			
		||||
| 
						 | 
				
			
			@ -54,18 +54,6 @@ namespace RJWSexperience
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void ExposeData()
 | 
			
		||||
        {
 | 
			
		||||
            base.ExposeData();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        public override void ThoughtInterval()
 | 
			
		||||
        {
 | 
			
		||||
            base.ThoughtInterval();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override bool TryMergeWithExistingMemory(out bool showBubble)
 | 
			
		||||
        {
 | 
			
		||||
            ThoughtHandler thoughts = pawn.needs.mood.thoughts;
 | 
			
		||||
| 
						 | 
				
			
			@ -83,11 +71,6 @@ namespace RJWSexperience
 | 
			
		|||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void Init()
 | 
			
		||||
        {
 | 
			
		||||
            base.Init();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected virtual void Merged()
 | 
			
		||||
        {
 | 
			
		||||
            age = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,8 +82,8 @@ namespace RJWSexperience.UI
 | 
			
		|||
		public static string GetStatExplanation(Pawn pawn, StatDef stat, float val)
 | 
			
		||||
        {
 | 
			
		||||
			if (!pawn.Dead)
 | 
			
		||||
			return stat.description + "\n" +
 | 
			
		||||
				stat.Worker.GetExplanationFull(StatRequest.For(pawn), ToStringNumberSense.Undefined, val);
 | 
			
		||||
				return stat.description + "\n" +
 | 
			
		||||
					stat.Worker.GetExplanationFull(StatRequest.For(pawn), ToStringNumberSense.Undefined, val);
 | 
			
		||||
			return "Dead".Translate();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -180,7 +180,6 @@ namespace RJWSexperience.UI
 | 
			
		|||
            if (partnerList.NullOrEmpty()) return;
 | 
			
		||||
            switch (mode)
 | 
			
		||||
            {
 | 
			
		||||
                case PartnerOrderMode.Normal:
 | 
			
		||||
                default:
 | 
			
		||||
                    partnerList = history?.PartnerList;
 | 
			
		||||
                    break;
 | 
			
		||||
| 
						 | 
				
			
			@ -328,10 +327,6 @@ namespace RJWSexperience.UI
 | 
			
		|||
                        FillableBarLabeled(infoRect3, Keyed.RS_Sex_Info(Keyed.RS_Interspecies, history.InterspeciesCount.ToString()), history.InterspeciesCount / 100f, Texture2D.linearGrayTexture, Texture2D.blackTexture);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    //GUI.Label(infoRect1, Keyed.RS_Normal + " ", fontstyleright);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -452,10 +447,6 @@ namespace RJWSexperience.UI
 | 
			
		|||
                listmain.Gap(1f);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            //listmain.GetRect(FONTHEIGHT);
 | 
			
		||||
            //listmain.Gap(1f);
 | 
			
		||||
 | 
			
		||||
            p = history.RapedCount;
 | 
			
		||||
            tmp = listmain.GetRect(FONTHEIGHT);
 | 
			
		||||
            if (p < history.BeenRapedCount)
 | 
			
		||||
| 
						 | 
				
			
			@ -484,10 +475,6 @@ namespace RJWSexperience.UI
 | 
			
		|||
                TooltipHandler.TipRegion(tmp, RJWUIUtility.GetStatExplanation(pawn, xxx.sex_satisfaction, pawn.Dead ? 0 : pawn.GetStatValue(xxx.sex_satisfaction)));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //p = pawn.GetStatValue(xxx.vulnerability_stat);
 | 
			
		||||
            //FillableBarLabeled(listmain.GetRect(FONTHEIGHT), String.Format(xxx.vulnerability_stat.LabelCap.CapitalizeFirst() + ": {0:P2}", p), p / 2, HistoryUtility.Khorne, Texture2D.blackTexture, xxx.vulnerability_stat.description);
 | 
			
		||||
            //listmain.Gap(1f);
 | 
			
		||||
 | 
			
		||||
            SkillRecord skill = pawn.skills?.GetSkill(VariousDefOf.SexSkill);
 | 
			
		||||
            p = skill?.Level ?? 0;
 | 
			
		||||
            tmp = listmain.GetRect(FONTHEIGHT);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue