diff --git a/Common/Assemblies/Rjw-Genes.dll b/Common/Assemblies/Rjw-Genes.dll index 1294fcb..6c73855 100644 Binary files a/Common/Assemblies/Rjw-Genes.dll and b/Common/Assemblies/Rjw-Genes.dll differ diff --git a/Common/Defs/AbilityDefs/Ability_Flight.xml b/Common/Defs/AbilityDefs/Ability_Flight.xml new file mode 100644 index 0000000..7829d10 --- /dev/null +++ b/Common/Defs/AbilityDefs/Ability_Flight.xml @@ -0,0 +1,28 @@ + + + + rjw_genes_flight + + Fly to a distant location using wings. + Genes/Icons/Succubus_Wings + 1250 + false + + Verb_CastAbilityJump + + false + false + 0.5 + 19.9 + true + Longjump_Jump + Longjump_Land + + true + false + false + + + CastJump + + \ No newline at end of file diff --git a/Common/Defs/AbilityDefs/Ability_ParalysingKiss.xml b/Common/Defs/AbilityDefs/Ability_ParalysingKiss.xml new file mode 100644 index 0000000..eb2a13d --- /dev/null +++ b/Common/Defs/AbilityDefs/Ability_ParalysingKiss.xml @@ -0,0 +1,44 @@ + + + + rjw_genes_paralysingkiss + + Paralyse someone briefly with a kiss. + Things/Mote/Heart + true + true + false + + 5 + + Mote_CoagulateStencil + Coagulate + Coagulate_Cast + 402 + + Verb_CastAbilityTouch + false + -1 + 1 + + true + false + false + false + true + + + +
  • + CompAbilityEffect_Stun + -15 +
  • +
  • + Heart . +
  • +
  • + 0.05 +
  • +
    +
    +
    \ No newline at end of file diff --git a/Common/Defs/AbilityDefs/Ability_Seduce.xml b/Common/Defs/AbilityDefs/Ability_Seduce.xml new file mode 100644 index 0000000..fb87fea --- /dev/null +++ b/Common/Defs/AbilityDefs/Ability_Seduce.xml @@ -0,0 +1,43 @@ + + + + rjw_genes_seduce + + Seduce the target to approach the caster. + Things/Mote/Heart + True + true + true + false + + 10 + + Mote_CoagulateStencil + Coagulate + Coagulate_Cast + + Verb_CastAbility + 10 + 1 + + false + false + false + false + true + + + +
  • + RJW_Genes.CompAbilityEffect_Seduce + Caster +
  • +
  • + Heart +
  • +
  • + 0.1 +
  • +
    +
    +
    \ No newline at end of file diff --git a/Common/Defs/Genes/GeneDefs_Cosmetic.xml b/Common/Defs/Genes/GeneDefs_Cosmetic.xml index 01e1f5d..a4460d2 100644 --- a/Common/Defs/Genes/GeneDefs_Cosmetic.xml +++ b/Common/Defs/Genes/GeneDefs_Cosmetic.xml @@ -19,6 +19,12 @@ Genes/Icons/Succubus_Wings (0.75, 0.75, 0.75) 1000 + +
  • rjw_genes_flight
  • +
    + + rjw_genes_flight + 1 Things/Pawn/Humanlike/BodyAttachments/rjw_genes_Succubus_Wings/Succubus_Wings diff --git a/Common/Defs/Genes/GeneDefs_LifeForce.xml b/Common/Defs/Genes/GeneDefs_LifeForce.xml index 21d63f6..76a1463 100644 --- a/Common/Defs/Genes/GeneDefs_LifeForce.xml +++ b/Common/Defs/Genes/GeneDefs_LifeForce.xml @@ -44,20 +44,20 @@ 10 rjw_genes_fertilin -
  • rjw_genes_pussyheal
  • +
  • rjw_genes_pussyheal
  • - rjw_genes_pussyheal + rjw_genes_pussyheal 1 -1 18 - -
  • life
  • -
  • pussy
  • -
  • heal
  • -
    + +
  • life
  • +
  • pussy
  • +
  • heal
  • +
    @@ -71,20 +71,72 @@ 11 rjw_genes_fertilin -
  • rjw_genes_cockeater
  • +
  • rjw_genes_cockeater
  • - rjw_genes_cockeater + rjw_genes_cockeater 1 -1 18 - -
  • life
  • -
  • cock
  • -
  • eat
  • -
    + +
  • life
  • +
  • cock
  • +
  • eat
  • +
    +
    + + + + rjw_genes_paralysingkiss + + paralysing kiss + Carriers of this gene are able to briefly stun an enemy with a kiss. + Things/Mote/Heart + rjw_genes_lifeforce + 11 + rjw_genes_fertilin + +
  • rjw_genes_paralysingkiss
  • +
    + + rjw_genes_paralysingkiss + + 1 + -1 + 18 + + +
  • stun
  • +
  • kiss
  • +
    +
    +
    + + + rjw_genes_seduce + + seduction + Carriers of this gene are able to seduce a pawn into having sex with them. + Things/Mote/Heart + rjw_genes_lifeforce + 11 + rjw_genes_fertilin + +
  • rjw_genes_seduce
  • +
    + + rjw_genes_seduce + + 1 + -1 + 18 + + +
  • stun
  • +
  • kiss
  • +
    diff --git a/Common/Defs/Genes/GeneDefs_SexSpecial.xml b/Common/Defs/Genes/GeneDefs_SexSpecial.xml index 3761995..6f90175 100644 --- a/Common/Defs/Genes/GeneDefs_SexSpecial.xml +++ b/Common/Defs/Genes/GeneDefs_SexSpecial.xml @@ -15,7 +15,7 @@ rjw_genes_special RJW_Genes.Gene_Aphrodisiac_Pheromones - Pheremones of this pawn induce an increased sexdrive to others nearby. + Carriers of this gene create an aphrodisiac pheremones which induce an increased sexdrive to others nearby, increasing in strength as the sexdrive of the carrier increases.\nCarriers are unaffected by others with this gene. UI/Memes/FleshPurity 2 1 diff --git a/Common/Defs/HediffDefs/Hediffs_Genes.xml b/Common/Defs/HediffDefs/Hediffs_Genes.xml index 41ed3e2..d03f411 100644 --- a/Common/Defs/HediffDefs/Hediffs_Genes.xml +++ b/Common/Defs/HediffDefs/Hediffs_Genes.xml @@ -1,6 +1,4 @@  - - Aphrodisiac_Pheromone @@ -16,7 +14,7 @@
  • - false + true 2 @@ -88,4 +86,24 @@
  • + + + rjw_genes_sexually_exhausted + HediffWithComps + + Has been exhaused due to sexual activities and needs a little break before being able to stand up again.\n\nWill remove submitting hediff. + (1,1,1) + +
  • + true +
  • +
    + +
  • + 300~900 + true +
  • +
  • + + \ No newline at end of file diff --git a/Common/Defs/JobDefs/Jobs_LifeForce.xml b/Common/Defs/JobDefs/Jobs_LifeForce.xml index babb547..6992ddd 100644 --- a/Common/Defs/JobDefs/Jobs_LifeForce.xml +++ b/Common/Defs/JobDefs/Jobs_LifeForce.xml @@ -14,4 +14,12 @@ Healing someone with sex. false + + + rjw_genes_lifeforce_seduced + RJW_Genes.JobDriver_Seduced + Seduced. + false + false + \ No newline at end of file diff --git a/Common/Defs/JobDefs/Jobs_SexOnSpot.xml b/Common/Defs/JobDefs/Jobs_SexOnSpot.xml new file mode 100644 index 0000000..e904f3e --- /dev/null +++ b/Common/Defs/JobDefs/Jobs_SexOnSpot.xml @@ -0,0 +1,17 @@ + + + + + sex_on_spot + RJW_Genes.JobDriver_SexOnSpot + Making love on the spot. + false + + + + sex_on_spot_reciever + RJW_Genes.JobDriver_SexOnSpotReciever + lovin'. + false + + \ No newline at end of file diff --git a/Source/Genes/Life_Force/CompAbilityEffect_Seduce.cs b/Source/Genes/Life_Force/CompAbilityEffect_Seduce.cs new file mode 100644 index 0000000..bf0643d --- /dev/null +++ b/Source/Genes/Life_Force/CompAbilityEffect_Seduce.cs @@ -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; + } + } +} diff --git a/Source/Genes/Life_Force/CompProperties_Seduce.cs b/Source/Genes/Life_Force/CompProperties_Seduce.cs new file mode 100644 index 0000000..21e0cde --- /dev/null +++ b/Source/Genes/Life_Force/CompProperties_Seduce.cs @@ -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; + } +} + diff --git a/Source/Genes/Life_Force/Gene_LifeForce.cs b/Source/Genes/Life_Force/Gene_LifeForce.cs index de19281..dcb61d1 100644 --- a/Source/Genes/Life_Force/Gene_LifeForce.cs +++ b/Source/Genes/Life_Force/Gene_LifeForce.cs @@ -29,13 +29,10 @@ namespace RJW_Genes { yield return gizmo; } - IEnumerator enumerator = null; foreach (Gizmo gizmo2 in GeneResourceDrainUtility.GetResourceDrainGizmos(this)) { yield return gizmo2; } - enumerator = null; - yield break; yield break; } diff --git a/Source/Genes/Life_Force/HediffCompProperties_RemoveSubmit.cs b/Source/Genes/Life_Force/HediffCompProperties_RemoveSubmit.cs new file mode 100644 index 0000000..fd68856 --- /dev/null +++ b/Source/Genes/Life_Force/HediffCompProperties_RemoveSubmit.cs @@ -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); + } + } +} diff --git a/Source/Genes/Life_Force/HediffComp_RemoveSubmit.cs b/Source/Genes/Life_Force/HediffComp_RemoveSubmit.cs new file mode 100644 index 0000000..01891cc --- /dev/null +++ b/Source/Genes/Life_Force/HediffComp_RemoveSubmit.cs @@ -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 + } + } + } + + } + } +} diff --git a/Source/Genes/Life_Force/JobDriver_Drink_Cumflation.cs b/Source/Genes/Life_Force/JobDriver_Drink_Cumflation.cs deleted file mode 100644 index b1ab9a1..0000000 --- a/Source/Genes/Life_Force/JobDriver_Drink_Cumflation.cs +++ /dev/null @@ -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 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() : 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.GetNamed("Rape_Reverse_Cunnilingus") : DefDatabase.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; - } -} diff --git a/Source/Genes/Life_Force/JobDriver_Seduced.cs b/Source/Genes/Life_Force/JobDriver_Seduced.cs new file mode 100644 index 0000000..8960887 --- /dev/null +++ b/Source/Genes/Life_Force/JobDriver_Seduced.cs @@ -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 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); + } + } +} diff --git a/Source/Genes/Life_Force/JobDriver_SexOnSpot.cs b/Source/Genes/Life_Force/JobDriver_SexOnSpot.cs new file mode 100644 index 0000000..05c9d5b --- /dev/null +++ b/Source/Genes/Life_Force/JobDriver_SexOnSpot.cs @@ -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 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; + } + } +} diff --git a/Source/Genes/Life_Force/JobDriver_SexOnSpotReceiver.cs b/Source/Genes/Life_Force/JobDriver_SexOnSpotReceiver.cs new file mode 100644 index 0000000..6399e43 --- /dev/null +++ b/Source/Genes/Life_Force/JobDriver_SexOnSpotReceiver.cs @@ -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 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; + } + } +} diff --git a/Source/Genes/Life_Force/Patch_SexTicks_ChangePsyfocus.cs b/Source/Genes/Life_Force/Patch_SexTicks_ChangePsyfocus.cs index 1a608cc..dd3444b 100644 --- a/Source/Genes/Life_Force/Patch_SexTicks_ChangePsyfocus.cs +++ b/Source/Genes/Life_Force/Patch_SexTicks_ChangePsyfocus.cs @@ -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 } } diff --git a/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs b/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs index 02e51de..d9f4341 100644 --- a/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs +++ b/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs @@ -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 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; + } } } diff --git a/Source/HediffDefOf.cs b/Source/HediffDefOf.cs index b0425ec..66796f8 100644 --- a/Source/HediffDefOf.cs +++ b/Source/HediffDefOf.cs @@ -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; } } diff --git a/Source/Interactions/GenesPartKindUsageRule.cs b/Source/Interactions/GenesPartKindUsageRule.cs index aae65b0..6c0f53c 100644 --- a/Source/Interactions/GenesPartKindUsageRule.cs +++ b/Source/Interactions/GenesPartKindUsageRule.cs @@ -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(50f, LewdablePartKind.Mouth); } else if (GeneUtility.HasLowLifeForce(pawn)) { - Log.Message("Low"); yield return new Weighted(10f, LewdablePartKind.Mouth); } else if (GeneUtility.HasLifeForce(pawn)) { - Log.Message("normal"); yield return new Weighted(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(50f, LewdablePartKind.Mouth); } else if (GeneUtility.HasLowLifeForce(pawn)) { - Log.Message("Low"); yield return new Weighted(10f, LewdablePartKind.Mouth); } else if (GeneUtility.HasLifeForce(pawn)) { - Log.Message("normal"); yield return new Weighted(2f, LewdablePartKind.Mouth); } yield break; diff --git a/Source/JobDefOf.cs b/Source/JobDefOf.cs index fc64b2d..8bae1fa 100644 --- a/Source/JobDefOf.cs +++ b/Source/JobDefOf.cs @@ -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; } } diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index ba2b195..487ae64 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -115,11 +115,17 @@ + + + + - + + + @@ -157,5 +163,6 @@ + \ No newline at end of file