Merge remote-tracking branch 'vegapnk/master' into dev

This commit is contained in:
amevarashi 2022-05-06 21:53:17 +05:00
commit 770798c4cc
6 changed files with 94 additions and 1 deletions

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>RJWSexperience</identifier> <identifier>RJWSexperience</identifier>
<version>1.0.3.1</version> <version>1.0.3.2</version>
<dependencies> <dependencies>
<li>RimJobWorld >= 4.9.5.3</li> <li>RimJobWorld >= 4.9.5.3</li>
</dependencies> </dependencies>

Binary file not shown.

View file

@ -23,6 +23,7 @@ namespace RJWSexperience
public const float MinSexablePercentDefault = 0.2f; public const float MinSexablePercentDefault = 0.2f;
public const float VirginRatioDefault = 0.01f; public const float VirginRatioDefault = 0.01f;
public const bool selectionLockedDefault = false; public const bool selectionLockedDefault = false;
public const bool SexCanFillBucketsDefault = false;
// Private attributes // Private attributes
private float maxLustDeviation = MaxInitialLustDefault; private float maxLustDeviation = MaxInitialLustDefault;
@ -55,6 +56,7 @@ namespace RJWSexperience
public float MinSexablePercent => minSexablePercent; public float MinSexablePercent => minSexablePercent;
public float VirginRatio => virginRatio; public float VirginRatio => virginRatio;
public float MaxSingleLustChange => maxSingleLustChange; public float MaxSingleLustChange => maxSingleLustChange;
public bool SexCanFillBuckets => sexCanFillBuckets;
public Settings.SettingsTabDebug Debug => debug; public Settings.SettingsTabDebug Debug => debug;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Minor Code Smell", "S2292:Trivial properties should be auto-implemented", Justification = "Can't scribe property")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Minor Code Smell", "S2292:Trivial properties should be auto-implemented", Justification = "Can't scribe property")]
public bool SelectionLocked { get => selectionLocked; set => selectionLocked = value; } public bool SelectionLocked { get => selectionLocked; set => selectionLocked = value; }
@ -74,6 +76,7 @@ namespace RJWSexperience
minSexableFromLifestage = MinSexableFromLifestageDefault; minSexableFromLifestage = MinSexableFromLifestageDefault;
minSexablePercent = MinSexablePercentDefault; minSexablePercent = MinSexablePercentDefault;
virginRatio = VirginRatioDefault; virginRatio = VirginRatioDefault;
sexCanFillBuckets = SexCanFillBucketsDefault;
} }
public override void ExposeData() public override void ExposeData()
@ -92,6 +95,7 @@ namespace RJWSexperience
Scribe_Values.Look(ref minSexablePercent, "MinSexablePercent", MinSexablePercentDefault); Scribe_Values.Look(ref minSexablePercent, "MinSexablePercent", MinSexablePercentDefault);
Scribe_Values.Look(ref virginRatio, "VirginRatio", VirginRatioDefault); Scribe_Values.Look(ref virginRatio, "VirginRatio", VirginRatioDefault);
Scribe_Values.Look(ref selectionLocked, "SelectionLocked", selectionLockedDefault); Scribe_Values.Look(ref selectionLocked, "SelectionLocked", selectionLockedDefault);
Scribe_Values.Look(ref sexCanFillBuckets, "SexCanFillBuckets", SexCanFillBucketsDefault);
Scribe_Deep.Look(ref debug, "Debug"); Scribe_Deep.Look(ref debug, "Debug");
base.ExposeData(); base.ExposeData();
@ -144,6 +148,9 @@ namespace RJWSexperience
listmain.CheckboxLabeled(Keyed.Option_EnableBastardRelation_Label, ref enableBastardRelation, Keyed.Option_EnableBastardRelation_Desc); listmain.CheckboxLabeled(Keyed.Option_EnableBastardRelation_Label, ref enableBastardRelation, Keyed.Option_EnableBastardRelation_Desc);
listmain.CheckboxLabeled("SexCanFillBuckets".Translate(), ref sexCanFillBuckets, "SexCanFillBuckets_desc".Translate());
if (listmain.ButtonText(Keyed.Button_ResetToDefault)) if (listmain.ButtonText(Keyed.Button_ResetToDefault))
{ {
ResetToDefault(); ResetToDefault();

View file

@ -44,6 +44,68 @@ namespace RJWSexperience
return null; return null;
} }
public static IEnumerable<T> GetAdjacentBuildings<T>(this Pawn pawn) where T : Building
{
// This Method was introduced to fill multiple CumBuckets around a single pawn.
var results = new List<T>();
if (pawn.Spawned)
{
EdificeGrid edifice = pawn.Map.edificeGrid;
if (edifice[pawn.Position] is T)
results.Add((T)edifice[pawn.Position]);
IEnumerable<IntVec3> adjcells = GenAdjFast.AdjacentCells8Way(pawn.Position);
foreach (IntVec3 pos in adjcells)
{
if (edifice[pos] is T)
results.Add((T)edifice[pos]);
}
}
return results;
}
public static float GetCumVolume(this Pawn pawn)
{
List<Hediff> hediffs = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn));
if (hediffs.NullOrEmpty()) return 0;
else return pawn.GetCumVolume(hediffs);
}
public static float GetCumVolume(this Pawn pawn, List<Hediff> hediffs)
{
float cum_value = 0;
// Add Cum for every existing Penis at the pawn
foreach (var penis in hediffs?.FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("penis")))
{
cum_value += pawn.GetCumVolume(penis.TryGetComp<CompHediffBodyPart>());
}
// Look for more exotic parts - if any is found, add some more cum for the first special part found
CompHediffBodyPart special_part = null;
if (special_part == null) special_part = hediffs?.FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorf")).InRandomOrder().FirstOrDefault()?.TryGetComp<CompHediffBodyPart>();
if (special_part == null) special_part = hediffs?.FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorm")).InRandomOrder().FirstOrDefault()?.TryGetComp<CompHediffBodyPart>();
if (special_part == null) special_part = hediffs?.FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("tentacle")).InRandomOrder().FirstOrDefault()?.TryGetComp<CompHediffBodyPart>();
cum_value += pawn.GetCumVolume(special_part);
return cum_value;
}
public static float GetCumVolume(this Pawn pawn, CompHediffBodyPart part)
{
float res;
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;
}
catch (NullReferenceException)
{
res = 0.0f;
}
if (pawn.Has(Quirk.Messy)) res *= Rand.Range(4.0f, 8.0f);
return res;
}
/// <summary> /// <summary>
/// If the pawn is virgin, return true. /// If the pawn is virgin, return true.
/// </summary> /// </summary>

View file

@ -5,6 +5,7 @@ using rjw.Modules.Interactions.Enums;
using RJWSexperience.Cum; using RJWSexperience.Cum;
using RJWSexperience.ExtensionMethods; using RJWSexperience.ExtensionMethods;
using RJWSexperience.Logs; using RJWSexperience.Logs;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using Verse; using Verse;
using Verse.AI; using Verse.AI;
@ -62,6 +63,7 @@ namespace RJWSexperience
{ {
Pawn pawn = props.pawn; Pawn pawn = props.pawn;
Pawn partner = props.partner; Pawn partner = props.partner;
xxx.rjwSextype sextype = props.sexType;
UpdateLust(props, satisfaction); UpdateLust(props, satisfaction);
if (props.sexType == xxx.rjwSextype.Masturbation || partner == null) if (props.sexType == xxx.rjwSextype.Masturbation || partner == null)
@ -69,6 +71,25 @@ namespace RJWSexperience
Building_CumBucket cumbucket = pawn.GetAdjacentBuilding<Building_CumBucket>(); Building_CumBucket cumbucket = pawn.GetAdjacentBuilding<Building_CumBucket>();
cumbucket?.AddCum(CumUtility.GetCumVolume(pawn)); cumbucket?.AddCum(CumUtility.GetCumVolume(pawn));
} }
bool sexFillsCumbuckets =
// Base: Fill Cumbuckets on Masturbation. Having no partner means it must be masturbation too
sextype == xxx.rjwSextype.Masturbation || partner == null
// Depending on configuration, also fill cumbuckets when certain sextypes are matched
|| (SexperienceMod.Settings.SexCanFillBuckets && (sextype == xxx.rjwSextype.Boobjob || sextype == xxx.rjwSextype.Footjob || sextype == xxx.rjwSextype.Handjob));
if (sexFillsCumbuckets)
{
IEnumerable<Building_CumBucket> buckets = pawn.GetAdjacentBuildings<Building_CumBucket>();
if (buckets != null && buckets.EnumerableCount() > 0)
{
var initial_Cum = pawn.GetCumVolume();
foreach (Building_CumBucket b in buckets)
{
b.AddCum(initial_Cum / buckets.EnumerableCount());
}
}
}
RJWUtility.UpdateSatisfactionHIstory(pawn, partner, props, satisfaction); RJWUtility.UpdateSatisfactionHIstory(pawn, partner, props, satisfaction);
pawn.records?.Increment(VariousDefOf.OrgasmCount); pawn.records?.Increment(VariousDefOf.OrgasmCount);

View file

@ -1,3 +1,6 @@
Version Beta 1.0.3.2
- Fix repeated scroll sounds in mod settings
Version Beta 1.0.3.1 Version Beta 1.0.3.1
- Added ability to draw more quirks in Sex Status window - Added ability to draw more quirks in Sex Status window
- Added option to disable Bastard relation - Added option to disable Bastard relation