From 1907820265aa743603a7ddcd6a4f9fd601d9f837 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Tue, 12 Jul 2022 15:49:55 -0700 Subject: [PATCH] Whole bunch of code cleanup, mostly using and whitespace --- .../MilkModule/JobDriver_MilkSelf.cs | 15 ++---- .../RJW_Menstruation/MilkModule/Milk_Patch.cs | 12 ++--- .../MilkModule/Properties/AssemblyInfo.cs | 1 - .../RJW_Menstruation/Configurations.cs | 18 +++---- .../RJW_Menstruation/RJW_Menstruation/Cum.cs | 26 +++++----- .../RJW_Menstruation/DrugOutcomeDoers.cs | 27 +++++----- .../EstrusPartKindUsageRule.cs | 4 +- .../HediffComps/HediffComp_Breast.cs | 37 +++++++------- .../HediffComps/HediffComp_InducedOvulator.cs | 8 +-- .../HediffComps/HediffComp_Menstruation.cs | 40 +++++++-------- .../HediffComps/MenstruationUtility.cs | 16 +++--- .../Hediff_MultiplePregnancy.cs | 14 ++--- .../RJW_Menstruation/IngestionOutcomeDoers.cs | 26 ++++------ .../RJW_Menstruation/JobDrivers.cs | 6 +-- .../RJW_Menstruation/Patch/GC_Patch.cs | 12 ++--- .../RJW_Menstruation/Patch/GetGizmos.cs | 2 +- .../RJW_Menstruation/Patch/Pawn_Patch.cs | 2 - .../RJW_Menstruation/Patch/RJW_Patch.cs | 16 +++--- .../RJW_Menstruation/Recipe_Surgery.cs | 12 ++--- .../RJW_Menstruation/Reflect.cs | 4 +- .../RJW_Menstruation/TextureCache.cs | 8 +-- .../RJW_Menstruation/Things.cs | 23 ++++----- .../RJW_Menstruation/Translations.cs | 16 +++--- .../UI/Dialog_HybridCustom.cs | 51 +++++++++---------- .../RJW_Menstruation/UI/Dialog_WombStatus.cs | 24 ++++----- .../RJW_Menstruation/UI/Gizmo_Womb.cs | 2 +- .../RJW_Menstruation/Utility.cs | 24 ++++----- .../RJW_Menstruation/VariousDefOf.cs | 5 +- .../SexperienceModule/GatheredCumMixture.cs | 17 ++----- .../SexperienceModule/JobDrivers.cs | 7 +-- .../SexperienceModule/Patch/GetGizmos.cs | 13 ++--- .../SexperienceModule/Patch/Harmony.cs | 7 +-- .../Patch/Menstruation_Patch.cs | 14 ++--- .../SexperienceModule/Patch/Pawn_Patch.cs | 26 ++++------ .../SexperienceModule/Patch/RJW_Patch.cs | 12 ++--- .../Properties/AssemblyInfo.cs | 1 - .../SexperienceModule/VariousDefOf.cs | 7 +-- 37 files changed, 228 insertions(+), 327 deletions(-) diff --git a/1.3/source/RJW_Menstruation/MilkModule/JobDriver_MilkSelf.cs b/1.3/source/RJW_Menstruation/MilkModule/JobDriver_MilkSelf.cs index e331d6b..b35b0a6 100644 --- a/1.3/source/RJW_Menstruation/MilkModule/JobDriver_MilkSelf.cs +++ b/1.3/source/RJW_Menstruation/MilkModule/JobDriver_MilkSelf.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; -using Verse.AI; -using RimWorld; -using Milk; +using Milk; using RJW_Menstruation; +using Verse; namespace MilkModule { @@ -51,7 +44,7 @@ namespace MilkModule if (pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Heavy_Lactating_Permanent)) { result = pawn.TryGetComp(); - + } else { @@ -125,6 +118,6 @@ namespace MilkModule // // //} - + } diff --git a/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs b/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs index 8fbcb96..6e45a31 100644 --- a/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs +++ b/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Reflection; -using HarmonyLib; -using Verse; -using RimWorld; +using HarmonyLib; using Milk; using RJW_Menstruation; +using System.Reflection; +using Verse; namespace MilkModule { diff --git a/1.3/source/RJW_Menstruation/MilkModule/Properties/AssemblyInfo.cs b/1.3/source/RJW_Menstruation/MilkModule/Properties/AssemblyInfo.cs index 019d075..c526740 100644 --- a/1.3/source/RJW_Menstruation/MilkModule/Properties/AssemblyInfo.cs +++ b/1.3/source/RJW_Menstruation/MilkModule/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs index e2a5d46..f177914 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs @@ -79,7 +79,7 @@ namespace RJW_Menstruation return NippleTransitionVariance * NippleTransitionSpeed; } } - + public static void SettoDefault() { ImplantationChanceAdjust = ImplantationChanceAdjustDefault; @@ -152,14 +152,14 @@ namespace RJW_Menstruation { List removeList = new List(); if (!HybridOverride.NullOrEmpty()) - foreach(HybridInformations o in HybridOverride) + foreach (HybridInformations o in HybridOverride) { if (o.IsNull) removeList.Add(o); if (o.DefName == def.defName) return true; } if (!removeList.NullOrEmpty()) { - foreach(HybridInformations o in removeList) + foreach (HybridInformations o in removeList) { HybridOverride.Remove(o); } @@ -226,7 +226,7 @@ namespace RJW_Menstruation base.ExposeData(); } - + } @@ -300,7 +300,7 @@ namespace RJW_Menstruation { wombsection.CheckboxLabeled(Translations.Option18_Label, ref Configurations.DrawEggOverlay, Translations.Option18_Desc); } - + wombsection.CheckboxLabeled(Translations.Option10_Label, ref Configurations.DrawVaginaStatus, Translations.Option10_Desc); wombsection.CheckboxLabeled(Translations.Option29_Label, ref Configurations.AllowShrinkIcon, Translations.Option29_Desc); if (wombsection.ButtonText(Translations.Option11_Label + ": " + Configurations.LevelString(Configurations.infoDetail))) @@ -353,17 +353,17 @@ namespace RJW_Menstruation } Adjust = (int)(Configurations.NippleTransitionVariance * 1000); - wombsection.Label(Translations.Option24_Label + " " + Configurations.NippleTransitionVariance* 100 + " / 100", -1,Translations.Option24_Desc); - Adjust = (int)wombsection.Slider(Adjust,0,1000); + wombsection.Label(Translations.Option24_Label + " " + Configurations.NippleTransitionVariance * 100 + " / 100", -1, Translations.Option24_Desc); + Adjust = (int)wombsection.Slider(Adjust, 0, 1000); Configurations.NippleTransitionVariance = (float)Adjust / 1000; Adjust = (int)(Configurations.NipplePermanentTransitionVariance * 1000); - wombsection.Label(Translations.Option25_Label + " " + Configurations.NipplePermanentTransitionVariance*100 + " / 100", -1, Translations.Option25_Desc); + wombsection.Label(Translations.Option25_Label + " " + Configurations.NipplePermanentTransitionVariance * 100 + " / 100", -1, Translations.Option25_Desc); Adjust = (int)wombsection.Slider(Adjust, 0, 1000); Configurations.NipplePermanentTransitionVariance = (float)Adjust / 1000; Adjust = (int)(Configurations.NippleMaximumTransition * 1000); - wombsection.Label(Translations.Option26_Label + " " + Configurations.NippleMaximumTransition* 100 + " / 100", -1, Translations.Option26_Desc); + wombsection.Label(Translations.Option26_Label + " " + Configurations.NippleMaximumTransition * 100 + " / 100", -1, Translations.Option26_Desc); Adjust = (int)wombsection.Slider(Adjust, 0, 1000); Configurations.NippleMaximumTransition = (float)Adjust / 1000; diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs index c9e4704..d969e18 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs @@ -178,7 +178,7 @@ namespace RJW_Menstruation cumthickness = cumthickness.LerpMultiple(DecayResist, 0.3f, speed); } - public void MergeWithCum(float volumein, float fertility, ThingDef updatefilthDef = null) + public void MergeWithCum(float volumein, float fertility, ThingDef updatefilthDef = null) { if (updatefilthDef != null) filthDef = updatefilthDef; volume += volumein; @@ -210,11 +210,11 @@ namespace RJW_Menstruation totalleak -= volume; return totalleak; } - + public float DismishForce(float portion, float leakfactor = 1.0f) { float totalleak = volume; - volume *= Math.Max(0, 1 - (portion * (1 - DecayResist/10)) * leakfactor); + volume *= Math.Max(0, 1 - (portion * (1 - DecayResist / 10)) * leakfactor); CutMinor(); totalleak -= volume; return totalleak; @@ -227,9 +227,9 @@ namespace RJW_Menstruation List doers = DNA.ingestionOutcomeDoers; if (!doers.NullOrEmpty()) for (int i = 0; i < doers.Count; i++) - { - doers[i].DoIngestionOutcome(pawn, CumThing); - } + { + doers[i].DoIngestionOutcome(pawn, CumThing); + } } protected void CutMinor() @@ -250,7 +250,7 @@ namespace RJW_Menstruation cums = new List(); } - public CumMixture(Pawn pawn, float volume, List cums, Color color, ThingDef mixtureDef, bool pure) + public CumMixture(Pawn pawn, float volume, List cums, Color color, ThingDef mixtureDef, bool pure) { this.pawn = pawn; this.volume = volume; @@ -263,7 +263,7 @@ namespace RJW_Menstruation public void Dispose() { cums.Clear(); - + } public override void ExposeData() @@ -275,11 +275,11 @@ namespace RJW_Menstruation public string GetIngredients() { string res = ""; - if (!cums.NullOrEmpty()) for(int i=0; i /// /// - public CumMixture MixtureOut(ThingDef mixtureDef ,float portion = 0.1f) + public CumMixture MixtureOut(ThingDef mixtureDef, float portion = 0.1f) { if (cums.NullOrEmpty()) return null; Color color = GetCumMixtureColor; @@ -848,7 +848,7 @@ namespace RJW_Menstruation cums.Clear(); } - + /// /// Fertilize eggs and return the result /// @@ -878,7 +878,7 @@ namespace RJW_Menstruation loaded = true; return; } - + if (cycleSpeed < 0f) cycleSpeed = Utility.RandGaussianLike(0.8f, 1.2f); if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent(); if (currentIntervalHours < 0) @@ -1085,10 +1085,10 @@ namespace RJW_Menstruation float mostCum = 0; Pawn mostCummer = null; - + foreach (Cum cum in eligibleCum) { - if(cum.FertVolume > mostCum) + if (cum.FertVolume > mostCum) { mostCum = cum.FertVolume; mostCummer = cum.pawn; @@ -1098,7 +1098,7 @@ namespace RJW_Menstruation return mostCummer; } - + protected bool Implant() { if (eggs.NullOrEmpty()) return false; @@ -1279,7 +1279,7 @@ namespace RJW_Menstruation protected virtual void FollicularAction(bool climacteric) { - if(climacteric && !Configurations.EnableMenopause) + if (climacteric && !Configurations.EnableMenopause) { RemoveClimactericEffect(); StayCurrentStage(); @@ -1293,7 +1293,7 @@ namespace RJW_Menstruation { GoNextStage(Stage.Ovulatory); } - else if(climacteric && ovarypower < OvaryPowerThreshold / 3 && Rand.Range(0.0f, 1.0f) < 0.2f) //skips ovulatory + else if (climacteric && ovarypower < OvaryPowerThreshold / 3 && Rand.Range(0.0f, 1.0f) < 0.2f) //skips ovulatory { GoNextStage(Stage.ClimactericLuteal); } @@ -1318,11 +1318,11 @@ namespace RJW_Menstruation { eggnum = Rand.ByCurve(parent.pawn.RaceProps.litterSizeCurve); } - catch(NullReferenceException) + catch (NullReferenceException) { eggnum = 1; } - catch(ArgumentException e) + catch (ArgumentException e) { Log.Warning($"Invalid litterSizeCurve for {parent.pawn.RaceProps}: {e}"); eggnum = 1; @@ -1410,7 +1410,7 @@ namespace RJW_Menstruation curStageHrs += Configurations.CycleAcceleration; StayCurrentStage(); } - + } protected virtual void BleedingAction(bool climacteric) @@ -1467,7 +1467,7 @@ namespace RJW_Menstruation Breast.BirthTransition(); } GoNextStage(Stage.Recover); - } + } } protected virtual void RecoverAction() @@ -1659,7 +1659,7 @@ namespace RJW_Menstruation actionref = action; return actionref; - + } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs index bbe01c2..f721c3e 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -1,12 +1,10 @@ -using System; +using RimWorld; +using rjw; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using RimWorld; -using Verse; -using rjw; using UnityEngine; +using Verse; namespace RJW_Menstruation { @@ -103,7 +101,7 @@ namespace RJW_Menstruation if (!fucker.RaceHasPregnancy() || !fucked.RaceHasPregnancy()) return false; if (!Genital_Helper.has_penis_fertile(fucker, fucker.GetGenitalsList())) return false; - + if (xxx.is_human(fucked) && xxx.is_human(fucker) && !RJWPregnancySettings.humanlike_pregnancy_enabled) return false; if (xxx.is_animal(fucker) != xxx.is_animal(fucked) && !RJWPregnancySettings.bestial_pregnancy_enabled) return false; @@ -203,7 +201,7 @@ namespace RJW_Menstruation else return ContentFinder.Get("Womb/Empty", true); } - switch(comp.curStage) + switch (comp.curStage) { case HediffComp_Menstruation.Stage.Follicular: case HediffComp_Menstruation.Stage.ClimactericFollicular: @@ -279,7 +277,7 @@ namespace RJW_Menstruation { var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("anus")); if (hediff == null) return ContentFinder.Get(("Genitals/Anal00"), true); - + string icon; float severity; HediffComp_Anus comp = hediff.GetAnusComp(); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index 31cfca3..41318d8 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -75,7 +75,7 @@ namespace RJW_Menstruation { if (babies.NullOrEmpty()) return "Null"; - + string res = ""; var babiesdistinct = babies.Distinct(new RaceComparer()); @@ -155,7 +155,7 @@ namespace RJW_Menstruation baby.relations.AddDirectRelation(PawnRelationDefOf.Sibling, sibling); } siblings.Add(baby); - + PostBirth(mother, father, baby); } @@ -302,7 +302,7 @@ namespace RJW_Menstruation protected void Train(Pawn baby, Pawn mother) { if (xxx.is_human(baby) || baby.Faction != Faction.OfPlayer) return; - + if (xxx.is_human(mother) && baby.Faction == Faction.OfPlayer && baby.training.CanAssignToTrain(TrainableDefOf.Obedience, out _).Accepted) { baby.training.Train(TrainableDefOf.Obedience, mother); @@ -357,7 +357,7 @@ namespace RJW_Menstruation kind: BabyPawnKindDecider(mother, father), //fixedIdeo: mother.Ideo, //forbidAnyTitle: true, - forceNoBackstory:true + forceNoBackstory: true ); int division = 1; @@ -368,7 +368,7 @@ namespace RJW_Menstruation string firstheadpath = null; string firstHARcrown = null; int traitSeed = Rand.Int; - List parentTraits = GetInheritableTraits(mother, father); + List parentTraits = GetInheritableTraits(mother, father); while (Rand.Chance(Configurations.EnzygoticTwinsChance) && division < Configurations.MaxEnzygoticTwins) division++; for (int i = 0; i < division; i++) { @@ -638,7 +638,7 @@ namespace RJW_Menstruation parentTraitPool.RemoveAll(x => x.ScenForced); int numberInherited; if (parentTraitPool != null) - numberInherited = System.Math.Min(parentTraitPool.Count(), Rand.RangeInclusive(0,2)); // Not 3; give a better chance for a natural trait to appear + numberInherited = System.Math.Min(parentTraitPool.Count(), Rand.RangeInclusive(0, 2)); // Not 3; give a better chance for a natural trait to appear else numberInherited = 0; @@ -669,7 +669,7 @@ namespace RJW_Menstruation if (!selectedTraits.Any(x => comparer.Equals(x, trait) || // skipping traits conflicting with already added x.def.ConflictsWith(trait))) selectedTraits.Add(new Trait(trait.def, trait.Degree, false)); - + } pawn.story.traits.allTraits = selectedTraits; diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/IngestionOutcomeDoers.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/IngestionOutcomeDoers.cs index 6ca0713..0ebf299 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/IngestionOutcomeDoers.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/IngestionOutcomeDoers.cs @@ -1,24 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using RimWorld; +using RimWorld; using Verse; -using rjw; namespace RJW_Menstruation { public class IngestionOutcomeDoer_GiveHediff_StackCount : IngestionOutcomeDoer_GiveHediff - { - protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) - { - Hediff hediff = HediffMaker.MakeHediff(hediffDef, pawn); - float effect = ((!(severity > 0f)) ? hediffDef.initialSeverity : severity) * ingested.stackCount; - AddictionUtility.ModifyChemicalEffectForToleranceAndBodySize(pawn, toleranceChemical, ref effect); - hediff.Severity = effect; - pawn.health.AddHediff(hediff); - } + { + protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) + { + Hediff hediff = HediffMaker.MakeHediff(hediffDef, pawn); + float effect = ((!(severity > 0f)) ? hediffDef.initialSeverity : severity) * ingested.stackCount; + AddictionUtility.ModifyChemicalEffectForToleranceAndBodySize(pawn, toleranceChemical, ref effect); + hediff.Severity = effect; + pawn.health.AddHediff(hediff); + } } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/JobDrivers.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/JobDrivers.cs index 876e1ee..99cae05 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/JobDrivers.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/JobDrivers.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using RimWorld; +using System.Collections.Generic; using System.Linq; -using RimWorld; using Verse; using Verse.AI; @@ -108,7 +108,7 @@ namespace RJW_Menstruation protected virtual void Finish() { - if(pawn.CurJobDef == JobDefOf.Wait_MaintainPosture) + if (pawn.CurJobDef == JobDefOf.Wait_MaintainPosture) { pawn.jobs.EndCurrentJob(JobCondition.InterruptForced); } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GC_Patch.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GC_Patch.cs index d92add8..79e7be5 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GC_Patch.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GC_Patch.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using System.Linq; -using HarmonyLib; -using Verse; +using HarmonyLib; using RimWorld; using RimWorld.Planet; +using System.Collections.Generic; +using System.Linq; +using Verse; namespace RJW_Menstruation.Patch { @@ -26,8 +26,8 @@ namespace RJW_Menstruation.Patch public static void Prefix() { GetCriticalPawnReason_Patch.cummedPawns.Clear(); -// foreach(Pawn p in PawnsFinder.All_AliveOrDead) - foreach(Pawn p in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_OfPlayerFaction.Union(PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_PrisonersOfColony)) + // foreach(Pawn p in PawnsFinder.All_AliveOrDead) + foreach (Pawn p in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_OfPlayerFaction.Union(PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_PrisonersOfColony)) { foreach (HediffComp_Menstruation comp in p.GetMenstruationComps()) GetCriticalPawnReason_Patch.cummedPawns.UnionWith(comp.GetCummersAndFertilizers()); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs index a15dca0..75ec1b2 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs @@ -100,7 +100,7 @@ namespace RJW_Menstruation Dialog_WombStatus.ToggleWindow(pawn, comp); } }; - + return gizmo; } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs index 334aca5..4362d13 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs @@ -2,10 +2,8 @@ using HugsLib; using RimWorld; using System.Collections.Generic; -using System.Linq; using UnityEngine; using Verse; -using rjw; namespace RJW_Menstruation { diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs index 037fc25..78b0248 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs @@ -2,12 +2,12 @@ using rjw; using rjw.Modules.Interactions.Enums; using rjw.Modules.Interactions.Objects; -using Verse; -using UnityEngine; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Emit; +using UnityEngine; +using Verse; namespace RJW_Menstruation { @@ -130,7 +130,7 @@ namespace RJW_Menstruation if (Configurations.EnableBirthVaginaMorph) { Hediff vagina = mother.health.hediffSet.hediffs.FirstOrFallback(x => x.def.defName.ToLower().Contains("vagina")); - float morph = Mathf.Max(baby.BodySize - Mathf.Pow(vagina.Severity * mother.BodySize,2), 0f); + float morph = Mathf.Max(baby.BodySize - Mathf.Pow(vagina.Severity * mother.BodySize, 2), 0f); vagina.Severity += morph * Configurations.VaginaMorphPower; } } @@ -197,7 +197,7 @@ namespace RJW_Menstruation { __result *= (1f + GetNetFertility(fucker, fucked) / 40); } - else if(xxx.is_animal(fucker) && fucked.IsInEstrus(true) && MenstruationUtility.CanFertilize(fucker, fucked)) + else if (xxx.is_animal(fucker) && fucked.IsInEstrus(true) && MenstruationUtility.CanFertilize(fucker, fucked)) { __result *= 1.25f; } @@ -217,9 +217,9 @@ namespace RJW_Menstruation public static IEnumerable Transpiler(IEnumerable instructions) { bool first_fuckability = true; - foreach(CodeInstruction instruction in instructions) + foreach (CodeInstruction instruction in instructions) { - if(instruction.LoadsField(MinimumFuckabilityToHookup)) + if (instruction.LoadsField(MinimumFuckabilityToHookup)) { // The first load will be for the estrus-haver considering a partner, the second for a pawn considering the estrus-haver yield return new CodeInstruction(first_fuckability ? OpCodes.Ldarg_0 : OpCodes.Ldarg_1); @@ -255,7 +255,7 @@ namespace RJW_Menstruation // Like in the last one, we switch the arguments around for the second load bool first_attractiveness = true; bool first_relationship = true; - foreach(CodeInstruction instruction in instructions) + foreach (CodeInstruction instruction in instructions) { // Get where the compiler decided to index the pawn at if (pawn_index == null && instruction.opcode == OpCodes.Stloc_S) // the first stloc.s in the IL is the pawn being loaded out of the list @@ -273,7 +273,7 @@ namespace RJW_Menstruation yield return CodeInstruction.Call(typeof(FindBestPartner_Patch), nameof(AttractivenessThreshold)); first_attractiveness = false; - } + } else if (instruction.LoadsField(MinimumRelationshipToHookup)) { if (pawn_index?.LocalType != typeof(Pawn)) diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Recipe_Surgery.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Recipe_Surgery.cs index 89ed888..6a1f8b8 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Recipe_Surgery.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Recipe_Surgery.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using RimWorld; -using Verse; +using RimWorld; using rjw; +using System.Collections.Generic; +using Verse; namespace RJW_Menstruation @@ -23,7 +19,7 @@ namespace RJW_Menstruation BodyPartRecord part = Genital_Helper.get_breastsBPR(pawn); if (part != null) { - + if (pawn.GetBreastComp() != null) yield return part; } } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Reflect.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Reflect.cs index 1289c0f..8df18e6 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Reflect.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Reflect.cs @@ -22,14 +22,14 @@ namespace RJW_Menstruation public static object GetPropertyValue(this Type type, string name) { BindingFlags flags = BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; - PropertyInfo propertyInfo = type?.GetProperty(name,flags); + PropertyInfo propertyInfo = type?.GetProperty(name, flags); return propertyInfo?.GetValue(null); } public static object GetPropertyValue(this object obj, string name) { BindingFlags flags = BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; - PropertyInfo propertyInfo = obj?.GetType().GetProperty(name,flags); + PropertyInfo propertyInfo = obj?.GetType().GetProperty(name, flags); return propertyInfo?.GetValue(obj); } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/TextureCache.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/TextureCache.cs index 937fdb9..f383986 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/TextureCache.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/TextureCache.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using RimWorld; +using UnityEngine; using Verse; -using UnityEngine; namespace RJW_Menstruation { diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Things.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Things.cs index 9f84f0c..e427e0f 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Things.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Things.cs @@ -1,8 +1,7 @@ -using System; -using System.Xml; -using System.Collections.Generic; -using RimWorld; +using RimWorld; using rjw; +using System.Collections.Generic; +using System.Xml; using UnityEngine; using Verse; @@ -64,14 +63,14 @@ namespace RJW_Menstruation { DirectXmlCrossRefLoader.RegisterObjectWantsCrossRef(this, "thingDef", xmlRoot.Name); XmlNodeList childNodes = xmlRoot.ChildNodes; - + if (childNodes.Count >= 1) foreach (XmlNode node in childNodes) - { - #if DEBUG + { +#if DEBUG Log.Message(xmlRoot.Name + "HybridInfo: " + node.Name + " " + node.InnerText); - #endif - hybridInfo.Add(node.Name, ParseHelper.FromString(node.InnerText)); - } +#endif + hybridInfo.Add(node.Name, ParseHelper.FromString(node.InnerText)); + } } } @@ -211,7 +210,7 @@ namespace RJW_Menstruation public virtual void WearEffect() { absorbedfluids += 0.1f; - if(dirty) wearhours++; + if (dirty) wearhours++; } public override Color DrawColorTwo => fluidColor; @@ -232,7 +231,7 @@ namespace RJW_Menstruation public override void WearEffect() { - if(dirty) wearhours++; + if (dirty) wearhours++; absorbedfluids += 0.5f; } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs index 6c395f7..6189613 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs @@ -99,23 +99,23 @@ namespace RJW_Menstruation public static readonly string Option23_Label_1 = "Option23_Label_1".Translate(); public static readonly string Option23_Label_2 = "Option23_Label_2".Translate(); public static readonly string Option24_Label = "Option24_Label".Translate(); - public static readonly string Option24_Desc = "Option24_Desc".Translate(); + public static readonly string Option24_Desc = "Option24_Desc".Translate(); public static readonly string Option25_Label = "Option25_Label".Translate(); - public static readonly string Option25_Desc = "Option25_Desc".Translate(); + public static readonly string Option25_Desc = "Option25_Desc".Translate(); public static readonly string Option26_Label = "Option26_Label".Translate(); - public static readonly string Option26_Desc = "Option26_Desc".Translate(); + public static readonly string Option26_Desc = "Option26_Desc".Translate(); public static readonly string Option27_Label = "Option27_Label".Translate(); - public static readonly string Option27_Desc = "Option27_Desc".Translate(); + public static readonly string Option27_Desc = "Option27_Desc".Translate(); public static readonly string Option28_Label = "Option28_Label".Translate(); public static readonly string Option28_Tooltip = "Option28_Tooltip".Translate(); public static readonly string Option29_Label = "Option29_Label".Translate(); - public static readonly string Option29_Desc = "Option29_Desc".Translate(); + public static readonly string Option29_Desc = "Option29_Desc".Translate(); public static readonly string Option30_Label = "Option30_Label".Translate(); - public static readonly string Option30_Desc = "Option30_Desc".Translate(); + public static readonly string Option30_Desc = "Option30_Desc".Translate(); public static readonly string Option31_Label = "Option31_Label".Translate(); - public static readonly string Option31_Desc = "Option31_Desc".Translate(); + public static readonly string Option31_Desc = "Option31_Desc".Translate(); public static readonly string Option32_Label = "Option32_Label".Translate(); - public static readonly string Option32_Desc = "Option32_Desc".Translate(); + public static readonly string Option32_Desc = "Option32_Desc".Translate(); public static readonly string Option_EnableGatherCumGizmo_Label = "Option_EnableGatherCumGizmo_Label".Translate(); public static readonly string Option_EstrusOverride_Label = "Option_EstrusOverride_Label".Translate(); public static readonly string Option_EstrusOverride_Desc = "Option_EstrusOverride_Desc".Translate(); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs index 8bcf63e..0a74f35 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs @@ -1,10 +1,7 @@ -using System; +using RimWorld; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using RimWorld; -using rjw; using UnityEngine; using Verse; using Verse.Sound; @@ -26,8 +23,8 @@ namespace RJW_Menstruation public void BuildRaceList() { raceList.Clear(); - if (!VariousDefOf.AllRaces.NullOrEmpty()) - foreach(ThingDef def in VariousDefOf.AllRaces) + if (!VariousDefOf.AllRaces.NullOrEmpty()) + foreach (ThingDef def in VariousDefOf.AllRaces) { if (def.race == null || Configurations.IsOverrideExist(def)) continue; raceList.Add(new FloatMenuOption(def.label, delegate { AddHybridOverride(def); }, def.uiIcon, Color.white)); @@ -130,17 +127,17 @@ namespace RJW_Menstruation } - + Rect outRect = new Rect(inRect.x, inRect.y + 30f, inRect.width, inRect.height - 30f); - Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, Math.Max(24f*Configurations.HybridOverride?.Count() ?? 1,10f)); + Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, Math.Max(24f * Configurations.HybridOverride?.Count() ?? 1, 10f)); Listing_Standard listmain = new Listing_Standard(); - + Widgets.BeginScrollView(outRect, ref scroll, mainRect); listmain.Begin(mainRect); - if (!Configurations.HybridOverride.NullOrEmpty()) - foreach(HybridInformations extension in Configurations.HybridOverride) + if (!Configurations.HybridOverride.NullOrEmpty()) + foreach (HybridInformations extension in Configurations.HybridOverride) { - if (extension.GetDef != null) DoRow(listmain.GetRect(24f),extension); + if (extension.GetDef != null) DoRow(listmain.GetRect(24f), extension); } Widgets.EndScrollView(); listmain.End(); @@ -258,7 +255,7 @@ namespace RJW_Menstruation SoundDefOf.TabClose.PlayOneShotOnCamera(); Find.WindowStack.Add(new Dialog_EditHybrid(info)); } - + } @@ -272,7 +269,7 @@ namespace RJW_Menstruation { raceList.Clear(); if (VariousDefOf.AllRaces.NullOrEmpty()) return; - + foreach (ThingDef def in VariousDefOf.AllRaces) { if (def.race != null) @@ -317,7 +314,7 @@ namespace RJW_Menstruation info.hybridExtension.Add(element); removeList.Remove(element); } - + foreach (HybridExtensionExposable element in removeList) { info.hybridExtension.Remove(element); @@ -326,7 +323,7 @@ namespace RJW_Menstruation float additionalHeight = 0f; - if (!info.hybridExtension.NullOrEmpty()) foreach(HybridExtensionExposable e in info.hybridExtension) + if (!info.hybridExtension.NullOrEmpty()) foreach (HybridExtensionExposable e in info.hybridExtension) { additionalHeight += (e.hybridInfo?.Count() ?? 1) * rowH; } @@ -349,7 +346,7 @@ namespace RJW_Menstruation } - + Widgets.EndScrollView(); listmain.End(); } @@ -369,7 +366,7 @@ namespace RJW_Menstruation if (Widgets.ButtonText(buttonRect, "Add")) { List list = new List(); - if (!VariousDefOf.AllRaces.NullOrEmpty()) foreach(ThingDef def in VariousDefOf.AllRaces) + if (!VariousDefOf.AllRaces.NullOrEmpty()) foreach (ThingDef def in VariousDefOf.AllRaces) { if (def.race != null) { @@ -385,7 +382,7 @@ namespace RJW_Menstruation list.SortBy(x => x.Label); Find.WindowStack.Add(new FloatMenu(list)); } - + } buttonRect.x -= 80f; @@ -396,18 +393,18 @@ namespace RJW_Menstruation if (!extension.hybridInfo.EnumerableNullOrEmpty()) { totalWeight = 0; - foreach(KeyValuePair element in extension.hybridInfo) + foreach (KeyValuePair element in extension.hybridInfo) { totalWeight += element.Value; } - + List keys = new List(extension.hybridInfo.Keys); foreach (string key in keys) { DoSubRow(sublist.GetRect(rowH), key, extension, removeelements); } } - if(!removeelements.NullOrEmpty()) foreach(string key in removeelements) + if (!removeelements.NullOrEmpty()) foreach (string key in removeelements) { extension.hybridInfo.Remove(key); } @@ -418,7 +415,7 @@ namespace RJW_Menstruation } - protected void DoSubRow(Rect rect, string key, HybridExtensionExposable extension , List removeelements) + protected void DoSubRow(Rect rect, string key, HybridExtensionExposable extension, List removeelements) { bool isPawnKind = false; int value = (int)extension.hybridInfo.TryGetValue(key); @@ -464,15 +461,15 @@ namespace RJW_Menstruation } label += ": " + key; Widgets.Label(rect, " - " + label); - Widgets.TextFieldNumeric(buttonRect, ref value, ref valuestr,0,9999999); + Widgets.TextFieldNumeric(buttonRect, ref value, ref valuestr, 0, 9999999); extension.hybridInfo.SetOrAdd(key, value); buttonRect.x -= 80f; Widgets.Label(buttonRect, String.Format("{0,0:P2}", value / totalWeight)); Widgets.DrawHighlightIfMouseover(rect); - TooltipHandler.TipRegion(rect, Translations.CustomHybrid_Tooltip(info.GetDef?.label ?? "Undefined", extension.GetDef?.label ?? "Undefined", label, String.Format("{0,0:0.########%}", value/totalWeight))); + TooltipHandler.TipRegion(rect, Translations.CustomHybrid_Tooltip(info.GetDef?.label ?? "Undefined", extension.GetDef?.label ?? "Undefined", label, String.Format("{0,0:0.########%}", value / totalWeight))); } - + } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs index 3bcd7c9..f684a0f 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs @@ -1,7 +1,7 @@ -using System; -using System.Collections.Generic; -using RimWorld; +using RimWorld; using rjw; +using System; +using System.Collections.Generic; using System.Linq; using UnityEngine; using Verse; @@ -229,7 +229,7 @@ namespace RJW_Menstruation if (pawn.story != null) GUI.Label(pawnLabel2Rect, pawn.ageTracker.AgeBiologicalYears + ", " + pawn.story.Title, fontstylecenter); GUI.color = Color.white; - + float wombrecth = 0; if (Configurations.DrawWombStatus) { @@ -248,7 +248,7 @@ namespace RJW_Menstruation } Rect wombInfoRect = new Rect(0f, mainRect.yMax - wombrecth - fontheight - 2, wombRectWidth, fontheight - 4f); - Rect progressRect = new Rect(wombInfoRect.x,wombInfoRect.yMax,wombRectWidth, 4f); + Rect progressRect = new Rect(wombInfoRect.x, wombInfoRect.yMax, wombRectWidth, 4f); buttonstyle.normal.textColor = Color.white; //boxstyle.normal.background = Texture2D.whiteTexture; buttonstyle.alignment = TextAnchor.MiddleLeft; @@ -285,7 +285,7 @@ namespace RJW_Menstruation cumlistRect = new Rect(pawnRectWidth, fontheight, 150f, mainRect.yMax - wombRectHeight - fontheight); } - Rect infoRect = new Rect(0, pawnRectHeight + 2*fontheight, pawnRectWidth, pawnRect.yMax + 2*fontheight - wombInfoRect.y); + Rect infoRect = new Rect(0, pawnRectHeight + 2 * fontheight, pawnRectWidth, pawnRect.yMax + 2 * fontheight - wombInfoRect.y); DrawInfos(infoRect); @@ -368,7 +368,7 @@ namespace RJW_Menstruation GUI.color = new Color(1.00f, 0.47f, 0.47f, 1); GUI.Box(rect, "", boxstyle); - + pawn.DrawBreastIcon(BreastIconRect, Mouse.IsOver(BreastIconRect) && Input.GetMouseButton(0)); @@ -387,11 +387,11 @@ namespace RJW_Menstruation float statvalue; const float height = 24f; statvalue = pawn.GetStatValue(xxx.sex_drive_stat); - FillableBarLabeled(lineRect, " " + xxx.sex_drive_stat.LabelCap.CapitalizeFirst() + " " + statvalue.ToStringPercent(), statvalue/2 ,TextureCache.SlaaneshTexture,Texture2D.blackTexture, xxx.sex_drive_stat.description); + FillableBarLabeled(lineRect, " " + xxx.sex_drive_stat.LabelCap.CapitalizeFirst() + " " + statvalue.ToStringPercent(), statvalue / 2, TextureCache.SlaaneshTexture, Texture2D.blackTexture, xxx.sex_drive_stat.description); lineRect.y += height; statvalue = pawn.GetStatValue(xxx.vulnerability_stat); - FillableBarLabeled(lineRect, " " + xxx.vulnerability_stat.LabelCap.CapitalizeFirst() + " " + statvalue.ToStringPercent(), statvalue/2, TextureCache.KhorneTexture,Texture2D.blackTexture, xxx.vulnerability_stat.description); + FillableBarLabeled(lineRect, " " + xxx.vulnerability_stat.LabelCap.CapitalizeFirst() + " " + statvalue.ToStringPercent(), statvalue / 2, TextureCache.KhorneTexture, Texture2D.blackTexture, xxx.vulnerability_stat.description); lineRect.y += height; statvalue = pawn.GetStatValue(xxx.sex_stat); @@ -417,7 +417,7 @@ namespace RJW_Menstruation statvalue = pawn.records.GetValue(xxx.EarnedMoneyByWhore); lineRect.y += height; FillableBarLabeled(lineRect, " " + VariousDefOf.RJW_EarnedMoneyByWhore.label.CapitalizeFirst() + " " + statvalue, statvalue / 10000, TextureCache.GhalmarazTexture, Texture2D.blackTexture); - + lineRect.y += height; } else @@ -428,7 +428,7 @@ namespace RJW_Menstruation statvalue = Configurations.ImplantationChance * comp.ImplantFactor; float fertchance = comp.GetFertilityChance(); - FillableBarLabeled(lineRect, " " + xxx.reproduction.LabelCap.CapitalizeFirst() + " " + statvalue.ToStringPercent(), statvalue, TextureCache.FertilityTexture, Texture2D.blackTexture, Translations.FertilityDesc(String.Format("{0:0.##}", fertchance*100))); + FillableBarLabeled(lineRect, " " + xxx.reproduction.LabelCap.CapitalizeFirst() + " " + statvalue.ToStringPercent(), statvalue, TextureCache.FertilityTexture, Texture2D.blackTexture, Translations.FertilityDesc(String.Format("{0:0.##}", fertchance * 100))); Rect overayRect = new Rect(lineRect.x, lineRect.y, lineRect.width * Math.Min(1.0f, fertchance), lineRect.height); GUI.DrawTexture(overayRect, TextureCache.FertChanceTex); lineRect.y += height; @@ -436,7 +436,7 @@ namespace RJW_Menstruation private void FillableBarLabeled(Rect rect, string label, float fillPercent, Texture2D filltexture, Texture2D bgtexture, string tooltip = null) { - Widgets.FillableBar(rect, Math.Min(fillPercent,1.0f), filltexture, bgtexture, true); + Widgets.FillableBar(rect, Math.Min(fillPercent, 1.0f), filltexture, bgtexture, true); GUI.Label(rect, label, fontstyleleft); Widgets.DrawHighlightIfMouseover(rect); if (tooltip != null) TooltipHandler.TipRegion(rect, tooltip); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Gizmo_Womb.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Gizmo_Womb.cs index 57f8dd1..7b60c02 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Gizmo_Womb.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/UI/Gizmo_Womb.cs @@ -37,7 +37,7 @@ namespace RJW_Menstruation Widgets.FillableBar(progressRect, comp.StageProgress, comp.GetStageTexture); } - + diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index 3fd8e10..2e3eb59 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -1,13 +1,11 @@ using RimWorld; using rjw; using System; -using System.Linq; using System.Collections.Generic; +using System.Linq; using UnityEngine; using Verse; using Verse.Sound; -using System.Threading; -using System.Threading.Tasks; namespace RJW_Menstruation @@ -16,7 +14,7 @@ namespace RJW_Menstruation { public static Color blood = new Color(0.78f, 0, 0); //public static Color nippleblack = new Color(0.215f, 0.078f, 0); // 81,20,0 - public static ColorInt white = new ColorInt(255,255,255,255); + public static ColorInt white = new ColorInt(255, 255, 255, 255); @@ -52,7 +50,7 @@ namespace RJW_Menstruation public static System.Random random = new System.Random(Environment.TickCount); - + public static float GetCumVolume(this Pawn pawn) { @@ -97,7 +95,7 @@ namespace RJW_Menstruation var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn))?.FindAll((Hediff h) => h is Hediff_PartBaseNatural || h is Hediff_PartBaseArtifical); HediffComp_Breast result; if (hedifflist.NullOrEmpty()) return null; - foreach(Hediff h in hedifflist) + foreach (Hediff h in hedifflist) { result = h.TryGetComp(); if (result != null) return result; @@ -161,10 +159,10 @@ namespace RJW_Menstruation Log.Error("Baby not exist: baby was not created or removed. Remove pregnancy."); comp.Pregnancy.Miscarry(); return null; - } + } } - public static void DrawBreastIcon(this Pawn pawn, Rect rect , bool drawOrigin = false) + public static void DrawBreastIcon(this Pawn pawn, Rect rect, bool drawOrigin = false) { var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("breast")); Texture2D breast, nipple, areola; @@ -209,7 +207,7 @@ namespace RJW_Menstruation nippleicon = icon + "_Nipple0" + GetNippleIndex(nipplesize); areolaicon = icon + "_Areola0" + GetAreolaIndex(areolasize); - + breast = ContentFinder.Get(icon, false); areola = ContentFinder.Get(areolaicon, false); @@ -306,12 +304,12 @@ namespace RJW_Menstruation } } - public static void DrawMilkBottle(Rect rect, Pawn pawn, JobDef milkjob,float fullness) + public static void DrawMilkBottle(Rect rect, Pawn pawn, JobDef milkjob, float fullness) { Texture2D texture; Rect buttonrect = new Rect(rect.x, rect.y, rect.height, rect.height); if (fullness <= 0.0f) return; - + if (fullness < 0.3f) texture = ContentFinder.Get("Milk/Milkbottle_Small", false); else if (fullness < 0.7f) texture = ContentFinder.Get("Milk/Milkbottle_Medium", false); else texture = ContentFinder.Get("Milk/Milkbottle_Large", false); @@ -414,7 +412,7 @@ namespace RJW_Menstruation } res /= iterations; - return (float)res*(max-min) + min; + return (float)res * (max - min) + min; } @@ -423,7 +421,7 @@ namespace RJW_Menstruation float tmult = Mathf.Pow(1 - t, num); return tmult * a + (1 - tmult) * b; } - + public static float VariationRange(this float num, float variant) { return num * Rand.Range(1.0f - variant, 1.0f + variant); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs index fcd923f..9d3cd61 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -1,8 +1,7 @@ using RimWorld; using rjw; -using System.Linq; -using System; using System.Collections.Generic; +using System.Linq; using Verse; namespace RJW_Menstruation @@ -56,7 +55,7 @@ namespace RJW_Menstruation get { if (allraces != null) return allraces; - + List allThings = DefDatabase.AllDefsListForReading; allraces = allThings.FindAll(x => x.race != null && x.race.IsFlesh); return allraces; diff --git a/1.3/source/RJW_Menstruation/SexperienceModule/GatheredCumMixture.cs b/1.3/source/RJW_Menstruation/SexperienceModule/GatheredCumMixture.cs index 1600282..b40ef61 100644 --- a/1.3/source/RJW_Menstruation/SexperienceModule/GatheredCumMixture.cs +++ b/1.3/source/RJW_Menstruation/SexperienceModule/GatheredCumMixture.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; -using RimWorld; -using RJWSexperience; -using RJW_Menstruation; +using System.Collections.Generic; using UnityEngine; +using Verse; namespace RJW_Menstruation.Sexperience { @@ -34,8 +27,8 @@ namespace RJW_Menstruation.Sexperience if (res && other is GatheredCumMixture mixture) { GatheredCumMixture othercum = mixture; - cumColor = Colors.CMYKLerp(cumColor,othercum.cumColor,count/(amount+count)); - if (!othercum.ingredients.NullOrEmpty()) for (int i=0; i comp.TotalCumPercent > 0.001f)) - foreach (LocalTargetInfo t in targets) - { - if (t.Thing is Building building) + foreach (LocalTargetInfo t in targets) { - if (building is Building_CumBucket) + if (t.Thing is Building building) { - opts.AddDistinct(MakeMenu(pawn, building)); - break; + if (building is Building_CumBucket) + { + opts.AddDistinct(MakeMenu(pawn, building)); + break; + } } } - } } public static FloatMenuOption MakeMenu(Pawn pawn, LocalTargetInfo target) diff --git a/1.3/source/RJW_Menstruation/SexperienceModule/Patch/RJW_Patch.cs b/1.3/source/RJW_Menstruation/SexperienceModule/Patch/RJW_Patch.cs index 483a343..b8d536e 100644 --- a/1.3/source/RJW_Menstruation/SexperienceModule/Patch/RJW_Patch.cs +++ b/1.3/source/RJW_Menstruation/SexperienceModule/Patch/RJW_Patch.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; +using HarmonyLib; +using rjw; +using RJWSexperience; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using RimWorld; using Verse; using Verse.AI; -using rjw; -using RJW_Menstruation; -using HarmonyLib; -using RJWSexperience; namespace RJW_Menstruation.Sexperience { diff --git a/1.3/source/RJW_Menstruation/SexperienceModule/Properties/AssemblyInfo.cs b/1.3/source/RJW_Menstruation/SexperienceModule/Properties/AssemblyInfo.cs index fa02342..a2226aa 100644 --- a/1.3/source/RJW_Menstruation/SexperienceModule/Properties/AssemblyInfo.cs +++ b/1.3/source/RJW_Menstruation/SexperienceModule/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 diff --git a/1.3/source/RJW_Menstruation/SexperienceModule/VariousDefOf.cs b/1.3/source/RJW_Menstruation/SexperienceModule/VariousDefOf.cs index fef502c..617eb47 100644 --- a/1.3/source/RJW_Menstruation/SexperienceModule/VariousDefOf.cs +++ b/1.3/source/RJW_Menstruation/SexperienceModule/VariousDefOf.cs @@ -1,9 +1,4 @@ -using RimWorld; -using rjw; -using System.Linq; -using System; -using System.Collections.Generic; -using Verse; +using Verse; namespace RJW_Menstruation.Sexperience {