From fd59e67233209add86b12f28e1b4614329d0f26d Mon Sep 17 00:00:00 2001 From: amevarashi Date: Sat, 23 Jul 2022 16:02:45 +0500 Subject: [PATCH] Adopt SexAbility, remove whoring patches --- Defs/StatDefs/SexAbility.xml | 42 +++++++++++++++++++ Patches/RJW_StatDefs.xml | 23 ---------- .../RJWSexperience/Cum/CumUtility.cs | 2 +- RJWSexperience/RJWSexperience/DebugAction.cs | 1 - .../ExtensionMethods/PawnExtensions.cs | 2 +- .../RJWSexperience/Patches/RJW_Patch.cs | 24 ++--------- .../RJWSexperience/SexHistory/UI/SexStatus.cs | 6 +-- 7 files changed, 50 insertions(+), 50 deletions(-) create mode 100644 Defs/StatDefs/SexAbility.xml diff --git a/Defs/StatDefs/SexAbility.xml b/Defs/StatDefs/SexAbility.xml new file mode 100644 index 0000000..dc0c906 --- /dev/null +++ b/Defs/StatDefs/SexAbility.xml @@ -0,0 +1,42 @@ + + + + + SexAbility + + Measures whether or not a pawn is capable of sex, and how good they are at it + PawnSocial + 1.0 + 0.0 + PercentTwo + + +
  • + Sex + 0.40 + 0.15 +
  • +
    + +
  • + 0.9 + 0.8 +
  • +
  • + 0.9 + 0.7 + 0.5 +
  • +
    +
    +
    \ No newline at end of file diff --git a/Patches/RJW_StatDefs.xml b/Patches/RJW_StatDefs.xml index 848165a..52b44de 100644 --- a/Patches/RJW_StatDefs.xml +++ b/Patches/RJW_StatDefs.xml @@ -1,27 +1,6 @@ - - Defs/StatDef[defName="SexAbility"]/capacityFactors - - - - - - - - Defs/StatDef[defName="SexAbility"] - - -
  • - Sex - 0.40 - 0.15 -
  • -
    -
    -
    - Defs/StatDef[defName="SexFrequency"]/parts @@ -37,6 +16,4 @@ - -
    \ No newline at end of file diff --git a/RJWSexperience/RJWSexperience/Cum/CumUtility.cs b/RJWSexperience/RJWSexperience/Cum/CumUtility.cs index 5c3e069..988349d 100644 --- a/RJWSexperience/RJWSexperience/Cum/CumUtility.cs +++ b/RJWSexperience/RJWSexperience/Cum/CumUtility.cs @@ -45,7 +45,7 @@ namespace RJWSexperience.Cum try { - res = part.FluidAmmount * part.FluidModifier * pawn.BodySize / pawn.RaceProps.baseBodySize * Rand.Range(0.8f, 1.2f) * RJWSettings.cum_on_body_amount_adjust * 0.3f; + res = part.FluidAmmount * part.FluidModifier * pawn.BodySize / pawn.RaceProps.baseBodySize * Rand.Range(0.8f, 1.2f) * 0.3f; } catch (NullReferenceException) { diff --git a/RJWSexperience/RJWSexperience/DebugAction.cs b/RJWSexperience/RJWSexperience/DebugAction.cs index e2b2445..0999856 100644 --- a/RJWSexperience/RJWSexperience/DebugAction.cs +++ b/RJWSexperience/RJWSexperience/DebugAction.cs @@ -99,7 +99,6 @@ namespace RJWSexperience pawn.records.SetTo(xxx.CountOfSexWithHumanlikes, 0); pawn.records.SetTo(xxx.CountOfSexWithInsects, 0); pawn.records.SetTo(xxx.CountOfSexWithOthers, 0); - pawn.records.SetTo(xxx.CountOfWhore, 0); } return true; diff --git a/RJWSexperience/RJWSexperience/ExtensionMethods/PawnExtensions.cs b/RJWSexperience/RJWSexperience/ExtensionMethods/PawnExtensions.cs index f56147f..3d47e0f 100644 --- a/RJWSexperience/RJWSexperience/ExtensionMethods/PawnExtensions.cs +++ b/RJWSexperience/RJWSexperience/ExtensionMethods/PawnExtensions.cs @@ -27,7 +27,7 @@ namespace RJWSexperience public static float GetSexStat(this Pawn pawn) { if (xxx.is_human(pawn) && !pawn.Dead) - return pawn.GetStatValue(xxx.sex_stat); + return pawn.GetStatValue(VariousDefOf.SexAbility); return 1.0f; } diff --git a/RJWSexperience/RJWSexperience/Patches/RJW_Patch.cs b/RJWSexperience/RJWSexperience/Patches/RJW_Patch.cs index 0bd4599..ecadf43 100644 --- a/RJWSexperience/RJWSexperience/Patches/RJW_Patch.cs +++ b/RJWSexperience/RJWSexperience/Patches/RJW_Patch.cs @@ -19,34 +19,16 @@ namespace RJWSexperience { if (__instance.Sexprops.isRape && __instance.Sexprops.isReceiver) { - __instance.pawn?.skills?.Learn(VariousDefOf.SexSkill, 0.05f, true); + __instance.pawn?.skills?.Learn(VariousDefOf.Sex, 0.05f, true); } else { - __instance.pawn?.skills?.Learn(VariousDefOf.SexSkill, 0.35f, true); + __instance.pawn?.skills?.Learn(VariousDefOf.Sex, 0.35f, true); } } } } - [HarmonyPatch(typeof(WhoringHelper), "WhoreAbilityAdjustmentMin")] - public static class RJW_Patch_WhoreAbilityAdjustmentMin - { - public static void Postfix(Pawn whore, ref float __result) - { - __result *= whore.GetSexStat(); - } - } - - [HarmonyPatch(typeof(WhoringHelper), "WhoreAbilityAdjustmentMax")] - public static class RJW_Patch_WhoreAbilityAdjustmentMax - { - public static void Postfix(Pawn whore, ref float __result) - { - __result *= whore.GetSexStat(); - } - } - [HarmonyPatch(typeof(SexUtility), nameof(SexUtility.SatisfyPersonal))] public static class RJW_Patch_SatisfyPersonal { @@ -81,7 +63,7 @@ namespace RJWSexperience { public static void Postfix(Pawn pawn) { - SkillRecord sexskill = pawn.skills.GetSkill(VariousDefOf.SexSkill); + SkillRecord sexskill = pawn.skills.GetSkill(VariousDefOf.Sex); if (sexskill != null) { sexskill.passion = Passion.Major; diff --git a/RJWSexperience/RJWSexperience/SexHistory/UI/SexStatus.cs b/RJWSexperience/RJWSexperience/SexHistory/UI/SexStatus.cs index 6e991e2..a919c40 100644 --- a/RJWSexperience/RJWSexperience/SexHistory/UI/SexStatus.cs +++ b/RJWSexperience/RJWSexperience/SexHistory/UI/SexStatus.cs @@ -460,13 +460,13 @@ namespace RJWSexperience.SexHistory.UI TooltipHandler.TipRegion(tmp, RJWUIUtility.GetStatExplanation(pawn, xxx.sex_satisfaction, pawn.Dead ? 0 : pawn.GetStatValue(xxx.sex_satisfaction))); } - SkillRecord skill = pawn.skills?.GetSkill(VariousDefOf.SexSkill); + SkillRecord skill = pawn.skills?.GetSkill(VariousDefOf.Sex); p = skill?.Level ?? 0; tmp = listmain.GetRect(FONTHEIGHT); - FillableBarLabeled(tmp, String.Format(Keyed.RS_SexSkill + ": {0}, {1:P2}", p, skill?.xpSinceLastLevel / skill?.XpRequiredForLevelUp), p / 20, HistoryUtility.Tzeentch, Texture2D.blackTexture, null, String.Format(xxx.sex_stat.LabelCap.CapitalizeFirst() + ": {0:P2}", pawn.Dead ? 0 : pawn.GetStatValue(xxx.sex_stat)), HistoryUtility.PassionBG[(int)(skill?.passion ?? 0)]); + FillableBarLabeled(tmp, $"{Keyed.RS_SexSkill}: {p}, {skill?.xpSinceLastLevel / skill?.XpRequiredForLevelUp:P2}", p / 20, HistoryUtility.Tzeentch, Texture2D.blackTexture, null, $"{VariousDefOf.SexAbility.LabelCap.CapitalizeFirst()}: {pawn.GetSexStat():P2}", HistoryUtility.PassionBG[(int)(skill?.passion ?? 0)]); if (Mouse.IsOver(tmp)) { - TooltipHandler.TipRegion(tmp, RJWUIUtility.GetStatExplanation(pawn, xxx.sex_stat, pawn.Dead ? 0 : pawn.GetStatValue(xxx.sex_stat))); + TooltipHandler.TipRegion(tmp, RJWUIUtility.GetStatExplanation(pawn, VariousDefOf.SexAbility, pawn.GetSexStat())); } listmain.Gap(1f);