Refactor cum ingestion

This commit is contained in:
amevarashi 2022-04-27 10:36:34 +05:00
parent 78480e6eda
commit 6652d7e1a6
3 changed files with 15 additions and 17 deletions

View File

@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Verse;
using RJWSexperience.Logs;
namespace RJWSexperience
{
@ -130,24 +131,18 @@ namespace RJWSexperience
}
}
public static void AteCum(this Pawn pawn, float amount, bool doDrugEffect = false)
public static void AteCum(this Pawn pawn, float amount)
{
pawn.records.AddTo(VariousDefOf.NumofEatenCum, 1);
pawn.records.AddTo(VariousDefOf.AmountofEatenCum, amount);
if (doDrugEffect) pawn.CumDrugEffect();
}
const float allOf = 1000f;
public static void CumDrugEffect(this Pawn pawn)
{
Need need = pawn.needs?.TryGetNeed(VariousDefOf.Chemical_Cum);
if (need != null) need.CurLevel += VariousDefOf.CumneedLevelOffset;
Hediff addictive = HediffMaker.MakeHediff(VariousDefOf.CumTolerance, pawn);
addictive.Severity = 0.032f;
pawn.health.AddHediff(addictive);
Hediff addiction = pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.CumAddiction);
if (addiction != null) addiction.Severity += VariousDefOf.CumexistingAddictionSeverityOffset;
var log = LogManager.GetLogger<DebugLogProvider>("PawnExtensions");
log.Message($"AteCum({pawn.NameShortColored}, {amount})");
pawn.needs?.mood?.thoughts?.memories?.TryGainMemoryFast(VariousDefOf.AteCum);
Thing cum = ThingMaker.MakeThing(VariousDefOf.GatheredCum);
cum.stackCount = (int)Math.Ceiling(amount);
log.Message($"Created a stack of {cum.stackCount} cum");
cum.Ingested(pawn, allOf);
log.Message($"{pawn.NameShortColored} ingested cum");
}
public static void AddVirginTrait(this Pawn pawn)

View File

@ -10,7 +10,10 @@ namespace RJWSexperience
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
pawn.AteCum(ingested.stackCount * unitAmount);
int amount = ingested.stackCount * (int)unitAmount;
Logs.LogManager.GetLogger<CumOutcomeDoers, Logs.DebugLogProvider>().Message($"Record {pawn.NameShortColored} eating {amount} ml of cum");
pawn.records.Increment(VariousDefOf.NumofEatenCum);
pawn.records.AddTo(VariousDefOf.AmountofEatenCum, amount);
}
}
}

View File

@ -124,7 +124,7 @@ namespace RJWSexperience
if (!PawnsPenisIsInPartnersMouth(props))
return;
props.partner.AteCum(props.pawn.GetCumVolume(), true);
props.partner.AteCum(props.pawn.GetCumVolume());
}
private static bool PawnsPenisIsInPartnersMouth(SexProps props)