Change VariousDefOf to RsDefOf

Fix some IDE messages
This commit is contained in:
amevarashi 2023-04-17 16:34:35 +05:00
parent 8a48d2e463
commit 67c2328ad6
23 changed files with 196 additions and 162 deletions

View File

@ -42,8 +42,8 @@ namespace RJWSexperience // Used in Menstruation with this namespace
if (SexperienceMod.Settings.DevMode)
{
stringBuilder.AppendLine();
stringBuilder.AppendLine($"[Debug] stored: {StoredStackCount}");
stringBuilder.Append($"[Debug] storedDecimalRemainder: {storedDecimalRemainder}");
stringBuilder.Append("[Debug] stored: ").Append(StoredStackCount).AppendLine();
stringBuilder.Append("[Debug] storedDecimalRemainder: ").Append(storedDecimalRemainder);
}
return stringBuilder.ToString();
@ -51,7 +51,7 @@ namespace RJWSexperience // Used in Menstruation with this namespace
public void AddCum(float amount)
{
AddCum(amount, VariousDefOf.GatheredCum);
AddCum(amount, RsDefOf.Thing.GatheredCum);
}
public void AddCum(float amount, ThingDef cumDef)
@ -69,7 +69,7 @@ namespace RJWSexperience // Used in Menstruation with this namespace
cum.stackCount = num;
if (cum.stackCount > 0 && !GenPlace.TryPlaceThing(cum, PositionHeld, Map, ThingPlaceMode.Direct, out Thing res))
{
FilthMaker.TryMakeFilth(PositionHeld, Map, VariousDefOf.FilthCum, num);
FilthMaker.TryMakeFilth(PositionHeld, Map, RsDefOf.Thing.FilthCum, num);
}
storedDecimalRemainder -= num;
}

View File

@ -125,7 +125,7 @@ namespace RJWSexperience.Cum
const float allOf = 1000f;
log.Message($"FeedCum({pawn.NameShortColored}, {amount})");
Thing cum = ThingMaker.MakeThing(VariousDefOf.GatheredCum);
Thing cum = ThingMaker.MakeThing(RsDefOf.Thing.GatheredCum);
cum.stackCount = (int)Math.Ceiling(amount);
log.Message($"Created a stack of {cum.stackCount} cum");
cum.Ingested(pawn, allOf);

View File

@ -6,7 +6,7 @@ namespace RJWSexperience.Cum.FilterWorkers
{
public override bool Matches(Thing t)
{
return IsCum(t) || IsFoodWithCum(t);
return IsCum(t.def) || IsFoodWithCum(t);
}
}
}

View File

@ -10,20 +10,18 @@ namespace RJWSexperience.Cum.FilterWorkers
return def.IsIngestible && def.IsProcessedFood;
}
protected bool IsCum(Thing t) => IsCum(t.def);
protected bool IsCum(ThingDef t) => t == VariousDefOf.GatheredCum;
protected bool IsCum(ThingDef t) => t == RsDefOf.Thing.GatheredCum;
protected bool IsFoodWithCum(Thing food)
{
CompIngredients compIngredients = food.TryGetComp<CompIngredients>();
if (compIngredients == null)
if (compIngredients?.ingredients == null)
return false;
foreach (ThingDef ingredient in compIngredients.ingredients)
for (int i = 0; i < compIngredients.ingredients.Count; i++)
{
if (IsCum(ingredient))
if (IsCum(compIngredients.ingredients[i]))
return true;
}

View File

@ -6,7 +6,7 @@ namespace RJWSexperience.Cum.FilterWorkers
{
public override bool Matches(Thing t)
{
return !IsCum(t) && !IsFoodWithCum(t);
return !IsCum(t.def) && !IsFoodWithCum(t);
}
}
}

View File

@ -12,8 +12,8 @@ namespace RJWSexperience.Cum
{
int amount = ingested.stackCount * (int)unitAmount;
Logs.LogManager.GetLogger<IngestionOutcomeDoer_RecordEatenCum, Logs.DebugLogProvider>().Message($"Record {pawn.NameShortColored} eating {amount} ml of cum");
pawn.records.Increment(VariousDefOf.NumofEatenCum);
pawn.records.AddTo(VariousDefOf.AmountofEatenCum, amount);
pawn.records.Increment(RsDefOf.Record.NumofEatenCum);
pawn.records.AddTo(RsDefOf.Record.AmountofEatenCum, amount);
}
}
}

View File

@ -17,7 +17,7 @@ namespace RJWSexperience.Cum.Interactions
if (context.Internals.Submissive.Parts.Penises.Any())
return GetForCumAddict(context.Internals.Dominant.Pawn);
if (AddictionUtility.IsAddicted(context.Internals.Submissive.Pawn, VariousDefOf.Cum))
if (AddictionUtility.IsAddicted(context.Internals.Submissive.Pawn, RsDefOf.Chemical.Cum))
return GetForPartner();
return Enumerable.Empty<Weighted<LewdablePartKind>>();
@ -28,7 +28,7 @@ namespace RJWSexperience.Cum.Interactions
if (context.Internals.Dominant.Parts.Penises.Any())
return GetForCumAddict(context.Internals.Submissive.Pawn);
if (AddictionUtility.IsAddicted(context.Internals.Dominant.Pawn, VariousDefOf.Cum))
if (AddictionUtility.IsAddicted(context.Internals.Dominant.Pawn, RsDefOf.Chemical.Cum))
return GetForPartner();
return Enumerable.Empty<Weighted<LewdablePartKind>>();
@ -42,7 +42,7 @@ namespace RJWSexperience.Cum.Interactions
var log = LogManager.GetLogger<CumAddictPartKindUsageRule, DebugLogProvider>();
log.Message($"Called for {pawn.NameShortColored}");
if (!(pawn.needs?.TryGetNeed(VariousDefOf.Chemical_Cum) is Need_Chemical cumNeed))
if (!(pawn.needs?.TryGetNeed(RsDefOf.Need.Chemical_Cum) is Need_Chemical cumNeed))
yield break;
log.Message($"{pawn.NameShortColored} is cum addict, current desire level: {cumNeed.CurCategory}");

View File

@ -4,7 +4,7 @@
{
protected override void UpdateCurStage()
{
if (pawn?.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false)
if (pawn?.health?.hediffSet?.HasHediff(RsDefOf.Hediff.CumAddiction) ?? false)
{
SetForcedStage(def.stages.Count - 1);
}

View File

@ -8,9 +8,9 @@ namespace RJWSexperience
public static class DebugToolsSexperience
{
[DebugAction("RJW Sexperience", "Reset pawn's record", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)]
private static void ResetRecords(Pawn p)
public static void ResetRecords(Pawn p)
{
Trait virgin = p.story?.traits?.GetTrait(VariousDefOf.Virgin);
Trait virgin = p.story?.traits?.GetTrait(RsDefOf.Trait.Virgin);
if (virgin != null) p.story.traits.RemoveTrait(virgin);
ResetRecord(p, true);
if (ResetRecord(p, false))
@ -19,7 +19,7 @@ namespace RJWSexperience
}
[DebugAction("RJW Sexperience", "Reset pawn's record(virgin)", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)]
private static void ResetRecordsZero(Pawn p)
public static void ResetRecordsZero(Pawn p)
{
ResetRecord(p, true);
Virginity.TraitHandler.AddVirginTrait(p);
@ -27,32 +27,31 @@ namespace RJWSexperience
}
[DebugAction("RJW Sexperience", "Reset lust", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)]
private static void ResetLust(Pawn p)
public static void ResetLust(Pawn p)
{
float lust = RecordRandomizer.RandomizeLust(p);
MoteMaker.ThrowText(p.TrueCenter(), p.Map, "Lust: " + lust);
}
[DebugAction("RJW Sexperience", "Set lust to 0", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)]
private static void SetLust(Pawn p)
public static void SetLust(Pawn p)
{
p.records.SetTo(VariousDefOf.Lust, 0);
p.records.SetTo(RsDefOf.Record.Lust, 0);
MoteMaker.ThrowText(p.TrueCenter(), p.Map, "Lust: 0");
}
[DebugAction("RJW Sexperience", "Add 10 to lust", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)]
private static void AddLust(Pawn p)
public static void AddLust(Pawn p)
{
p.records.AddTo(VariousDefOf.Lust, 10);
MoteMaker.ThrowText(p.TrueCenter(), p.Map, "Lust: " + p.records.GetValue(VariousDefOf.Lust));
p.records.AddTo(RsDefOf.Record.Lust, 10);
MoteMaker.ThrowText(p.TrueCenter(), p.Map, "Lust: " + p.records.GetValue(RsDefOf.Record.Lust));
}
[DebugAction("RJW Sexperience", "Subtract 10 to lust", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)]
private static void SubtractLust(Pawn p)
public static void SubtractLust(Pawn p)
{
p.records.AddTo(VariousDefOf.Lust, -10);
MoteMaker.ThrowText(p.TrueCenter(), p.Map, "Lust: " + p.records.GetValue(VariousDefOf.Lust));
p.records.AddTo(RsDefOf.Record.Lust, -10);
MoteMaker.ThrowText(p.TrueCenter(), p.Map, "Lust: " + p.records.GetValue(RsDefOf.Record.Lust));
}
private static bool ResetRecord(Pawn pawn, bool allzero)
@ -66,21 +65,21 @@ namespace RJWSexperience
}
else
{
pawn.records.SetTo(VariousDefOf.Lust, 0);
pawn.records.SetTo(VariousDefOf.NumofEatenCum, 0);
pawn.records.SetTo(VariousDefOf.AmountofEatenCum, 0);
pawn.records.SetTo(VariousDefOf.VaginalSexCount, 0);
pawn.records.SetTo(VariousDefOf.AnalSexCount, 0);
pawn.records.SetTo(VariousDefOf.OralSexCount, 0);
pawn.records.SetTo(VariousDefOf.BlowjobCount, 0);
pawn.records.SetTo(VariousDefOf.CunnilingusCount, 0);
pawn.records.SetTo(VariousDefOf.GenitalCaressCount, 0);
pawn.records.SetTo(VariousDefOf.HandjobCount, 0);
pawn.records.SetTo(VariousDefOf.FingeringCount, 0);
pawn.records.SetTo(VariousDefOf.FootjobCount, 0);
pawn.records.SetTo(VariousDefOf.MiscSexualBehaviorCount, 0);
pawn.records.SetTo(VariousDefOf.SexPartnerCount, 0);
pawn.records.SetTo(VariousDefOf.OrgasmCount, 0);
pawn.records.SetTo(RsDefOf.Record.Lust, 0);
pawn.records.SetTo(RsDefOf.Record.NumofEatenCum, 0);
pawn.records.SetTo(RsDefOf.Record.AmountofEatenCum, 0);
pawn.records.SetTo(RsDefOf.Record.VaginalSexCount, 0);
pawn.records.SetTo(RsDefOf.Record.AnalSexCount, 0);
pawn.records.SetTo(RsDefOf.Record.OralSexCount, 0);
pawn.records.SetTo(RsDefOf.Record.BlowjobCount, 0);
pawn.records.SetTo(RsDefOf.Record.CunnilingusCount, 0);
pawn.records.SetTo(RsDefOf.Record.GenitalCaressCount, 0);
pawn.records.SetTo(RsDefOf.Record.HandjobCount, 0);
pawn.records.SetTo(RsDefOf.Record.FingeringCount, 0);
pawn.records.SetTo(RsDefOf.Record.FootjobCount, 0);
pawn.records.SetTo(RsDefOf.Record.MiscSexualBehaviorCount, 0);
pawn.records.SetTo(RsDefOf.Record.SexPartnerCount, 0);
pawn.records.SetTo(RsDefOf.Record.OrgasmCount, 0);
pawn.records.SetTo(xxx.CountOfBeenRapedByAnimals, 0);
pawn.records.SetTo(xxx.CountOfBeenRapedByHumanlikes, 0);
pawn.records.SetTo(xxx.CountOfBeenRapedByInsects, 0);

View File

@ -27,7 +27,7 @@ namespace RJWSexperience
public static float GetSexStat(this Pawn pawn)
{
if (xxx.is_human(pawn) && !pawn.Dead)
return pawn.GetStatValue(VariousDefOf.SexAbility);
return pawn.GetStatValue(RsDefOf.Stat.SexAbility);
return 1.0f;
}
@ -70,7 +70,7 @@ namespace RJWSexperience
/// </summary>
public static bool IsVirgin(this Pawn pawn)
{
return pawn.records.GetValue(VariousDefOf.VaginalSexCount) == 0;
return pawn.records.GetValue(RsDefOf.Record.VaginalSexCount) == 0;
}
/// <summary>

View File

@ -74,7 +74,7 @@ namespace RJWSexperience
public static void UpdateLust(SexProps props, float satisfaction, float baseSatisfaction)
{
float? lust = props.pawn.records?.GetValue(VariousDefOf.Lust);
float? lust = props.pawn.records?.GetValue(RsDefOf.Record.Lust);
if (lust == null)
return;
@ -97,7 +97,7 @@ namespace RJWSexperience
return;
LogManager.GetLogger<DebugLogProvider>("LustUtility").Message($"{props.pawn.NameShortColored}'s lust changed by {lustDelta} (from {lust})");
props.pawn.records.AddTo(VariousDefOf.Lust, lustDelta);
props.pawn.records.AddTo(RsDefOf.Record.Lust, lustDelta);
}
private static float LustIncrementFactor(float lust)

View File

@ -20,11 +20,11 @@ namespace RJWSexperience
{
if (__instance.Sexprops.isRape && __instance.Sexprops.isReceiver)
{
__instance.pawn?.skills?.Learn(VariousDefOf.Sex, 0.05f, true);
__instance.pawn?.skills?.Learn(RsDefOf.Skill.Sex, 0.05f, true);
}
else
{
__instance.pawn?.skills?.Learn(VariousDefOf.Sex, 0.35f, true);
__instance.pawn?.skills?.Learn(RsDefOf.Skill.Sex, 0.35f, true);
}
}
}
@ -44,7 +44,7 @@ namespace RJWSexperience
{
LustUtility.UpdateLust(props, satisfaction, base_sat_per_fuck);
CumUtility.FillCumBuckets(props);
props.pawn.records?.Increment(VariousDefOf.OrgasmCount);
props.pawn.records?.Increment(RsDefOf.Record.OrgasmCount);
if (SexperienceMod.Settings.EnableSexHistory && props.hasPartner())
props.pawn.TryGetComp<SexHistoryComp>()?.RecordSatisfaction(props.partner, props, satisfaction);
}
@ -64,7 +64,7 @@ namespace RJWSexperience
{
public static void Postfix(Pawn pawn)
{
SkillRecord sexskill = pawn.skills.GetSkill(VariousDefOf.Sex);
SkillRecord sexskill = pawn.skills.GetSkill(RsDefOf.Skill.Sex);
if (sexskill != null)
{
sexskill.passion = Passion.Major;

View File

@ -32,11 +32,11 @@ namespace RJWSexperience
if (!pawn.relations.DirectRelationExists(PawnRelationDefOf.Parent, newMother))
return;
Trait virgin = newMother.story?.traits?.GetTrait(VariousDefOf.Virgin, Virginity.TraitDegree.FemaleVirgin);
Trait virgin = newMother.story?.traits?.GetTrait(RsDefOf.Trait.Virgin, Virginity.TraitDegree.FemaleVirgin);
if (virgin != null)
{
newMother.story.traits.RemoveTrait(virgin);
newMother.story.traits.GainTrait(new Trait(VariousDefOf.Virgin, Virginity.TraitDegree.FemaleAfterSurgery));
newMother.story.traits.GainTrait(new Trait(RsDefOf.Trait.Virgin, Virginity.TraitDegree.FemaleAfterSurgery));
}
}
}

View File

@ -98,7 +98,7 @@
<Compile Include="SexHistory\UI\UIUtility.cs" />
<Compile Include="SexHistory\UI\SexStatusWindow.cs" />
<Compile Include="Utility.cs" />
<Compile Include="VariousDefOf.cs" />
<Compile Include="RsDefOf.cs" />
<Compile Include="Virginity\TraitDegree.cs" />
<Compile Include="Virginity\TraitHandler.cs" />
</ItemGroup>

View File

@ -58,52 +58,52 @@ namespace RJWSexperience
{
case xxx.rjwSextype.Vaginal:
case xxx.rjwSextype.Scissoring:
IncreaseSameRecords(pawn, partner, VariousDefOf.VaginalSexCount);
IncreaseSameRecords(pawn, partner, RsDefOf.Record.VaginalSexCount);
break;
case xxx.rjwSextype.Anal:
IncreaseSameRecords(pawn, partner, VariousDefOf.AnalSexCount);
IncreaseSameRecords(pawn, partner, RsDefOf.Record.AnalSexCount);
break;
case xxx.rjwSextype.Oral:
case xxx.rjwSextype.Fellatio:
if (Genital_Helper.has_penis_fertile(giver) || Genital_Helper.has_penis_infertile(giver))
{
IncreaseRecords(giver, receiver, VariousDefOf.OralSexCount, VariousDefOf.BlowjobCount);
IncreaseRecords(giver, receiver, RsDefOf.Record.OralSexCount, RsDefOf.Record.BlowjobCount);
}
else if (Genital_Helper.has_penis_fertile(receiver) || Genital_Helper.has_penis_infertile(receiver))
{
IncreaseRecords(giver, receiver, VariousDefOf.BlowjobCount, VariousDefOf.OralSexCount);
IncreaseRecords(giver, receiver, RsDefOf.Record.BlowjobCount, RsDefOf.Record.OralSexCount);
}
break;
case xxx.rjwSextype.Sixtynine:
IncreaseSameRecords(pawn, partner, VariousDefOf.OralSexCount);
IncreaseSameRecords(pawn, partner, RsDefOf.Record.OralSexCount);
RecordDef recordpawn, recordpartner;
if (Genital_Helper.has_penis_fertile(pawn) || Genital_Helper.has_penis_infertile(pawn))
{
recordpartner = VariousDefOf.BlowjobCount;
recordpartner = RsDefOf.Record.BlowjobCount;
}
else
{
recordpartner = VariousDefOf.CunnilingusCount;
recordpartner = RsDefOf.Record.CunnilingusCount;
}
if (Genital_Helper.has_penis_fertile(partner) || Genital_Helper.has_penis_infertile(partner))
{
recordpawn = VariousDefOf.BlowjobCount;
recordpawn = RsDefOf.Record.BlowjobCount;
}
else
{
recordpawn = VariousDefOf.CunnilingusCount;
recordpawn = RsDefOf.Record.CunnilingusCount;
}
IncreaseRecords(pawn, partner, recordpawn, recordpartner);
break;
case xxx.rjwSextype.Cunnilingus:
if (Genital_Helper.has_vagina(giver))
{
IncreaseRecords(giver, receiver, VariousDefOf.OralSexCount, VariousDefOf.CunnilingusCount);
IncreaseRecords(giver, receiver, RsDefOf.Record.OralSexCount, RsDefOf.Record.CunnilingusCount);
}
else if (Genital_Helper.has_vagina(receiver))
{
IncreaseRecords(giver, receiver, VariousDefOf.CunnilingusCount, VariousDefOf.OralSexCount);
IncreaseRecords(giver, receiver, RsDefOf.Record.CunnilingusCount, RsDefOf.Record.OralSexCount);
}
break;
case xxx.rjwSextype.Masturbation:
@ -111,29 +111,29 @@ namespace RJWSexperience
case xxx.rjwSextype.Handjob:
if (Genital_Helper.has_penis_fertile(giver) || Genital_Helper.has_penis_infertile(giver))
{
IncreaseRecords(giver, receiver, VariousDefOf.GenitalCaressCount, VariousDefOf.HandjobCount);
IncreaseRecords(giver, receiver, RsDefOf.Record.GenitalCaressCount, RsDefOf.Record.HandjobCount);
}
else
{
IncreaseRecords(giver, receiver, VariousDefOf.HandjobCount, VariousDefOf.GenitalCaressCount);
IncreaseRecords(giver, receiver, RsDefOf.Record.HandjobCount, RsDefOf.Record.GenitalCaressCount);
}
break;
case xxx.rjwSextype.Fingering:
case xxx.rjwSextype.Fisting:
if (Genital_Helper.has_vagina(giver))
{
IncreaseRecords(giver, receiver, VariousDefOf.GenitalCaressCount, VariousDefOf.FingeringCount);
IncreaseRecords(giver, receiver, RsDefOf.Record.GenitalCaressCount, RsDefOf.Record.FingeringCount);
}
else
{
IncreaseRecords(giver, receiver, VariousDefOf.FingeringCount, VariousDefOf.GenitalCaressCount);
IncreaseRecords(giver, receiver, RsDefOf.Record.FingeringCount, RsDefOf.Record.GenitalCaressCount);
}
break;
case xxx.rjwSextype.Footjob:
IncreaseSameRecords(pawn, partner, VariousDefOf.FootjobCount);
IncreaseSameRecords(pawn, partner, RsDefOf.Record.FootjobCount);
break;
default:
IncreaseSameRecords(pawn, partner, VariousDefOf.MiscSexualBehaviorCount);
IncreaseSameRecords(pawn, partner, RsDefOf.Record.MiscSexualBehaviorCount);
break;
}
}
@ -154,7 +154,7 @@ namespace RJWSexperience
// Moved this method back because of Menstruation
public static Building_CumBucket FindClosestBucket(this Pawn pawn)
{
List<Building> buckets = pawn.Map.listerBuildings.allBuildingsColonist.FindAll(x => x is Building_CumBucket bucket && bucket.StoredStackCount < VariousDefOf.GatheredCum.stackLimit);
List<Building> buckets = pawn.Map.listerBuildings.allBuildingsColonist.FindAll(x => x is Building_CumBucket bucket && bucket.StoredStackCount < RsDefOf.Thing.GatheredCum.stackLimit);
if (buckets.NullOrEmpty())
return null;

View File

@ -0,0 +1,78 @@
using RimWorld;
using Verse;
namespace RJWSexperience
{
public static class RsDefOf
{
[DefOf]
public static class Record
{
public static readonly RecordDef NumofEatenCum;
public static readonly RecordDef AmountofEatenCum;
public static readonly RecordDef Lust;
public static readonly RecordDef VaginalSexCount;
public static readonly RecordDef AnalSexCount;
public static readonly RecordDef OralSexCount;
public static readonly RecordDef BlowjobCount;
public static readonly RecordDef CunnilingusCount;
public static readonly RecordDef GenitalCaressCount;
public static readonly RecordDef HandjobCount;
public static readonly RecordDef FingeringCount;
public static readonly RecordDef FootjobCount;
public static readonly RecordDef MiscSexualBehaviorCount;
public static readonly RecordDef SexPartnerCount;
public static readonly RecordDef OrgasmCount;
}
[DefOf]
public static class Skill
{
public static readonly SkillDef Sex;
}
[DefOf]
public static class Thing
{
public static readonly ThingDef GatheredCum;
public static readonly ThingDef FilthCum;
}
[DefOf]
public static class Chemical
{
public static readonly ChemicalDef Cum;
}
[DefOf]
public static class Need
{
public static readonly NeedDef Chemical_Cum;
}
[DefOf]
public static class Trait
{
public static readonly TraitDef Virgin;
}
[DefOf]
public static class KeyBinding
{
public static readonly KeyBindingDef OpenSexStatistics;
}
[DefOf]
public static class Stat
{
public static readonly StatDef SexAbility;
}
[DefOf]
public static class Hediff
{
public static readonly HediffDef CumAddiction;
public static readonly HediffDef CumTolerance;
}
}
}

View File

@ -95,8 +95,8 @@ namespace RJWSexperience.SexHistory
minValue = float.MinValue;
value = Mathf.Clamp(value, minValue, float.MaxValue);
float recordvalue = pawn.records.GetValue(VariousDefOf.Lust);
pawn.records.AddTo(VariousDefOf.Lust, value - recordvalue);
float recordvalue = pawn.records.GetValue(RsDefOf.Record.Lust);
pawn.records.AddTo(RsDefOf.Record.Lust, value - recordvalue);
return value;
}
@ -145,7 +145,7 @@ namespace RJWSexperience.SexHistory
totalSexCount += RandomizeRecord(pawn, xxx.CountOfSexWithHumanlikes, avgsex, deviation);
if (totalSexCount > 0)
pawn.records.AddTo(VariousDefOf.SexPartnerCount, Math.Max(1, Rand.Range(0, totalSexCount / 7)));
pawn.records.AddTo(RsDefOf.Record.SexPartnerCount, Math.Max(1, Rand.Range(0, totalSexCount / 7)));
return totalSexCount;
}
@ -170,67 +170,67 @@ namespace RJWSexperience.SexHistory
Gender prefer = PreferredGender(pawn);
int sex = (int)(totalsex * RJWPreferenceSettings.vaginal / totalweight);
totalsex -= sex;
pawn.records.AddTo(VariousDefOf.VaginalSexCount, sex);
pawn.records.AddTo(RsDefOf.Record.VaginalSexCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.anal / totalweight);
totalsex -= sex;
pawn.records.AddTo(VariousDefOf.AnalSexCount, sex);
pawn.records.AddTo(RsDefOf.Record.AnalSexCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.fellatio / totalweight);
totalsex -= sex;
if (prefer == Gender.Male) pawn.records.AddTo(VariousDefOf.BlowjobCount, sex);
else pawn.records.AddTo(VariousDefOf.OralSexCount, sex);
if (prefer == Gender.Male) pawn.records.AddTo(RsDefOf.Record.BlowjobCount, sex);
else pawn.records.AddTo(RsDefOf.Record.OralSexCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.cunnilingus / totalweight);
totalsex -= sex;
if (prefer == Gender.Male) pawn.records.AddTo(VariousDefOf.OralSexCount, sex);
else pawn.records.AddTo(VariousDefOf.CunnilingusCount, sex);
if (prefer == Gender.Male) pawn.records.AddTo(RsDefOf.Record.OralSexCount, sex);
else pawn.records.AddTo(RsDefOf.Record.CunnilingusCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.rimming / totalweight);
totalsex -= sex;
pawn.records.AddTo(VariousDefOf.MiscSexualBehaviorCount, sex);
pawn.records.AddTo(RsDefOf.Record.MiscSexualBehaviorCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.double_penetration / totalweight) / 2;
totalsex -= sex;
totalsex -= sex;
pawn.records.AddTo(VariousDefOf.VaginalSexCount, sex);
pawn.records.AddTo(VariousDefOf.AnalSexCount, sex);
pawn.records.AddTo(RsDefOf.Record.VaginalSexCount, sex);
pawn.records.AddTo(RsDefOf.Record.AnalSexCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.breastjob / totalweight);
totalsex -= sex;
pawn.records.AddTo(VariousDefOf.MiscSexualBehaviorCount, sex);
pawn.records.AddTo(RsDefOf.Record.MiscSexualBehaviorCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.handjob / totalweight);
totalsex -= sex;
if (prefer == Gender.Male) pawn.records.AddTo(VariousDefOf.HandjobCount, sex);
else pawn.records.AddTo(VariousDefOf.GenitalCaressCount, sex);
if (prefer == Gender.Male) pawn.records.AddTo(RsDefOf.Record.HandjobCount, sex);
else pawn.records.AddTo(RsDefOf.Record.GenitalCaressCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.fingering / totalweight);
totalsex -= sex;
if (prefer == Gender.Female) pawn.records.AddTo(VariousDefOf.FingeringCount, sex);
else pawn.records.AddTo(VariousDefOf.GenitalCaressCount, sex);
if (prefer == Gender.Female) pawn.records.AddTo(RsDefOf.Record.FingeringCount, sex);
else pawn.records.AddTo(RsDefOf.Record.GenitalCaressCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.mutual_masturbation / totalweight);
totalsex -= sex;
if (prefer == Gender.Male) pawn.records.AddTo(VariousDefOf.HandjobCount, sex);
else pawn.records.AddTo(VariousDefOf.FingeringCount, sex);
pawn.records.AddTo(VariousDefOf.GenitalCaressCount, sex);
if (prefer == Gender.Male) pawn.records.AddTo(RsDefOf.Record.HandjobCount, sex);
else pawn.records.AddTo(RsDefOf.Record.FingeringCount, sex);
pawn.records.AddTo(RsDefOf.Record.GenitalCaressCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.footjob / totalweight);
totalsex -= sex;
pawn.records.AddTo(VariousDefOf.FootjobCount, sex);
pawn.records.AddTo(RsDefOf.Record.FootjobCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.scissoring / totalweight);
totalsex -= sex;
pawn.records.AddTo(VariousDefOf.MiscSexualBehaviorCount, sex);
pawn.records.AddTo(RsDefOf.Record.MiscSexualBehaviorCount, sex);
sex = (int)(totalsex * RJWPreferenceSettings.fisting / totalweight);
totalsex -= sex;
pawn.records.AddTo(VariousDefOf.MiscSexualBehaviorCount, sex);
pawn.records.AddTo(RsDefOf.Record.MiscSexualBehaviorCount, sex);
pawn.records.AddTo(VariousDefOf.OralSexCount, totalsex);
if (prefer == Gender.Male) pawn.records.AddTo(VariousDefOf.BlowjobCount, totalsex);
else pawn.records.AddTo(VariousDefOf.CunnilingusCount, totalsex);
pawn.records.AddTo(RsDefOf.Record.OralSexCount, totalsex);
if (prefer == Gender.Male) pawn.records.AddTo(RsDefOf.Record.BlowjobCount, totalsex);
else pawn.records.AddTo(RsDefOf.Record.CunnilingusCount, totalsex);
}
private static Gender PreferredGender(Pawn pawn)

View File

@ -291,7 +291,7 @@ namespace RJWSexperience.SexHistory
SexPartnerHistoryRecord newRecord = new SexPartnerHistoryRecord(partner, partner.IsIncest(ParentPawn));
histories.Add(partnerId, newRecord);
ParentPawn.records.Increment(VariousDefOf.SexPartnerCount);
ParentPawn.records.Increment(RsDefOf.Record.SexPartnerCount);
return newRecord;
}
@ -442,7 +442,7 @@ namespace RJWSexperience.SexHistory
defaultLabel = Keyed.RS_Sex_History,
icon = HistoryUtility.HistoryIcon,
defaultIconColor = HistoryUtility.HistoryColor,
hotKey = VariousDefOf.OpenSexStatistics,
hotKey = RsDefOf.KeyBinding.OpenSexStatistics,
action = () => UI.SexStatusWindow.ToggleWindow(this)
};
}

View File

@ -163,7 +163,7 @@ namespace RJWSexperience.SexHistory.UI
}
SexTypes.Add(new BarInfo(
label: String.Format(Keyed.RS_Sex_Partners + ": {0} ({1})", _history.PartnerCount, Pawn.records.GetValue(VariousDefOf.SexPartnerCount)),
label: String.Format(Keyed.RS_Sex_Partners + ": {0} ({1})", _history.PartnerCount, Pawn.records.GetValue(RsDefOf.Record.SexPartnerCount)),
fillPercent: _history.PartnerCount / 50,
fillTexture: HistoryUtility.Partners));
@ -178,7 +178,7 @@ namespace RJWSexperience.SexHistory.UI
fillTexture: HistoryUtility.TotalSex,
labelRight: Keyed.RS_SatAVG(_history.AVGSat));
float lust = Pawn.records.GetValue(VariousDefOf.Lust);
float lust = Pawn.records.GetValue(RsDefOf.Record.Lust);
float sexDrive = GetStatValue(xxx.sex_drive_stat);
float lustLimit = SexperienceMod.Settings.LustLimit * 3f;
Lust = new BarInfo(
@ -212,14 +212,14 @@ namespace RJWSexperience.SexHistory.UI
fillPercent: _history.IncestuousCount / 50,
fillTexture: HistoryUtility.Nurgle);
float amountofEatenCum = Pawn.records.GetValue(VariousDefOf.AmountofEatenCum);
float amountofEatenCum = Pawn.records.GetValue(RsDefOf.Record.AmountofEatenCum);
ConsumedCum = new BarInfo(
label: String.Format(Keyed.RS_Cum_Swallowed + ": {0} mL, {1} " + Keyed.RS_NumofTimes, amountofEatenCum, Pawn.records.GetValue(VariousDefOf.NumofEatenCum)),
label: String.Format(Keyed.RS_Cum_Swallowed + ": {0} mL, {1} " + Keyed.RS_NumofTimes, amountofEatenCum, Pawn.records.GetValue(RsDefOf.Record.NumofEatenCum)),
fillPercent: amountofEatenCum / 1000,
fillTexture: Texture2D.linearGrayTexture);
Hediff cumHediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.CumAddiction)
?? Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.CumTolerance);
Hediff cumHediff = Pawn.health.hediffSet.GetFirstHediffOfDef(RsDefOf.Hediff.CumAddiction)
?? Pawn.health.hediffSet.GetFirstHediffOfDef(RsDefOf.Hediff.CumTolerance);
if (cumHediff != null)
{
CumHediff = new BarInfo(
@ -254,15 +254,15 @@ namespace RJWSexperience.SexHistory.UI
fillTexture: HistoryUtility.Satisfaction,
tooltip: GetStatTooltip(xxx.sex_satisfaction, sexSatisfaction));
SkillRecord skill = Pawn.skills?.GetSkill(VariousDefOf.Sex);
SkillRecord skill = Pawn.skills?.GetSkill(RsDefOf.Skill.Sex);
float sexSkillLevel = skill?.Level ?? 0f;
float sexStat = Pawn.GetSexStat();
SexSkill = new BarInfo(
label: $"{Keyed.RS_SexSkill}: {sexSkillLevel}, {skill?.xpSinceLastLevel / skill?.XpRequiredForLevelUp:P2}",
fillPercent: sexSkillLevel / 20,
fillTexture: HistoryUtility.Tzeentch,
tooltip: GetStatTooltip(VariousDefOf.SexAbility, sexStat),
labelRight: VariousDefOf.SexAbility.LabelCap + ": " + sexStat.ToStringPercent(),
tooltip: GetStatTooltip(RsDefOf.Stat.SexAbility, sexStat),
labelRight: RsDefOf.Stat.SexAbility.LabelCap + ": " + sexStat.ToStringPercent(),
border: HistoryUtility.GetPassionBG(skill?.passion));
}
@ -294,7 +294,7 @@ namespace RJWSexperience.SexHistory.UI
private void UpdateVirginAndSexuality()
{
Trait virginity = Pawn.story?.traits?.GetTrait(VariousDefOf.Virgin);
Trait virginity = Pawn.story?.traits?.GetTrait(RsDefOf.Trait.Virgin);
if (virginity != null && virginity.Degree != Virginity.TraitDegree.FemaleAfterSurgery)
{
VirginLabel = virginity.Label;

View File

@ -24,7 +24,7 @@ namespace RJWSexperience
val *= GetLustFactor(pawn);
}
protected float GetLustFactor(Pawn pawn) => LustUtility.GetLustFactor(pawn.records.GetValue(VariousDefOf.Lust));
protected float GetLustFactor(Pawn pawn) => LustUtility.GetLustFactor(pawn.records.GetValue(RsDefOf.Record.Lust));
}
/// <summary>

View File

@ -1,37 +0,0 @@
using RimWorld;
using Verse;
namespace RJWSexperience
{
[DefOf]
public static class VariousDefOf
{
public static readonly RecordDef NumofEatenCum;
public static readonly RecordDef AmountofEatenCum;
public static readonly RecordDef Lust;
public static readonly RecordDef VaginalSexCount;
public static readonly RecordDef AnalSexCount;
public static readonly RecordDef OralSexCount;
public static readonly RecordDef BlowjobCount;
public static readonly RecordDef CunnilingusCount;
public static readonly RecordDef GenitalCaressCount;
public static readonly RecordDef HandjobCount;
public static readonly RecordDef FingeringCount;
public static readonly RecordDef FootjobCount;
public static readonly RecordDef MiscSexualBehaviorCount;
public static readonly RecordDef SexPartnerCount;
public static readonly RecordDef OrgasmCount;
public static readonly SkillDef Sex;
public static readonly ThingDef CumBucket;
public static readonly ThingDef GatheredCum;
public static readonly ThingDef FilthCum;
public static readonly ChemicalDef Cum;
public static readonly NeedDef Chemical_Cum;
public static readonly TraitDef Virgin;
public static readonly KeyBindingDef OpenSexStatistics;
public static readonly StatDef SexAbility;
public static readonly HediffDef CumAddiction;
public static readonly HediffDef CumTolerance;
}
}

View File

@ -26,14 +26,10 @@ namespace RJWSexperience.Virginity
if (billDoer == null)
return;
TaleRecorder.RecordTale(TaleDefOf.DidSurgery, new object[]
{
billDoer,
pawn
});
TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn);
TraitHandler.AddVirginTrait(pawn);
}
private static bool HasHymen(Pawn pawn) => pawn.story?.traits?.GetTrait(VariousDefOf.Virgin)?.Degree > 0;
private static bool HasHymen(Pawn pawn) => pawn.story?.traits?.GetTrait(RsDefOf.Trait.Virgin)?.Degree > 0;
}
}

View File

@ -17,7 +17,7 @@ namespace RJWSexperience.Virginity
{
if (Rand.Chance(hymenSurgeryChance))
{
Trait virgin = new Trait(VariousDefOf.Virgin, TraitDegree.FemaleAfterSurgery, true);
Trait virgin = new Trait(RsDefOf.Trait.Virgin, TraitDegree.FemaleAfterSurgery, true);
pawn.story.traits.GainTrait(virgin);
}
return;
@ -36,19 +36,19 @@ namespace RJWSexperience.Virginity
int degree = TraitDegree.MaleVirgin;
if (pawn.gender == Gender.Female)
degree = TraitDegree.FemaleVirgin;
Trait virgin = new Trait(VariousDefOf.Virgin, degree, true);
Trait virgin = new Trait(RsDefOf.Trait.Virgin, degree, true);
pawn.story.traits.GainTrait(virgin);
}
else if (pawn.gender == Gender.Female)
{
Trait virgin = new Trait(VariousDefOf.Virgin, TraitDegree.FemaleAfterSurgery, true);
Trait virgin = new Trait(RsDefOf.Trait.Virgin, TraitDegree.FemaleAfterSurgery, true);
pawn.story.traits.GainTrait(virgin);
}
}
public static int? RemoveVirginTrait(Pawn pawn)
{
Trait virgin = pawn.story?.traits?.GetTrait(VariousDefOf.Virgin);
Trait virgin = pawn.story?.traits?.GetTrait(RsDefOf.Trait.Virgin);
if (virgin == null)
return null;