// Token: 0x06000022 RID: 34 RVA: 0x00003514 File Offset: 0x00001714 internal static int AugmentOffset(Pawn patient) { var spread = 10; var offset = CommonAilments.GetImmunityOS(patient); if (patient.story.traits.HasTrait(DefDatabase <TraitDef> .GetNamed("Transhumanist", false))) { offset -= 5; } if (patient.story.traits.HasTrait(DefDatabase <TraitDef> .GetNamed("BodyPurist", false))) { offset += 5; } if (!patient.story.traits.HasTrait(DefDatabase <TraitDef> .GetNamed("NaturalMood", false))) { return(Math.Max(0 - spread, Math.Min(spread, offset))); } var traits = patient.story.traits; var NMTrait = traits?.GetTrait(DefDatabase <TraitDef> .GetNamed("NaturalMood", false)); if (NMTrait != null) { offset -= NMTrait.Degree * 2; } return(Math.Max(0 - spread, Math.Min(spread, offset))); }
// Token: 0x06000038 RID: 56 RVA: 0x00003BC0 File Offset: 0x00001DC0 public override void CompPostTick(ref float severityAdjustment) { if (!Controller.Settings.DoSymptoms || !CommonAilments.PawnCanAcceptCA(Pawn) || !Controller.Settings.DoAilments || GenDate.DaysPassed < Controller.Settings.CAStartDays || !Pawn.IsHashIntervalTick(2501)) { return; } var chance = (int)(CAProps.symptomChance + Controller.Settings.CAChance); CommonAilments.CurSituation(Pawn, out var offset, out _, out _, out _, out _, out _); offset += Math.Max(-20, Math.Min(10, CommonAilments.GetImmunityOS(Pawn))); if (CommonAilments.CanAddCA(chance, offset)) { CommonAilmentsUtility.ApplySymptom(Pawn); } }
public static void PostFix(ref JobDriver_Lovin __instance, ref TargetIndex ___PartnerInd, Pawn pawn) { if (!Controller.Settings.DoAilments || !Controller.Settings.DoSTI || GenDate.DaysPassed < Controller.Settings.CAStartDays) { return; } HediffDef hediffdef = null; var severity = 0f; CommonAilments.CurSituation(pawn, out var offset, out _, out _, out _, out _, out _); offset += CommonAilments.GetImmunityOS(pawn); var CASTIBaseChance = Controller.Settings.CASTIChance; if (offset > 25) { offset = 25; } if (offset < -25) { offset = -25; } Hediff std = null; var sexwith = (Pawn)(Thing)__instance.job.GetTarget(___PartnerInd); if (sexwith == null) { return; } if (!CommonAilments.GetEitherProtected(sexwith, pawn)) { var health = sexwith.health; var hediffSet = health?.hediffSet; var swset = hediffSet; var infected = false; if (swset != null) { offset += Controller.Settings.CASTIOffset; std = swset.GetFirstHediffOfDef(ComAilDefOf.HediffDefOf.CA_Minor_STD); if (std != null) { infected = true; } } if (CommonAilments.CanAddCASTI(CASTIBaseChance, offset, infected)) { if (std != null) { hediffdef = std.def; severity = std.Severity + GetARnd(-0.5f, 0.5f); } else { hediffdef = ComAilDefOf.HediffDefOf.CA_Minor_STD; severity = GetARnd(1f, 5f); } } } if (hediffdef == null || !(severity > 0f)) { return; } CommonAilments.TryApplyAilment(hediffdef, severity, pawn, null, out _); if (std != null || !(GetARnd(1f, 100f) < 50f)) { return; } CommonAilments.TryApplyAilment(hediffdef, severity, sexwith, null, out _); }