mirror of
https://gitgud.io/c0ffeeeeeeee/rjw-events.git
synced 2024-08-14 23:57:42 +00:00
first commit
This commit is contained in:
parent
1c82248286
commit
6d1a218b2e
23 changed files with 836 additions and 0 deletions
29
Source/JobDrivers/JobDriver_GetNaked.cs
Normal file
29
Source/JobDrivers/JobDriver_GetNaked.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using rjw;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse.AI;
|
||||
|
||||
namespace RJW_Events
|
||||
{
|
||||
class JobDriver_GetNaked : JobDriver
|
||||
{
|
||||
public override bool TryMakePreToilReservations(bool errorOnFailed)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override IEnumerable<Toil> MakeNewToils()
|
||||
{
|
||||
Toil t = new Toil();
|
||||
t.AddFinishAction(() => {
|
||||
|
||||
SexUtility.DrawNude(pawn);
|
||||
|
||||
});
|
||||
yield return t;
|
||||
}
|
||||
}
|
||||
}
|
111
Source/JobDrivers/JobDriver_OrgySex.cs
Normal file
111
Source/JobDrivers/JobDriver_OrgySex.cs
Normal file
|
@ -0,0 +1,111 @@
|
|||
using RimWorld;
|
||||
using rjw;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using Verse.AI.Group;
|
||||
|
||||
namespace RJW_Events
|
||||
{
|
||||
class JobDriver_OrgySex : JobDriver_SexQuick
|
||||
{
|
||||
|
||||
public override bool TryMakePreToilReservations(bool errorOnFailed)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override IEnumerable<Toil> MakeNewToils()
|
||||
{
|
||||
base.setup_ticks();
|
||||
JobDef PartnerJob = DefDatabase<JobDef>.GetNamed("GettinOrgySex", true);
|
||||
this.FailOnDespawnedNullOrForbidden(this.iTarget);
|
||||
this.FailOn(() => !this.Partner.health.capacities.CanBeAwake);
|
||||
this.FailOn(() => this.pawn.IsFighting());
|
||||
this.FailOn(() => this.Partner.IsFighting());
|
||||
this.FailOn(() => this.pawn.Drafted);
|
||||
yield return Toils_Goto.GotoThing(this.iTarget, PathEndMode.OnCell);
|
||||
yield return new Toil
|
||||
{
|
||||
defaultCompleteMode = ToilCompleteMode.Delay,
|
||||
initAction = delegate ()
|
||||
{
|
||||
this.ticksLeftThisToil = 5000;
|
||||
},
|
||||
tickAction = delegate ()
|
||||
{
|
||||
this.pawn.GainComfortFromCellIfPossible(false);
|
||||
if (this.pawn.Position.DistanceTo(this.Partner.Position) <= 1f)
|
||||
{
|
||||
this.ReadyForNextToil();
|
||||
}
|
||||
}
|
||||
};
|
||||
yield return new Toil
|
||||
{
|
||||
defaultCompleteMode = ToilCompleteMode.Instant,
|
||||
socialMode = RandomSocialMode.Off,
|
||||
initAction = delegate ()
|
||||
{
|
||||
|
||||
if(Partner.CurJob.def != PartnerJob)
|
||||
{
|
||||
Job newJob = JobMaker.MakeJob(PartnerJob, this.pawn, this.Partner);
|
||||
this.Partner.jobs.StartJob(newJob, JobCondition.InterruptForced, null, false, true, null, null, false, false);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
Toil toil = new Toil();
|
||||
toil.defaultCompleteMode = ToilCompleteMode.Never;
|
||||
toil.socialMode = RandomSocialMode.Off;
|
||||
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.usedCondom = (CondomUtility.TryUseCondom(this.pawn) || CondomUtility.TryUseCondom(this.Partner));
|
||||
this.Start();
|
||||
};
|
||||
toil.AddPreTickAction(delegate
|
||||
{
|
||||
this.ticks_left--;
|
||||
if (this.pawn.IsHashIntervalTick(this.ticks_between_hearts))
|
||||
{
|
||||
this.ThrowMetaIcon(this.pawn.Position, this.pawn.Map, ThingDefOf.Mote_Heart);
|
||||
}
|
||||
this.SexTick(this.pawn, this.Partner, true, true);
|
||||
SexUtility.reduce_rest(this.Partner, 1f);
|
||||
SexUtility.reduce_rest(this.pawn, 1f);
|
||||
if (this.ticks_left <= 0)
|
||||
{
|
||||
this.ReadyForNextToil();
|
||||
}
|
||||
});
|
||||
toil.AddFinishAction(delegate
|
||||
{
|
||||
this.End();
|
||||
if(LordUtility.GetLord(pawn)?.CurLordToil != null && !(LordUtility.GetLord(pawn).CurLordToil is LordToil_End))
|
||||
SexUtility.DrawNude(pawn);
|
||||
});
|
||||
yield return toil;
|
||||
yield return new Toil
|
||||
{
|
||||
initAction = delegate ()
|
||||
{
|
||||
SexUtility.ProcessSex(this.pawn, this.Partner, this.usedCondom, this.isRape, false, false, this.sexType);
|
||||
},
|
||||
defaultCompleteMode = ToilCompleteMode.Instant
|
||||
};
|
||||
yield break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
79
Source/JobDrivers/JobDriver_OrgySexReceiver.cs
Normal file
79
Source/JobDrivers/JobDriver_OrgySexReceiver.cs
Normal file
|
@ -0,0 +1,79 @@
|
|||
using RimWorld;
|
||||
using rjw;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
|
||||
namespace RJW_Events
|
||||
{
|
||||
class JobDriver_OrgySexReceiver : JobDriver_SexBaseReciever
|
||||
{
|
||||
|
||||
protected override IEnumerable<Toil> MakeNewToils()
|
||||
{
|
||||
base.setup_ticks();
|
||||
this.parteners.Add(base.Partner);
|
||||
float num = xxx.get_sex_ability(base.Partner);
|
||||
if (num < 0.8f)
|
||||
{
|
||||
this.ticks_between_thrusts += 120;
|
||||
}
|
||||
else if (num > 2f)
|
||||
{
|
||||
this.ticks_between_thrusts -= 30;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
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.ThrowMetaIcon(this.pawn.Position, this.pawn.Map, ThingDefOf.Mote_Heart);
|
||||
}
|
||||
};
|
||||
toil.AddEndCondition(delegate
|
||||
{
|
||||
if (this.parteners.Count <= 0)
|
||||
{
|
||||
return JobCondition.Succeeded;
|
||||
}
|
||||
return JobCondition.Ongoing;
|
||||
});
|
||||
toil.socialMode = RandomSocialMode.Off;
|
||||
return toil;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue