better/clear job driver logging

moved price calculation to start of job so its not affected by aftersex filth
made minimal payout 1 silver, no free whoring due to shitty room
This commit is contained in:
Ed86 2022-08-09 18:18:37 +03:00
parent d56c5016f8
commit e0939be2b6
3 changed files with 11 additions and 9 deletions

View file

@ -26,15 +26,17 @@ namespace rjwwhoring
this.FailOnDespawnedOrNull(iTarget); this.FailOnDespawnedOrNull(iTarget);
this.FailOnDespawnedNullOrForbidden(iBed); this.FailOnDespawnedNullOrForbidden(iBed);
if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":MakeNewToils() fail conditions check " + !WhoreBed_Utility.CanUseForWhoring(pawn, Bed) + " " + !pawn.CanReserve(Partner)); if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":fail conditions check " + !WhoreBed_Utility.CanUseForWhoring(pawn, Bed) + " " + !pawn.CanReserve(Partner));
this.FailOn(() => !WhoreBed_Utility.CanUseForWhoring(pawn, Bed) || !pawn.CanReserve(Partner)); this.FailOn(() => !WhoreBed_Utility.CanUseForWhoring(pawn, Bed) || !pawn.CanReserve(Partner));
this.FailOn(() => pawn.Drafted); this.FailOn(() => pawn.Drafted);
this.FailOn(() => Partner.IsFighting()); this.FailOn(() => Partner.IsFighting());
yield return Toils_Reserve.Reserve(iTarget, 1, 0); yield return Toils_Reserve.Reserve(iTarget, 1, 0);
int basePrice = WhoringHelper.PriceOfWhore(pawn);
float bedMult = WhoreBed_Utility.CalculatePriceFactor(Bed);
//yield return Toils_Reserve.Reserve(BedInd, Bed.SleepingSlotsCount, 0); //yield return Toils_Reserve.Reserve(BedInd, Bed.SleepingSlotsCount, 0);
if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":MakeNewToils() - generate toils"); if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":generate job toils");
Toil gotoBed = new Toil(); Toil gotoBed = new Toil();
gotoBed.defaultCompleteMode = ToilCompleteMode.PatherArrival; gotoBed.defaultCompleteMode = ToilCompleteMode.PatherArrival;
gotoBed.FailOnBedNoLongerUsable(iBed, Bed); gotoBed.FailOnBedNoLongerUsable(iBed, Bed);
@ -42,7 +44,7 @@ namespace rjwwhoring
gotoBed.FailOn(() => !Partner.CanReach(Bed, PathEndMode.Touch, Danger.Deadly)); gotoBed.FailOn(() => !Partner.CanReach(Bed, PathEndMode.Touch, Danger.Deadly));
gotoBed.initAction = delegate gotoBed.initAction = delegate
{ {
if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":MakeNewToils() - gotoWhoreBed"); if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":gotoWhoreBed");
pawn.pather.StartPath(SleepSpot, PathEndMode.OnCell); pawn.pather.StartPath(SleepSpot, PathEndMode.OnCell);
Partner.jobs.StopAll(); Partner.jobs.StopAll();
Job job = JobMaker.MakeJob(JobDefOf.GotoMindControlled, SleepSpot); Job job = JobMaker.MakeJob(JobDefOf.GotoMindControlled, SleepSpot);
@ -73,7 +75,7 @@ namespace rjwwhoring
StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.socialMode = RandomSocialMode.Off;
StartPartnerJob.initAction = delegate StartPartnerJob.initAction = delegate
{ {
if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":MakeNewToils() - StartPartnerJob"); if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":StartPartnerJob");
var gettin_loved = JobMaker.MakeJob(PartnerJob, pawn, Bed); var gettin_loved = JobMaker.MakeJob(PartnerJob, pawn, Bed);
Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced); Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced);
}; };
@ -87,7 +89,7 @@ namespace rjwwhoring
SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.FailOn(() => Partner.CurJob.def != PartnerJob);
SexToil.initAction = delegate SexToil.initAction = delegate
{ {
if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":MakeNewToils() - loveToil"); if (WhoringBase.DebugWhoring) ModLog.Message("" + this.GetType().ToString() + ":SexToil start");
// refresh bed reservation // refresh bed reservation
Bed.ReserveForWhoring(pawn, ticks_left+100); Bed.ReserveForWhoring(pawn, ticks_left+100);
@ -141,16 +143,16 @@ namespace rjwwhoring
if (!(Partner.IsColonist && (pawn.IsPrisonerOfColony || pawn.IsColonist))) if (!(Partner.IsColonist && (pawn.IsPrisonerOfColony || pawn.IsColonist)))
{ {
int basePrice = WhoringHelper.PriceOfWhore(pawn);
float bedMult = WhoreBed_Utility.CalculatePriceFactor(Bed);
int netPrice = (int) (basePrice * bedMult); int netPrice = (int) (basePrice * bedMult);
if (netPrice == 0)
netPrice += 1;
int bedTip = netPrice - basePrice; int bedTip = netPrice - basePrice;
int defect = WhoringHelper.PayPriceToWhore(Partner, netPrice, pawn); int defect = WhoringHelper.PayPriceToWhore(Partner, netPrice, pawn);
if (WhoringBase.DebugWhoring) if (WhoringBase.DebugWhoring)
{ {
ModLog.Message($"{GetType()}:MakeNewToild() - {Partner} tried to pay {basePrice} + {bedTip} silver to {pawn}"); ModLog.Message($"{GetType()}:afterSex toil - {Partner} tried to pay {basePrice}(whore price) + {bedTip}(room modifier) silver to {pawn}");
if (defect <= 0) if (defect <= 0)
ModLog.Message(" Paid full price"); ModLog.Message(" Paid full price");

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest> <Manifest>
<identifier>RimJobWorld Whoring</identifier> <identifier>RimJobWorld Whoring</identifier>
<version>1.0.0</version> <version>1.0.1</version>
<dependencies> <dependencies>
<li>RimJobWorld</li> <li>RimJobWorld</li>
</dependencies> </dependencies>