mirror of
				https://github.com/vegapnk/RJW-Genes.git
				synced 2024-08-15 00:23:31 +00:00 
			
		
		
		
	Several genes and changes
- Succubus wings now have the flight abilty (same as longjump) - Modified aphrodisiac pheromones to increase with strenght based on carrier's sexdrive. - Added paralysing kiss, touch range stun which uses fertilin - Added seduce, beckon like ability which results in sex if target reached caster. Uses fertilin
This commit is contained in:
		
							parent
							
								
									5555083bc2
								
							
						
					
					
						commit
						400b48787d
					
				
					 25 changed files with 687 additions and 171 deletions
				
			
		
							
								
								
									
										82
									
								
								Source/Genes/Life_Force/CompAbilityEffect_Seduce.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								Source/Genes/Life_Force/CompAbilityEffect_Seduce.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,82 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Verse;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using Verse.AI;
 | 
			
		||||
using rjw;
 | 
			
		||||
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
	public class CompAbilityEffect_Seduce : CompAbilityEffect_WithDest
 | 
			
		||||
	{
 | 
			
		||||
		private new CompProperties_Seduce Props
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return (CompProperties_Seduce)this.props;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
 | 
			
		||||
		{
 | 
			
		||||
			base.Apply(target, dest);
 | 
			
		||||
			Pawn pawn = target.Thing as Pawn;
 | 
			
		||||
			Pawn pawn2 = this.parent.pawn;
 | 
			
		||||
			if (pawn != null && pawn2 != null && !pawn.Downed)
 | 
			
		||||
			{
 | 
			
		||||
				Job job = JobMaker.MakeJob(JobDefOf.rjw_genes_lifeforce_seduced, pawn2);//ChooseJob(pawn, pawn2);
 | 
			
		||||
				job.mote = MoteMaker.MakeThoughtBubble(pawn, this.parent.def.iconPath, true); //make this image of pawn or else heart
 | 
			
		||||
				pawn.jobs.StopAll(false, true);
 | 
			
		||||
				pawn.jobs.StartJob(job, JobCondition.InterruptForced, null, false, true, null, null, false, false, null, false, true);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public override bool Valid(LocalTargetInfo target, bool throwMessages = false)
 | 
			
		||||
		{
 | 
			
		||||
 | 
			
		||||
			Pawn pawn = target.Pawn;
 | 
			
		||||
			if (pawn != null)
 | 
			
		||||
			{
 | 
			
		||||
				if (!xxx.can_be_fucked(pawn))
 | 
			
		||||
				{
 | 
			
		||||
					if (throwMessages)
 | 
			
		||||
					{
 | 
			
		||||
						Messages.Message(pawn.Name + " is unable to have sex", pawn, MessageTypeDefOf.RejectInput, false);
 | 
			
		||||
					}
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				else if (pawn.IsAnimal() && !RJWSettings.bestiality_enabled)
 | 
			
		||||
				{
 | 
			
		||||
					if (throwMessages)
 | 
			
		||||
					{
 | 
			
		||||
						Messages.Message("bestiality is disabled", pawn, MessageTypeDefOf.RejectInput, false);
 | 
			
		||||
					}
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				else if (pawn.Downed)
 | 
			
		||||
                {
 | 
			
		||||
					if (throwMessages)
 | 
			
		||||
					{
 | 
			
		||||
						Messages.Message(pawn.Name + " is unable to move", pawn, MessageTypeDefOf.RejectInput, false);
 | 
			
		||||
					}
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
			}
 | 
			
		||||
			return base.Valid(target, throwMessages);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public override bool GizmoDisabled(out string reason)
 | 
			
		||||
		{
 | 
			
		||||
			reason = null;
 | 
			
		||||
			if (!RJWSettings.rape_enabled)
 | 
			
		||||
			{
 | 
			
		||||
				reason = "Rape is disabled";
 | 
			
		||||
				return true;
 | 
			
		||||
			}
 | 
			
		||||
			return false;
 | 
			
		||||
		} 
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										21
									
								
								Source/Genes/Life_Force/CompProperties_Seduce.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Source/Genes/Life_Force/CompProperties_Seduce.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Verse;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
	public class CompProperties_Seduce : CompProperties_EffectWithDest
 | 
			
		||||
	{
 | 
			
		||||
		public CompProperties_Seduce()
 | 
			
		||||
		{
 | 
			
		||||
			this.compClass = typeof(CompAbilityEffect_Seduce);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		public StatDef durationMultiplier;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -29,13 +29,10 @@ namespace RJW_Genes
 | 
			
		|||
			{
 | 
			
		||||
				yield return gizmo;
 | 
			
		||||
			}
 | 
			
		||||
			IEnumerator<Gizmo> enumerator = null;
 | 
			
		||||
			foreach (Gizmo gizmo2 in GeneResourceDrainUtility.GetResourceDrainGizmos(this))
 | 
			
		||||
			{
 | 
			
		||||
				yield return gizmo2;
 | 
			
		||||
			}
 | 
			
		||||
			enumerator = null;
 | 
			
		||||
			yield break;
 | 
			
		||||
			yield break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										18
									
								
								Source/Genes/Life_Force/HediffCompProperties_RemoveSubmit.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Source/Genes/Life_Force/HediffCompProperties_RemoveSubmit.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Verse;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
    public class HediffCompProperties_RemoveSubmit :HediffCompProperties
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        public HediffCompProperties_RemoveSubmit()
 | 
			
		||||
        {
 | 
			
		||||
            this.compClass = typeof(HediffComp_RemoveSubmit);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										42
									
								
								Source/Genes/Life_Force/HediffComp_RemoveSubmit.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								Source/Genes/Life_Force/HediffComp_RemoveSubmit.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,42 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Verse;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using rjw;
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
    public class HediffComp_RemoveSubmit : HediffComp
 | 
			
		||||
    {
 | 
			
		||||
		public HediffCompProperties_RemoveSubmit Props
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return (HediffCompProperties_RemoveSubmit)this.props;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
        public override void CompPostPostRemoved()
 | 
			
		||||
        {
 | 
			
		||||
            base.CompPostPostRemoved();
 | 
			
		||||
			HediffWithComps submitting = this.Pawn.health.hediffSet.GetFirstHediffOfDef(xxx.submitting) as HediffWithComps;
 | 
			
		||||
			submitting.CurStage.becomeVisible = false;
 | 
			
		||||
			if (submitting != null)
 | 
			
		||||
			{
 | 
			
		||||
				foreach (HediffComp comp in submitting.comps)
 | 
			
		||||
				{
 | 
			
		||||
					HediffComp_Disappears hediffComp = comp as HediffComp_Disappears;
 | 
			
		||||
					if (hediffComp != null)
 | 
			
		||||
					{
 | 
			
		||||
						hediffComp.ticksToDisappear = 1;
 | 
			
		||||
						//pawn.health.RemoveHediff(submitting);
 | 
			
		||||
						//removing the hediff directly gives an error, ArgementOutOrRange, making the remaining time 1 ticks should have the same effect without the error
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,131 +0,0 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using Verse;
 | 
			
		||||
using Verse.AI;
 | 
			
		||||
using rjw;
 | 
			
		||||
using rjw.Modules.Interactions.Enums;
 | 
			
		||||
using rjw.Modules.Interactions.Helpers;
 | 
			
		||||
using rjw.Modules.Interactions.Objects;
 | 
			
		||||
using rjw.Modules.Interactions.Contexts;
 | 
			
		||||
using rjw.Modules.Interactions.Implementation;
 | 
			
		||||
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
	public class JobDriver_DrinkCumflation : JobDriver_SexBaseInitiator
 | 
			
		||||
	{
 | 
			
		||||
		//Summary//
 | 
			
		||||
		//WIP is for custom interaction
 | 
			
		||||
		protected override IEnumerable<Toil> MakeNewToils()
 | 
			
		||||
		{
 | 
			
		||||
			base.setup_ticks();
 | 
			
		||||
			this.rape = !LovePartnerRelationUtility.LovePartnerRelationExists(this.pawn, this.Partner);
 | 
			
		||||
			JobDef PartnerJob =  rape? xxx.gettin_raped: xxx.getting_quickie;
 | 
			
		||||
			this.FailOnDestroyedNullOrForbidden(TargetIndex.A);
 | 
			
		||||
			this.FailOnSomeonePhysicallyInteracting(TargetIndex.A);
 | 
			
		||||
			this.FailOn(() => this.pawn.Drafted);
 | 
			
		||||
			this.FailOn(() => this.pawn.IsFighting());
 | 
			
		||||
			this.FailOn(() => this.Partner.IsFighting());
 | 
			
		||||
			yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch);
 | 
			
		||||
			yield return new Toil
 | 
			
		||||
			{
 | 
			
		||||
				defaultCompleteMode = ToilCompleteMode.Instant,
 | 
			
		||||
				socialMode = RandomSocialMode.Off,
 | 
			
		||||
				initAction = delegate ()
 | 
			
		||||
				{
 | 
			
		||||
					Job newJob = JobMaker.MakeJob(PartnerJob, this.pawn, this.Partner);
 | 
			
		||||
					this.Partner.jobs.StartJob(newJob, JobCondition.InterruptForced, null, false, true, null, null, false, false, null, false, true);
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
 | 
			
		||||
			Toil toil = new Toil();
 | 
			
		||||
			toil.defaultCompleteMode = ToilCompleteMode.Never;
 | 
			
		||||
			toil.defaultDuration = this.duration;
 | 
			
		||||
			toil.handlingFacing = true;
 | 
			
		||||
			toil.FailOn(() => this.Partner.CurJob.def != PartnerJob);
 | 
			
		||||
			toil.initAction = delegate ()
 | 
			
		||||
			{
 | 
			
		||||
				this.Partner.pather.StopDead();
 | 
			
		||||
				this.Partner.jobs.curDriver.asleep = false;
 | 
			
		||||
				this.SetInteraction();
 | 
			
		||||
				this.cumflation = this.Partner.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("Cumflation"));
 | 
			
		||||
				this.gene_LifeForce = (this.pawn.genes != null) ? this.pawn.genes.GetFirstGeneOfType<Gene_LifeForce>() : null;
 | 
			
		||||
				this.Start();
 | 
			
		||||
			};
 | 
			
		||||
			toil.tickAction = delegate ()
 | 
			
		||||
			{
 | 
			
		||||
				if (this.pawn.IsHashIntervalTick(this.ticks_between_hearts))
 | 
			
		||||
				{
 | 
			
		||||
					this.ThrowMetaIconF(this.pawn.Position, this.pawn.Map, FleckDefOf.Heart);
 | 
			
		||||
				}
 | 
			
		||||
				this.SexTick(this.pawn, this.Partner, true, true);
 | 
			
		||||
				SexUtility.reduce_rest(this.Partner, 1f);
 | 
			
		||||
				SexUtility.reduce_rest(this.pawn, 2f);
 | 
			
		||||
				if (this.ticks_left <= 0)
 | 
			
		||||
				{
 | 
			
		||||
					this.ReadyForNextToil();
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
			toil.AddFinishAction(delegate
 | 
			
		||||
			{
 | 
			
		||||
				this.End();
 | 
			
		||||
			});
 | 
			
		||||
			yield return toil;
 | 
			
		||||
			yield return new Toil
 | 
			
		||||
			{
 | 
			
		||||
				initAction = delegate ()
 | 
			
		||||
				{
 | 
			
		||||
					SexUtility.ProcessSex(this.Sexprops);
 | 
			
		||||
				},
 | 
			
		||||
				defaultCompleteMode = ToilCompleteMode.Instant
 | 
			
		||||
			};
 | 
			
		||||
			yield break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public void Reduce_Cumflation()
 | 
			
		||||
        {
 | 
			
		||||
			this.reductiontick--;
 | 
			
		||||
			if (reductiontick <= 0)
 | 
			
		||||
            {
 | 
			
		||||
				if (this.cumflation != null && this.gene_LifeForce != null)
 | 
			
		||||
				{
 | 
			
		||||
					this.cumflation.Severity =+ 0.01f;
 | 
			
		||||
					gene_LifeForce.Resource.Value += 0.01f;
 | 
			
		||||
				}
 | 
			
		||||
				this.reductiontick = 60;
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
		}
 | 
			
		||||
		public override bool TryMakePreToilReservations(bool errorOnFailed)
 | 
			
		||||
		{
 | 
			
		||||
			return this.pawn.Reserve(this.job.GetTarget(TargetIndex.A), this.job, 1, -1, null, errorOnFailed);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public void SetInteraction()
 | 
			
		||||
		{
 | 
			
		||||
			InteractionDef interaction = rape ? DefDatabase<InteractionDef>.GetNamed("Rape_Reverse_Cunnilingus") : DefDatabase<InteractionDef>.GetNamed("Sex_Reverse_Cunnilingus");
 | 
			
		||||
 | 
			
		||||
			SpecificInteractionInputs inputs = new SpecificInteractionInputs
 | 
			
		||||
			{
 | 
			
		||||
				Initiator = this.pawn,
 | 
			
		||||
				Partner = this.Partner,
 | 
			
		||||
				Interaction = interaction
 | 
			
		||||
			};
 | 
			
		||||
			InteractionOutputs interactionOutputs = SpecificLewdInteractionService.Instance.GenerateSpecificInteraction(inputs);
 | 
			
		||||
			this.Sexprops.sexType = interactionOutputs.Generated.RjwSexType;
 | 
			
		||||
			this.Sexprops.rulePack = interactionOutputs.Generated.RulePack.defName;
 | 
			
		||||
			this.Sexprops.dictionaryKey = interaction;
 | 
			
		||||
			this.Sexprops.isRapist = rape;
 | 
			
		||||
			this.Sexprops.isWhoring = false;
 | 
			
		||||
			this.Sexprops.isRevese = true;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public Hediff cumflation;
 | 
			
		||||
		public Gene_LifeForce gene_LifeForce;
 | 
			
		||||
		int reductiontick = 60; 
 | 
			
		||||
		bool rape = false; 
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										54
									
								
								Source/Genes/Life_Force/JobDriver_Seduced.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								Source/Genes/Life_Force/JobDriver_Seduced.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,54 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using Verse;
 | 
			
		||||
using Verse.AI;
 | 
			
		||||
using rjw;
 | 
			
		||||
using rjw.Modules.Interactions.Enums;
 | 
			
		||||
using rjw.Modules.Interactions.Helpers;
 | 
			
		||||
using rjw.Modules.Interactions.Objects;
 | 
			
		||||
using rjw.Modules.Interactions.Contexts;
 | 
			
		||||
using rjw.Modules.Interactions.Implementation;
 | 
			
		||||
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
	public class JobDriver_Seduced : JobDriver
 | 
			
		||||
	{
 | 
			
		||||
		//Summary//
 | 
			
		||||
		//Makes a pawn move to seducing pawn and then tries to rape them.
 | 
			
		||||
		protected override IEnumerable<Toil> MakeNewToils()
 | 
			
		||||
		{
 | 
			
		||||
			
 | 
			
		||||
			this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
 | 
			
		||||
			this.FailOn(() => !this.pawn.CanReserve(TargetA, xxx.max_rapists_per_prisoner, 0, null, false));
 | 
			
		||||
			this.FailOn(() => this.pawn.IsFighting());
 | 
			
		||||
			this.FailOn(() => this.pawn.Drafted);
 | 
			
		||||
	
 | 
			
		||||
			Pawn partner = this.job.GetTarget(TargetIndex.A).Pawn;
 | 
			
		||||
			yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch);
 | 
			
		||||
			yield return new Toil
 | 
			
		||||
			{
 | 
			
		||||
				defaultCompleteMode = ToilCompleteMode.Instant,
 | 
			
		||||
				socialMode = RandomSocialMode.Off,
 | 
			
		||||
				initAction = delegate ()
 | 
			
		||||
				{
 | 
			
		||||
					if(partner != null)
 | 
			
		||||
                    {
 | 
			
		||||
						partner.drafter.Drafted = false;
 | 
			
		||||
						Job newJob = JobMaker.MakeJob(JobDefOf.sex_on_spot, pawn);
 | 
			
		||||
						partner.jobs.StartJob(newJob, JobCondition.InterruptForced, null, false, true, null, null, false, false, null, false, true);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
			yield break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public override bool TryMakePreToilReservations(bool errorOnFailed)
 | 
			
		||||
		{
 | 
			
		||||
			return this.pawn.Reserve(TargetA, this.job, xxx.max_rapists_per_prisoner, 0, null, errorOnFailed);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										108
									
								
								Source/Genes/Life_Force/JobDriver_SexOnSpot.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								Source/Genes/Life_Force/JobDriver_SexOnSpot.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,108 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using Verse;
 | 
			
		||||
using Verse.AI;
 | 
			
		||||
using rjw;
 | 
			
		||||
using rjw.Modules.Interactions.Enums;
 | 
			
		||||
using rjw.Modules.Interactions.Helpers;
 | 
			
		||||
using rjw.Modules.Interactions.Objects;
 | 
			
		||||
using rjw.Modules.Interactions.Contexts;
 | 
			
		||||
using rjw.Modules.Interactions.Implementation;
 | 
			
		||||
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
	public class JobDriver_SexOnSpot : JobDriver_SexBaseInitiator
 | 
			
		||||
	{
 | 
			
		||||
		protected override IEnumerable<Toil> MakeNewToils()
 | 
			
		||||
		{
 | 
			
		||||
			if (RJWSettings.DebugRape)
 | 
			
		||||
			{
 | 
			
		||||
				ModLog.Message(base.GetType().ToString() + "::MakeNewToils() called");
 | 
			
		||||
			}
 | 
			
		||||
			base.setup_ticks();
 | 
			
		||||
			JobDef PartnerJob = JobDefOf.sex_on_spot_reciever;
 | 
			
		||||
			this.FailOnDespawnedNullOrForbidden(this.iTarget);
 | 
			
		||||
			this.FailOn(() => !this.pawn.CanReserve(this.Partner, xxx.max_rapists_per_prisoner, 0, null, false));
 | 
			
		||||
			this.FailOn(() => this.pawn.IsFighting());
 | 
			
		||||
			this.FailOn(() => this.Partner.IsFighting());
 | 
			
		||||
			this.FailOn(() => this.pawn.Drafted);
 | 
			
		||||
			yield return Toils_Goto.GotoThing(this.iTarget, PathEndMode.Touch);
 | 
			
		||||
			if (this.pawn.HostileTo(this.Partner))
 | 
			
		||||
            {
 | 
			
		||||
				Partner.health.AddHediff(xxx.submitting);
 | 
			
		||||
            }
 | 
			
		||||
			yield return Toils_Goto.GotoThing(this.iTarget, PathEndMode.OnCell);
 | 
			
		||||
			//Give thought malus to partner (I was seduced into having sex against my will)
 | 
			
		||||
			yield return new Toil
 | 
			
		||||
			{
 | 
			
		||||
				defaultCompleteMode = ToilCompleteMode.Instant,
 | 
			
		||||
				socialMode = RandomSocialMode.Off,
 | 
			
		||||
				initAction = delegate ()
 | 
			
		||||
				{
 | 
			
		||||
					if (!(this.Partner.jobs.curDriver is JobDriver_SexOnSpotReciever))
 | 
			
		||||
					{
 | 
			
		||||
						Job newJob = JobMaker.MakeJob(PartnerJob, this.pawn);
 | 
			
		||||
						Building_Bed building_Bed = null;
 | 
			
		||||
						if (this.Partner.GetPosture() == PawnPosture.LayingInBed)
 | 
			
		||||
						{
 | 
			
		||||
							building_Bed = this.Partner.CurrentBed();
 | 
			
		||||
						}
 | 
			
		||||
						this.Partner.jobs.StartJob(newJob, JobCondition.InterruptForced, null, false, true, null, null, false, false, null, false, true);
 | 
			
		||||
						if (building_Bed != null)
 | 
			
		||||
						{
 | 
			
		||||
							JobDriver_SexOnSpotReciever jobDriver_SexOnSpotReciever = this.Partner.jobs.curDriver as JobDriver_SexOnSpotReciever;
 | 
			
		||||
							if (jobDriver_SexOnSpotReciever == null)
 | 
			
		||||
							{
 | 
			
		||||
								return;
 | 
			
		||||
							}
 | 
			
		||||
							jobDriver_SexOnSpotReciever.Set_bed(building_Bed);
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
			Toil toil = new Toil();
 | 
			
		||||
			toil.defaultCompleteMode = ToilCompleteMode.Never;
 | 
			
		||||
			toil.defaultDuration = this.duration;
 | 
			
		||||
			toil.handlingFacing = true;
 | 
			
		||||
			toil.FailOn(() => this.Partner.CurJob.def != PartnerJob);
 | 
			
		||||
			toil.initAction = delegate ()
 | 
			
		||||
			{
 | 
			
		||||
				this.Partner.pather.StopDead();
 | 
			
		||||
				this.Partner.jobs.curDriver.asleep = false;
 | 
			
		||||
				this.Start();
 | 
			
		||||
			};
 | 
			
		||||
			toil.tickAction = delegate ()
 | 
			
		||||
			{
 | 
			
		||||
				if (this.pawn.IsHashIntervalTick(this.ticks_between_hearts))
 | 
			
		||||
				{
 | 
			
		||||
					this.ThrowMetaIconF(this.pawn.Position, this.pawn.Map, FleckDefOf.Heart);
 | 
			
		||||
				}
 | 
			
		||||
				this.SexTick(this.pawn, this.Partner, true, true);
 | 
			
		||||
				SexUtility.reduce_rest(this.Partner, 1f);
 | 
			
		||||
				SexUtility.reduce_rest(this.pawn, 2f);
 | 
			
		||||
				if (this.ticks_left <= 0)
 | 
			
		||||
				{
 | 
			
		||||
					this.ReadyForNextToil();
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
			toil.AddFinishAction(delegate
 | 
			
		||||
			{
 | 
			
		||||
				this.End();
 | 
			
		||||
			});
 | 
			
		||||
			yield return toil;
 | 
			
		||||
			yield return new Toil
 | 
			
		||||
			{
 | 
			
		||||
				initAction = delegate ()
 | 
			
		||||
				{
 | 
			
		||||
					SexUtility.ProcessSex(this.Sexprops);
 | 
			
		||||
				},
 | 
			
		||||
				defaultCompleteMode = ToilCompleteMode.Instant
 | 
			
		||||
			};
 | 
			
		||||
			yield break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										84
									
								
								Source/Genes/Life_Force/JobDriver_SexOnSpotReceiver.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								Source/Genes/Life_Force/JobDriver_SexOnSpotReceiver.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,84 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using Verse;
 | 
			
		||||
using Verse.AI;
 | 
			
		||||
using rjw;
 | 
			
		||||
using rjw.Modules.Interactions.Enums;
 | 
			
		||||
using rjw.Modules.Interactions.Helpers;
 | 
			
		||||
using rjw.Modules.Interactions.Objects;
 | 
			
		||||
using rjw.Modules.Interactions.Contexts;
 | 
			
		||||
using rjw.Modules.Interactions.Implementation;
 | 
			
		||||
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
	//Modified JobDriver_SexBaseRecieverLoved from rjw
 | 
			
		||||
	public class JobDriver_SexOnSpotReciever : JobDriver_SexBaseReciever
 | 
			
		||||
	{
 | 
			
		||||
		protected override IEnumerable<Toil> MakeNewToils()
 | 
			
		||||
		{
 | 
			
		||||
			base.setup_ticks();
 | 
			
		||||
			this.parteners.Add(base.Partner);
 | 
			
		||||
			if (this.pawn.relations.OpinionOf(base.Partner) < 0)
 | 
			
		||||
			{
 | 
			
		||||
				this.ticks_between_hearts += 50;
 | 
			
		||||
			}
 | 
			
		||||
			else if (this.pawn.relations.OpinionOf(base.Partner) > 60)
 | 
			
		||||
			{
 | 
			
		||||
				this.ticks_between_hearts -= 25;
 | 
			
		||||
			}
 | 
			
		||||
			this.FailOnDespawnedOrNull(this.iTarget);
 | 
			
		||||
			this.FailOn(() => !base.Partner.health.capacities.CanBeAwake);
 | 
			
		||||
			this.FailOn(() => this.pawn.Drafted);
 | 
			
		||||
			this.FailOn(() => base.Partner.Drafted);
 | 
			
		||||
			yield return Toils_Reserve.Reserve(this.iTarget, 1, 0, null);
 | 
			
		||||
			Toil toil2 = this.MakeSexToil();
 | 
			
		||||
			toil2.handlingFacing = false;
 | 
			
		||||
			yield return toil2;
 | 
			
		||||
			yield break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Token: 0x06000420 RID: 1056 RVA: 0x00024190 File Offset: 0x00022390
 | 
			
		||||
		private Toil MakeSexToil()
 | 
			
		||||
		{
 | 
			
		||||
			Toil toil = new Toil();
 | 
			
		||||
			toil.defaultCompleteMode = ToilCompleteMode.Never;
 | 
			
		||||
			toil.socialMode = RandomSocialMode.Off;
 | 
			
		||||
			toil.handlingFacing = true;
 | 
			
		||||
			toil.tickAction = delegate ()
 | 
			
		||||
			{
 | 
			
		||||
				if (this.pawn.IsHashIntervalTick(this.ticks_between_hearts))
 | 
			
		||||
				{
 | 
			
		||||
					base.ThrowMetaIconF(this.pawn.Position, this.pawn.Map, FleckDefOf.Heart);
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
			toil.AddEndCondition(delegate
 | 
			
		||||
			{
 | 
			
		||||
				if (this.parteners.Count <= 0)
 | 
			
		||||
				{
 | 
			
		||||
					return JobCondition.Succeeded;
 | 
			
		||||
				}
 | 
			
		||||
				return JobCondition.Ongoing;
 | 
			
		||||
			});
 | 
			
		||||
			toil.AddFinishAction(delegate
 | 
			
		||||
			{
 | 
			
		||||
				if (xxx.is_human(this.pawn))
 | 
			
		||||
				{
 | 
			
		||||
					this.pawn.Drawer.renderer.graphics.ResolveApparelGraphics();
 | 
			
		||||
				}
 | 
			
		||||
				GlobalTextureAtlasManager.TryMarkPawnFrameSetDirty(this.pawn);
 | 
			
		||||
				Hediff submitting = this.pawn.health.hediffSet.GetFirstHediffOfDef(xxx.submitting);
 | 
			
		||||
				if (submitting != null)
 | 
			
		||||
				{
 | 
			
		||||
					this.pawn.health.RemoveHediff(submitting);
 | 
			
		||||
					this.pawn.stances.stunner.StunFor(60, this.pawn, true, true);
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
			toil.socialMode = RandomSocialMode.Off;
 | 
			
		||||
			return toil;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -44,9 +44,6 @@ namespace RJW_Genes
 | 
			
		|||
 | 
			
		||||
		public static void DrinkCumflation(Pawn dom, Pawn sub)
 | 
			
		||||
        {
 | 
			
		||||
			Log.Message("Firese");
 | 
			
		||||
			Log.Message(dom.Name.ToString());
 | 
			
		||||
			Log.Message(sub.Name.ToString());
 | 
			
		||||
			if (GeneUtility.HasLifeForce(sub) && dom.health.hediffSet.HasHediff(HediffDef.Named("Cumflation")))
 | 
			
		||||
			{
 | 
			
		||||
				Hediff cumflation = dom.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("Cumflation"));
 | 
			
		||||
| 
						 | 
				
			
			@ -55,6 +52,6 @@ namespace RJW_Genes
 | 
			
		|||
				gene_LifeForce.Resource.Value += 0.05f;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		//Maybe i can store instance and hediff so I dont need to look them up every time
 | 
			
		||||
		//Maybe I can store gene and hediff so I dont need to look them up every time
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,19 +19,24 @@ namespace RJW_Genes
 | 
			
		|||
            base.Tick();
 | 
			
		||||
            if (this.pawn.IsHashIntervalTick(2500))
 | 
			
		||||
            {
 | 
			
		||||
                foreach (Pawn pawn in this.AffectedPawns(this.pawn.Position, this.pawn.Map))
 | 
			
		||||
                { 
 | 
			
		||||
                    this.InduceAphrodisiac(pawn);
 | 
			
		||||
                }
 | 
			
		||||
                //Only spread pheromones if sexdrive above 1
 | 
			
		||||
                float sexfrequency = this.pawn.GetStatValue(StatDef.Named("SexFrequency"));
 | 
			
		||||
                if(sexfrequency > 1f)
 | 
			
		||||
                {
 | 
			
		||||
                    foreach (Pawn pawn in this.AffectedPawns(this.pawn.Position, this.pawn.Map))
 | 
			
		||||
                    {
 | 
			
		||||
                        this.InduceAphrodisiac(pawn, sexfrequency);
 | 
			
		||||
                    }
 | 
			
		||||
                }               
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //Creatus an IEnumerable of all pawns which are closeby and in lineofsight
 | 
			
		||||
        //Creatus an IEnumerable of all pawns which are closeby and in lineofsight, self and other pawns with aphrodisiac pheromones gene are skipped.
 | 
			
		||||
        private IEnumerable<Pawn> AffectedPawns(IntVec3 pos, Map map)
 | 
			
		||||
        {
 | 
			
		||||
            foreach (Pawn pawn in map.mapPawns.AllPawns)
 | 
			
		||||
            {
 | 
			
		||||
                if (pos.DistanceTo(pawn.Position) < 5 && GenSight.LineOfSight(pos, pawn.Position, pawn.Map))
 | 
			
		||||
                if (this.pawn != null && pawn != this.pawn && pos.DistanceTo(pawn.Position) < 5 && GenSight.LineOfSight(pos, pawn.Position, pawn.Map) && !GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_aphrodisiac_pheromones))
 | 
			
		||||
                {
 | 
			
		||||
                    yield return pawn;
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			@ -41,17 +46,35 @@ namespace RJW_Genes
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        //Applies er renews a hediff which increases sexdrive for 6 hours
 | 
			
		||||
        private void InduceAphrodisiac(Pawn pawn)
 | 
			
		||||
        private void InduceAphrodisiac(Pawn pawn, float sexfrequency)
 | 
			
		||||
        {
 | 
			
		||||
            Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.Aphrodisiac_Pheromone);
 | 
			
		||||
            
 | 
			
		||||
            if (hediff != null)
 | 
			
		||||
            {
 | 
			
		||||
                hediff.Severity = 1f;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                pawn.health.AddHediff(HediffDefOf.Aphrodisiac_Pheromone);
 | 
			
		||||
                Hediff aphrodisiac = HediffMaker.MakeHediff(HediffDefOf.Aphrodisiac_Pheromone, pawn);
 | 
			
		||||
                foreach (StatModifier stat in aphrodisiac.CurStage.statFactors)
 | 
			
		||||
                {
 | 
			
		||||
                    //Log.Message(pawn.Name.ToString());
 | 
			
		||||
                    //Log.Message(stat.stat.defName);
 | 
			
		||||
                    //Log.Message(stat.value.ToString());
 | 
			
		||||
                    if (stat.stat.defName == "SexFrequency")
 | 
			
		||||
                    {
 | 
			
		||||
                        stat.value = ModifySexfrequency(pawn, sexfrequency);
 | 
			
		||||
                        pawn.health.AddHediff(aphrodisiac);
 | 
			
		||||
                    }                    
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //Function to modify aphrodisiac strength, currently has no effect, but it's an easy hook for other modders.
 | 
			
		||||
        public float ModifySexfrequency(Pawn pawn, float sexfrequency)
 | 
			
		||||
        {
 | 
			
		||||
            return sexfrequency;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,5 +14,6 @@ namespace RJW_Genes
 | 
			
		|||
        public static readonly HediffDef Aphrodisiac_Pheromone;
 | 
			
		||||
        public static readonly HediffDef Fertilin_Lost;
 | 
			
		||||
        public static readonly HediffDef Succubus_Drained;
 | 
			
		||||
        public static readonly HediffDef rjw_genes_sexually_exhausted;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,17 +19,14 @@ namespace RJW_Genes.Interactions
 | 
			
		|||
			Pawn pawn = context.Internals.Dominant.Pawn;
 | 
			
		||||
			if (GeneUtility.HasCriticalLifeForce(pawn))
 | 
			
		||||
			{
 | 
			
		||||
				Log.Message("Critical");
 | 
			
		||||
				yield return new Weighted<LewdablePartKind>(50f, LewdablePartKind.Mouth);
 | 
			
		||||
			}
 | 
			
		||||
			else if (GeneUtility.HasLowLifeForce(pawn))
 | 
			
		||||
			{
 | 
			
		||||
				Log.Message("Low");
 | 
			
		||||
				yield return new Weighted<LewdablePartKind>(10f, LewdablePartKind.Mouth);
 | 
			
		||||
			}
 | 
			
		||||
			else if (GeneUtility.HasLifeForce(pawn))
 | 
			
		||||
			{
 | 
			
		||||
				Log.Message("normal");
 | 
			
		||||
				yield return new Weighted<LewdablePartKind>(2f, LewdablePartKind.Mouth);
 | 
			
		||||
			}
 | 
			
		||||
			yield break;
 | 
			
		||||
| 
						 | 
				
			
			@ -40,17 +37,14 @@ namespace RJW_Genes.Interactions
 | 
			
		|||
			Pawn pawn = context.Internals.Submissive.Pawn;
 | 
			
		||||
			if (GeneUtility.HasCriticalLifeForce(pawn))
 | 
			
		||||
			{
 | 
			
		||||
				Log.Message("Critical");
 | 
			
		||||
				yield return new Weighted<LewdablePartKind>(50f, LewdablePartKind.Mouth);
 | 
			
		||||
			}
 | 
			
		||||
			else if (GeneUtility.HasLowLifeForce(pawn))
 | 
			
		||||
			{
 | 
			
		||||
				Log.Message("Low");
 | 
			
		||||
				yield return new Weighted<LewdablePartKind>(10f, LewdablePartKind.Mouth);
 | 
			
		||||
			}
 | 
			
		||||
			else if (GeneUtility.HasLifeForce(pawn))
 | 
			
		||||
			{
 | 
			
		||||
				Log.Message("normal");
 | 
			
		||||
				yield return new Weighted<LewdablePartKind>(2f, LewdablePartKind.Mouth);
 | 
			
		||||
			}
 | 
			
		||||
			yield break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,5 +11,8 @@ namespace RJW_Genes
 | 
			
		|||
    public static class JobDefOf
 | 
			
		||||
    {
 | 
			
		||||
        public static readonly JobDef rjw_genes_lifeforce_randomrape;
 | 
			
		||||
        public static readonly JobDef rjw_genes_lifeforce_seduced;
 | 
			
		||||
        public static readonly JobDef sex_on_spot;
 | 
			
		||||
        public static readonly JobDef sex_on_spot_reciever;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,11 +115,17 @@
 | 
			
		|||
    <Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
 | 
			
		||||
    <Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\AbilityUtility.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\CompAbilityEffect_Seduce.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\CompAbilityEffect_LifeForceCost.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\CompAbilityEffect_CockEater.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\CompProperties_Seduce.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\CompProperties_AbilityCockEater.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\HediffCompProperties_RemoveSubmit.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\HediffComp_RemoveSubmit.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\IngestionOutcomeDoer_LifeForceOffset.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\JobDriver_Drink_Cumflation.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\JobDriver_SexOnSpotReceiver.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\JobDriver_SexOnSpot.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\JobDriver_Seduced.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\Patch_SexTicks_ChangePsyfocus.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\ThinkNode_ConditionalLowLifeForce.cs" />
 | 
			
		||||
    <Compile Include="Genes\Life_Force\ThinkNode_ConditionalCritcalLifeForce.cs" />
 | 
			
		||||
| 
						 | 
				
			
			@ -157,5 +163,6 @@
 | 
			
		|||
  <ItemGroup>
 | 
			
		||||
    <Content Include="GeneDefs_GenitaliaTypeEndogenes.xml" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup />
 | 
			
		||||
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 | 
			
		||||
</Project>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue