code
stringlengths
0
56.1M
repo_name
stringlengths
3
57
path
stringlengths
2
176
language
stringclasses
672 values
license
stringclasses
8 values
size
int64
0
56.8M
namespace rjw { public enum GenitalTag { CanPenetrate, CanBePenetrated, CanFertilize, CanBeFertilized, CanEgg, CanFertilizeEgg, CanLactate } }
Korth95/rjw
1.5/Source/Modules/Shared/Enums/GenitalTag.cs
C#
mit
163
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace rjw.Modules.Shared.Enums { public enum PawnState { Healthy, Downed, Unconscious, Dead } }
Korth95/rjw
1.5/Source/Modules/Shared/Enums/PawnState.cs
C#
mit
231
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Verse; namespace rjw.Modules.Shared.Extensions { public static class BodyPartRecordExtension { public static bool IsMissingForPawn(this BodyPartRecord self, Pawn pawn) { if (pawn == null) { throw new ArgumentNullException(nameof(pawn)); } if (self == null) { throw new ArgumentNullException(nameof(self)); } return pawn.health.hediffSet.hediffs .Where(hediff => hediff.Part == self) .Where(hediff => hediff is Hediff_MissingPart) .Any(); } } }
Korth95/rjw
1.5/Source/Modules/Shared/Extensions/BodyPartRecordExtension.cs
C#
mit
621
using System; using Verse; namespace rjw.Modules.Shared.Extensions { public static class PawnExtensions { public static string GetName(this Pawn pawn) { if (pawn == null) { return "null"; } if (String.IsNullOrWhiteSpace(pawn.Name?.ToStringFull) == false) { return pawn.Name.ToStringFull; } return pawn.def.defName; } } }
Korth95/rjw
1.5/Source/Modules/Shared/Extensions/PawnExtensions.cs
C#
mit
365
using System; using UnityEngine; using Verse; namespace rjw.Modules.Shared.Helpers { public static class AgeHelper { public const int ImmortalRaceAgeClamp = 25; public const int NonHumanRaceAgeClamp = 25; public static int ScaleToHumanAge(Pawn pawn, int humanLifespan = 80) { float pawnAge = pawn.ageTracker.AgeBiologicalYearsFloat; if (pawn.def.defName == "Human") return (int)pawnAge; // Human, no need to scale anything. float lifeExpectancy = pawn.RaceProps.lifeExpectancy; if (RJWSettings.UseAdvancedAgeScaling == true) { //pseudo-immortal & immortal races if (lifeExpectancy >= 500) { return CalculateForImmortals(pawn, humanLifespan); } if (lifeExpectancy != humanLifespan) { //other races return CalculateForNonHuman(pawn, humanLifespan); } } float ageScaling = humanLifespan / lifeExpectancy; float scaledAge = pawnAge * ageScaling; return (int)Mathf.Max(scaledAge, 1); } private static int CalculateForImmortals(Pawn pawn, int humanLifespan) { float age = pawn.ageTracker.AgeBiologicalYearsFloat; float lifeExpectancy = pawn.RaceProps.lifeExpectancy; float growth = pawn.ageTracker.Growth; //Growth and hacks { growth = ImmortalGrowthHacks(pawn, age, growth); if (growth < 1) { return (int)Mathf.Lerp(0, ImmortalRaceAgeClamp, growth); } } //curve { float life = age / lifeExpectancy; //Hypothesis : very long living races looks "young" until the end of their lifespan if (life < 0.9f) { return ImmortalRaceAgeClamp; } return (int)Mathf.LerpUnclamped(ImmortalRaceAgeClamp, humanLifespan, Mathf.InverseLerp(0.9f, 1, life)); } } private static float ImmortalGrowthHacks(Pawn pawn, float age, float originalGrowth) { if (pawn.ageTracker.CurLifeStage.reproductive == false) { //Hopefully, reproductive life stage will mean that we're dealing with an adult return Math.Min(1, age / ImmortalRaceAgeClamp); } return 1; } private static int CalculateForNonHuman(Pawn pawn, int humanLifespan) { float age = pawn.ageTracker.AgeBiologicalYearsFloat; float lifeExpectancy = pawn.RaceProps.lifeExpectancy; float growth = pawn.ageTracker.Growth; //Growth and hacks { growth = NonHumanGrowthHacks(pawn, age, growth); if (growth < 1) { return (int)Mathf.Lerp(0, NonHumanRaceAgeClamp, growth); } } //curve { float life = age / lifeExpectancy; return (int)Mathf.LerpUnclamped(NonHumanRaceAgeClamp, humanLifespan, life); } } private static float NonHumanGrowthHacks(Pawn pawn, float age, float originalGrowth) { if (pawn.ageTracker.CurLifeStage.reproductive == false) { //Hopefully, reproductive life stage will mean that we're dealing with an adult return Math.Min(1, age / NonHumanRaceAgeClamp); } return 1; } } }
Korth95/rjw
1.5/Source/Modules/Shared/Helpers/AgeHelper.cs
C#
mit
2,914
using System.Collections.Generic; using System.Linq; using Multiplayer.API; using rjw.Modules.Shared; using UnityEngine; using Verse; namespace rjw { public static class RandomHelper { /// <remarks>this is not foolproof</remarks> [SyncMethod] public static TType WeightedRandom<TType>(IList<Weighted<TType>> weights) { if (weights == null || weights.Any() == false || weights.Where(e => e.Weight < 0).Any()) { return default(TType); } Weighted<TType> result; if (weights.TryRandomElementByWeight(e => e.Weight, out result) == true) { return result.Element; } return weights.RandomElement().Element; } } }
Korth95/rjw
1.5/Source/Modules/Shared/Helpers/RandomHelper.cs
C#
mit
657
using rjw.Modules.Shared.Enums; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Verse; namespace rjw.Modules.Shared { public interface IPawnStateService { PawnState Detect(Pawn pawn); } }
Korth95/rjw
1.5/Source/Modules/Shared/IPawnStateService.cs
C#
mit
271
using rjw.Modules.Shared.Enums; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Verse; namespace rjw.Modules.Shared.Implementation { public class PawnStateService : IPawnStateService { public static IPawnStateService Instance { get; private set; } static PawnStateService() { Instance = new PawnStateService(); } public PawnState Detect(Pawn pawn) { if (pawn.Dead) { return PawnState.Dead; } if (pawn.Downed) { if (pawn.health.capacities.CanBeAwake == false) { return PawnState.Unconscious; } return PawnState.Downed; } return PawnState.Healthy; } } }
Korth95/rjw
1.5/Source/Modules/Shared/Implementation/PawnStateService.cs
C#
mit
701
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace rjw.Modules.Shared.Logs { public interface ILog { void Debug(string message); void Debug(string message, Exception e); void Message(string message); void Message(string message, Exception e); void Warning(string message); void Warning(string message, Exception e); void Error(string message); void Error(string message, Exception e); } }
Korth95/rjw
1.5/Source/Modules/Shared/Logs/ILog.cs
C#
mit
487
namespace rjw.Modules.Shared.Logs { public interface ILogProvider { bool IsActive { get; } } }
Korth95/rjw
1.5/Source/Modules/Shared/Logs/ILogProvider.cs
C#
mit
103
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace rjw.Modules.Shared.Logs { public static class LogManager { private class Logger : ILog { private readonly string _loggerTypeName; private readonly ILogProvider _logProvider; public Logger(string typeName) { _loggerTypeName = typeName; } public Logger(string typeName, ILogProvider logProvider) { _loggerTypeName = typeName; _logProvider = logProvider; } public void Debug(string message) { LogDebug(CreateLogMessage(message)); } public void Debug(string message, Exception exception) { LogDebug(CreateLogMessage(message, exception)); } public void Message(string message) { LogMessage(CreateLogMessage(message)); } public void Message(string message, Exception exception) { LogMessage(CreateLogMessage(message, exception)); } public void Warning(string message) { LogWarning(CreateLogMessage(message)); } public void Warning(string message, Exception exception) { LogWarning(CreateLogMessage(message, exception)); } public void Error(string message) { LogError(CreateLogMessage(message)); } public void Error(string message, Exception exception) { LogError(CreateLogMessage(message, exception)); } private string CreateLogMessage(string message) { return $"[{_loggerTypeName}] {message}"; } private string CreateLogMessage(string message, Exception exception) { return $"{CreateLogMessage(message)}{Environment.NewLine}{exception}"; } private void LogDebug(string message) { if (_logProvider?.IsActive != false && RJWSettings.DevMode == true) { ModLog.Message(message); } } private void LogMessage(string message) { if (_logProvider?.IsActive != false) { ModLog.Message(message); } } private void LogWarning(string message) { if (_logProvider?.IsActive != false) { ModLog.Warning(message); } } private void LogError(string message) { if (_logProvider?.IsActive != false) { ModLog.Error(message); } } } public static ILog GetLogger<TType, TLogProvider>() where TLogProvider : ILogProvider, new() { return new Logger(typeof(TType).Name, new TLogProvider()); } public static ILog GetLogger<TType>() { return new Logger(typeof(TType).Name); } public static ILog GetLogger(string staticTypeName) { return new Logger(staticTypeName); } } }
Korth95/rjw
1.5/Source/Modules/Shared/Logs/LogManager.cs
C#
mit
2,582
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace rjw.Modules.Shared { public static class Multipliers { public const float Never = 0f; public const float AlmostNever = 0.1f; public const float VeryRare = 0.2f; public const float Rare = 0.5f; public const float Uncommon = 0.8f; public const float Average = 1.0f; public const float Common = 1.2f; public const float Frequent = 1.5f; public const float VeryFrequent = 1.8f; public const float Doubled = 2.0f; public const float DoubledPlus = 2.5f; } }
Korth95/rjw
1.5/Source/Modules/Shared/Multipliers.cs
C#
mit
612
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace rjw.Modules.Shared { public class Weighted<TType> { public TType Element { get; set; } public float Weight { get; set; } public Weighted(float weight, TType element) { Weight = weight; Element = element; } } }
Korth95/rjw
1.5/Source/Modules/Shared/Weighted.cs
C#
mit
360
#nullable enable using System.Linq; using Verse; using rjw.Modules.Shared.Logs; using rjw.Modules.Interactions.DefModExtensions; using static rjw.Genital_Helper; using Sex = rjw.GenderHelper.Sex; using Seeded = rjw.Modules.Rand.Seeded; namespace rjw.Modules.Testing { static class TestHelper { static readonly ILog Log = LogManager.GetLogger("TestHelper"); /// <summary> /// Adds some default options to this request that are desireable for testing. /// </summary> /// <param name="request">The request to modify.</param> /// <returns>The modified request.</returns> public static PawnGenerationRequest RequestDefaults(this PawnGenerationRequest request) => request with { CanGeneratePawnRelations = false, ForceNoIdeo = true, ForceGenerateNewPawn = true }; /// <summary> /// <para>Generates a natural pawn using the given request and a fixed seed.</para> /// <para>If there was an issue generating the pawn, it will return null.</para> /// </summary> /// <param name="request">The pawn request.</param> /// <returns>The generated pawn or null.</returns> public static Pawn? GenerateSeededPawn(PawnGenerationRequest request) { using (Seeded.With(42)) { var tries = 5; while (tries >= 0) { var pawn = PawnGenerator.GeneratePawn(request); // Keep generating until we get a "natural" pawn. We want to // control when futas and traps happen. switch (GenderHelper.GetSex(pawn)) { case Sex.Male when pawn.gender == Gender.Male: case Sex.Female when pawn.gender == Gender.Female: case Sex.None when pawn.gender == Gender.None: return pawn; } tries -= 1; } Log.Error($"Could not generate test pawn for: {request.KindDef.defName}"); return null; } } /// <summary> /// Tries to replace a sex-part of the given pawn using a recipe. /// </summary> /// <param name="pawn">The pawn to change.</param> /// <param name="recipe">The recipe to apply.</param> /// <returns>Whether the part was applied successfully.</returns> public static bool ApplyPartToPawn(Pawn pawn, RecipeDef recipe) { var worker = recipe.Worker; var defToAdd = recipe.addsHediff as HediffDef_SexPart; if (defToAdd == null) return false; // They must have the correct body part for this sex part. var bpr = worker.GetPartsToApplyOn(pawn, recipe).FirstOrDefault(); if (bpr is null) return false; var curParts = get_AllPartsHediffList(pawn) .Where(hed => hed is ISexPartHediff part && part.Def.genitalFamily == defToAdd.genitalFamily) .ToArray(); // We're replacing natural with artifical. if (curParts.Length == 0) return false; foreach (var part in curParts) pawn.health.RemoveHediff(part); var hediff = SexPartAdder.MakePart(defToAdd, pawn, bpr); pawn.health.AddHediff(hediff, bpr); return true; } /// <summary> /// Replaces the genitals of a pawn with artificial ones. /// </summary> /// <param name="pawn">The pawn to change.</param> /// <returns>Whether the part was swapped successfully.</returns> public static bool GiveArtificialGenitals(Pawn pawn) { var changed = false; if (get_genitalsBPR(pawn) is not { } bpr) return changed; if (has_penis_fertile(pawn)) { foreach (var part in pawn.GetGenitalsList()) if (is_fertile_penis(part)) pawn.health.RemoveHediff(part); var hediff = SexPartAdder.MakePart(hydraulic_penis, pawn, bpr); pawn.health.AddHediff(hediff, bpr); changed = true; } if (has_vagina(pawn)) { foreach (var part in pawn.GetGenitalsList()) if (is_vagina(part)) pawn.health.RemoveHediff(part); var hediff = SexPartAdder.MakePart(hydraulic_vagina, pawn, bpr); pawn.health.AddHediff(hediff, bpr); changed = true; } return changed; } /// <summary> /// <para>Adds parts to a pawn to make them into a trap.</para> /// <para>The pawn must be a natural male to be changed. If the pawn is /// already a trap, it will return `true`. Otherwise, it will return `false` /// if it failed to change the pawn.</para> /// <para>Note since Feb-2023: this is currently bugged, since the /// `SexPartAdder.add_breasts` does not respect the request to use female /// breasts.</para> /// </summary> /// <param name="pawn">The pawn to change.</param> /// <returns>Whether the pawn was modified.</returns> public static bool MakeIntoTrap(Pawn pawn) { if (GenderHelper.GetSex(pawn) is var sex and not Sex.Male) return sex is Sex.Trap; var parts = pawn.GetBreastList(); foreach (var part in parts) pawn.health.RemoveHediff(part); SexPartAdder.add_breasts(pawn, gender: Gender.Female); return GenderHelper.GetSex(pawn) is Sex.Trap; } /// <summary> /// <para>Adds a part to a pawn to make them into a futa.</para> /// <para>The pawn must be a natural male or female and will return `false` /// if it failed to change the pawn into a futa.</para> /// </summary> /// <param name="pawn">The pawn to change.</param> /// <param name="infertile">Whether the part should be infertile.</param> /// <returns>Whether the pawn was modified.</returns> public static bool MakeIntoFuta(Pawn pawn, bool infertile = false) { Hediff hediff; switch ((GenderHelper.GetSex(pawn), infertile)) { case (Sex.Male or Sex.Trap, false): SexPartAdder.add_genitals(pawn, gender: Gender.Female); return GenderHelper.GetSex(pawn) is Sex.Futa; case (Sex.Male or Sex.Trap, true) when get_genitalsBPR(pawn) is { } bpr: hediff = SexPartAdder.MakePart(hydraulic_vagina, pawn, bpr); pawn.health.AddHediff(hediff, bpr); return GenderHelper.GetSex(pawn) is Sex.Futa; case (Sex.Female, false): SexPartAdder.add_genitals(pawn, gender: Gender.Male); return GenderHelper.GetSex(pawn) is Sex.Futa; case (Sex.Female, true) when get_genitalsBPR(pawn) is { } bpr: hediff = SexPartAdder.MakePart(hydraulic_penis, pawn, bpr); pawn.health.AddHediff(hediff, bpr); return GenderHelper.GetSex(pawn) is Sex.Futa; default: return false; } } } }
Korth95/rjw
1.5/Source/Modules/Testing/TestHelper.cs
C#
mit
6,130
using System; using System.Collections.Generic; using RimWorld; using Verse; namespace rjw { public class Need_Sex : Need_Seeker { public bool isInvisible => pawn.Map == null; private static float decay_per_day = 0.3f; // TODO: make these threshold values constants or at least static // readonly properties, if they're meant for patching. public float thresh_frustrated() => 0.05f; public float thresh_horny() => 0.25f; public float thresh_neutral() => 0.50f; public float thresh_satisfied() => 0.75f; public float thresh_ahegao() => 0.95f; public Need_Sex(Pawn pawn) : base(pawn) { //if (xxx.is_mechanoid(pawn)) return; //Added by nizhuan-jjr:Misc.Robots are not allowed to have sex, so they don't need sex actually. threshPercents = new List<float> { thresh_frustrated(), thresh_horny(), thresh_neutral(), thresh_satisfied(), thresh_ahegao() }; } // These are overridden just for other mods to patch and alter their behavior. // Without it, they would need to patch `Need` itself, adding a type check to // every single need IN THE GAME before executing the new behavior. public override float CurInstantLevel { get { return base.CurInstantLevel; } } public override float CurLevel { get { return base.CurLevel; } set { base.CurLevel = value; } } //public override bool ShowOnNeedList //{ // get // { // if (Genital_Helper.has_genitals(pawn)) // return true; // ModLog.Message("curLevelInt " + curLevelInt); // return false; // } //} //public override string GetTipString() //{ // return string.Concat(new string[] // { // this.LabelCap, // ": ", // this.CurLevelPercentage.ToStringPercent(), // "\n", // this.def.description, // "\n", // }); //} public static float brokenbodyfactor(Pawn pawn) { //This adds in the broken body system float broken_body_factor = 1f; if (pawn.health.hediffSet.HasHediff(xxx.feelingBroken)) { switch (pawn.health.hediffSet.GetFirstHediffOfDef(xxx.feelingBroken).CurStageIndex) { case 0: return 0.75f; case 1: return 1.4f; case 2: return 2f; } } return broken_body_factor; } public static float druggedfactor(Pawn pawn) { if (pawn.health.hediffSet.HasHediff(RJWHediffDefOf.HumpShroomEffect)) { //ModLog.Message("Need_Sex::druggedfactor 3 pawn is " + xxx.get_pawnname(pawn)); return 3f; } // No humpshroom effect but addicted? if (pawn.health.hediffSet.HasHediff(RJWHediffDefOf.HumpShroomAddiction)) { //ModLog.Message("Need_Sex::druggedfactor 0.5 pawn is " + xxx.get_pawnname(pawn)); return 0.5f; } //ModLog.Message("Need_Sex::druggedfactor 1 pawn is " + xxx.get_pawnname(pawn)); return 1f; } static float diseasefactor(Pawn pawn) { return 1f; } static float futafactor(Pawn pawn) { // Checks for doubly-fertile futa. // Presumably, they got twice the hormones coursing through their brain. return Genital_Helper.is_futa(pawn) ? 2.0f : 1.0f; } static float agefactor(Pawn pawn) { // Age check was moved to start of `NeedInterval` and this factor // is no longer useful in base RJW. It is left here in case any // mod patches this factor. return 1f; } /// <summary> /// Gets the cumulative factors affecting decay for a given pawn. /// </summary> public static float GetFallFactorFor(Pawn pawn) { return brokenbodyfactor(pawn) * druggedfactor(pawn) * diseasefactor(pawn) * agefactor(pawn) * futafactor(pawn); } static float fall_per_tick(Pawn pawn) { var fall_per_tick = decay_per_day / GenDate.TicksPerDay * GetFallFactorFor(pawn); //--ModLog.Message("Need_Sex::NeedInterval is called - pawn is " + xxx.get_pawnname(pawn) + " is has both genders " + (Genital_Helper.has_penis(pawn) && Genital_Helper.has_vagina(pawn))); //ModLog.Message(" " + xxx.get_pawnname(pawn) + "'s sex need stats:: fall_per_tick: " + fall_per_tick + ", sex_need_factor_from_lifestage: " + sex_need_factor_from_lifestage(pawn) ); return fall_per_tick; } public override void NeedInterval() { if (isInvisible) return; // no caravans // Asexual or too young. if (xxx.is_asexual(pawn) || !xxx.can_do_loving(pawn)) { CurLevel = 0.5f; return; } //--ModLog.Message("Need_Sex::NeedInterval is called0 - pawn is "+xxx.get_pawnname(pawn)); if (!def.freezeWhileSleeping || pawn.Awake()) { // `NeedInterval` is called by `Pawn_NeedsTracker` once every 150 ticks, which is around .06 game hours. var fallPerCall = 150 * fall_per_tick(pawn); var sexDriveModifier = xxx.get_sex_drive(pawn); var decayRateModifier = RJWSettings.sexneed_decay_rate; var decayThisCall = fallPerCall * sexDriveModifier * decayRateModifier; CurLevel -= decayThisCall; // ModLog.Message($" {xxx.get_pawnname(pawn)}'s sex need stats:: Decay/call: {decayThisCall}, Dec. rate: {decayRateModifier}, Cur.lvl: {CurLevel}, Sex drive: {sexDriveModifier}"); } //--ModLog.Message("Need_Sex::NeedInterval is called1"); } } }
Korth95/rjw
1.5/Source/Needs/Need_Sex.cs
C#
mit
5,134
using Verse; namespace rjw { /// <summary> /// Looks up and returns a BodyPartTagDef defined in the XML /// </summary> public static class BodyPartTagDefOf { public static BodyPartTagDef RJW_Fertility { get { if (a == null) a = (BodyPartTagDef)GenDefDatabase.GetDef(typeof(BodyPartTagDef), "RJW_Fertility"); return a; } } private static BodyPartTagDef a; } }
Korth95/rjw
1.5/Source/PawnCapacities/BodyPartTagDefOf.cs
C#
mit
395
using RimWorld; using System; using System.Collections.Generic; using UnityEngine; using Verse; namespace rjw { /// <summary> /// Calculates a pawn's fertility based on its age and fertility sources /// </summary> public class PawnCapacityWorker_Fertility : PawnCapacityWorker { public override float CalculateCapacityLevel(HediffSet diffSet, List<PawnCapacityUtility.CapacityImpactor> impactors = null) { Pawn pawn = diffSet.pawn; var parts = pawn.GetGenitalsList(); if (!Genital_Helper.has_penis_fertile(pawn, parts) && !Genital_Helper.has_vagina(pawn, parts)) return 0; if (Genital_Helper.has_ovipositorF(pawn, parts) || Genital_Helper.has_ovipositorM(pawn, parts)) return 0; //ModLog.Message("PawnCapacityWorker_Fertility::CalculateCapacityLevel is called for: " + xxx.get_pawnname(pawn)); if (!pawn.RaceHasFertility()) { //Log.Message(" Fertility_filter, no fertility for : " + pawn.kindDef.defName); return 0f; } //androids only fertile with archotech parts if (AndroidsCompatibility.IsAndroid(pawn) && !(AndroidsCompatibility.AndroidPenisFertility(pawn) || AndroidsCompatibility.AndroidVaginaFertility(pawn))) { //Log.Message(" Android has no archotech genitals set fertility to 0 for: " + pawn.kindDef.defName); return 0f; } float result = 1; if (RJWPregnancySettings.UseVanillaPregnancy && pawn.RaceProps.Humanlike) { float fertilityStat = pawn.GetStatValue(StatDefOf.Fertility); if (fertilityStat != 1) { result *= fertilityStat; impactors?.Add(new CapacityImpactorVanillaFertility()); } } else { float ageFactor = CalculateAgeImpact(pawn); if (ageFactor != 1) { result *= ageFactor; impactors?.Add(new CapacityImpactorAge()); } } result *= PawnCapacityUtility.CalculateTagEfficiency(diffSet, BodyPartTagDefOf.RJW_Fertility, 1f, FloatRange.ZeroToOne, impactors); //ModLog.Message("PawnCapacityWorker_Fertility::CalculateCapacityLevel result is: " + result); return result; } public override bool CanHaveCapacity(BodyDef body) { return body.HasPartWithTag(BodyPartTagDefOf.RJW_Fertility); } private float CalculateAgeImpact(Pawn pawn) { RaceProperties race = pawn.RaceProps; float startAge = 0f; //raise fertility float startMaxAge = 0f; //max fertility float endAge = race.lifeExpectancy * (RJWPregnancySettings.fertility_endage_male * 0.7f); // Age when males start to lose potency. float zeroFertility = race.lifeExpectancy * RJWPregnancySettings.fertility_endage_male; // Age when fertility hits 0%. if (xxx.is_female(pawn)) { if (xxx.is_animal(pawn)) { endAge = race.lifeExpectancy * (RJWPregnancySettings.fertility_endage_female_animal * 0.6f); zeroFertility = race.lifeExpectancy * RJWPregnancySettings.fertility_endage_female_animal; } else { endAge = race.lifeExpectancy * (RJWPregnancySettings.fertility_endage_female_humanlike * 0.6f); // Age when fertility begins to drop. zeroFertility = race.lifeExpectancy * RJWPregnancySettings.fertility_endage_female_humanlike; // Age when fertility hits 0%. } } //If pawn is an animal, first reproductive lifestage is (usually) adult, so set startMaxAge at first reproductive stage, and startAge at stage before that. int adult; if (xxx.is_animal(pawn) && (adult = race.lifeStageAges.FirstIndexOf((ls) => ls.def.reproductive)) > 0) { startAge = race.lifeStageAges[adult - 1].minAge; startMaxAge = race.lifeStageAges[adult].minAge; } else { foreach (LifeStageAge lifestage in race.lifeStageAges) { if (lifestage.def.reproductive) //presumably teen stage if (startAge == 0f && startMaxAge == 0f) { startAge = lifestage.minAge; startMaxAge = (Mathf.Max(startAge + (startAge + endAge) * 0.08f, startAge)); } //presumably adult stage else { if (startMaxAge > lifestage.minAge) // ensure peak fertility stays at start or a bit before adult stage startMaxAge = lifestage.minAge; } } } //Log.Message(" Fertility ages for " + pawn.Name + " are: " + startAge + ", " + startMaxAge + ", " + endAge + ", " + endMaxAge); return GenMath.FlatHill(startAge, startMaxAge, endAge, zeroFertility, pawn.ageTracker.AgeBiologicalYearsFloat); } // Tooltips are hardcoded to only use concrete vanilla CapacityImpactors(?!), so we need to subclass one // in order to show anything without gratuitous patching (and possibly stepping on the toes of any mod that // happens to mess with these tooltips). CapacityImpactorPain doesn't have any fields or specialised methods, // so that's what we'll use. public class CapacityImpactorAge : PawnCapacityUtility.CapacityImpactorPain { public override string Readable(Pawn pawn) { return "AgeImpactor".Translate() + pawn.ageTracker.AgeBiologicalYearsFloat.ToStringApproxAge(); } } public class CapacityImpactorVanillaFertility : PawnCapacityUtility.CapacityImpactorPain { public override string Readable(Pawn pawn) { return "VanillaFertilityImpactor".Translate( ((int) (pawn.GetStatValue(StatDefOf.Fertility) * 100)).Named("VALUE") ); } } } }
Korth95/rjw
1.5/Source/PawnCapacities/PawnCapacityWorker_Fertility.cs
C#
mit
5,265
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("RimJobWorld")] [assembly: AssemblyDescription("Adult mod for Rimworld")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Community Project")] [assembly: AssemblyProduct("RimJobWorld")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("22f82fff-8bd4-4cee-9f22-c7da71281e72")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.5.*")]
Korth95/rjw
1.5/Source/Properties/AssemblyInfo.cs
C#
mit
1,350
using System; using System.Collections.Generic; using System.Linq; using Verse; using UnityEngine; using RimWorld; using Verse.Sound; namespace rjw.MainTab { [StaticConstructorOnStartup] public static class DesignatorCheckbox { public static readonly Texture2D CheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_on"); public static readonly Texture2D CheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_off"); public static readonly Texture2D CheckboxDisabledTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_Refuse"); private static bool checkboxPainting; private static bool checkboxPaintingState; public static void Checkbox(Vector2 topLeft, ref bool checkOn, float size = 24f, bool disabled = false, Texture2D texChecked = null, Texture2D texUnchecked = null, Texture2D texDisabled = null) { Checkbox(topLeft.x, topLeft.y, ref checkOn, size, disabled, texChecked, texUnchecked); } public static void Checkbox(float x, float y, ref bool checkOn, float size = 24f, bool disabled = false, Texture2D texChecked = null, Texture2D texUnchecked = null, Texture2D texDisabled = null) { Rect rect = new Rect(x, y, size, size); CheckboxDraw(x, y, checkOn, disabled, size, texChecked, texUnchecked,texDisabled); if (!disabled) { MouseoverSounds.DoRegion(rect); bool flag = false; Widgets.DraggableResult draggableResult = Widgets.ButtonInvisibleDraggable(rect, false); if (draggableResult == Widgets.DraggableResult.Pressed) { checkOn = !checkOn; flag = true; } else if (draggableResult == Widgets.DraggableResult.Dragged) { checkOn = !checkOn; flag = true; checkboxPainting = true; checkboxPaintingState = checkOn; } if (Mouse.IsOver(rect) && checkboxPainting && Input.GetMouseButton(0) && checkOn != checkboxPaintingState) { checkOn = checkboxPaintingState; flag = true; } if (flag) { if (checkOn) { SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera(null); } else { SoundDefOf.Checkbox_TurnedOff.PlayOneShotOnCamera(null); } } } } private static void CheckboxDraw(float x, float y, bool active, bool disabled, float size = 24f, Texture2D texChecked = null, Texture2D texUnchecked = null, Texture2D texDisabled = null) { Texture2D image; if (disabled) { image = ((!(texDisabled != null)) ? CheckboxDisabledTex : texDisabled); } else if (active) { image = ((!(texChecked != null)) ? CheckboxOnTex : texChecked); } else { image = ((!(texUnchecked != null)) ? CheckboxOffTex : texUnchecked); } Rect position = new Rect(x, y, size, size); GUI.DrawTexture(position, image); } } }
Korth95/rjw
1.5/Source/RJWTab/Checkboxes/DesignatorCheckbox.cs
C#
mit
2,754
using System; using System.Collections.Generic; using System.Linq; using Verse; using UnityEngine; using RimWorld; using Verse.Sound; namespace rjw.MainTab.Checkbox { [StaticConstructorOnStartup] public abstract class PawnColumnCheckbox : PawnColumnWorker { public static readonly Texture2D CheckboxOnTex; public static readonly Texture2D CheckboxOffTex; public static readonly Texture2D CheckboxDisabledTex; public const int HorizontalPadding = 2; public override void DoCell(Rect rect, Pawn pawn, RimWorld.PawnTable table) { if (!this.HasCheckbox(pawn)) { return; } if (Find.TickManager.TicksGame % 60 == 0) { pawn.UpdatePermissions(); //Log.Message("GetDisabled UpdateCanDesignateService for " + xxx.get_pawnname(pawn)); //Log.Message("UpdateCanDesignateService " + pawn.UpdateCanDesignateService()); //Log.Message("CanDesignateService " + pawn.CanDesignateService()); //Log.Message("GetDisabled " + GetDisabled(pawn)); } int num = (int)((rect.width - 24f) / 2f); int num2 = Mathf.Max(3, 0); Vector2 vector = new Vector2(rect.x + (float)num, rect.y + (float)num2); Rect rect2 = new Rect(vector.x, vector.y, 24f, 24f); bool disabled = this.GetDisabled(pawn); bool value; if (disabled) { value = false; } else { value = this.GetValue(pawn); } bool flag = value; Vector2 topLeft = vector; //Widgets.Checkbox(topLeft, ref value, 24f, disabled, CheckboxOnTex, CheckboxOffTex, CheckboxDisabledTex); MakeCheckbox(topLeft, ref value, 24f, disabled, CheckboxOnTex, CheckboxOffTex, CheckboxDisabledTex); if (Mouse.IsOver(rect2)) { string tip = this.GetTip(pawn); if (!tip.NullOrEmpty()) { TooltipHandler.TipRegion(rect2, tip); } } if (value != flag) { this.SetValue(pawn, value); } } protected void MakeCheckbox(Vector2 topLeft, ref bool value, float v = 24f, bool disabled = false, Texture2D checkboxOnTex = null, Texture2D checkboxOffTex = null, Texture2D checkboxDisabledTex = null) { Widgets.Checkbox(topLeft, ref value, v, disabled, checkboxOnTex, checkboxOffTex, checkboxDisabledTex); } protected virtual string GetTip(Pawn pawn) { return null; } protected virtual bool HasCheckbox(Pawn pawn) { return false; } protected abstract bool GetValue(Pawn pawn); protected abstract void SetValue(Pawn pawn, bool value); protected virtual bool GetDisabled(Pawn pawn) { return false; } } }
Korth95/rjw
1.5/Source/RJWTab/Checkboxes/PawnColumnCheckbox.cs
C#
mit
2,494
using RimWorld; using UnityEngine; using Verse; namespace rjw.MainTab.Checkbox { [StaticConstructorOnStartup] public class PawnColumnWorker_BreedAnimal : PawnColumnWorker_Checkbox { public static readonly Texture2D CheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_on"); public static readonly Texture2D CheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_off"); public static readonly Texture2D CheckboxDisabledTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_Refuse"); protected override bool HasCheckbox(Pawn pawn) { return pawn.CanDesignateBreeding(); } protected bool GetDisabled(Pawn pawn) { return !pawn.CanDesignateBreeding(); } protected override bool GetValue(Pawn pawn) { return pawn.IsDesignatedBreeding() && xxx.is_animal(pawn); } protected override void SetValue(Pawn pawn, bool value, PawnTable table) { if (value == this.GetValue(pawn)) return; pawn.ToggleBreeding(); } } }
Korth95/rjw
1.5/Source/RJWTab/Checkboxes/PawnColumnWorker_BreedAnimal.cs
C#
mit
1,000
using RimWorld; using UnityEngine; using Verse; namespace rjw.MainTab.Checkbox { [StaticConstructorOnStartup] public class PawnColumnWorker_BreedHumanlike : PawnColumnWorker_Checkbox { public static readonly Texture2D CheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_on"); public static readonly Texture2D CheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_off"); public static readonly Texture2D CheckboxDisabledTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_Refuse"); protected override bool HasCheckbox(Pawn pawn) { return pawn.CanDesignateBreeding(); } protected bool GetDisabled(Pawn pawn) { return !pawn.CanDesignateBreeding(); } protected override bool GetValue(Pawn pawn) { return pawn.IsDesignatedBreeding() && xxx.is_human(pawn); } protected override void SetValue(Pawn pawn, bool value, PawnTable table) { if (value == this.GetValue(pawn)) return; pawn.ToggleBreeding(); } } }
Korth95/rjw
1.5/Source/RJWTab/Checkboxes/PawnColumnWorker_BreedHumanlike.cs
C#
mit
1,002
using RimWorld; using UnityEngine; using Verse; namespace rjw.MainTab.Checkbox { [StaticConstructorOnStartup] public class PawnColumnWorker_BreederAnimal : PawnColumnWorker_Checkbox { public static readonly Texture2D CheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_on"); public static readonly Texture2D CheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_off"); public static readonly Texture2D CheckboxDisabledTex = ContentFinder<Texture2D>.Get("UI/Commands/Breeding_Pawn_Refuse"); protected override bool HasCheckbox(Pawn pawn) { return pawn.CanDesignateBreedingAnimal(); } protected bool GetDisabled(Pawn pawn) { return !pawn.CanDesignateBreedingAnimal(); } protected override bool GetValue(Pawn pawn) { return pawn.IsDesignatedBreedingAnimal() && xxx.is_animal(pawn); } protected override void SetValue(Pawn pawn, bool value, PawnTable table) { if (value == this.GetValue(pawn)) return; pawn.ToggleBreedingAnimal(); } } }
Korth95/rjw
1.5/Source/RJWTab/Checkboxes/PawnColumnWorker_BreederAnimal.cs
C#
mit
1,026
using RimWorld; using UnityEngine; using Verse; namespace rjw.MainTab.Checkbox { [StaticConstructorOnStartup] public class PawnColumnWorker_Comfort : PawnColumnWorker_Checkbox { public static readonly Texture2D CheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_on"); public static readonly Texture2D CheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off"); public static readonly Texture2D CheckboxDisabledTex = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_Refuse"); protected override bool HasCheckbox(Pawn pawn) { return pawn.CanDesignateComfort(); } protected bool GetDisabled(Pawn pawn) { return !pawn.CanDesignateComfort(); } protected override bool GetValue(Pawn pawn) { return pawn.IsDesignatedComfort(); } protected override void SetValue(Pawn pawn, bool value, PawnTable table) { pawn.ToggleComfort(); } } }
Korth95/rjw
1.5/Source/RJWTab/Checkboxes/PawnColumnWorker_Comfort.cs
C#
mit
931
using RimWorld; using UnityEngine; using Verse; namespace rjw.MainTab.Checkbox { [StaticConstructorOnStartup] public class PawnColumnWorker_Hero : PawnColumnCheckbox { //public static readonly Texture2D CheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Hero_on"); //public static readonly Texture2D CheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Hero_off"); //public static readonly Texture2D CheckboxDisabledTex = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_Refuse"); //public static readonly Texture2D iconAccept = ContentFinder<Texture2D>.Get("UI/Commands/Hero_off"); //static readonly Texture2D iconCancel = ContentFinder<Texture2D>.Get("UI/Commands/Hero_on"); //protected override Texture2D GetIconFor(Pawn pawn) //{ // return pawn.CanDesignateHero() ? pawn.IsDesignatedHero() ? iconAccept : iconCancel : null; //} //protected override string GetIconTip(Pawn pawn) //{ // return "PawnColumnWorker_IsHero".Translate(); // ; //} //public static Texture2D CheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Hero_on"); //public static Texture2D CheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Hero_off"); protected override bool HasCheckbox(Pawn pawn) { return pawn.CanDesignateHero() || pawn.IsDesignatedHero(); } protected override bool GetValue(Pawn pawn) { return pawn.IsDesignatedHero(); } protected override void SetValue(Pawn pawn, bool value) { if (pawn.IsDesignatedHero()) return; pawn.ToggleHero(); //reload/update tab var rjwtab = DefDatabase<MainButtonDef>.GetNamed("RJW_MainButton"); Find.MainTabsRoot.ToggleTab(rjwtab, false);//off Find.MainTabsRoot.ToggleTab(rjwtab, false);//on } } }
Korth95/rjw
1.5/Source/RJWTab/Checkboxes/PawnColumnWorker_Hero.cs
C#
mit
1,740
using RimWorld; using UnityEngine; using Verse; namespace rjw.MainTab.Checkbox { [StaticConstructorOnStartup] public class PawnColumnWorker_Whore : PawnColumnWorker_Checkbox { public static readonly Texture2D CheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_on"); public static readonly Texture2D CheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_off"); public static readonly Texture2D CheckboxDisabledTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_Refuse"); protected override bool HasCheckbox(Pawn pawn) { return pawn.CanDesignateService(); } protected bool GetDisabled(Pawn pawn) { return !pawn.CanDesignateService(); } protected override bool GetValue(Pawn pawn) { return pawn.IsDesignatedService(); } protected override void SetValue(Pawn pawn, bool value, PawnTable table) { pawn.ToggleService(); } } }
Korth95/rjw
1.5/Source/RJWTab/Checkboxes/PawnColumnWorker_Whore.cs
C#
mit
905
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Verse; namespace rjw.MainTab.DefModExtensions { public class RJW_PawnTable : DefModExtension { public string label; } }
Korth95/rjw
1.5/Source/RJWTab/DefModExtensions/RJW_PawnTable.cs
C#
mit
251
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab.Icon { [StaticConstructorOnStartup] public class PawnColumnWorker_IsBreeder : PawnColumnWorker_Icon { private static readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_on"); private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off"); private readonly Texture2D comfortOff_nobg = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off_nobg"); protected override Texture2D GetIconFor(Pawn pawn) { return pawn.CanDesignateBreeding() ? pawn.IsDesignatedBreeding() ? comfortOn : comfortOff : comfortOff_nobg; //return xxx.is_slave(pawn) ? comfortOff : null; } protected override string GetIconTip(Pawn pawn) { return "PawnColumnWorker_IsBreeder".Translate(); ; } } }
Korth95/rjw
1.5/Source/RJWTab/Icons/PawnColumnWorker_IsBreeder.cs
C#
mit
954
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab.Icon { [StaticConstructorOnStartup] public class PawnColumnWorker_IsComfort : PawnColumnWorker_Icon { private readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_on"); private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off"); private readonly Texture2D comfortOff_nobg = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off_nobg"); protected override Texture2D GetIconFor(Pawn pawn) { return pawn.CanDesignateComfort() ? pawn.IsDesignatedComfort() ? comfortOn : comfortOff : comfortOff_nobg; } protected override string GetIconTip(Pawn pawn) { return "PawnColumnWorker_IsComfort".Translate(); ; } } }
Korth95/rjw
1.5/Source/RJWTab/Icons/PawnColumnWorker_IsComfort.cs
C#
mit
893
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab.Icon { [StaticConstructorOnStartup] public class PawnColumnWorker_IsPrisoner : PawnColumnWorker_Icon { private static readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_on"); private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off"); private readonly Texture2D comfortOff_nobg = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off_nobg"); protected override Texture2D GetIconFor(Pawn pawn) { return pawn.IsPrisonerOfColony ? comfortOff_nobg : null; } protected override string GetIconTip(Pawn pawn) { return "PawnColumnWorker_IsPrisoner".Translate(); } } }
Korth95/rjw
1.5/Source/RJWTab/Icons/PawnColumnWorker_IsPrisoner.cs
C#
mit
848
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab.Icon { [StaticConstructorOnStartup] public class PawnColumnWorker_IsSlave : PawnColumnWorker_Icon { private readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_on"); private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off"); private readonly Texture2D comfortOff_nobg = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off_nobg"); protected override Texture2D GetIconFor(Pawn pawn) { return xxx.is_slave(pawn) ? ModsConfig.IdeologyActive ? GuestUtility.SlaveIcon : comfortOff_nobg : null; } protected override string GetIconTip(Pawn pawn) { return "PawnColumnWorker_IsSlave".Translate(); ; } } }
Korth95/rjw
1.5/Source/RJWTab/Icons/PawnColumnWorker_IsSlave.cs
C#
mit
887
using RimWorld; using UnityEngine; using Verse; using static rjw.GenderHelper; namespace rjw.MainTab.Icon { [StaticConstructorOnStartup] public class PawnColumnWorker_RJWGender : PawnColumnWorker_Gender { public static readonly Texture2D hermIcon = ContentFinder<Texture2D>.Get("UI/Icons/Gender/Genders", true); protected override Texture2D GetIconFor(Pawn pawn) => GetSex(pawn) switch { Sex.Futa => hermIcon, _ => pawn.gender.GetIcon() }; protected override string GetIconTip(Pawn pawn) => GetSex(pawn) switch { Sex.Futa => "PawnColumnWorker_RJWGender_IsHerm".Translate(), _ => pawn.GetGenderLabel().CapitalizeFirst() }; } }
Korth95/rjw
1.5/Source/RJWTab/Icons/PawnColumnWorker_RJWGender.cs
C#
mit
661
using System.Collections.Generic; using System.Linq; using Verse; using RimWorld; using RimWorld.Planet; using UnityEngine; using rjw.MainTab.DefModExtensions; namespace rjw.MainTab { [StaticConstructorOnStartup] public class RJW_PawnTableList { public List<PawnTableDef> getdefs() { var defs = new List<PawnTableDef>(); defs.AddRange(DefDatabase<PawnTableDef>.AllDefs.Where(x => x.HasModExtension<RJW_PawnTable>())); return defs; } } public class MainTabWindow : MainTabWindow_PawnTable { protected override float ExtraBottomSpace { get { return 53f; //default 53 } } protected override float ExtraTopSpace { get { return 40f; //default 0 } } protected override PawnTableDef PawnTableDef => pawnTableDef; protected override IEnumerable<Pawn> Pawns => pawns; public IEnumerable<Pawn> pawns = Find.CurrentMap.mapPawns.AllPawns.Where(p => p.RaceProps.Humanlike && p.IsColonist && !xxx.is_slave(p)); public PawnTableDef pawnTableDef = DefDatabase<PawnTableDef>.GetNamed("RJW_PawnTable_Colonists"); /// <summary> /// draw table /// </summary> /// <param name="rect"></param> public override void DoWindowContents(Rect rect) { base.DoWindowContents(rect); if (Widgets.ButtonText(new Rect(rect.x + 5f, rect.y + 5f, Mathf.Min(rect.width, 260f), 32f), "MainTabWindow_Designators".Translate(), true, true, true)) { MakeMenu(); } } public override void PostOpen() { base.PostOpen(); Find.World.renderer.wantedMode = WorldRenderMode.None; } /// <summary> /// reload/update tab /// </summary> public static void Reloadtab() { var rjwtab = DefDatabase<MainButtonDef>.GetNamed("RJW_MainButton"); Find.MainTabsRoot.ToggleTab(rjwtab, false);//off Find.MainTabsRoot.ToggleTab(rjwtab, false);//on } public void MakeMenu() { Find.WindowStack.Add(new FloatMenu(MakeOptions())); } /// <summary> /// switch pawnTable's /// patch this /// </summary> public List<FloatMenuOption> MakeOptions() { List<FloatMenuOption> opts = new List<FloatMenuOption>(); PawnTableDef tabC = DefDatabase<PawnTableDef>.GetNamed("RJW_PawnTable_Colonists"); PawnTableDef tabA = DefDatabase<PawnTableDef>.GetNamed("RJW_PawnTable_Animals"); PawnTableDef tabP = DefDatabase<PawnTableDef>.GetNamed("RJW_PawnTable_Property"); opts.Add(new FloatMenuOption(tabC.GetModExtension<RJW_PawnTable>().label, () => { pawnTableDef = tabC; pawns = Find.CurrentMap.mapPawns.AllPawns.Where(p => p.RaceProps.Humanlike && p.IsColonist && !xxx.is_slave(p)); Notify_ResolutionChanged(); Reloadtab(); }, MenuOptionPriority.Default)); opts.Add(new FloatMenuOption(tabA.GetModExtension<RJW_PawnTable>().label, () => { pawnTableDef = tabA; pawns = Find.CurrentMap.mapPawns.PawnsInFaction(Faction.OfPlayer).Where(p => xxx.is_animal(p)); Notify_ResolutionChanged(); Reloadtab(); }, MenuOptionPriority.Default)); opts.Add(new FloatMenuOption(tabP.GetModExtension<RJW_PawnTable>().label, () => { pawnTableDef = tabP; pawns = Find.CurrentMap.mapPawns.AllPawns.Where(p => p.RaceProps.Humanlike && (p.IsColonist && xxx.is_slave(p) || p.IsPrisonerOfColony)); Notify_ResolutionChanged(); Reloadtab(); }, MenuOptionPriority.Default)); return opts; } } }
Korth95/rjw
1.5/Source/RJWTab/MainTabWindow.cs
C#
mit
3,335
using System; using UnityEngine; using Verse; using Verse.Sound; namespace RimWorld { // Token: 0x020013F0 RID: 5104 public class PawnColumnWorker_Master : PawnColumnWorker { // Token: 0x17001618 RID: 5656 // (get) Token: 0x06007D97 RID: 32151 RVA: 0x00012AE6 File Offset: 0x00010CE6 protected override GameFont DefaultHeaderFont { get { return GameFont.Tiny; } } // Token: 0x06007D98 RID: 32152 RVA: 0x002CCC79 File Offset: 0x002CAE79 public override int GetMinWidth(PawnTable table) { return Mathf.Max(base.GetMinWidth(table), 100); } // Token: 0x06007D99 RID: 32153 RVA: 0x002CCC89 File Offset: 0x002CAE89 public override int GetOptimalWidth(PawnTable table) { return Mathf.Clamp(170, this.GetMinWidth(table), this.GetMaxWidth(table)); } // Token: 0x06007D9A RID: 32154 RVA: 0x002CB126 File Offset: 0x002C9326 public override void DoHeader(Rect rect, PawnTable table) { base.DoHeader(rect, table); MouseoverSounds.DoRegion(rect); } // Token: 0x06007D9B RID: 32155 RVA: 0x002CCCA3 File Offset: 0x002CAEA3 public override void DoCell(Rect rect, Pawn pawn, PawnTable table) { if (!this.CanAssignMaster(pawn)) { return; } TrainableUtility.MasterSelectButton(rect.ContractedBy(2f), pawn, true); } // Token: 0x06007D9C RID: 32156 RVA: 0x002CCCC4 File Offset: 0x002CAEC4 public override int Compare(Pawn a, Pawn b) { int valueToCompare = this.GetValueToCompare1(a); int valueToCompare2 = this.GetValueToCompare1(b); if (valueToCompare != valueToCompare2) { return valueToCompare.CompareTo(valueToCompare2); } return this.GetValueToCompare2(a).CompareTo(this.GetValueToCompare2(b)); } // Token: 0x06007D9D RID: 32157 RVA: 0x002CCD01 File Offset: 0x002CAF01 private bool CanAssignMaster(Pawn pawn) { return pawn.RaceProps.Animal && pawn.Faction == Faction.OfPlayer && pawn.training.HasLearned(TrainableDefOf.Obedience); } // Token: 0x06007D9E RID: 32158 RVA: 0x002CCD34 File Offset: 0x002CAF34 private int GetValueToCompare1(Pawn pawn) { if (!this.CanAssignMaster(pawn)) { return 0; } if (pawn.playerSettings.Master == null) { return 1; } return 2; } // Token: 0x06007D9F RID: 32159 RVA: 0x002CCD51 File Offset: 0x002CAF51 private string GetValueToCompare2(Pawn pawn) { if (pawn.playerSettings != null && pawn.playerSettings.Master != null) { return pawn.playerSettings.Master.Label; } return ""; } } }
Korth95/rjw
1.5/Source/RJWTab/PawnColumnWorker_Master.cs
C#
mit
2,498
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { public abstract class PawnColumnWorker_TextCenter : PawnColumnWorker_Text { public override void DoCell(Rect rect, Pawn pawn, PawnTable table) { Rect rect2 = new Rect(rect.x, rect.y, rect.width, Mathf.Min(rect.height, 30f)); string textFor = GetTextFor(pawn); if (textFor != null) { Text.Font = GameFont.Small; Text.Anchor = TextAnchor.MiddleCenter; Text.WordWrap = false; Widgets.Label(rect2, textFor); Text.WordWrap = true; Text.Anchor = TextAnchor.UpperLeft; string tip = GetTip(pawn); if (!tip.NullOrEmpty()) { TooltipHandler.TipRegion(rect2, tip); } } } } }
Korth95/rjw
1.5/Source/RJWTab/PawnColumnWorker_TextCenter.cs
C#
mit
803
using System; using System.Collections.Generic; using System.Linq; using RimWorld; using rjw; using Verse; namespace rjw.MainTab { public class RJW_PawnTable_Animals : PawnTable_Animals { public RJW_PawnTable_Animals(PawnTableDef def, Func<IEnumerable<Pawn>> pawnsGetter, int uiWidth, int uiHeight) : base(def, pawnsGetter, uiWidth, uiHeight) { } //default sorting protected override IEnumerable<Pawn> LabelSortFunction(IEnumerable<Pawn> input) { //return input.OrderBy(p => p.Name); foreach (Pawn p in input) p.UpdatePermissions(); return input.OrderByDescending(p => xxx.get_pawnname(p)); //return input.OrderByDescending(p => (p.IsPrisonerOfColony || p.IsSlaveOfColony) != false).ThenBy(p => (p.Name.ToStringShort.Colorize(Color.yellow))); //return input.OrderBy(p => xxx.get_pawnname(p)); } protected override IEnumerable<Pawn> PrimarySortFunction(IEnumerable<Pawn> input) { foreach (Pawn p in input) p.UpdatePermissions(); return input; //return base.PrimarySortFunction(input); } //public IEnumerable<Pawn> FilterPawns //{ // get // { // ModLog.Message("FilterPawnsGet"); // var x = Find.CurrentMap.mapPawns.PawnsInFaction(Faction.OfPlayer).Where(p => xxx.is_animal(p)); // ModLog.Message("x: " + x); // return x; // } //} } }
Korth95/rjw
1.5/Source/RJWTab/PawnTable_Animals.cs
C#
mit
1,314
using System; using System.Collections.Generic; using System.Linq; using RimWorld; using rjw; using Verse; namespace rjw.MainTab { public class RJW_PawnTable_Humanlikes : PawnTable_PlayerPawns { public RJW_PawnTable_Humanlikes(PawnTableDef def, Func<IEnumerable<Pawn>> pawnsGetter, int uiWidth, int uiHeight) : base(def, pawnsGetter, uiWidth, uiHeight) { } //default sorting protected override IEnumerable<Pawn> LabelSortFunction(IEnumerable<Pawn> input) { //return input.OrderBy(p => p.Name); foreach (Pawn p in input) p.UpdatePermissions(); return input.OrderByDescending(p => (p.IsPrisonerOfColony || p.IsSlaveOfColony) != false).ThenBy(p => xxx.get_pawnname(p)); //return input.OrderByDescending(p => (p.IsPrisonerOfColony || p.IsSlaveOfColony) != false).ThenBy(p => (p.Name.ToStringShort.Colorize(Color.yellow))); //return input.OrderBy(p => xxx.get_pawnname(p)); } protected override IEnumerable<Pawn> PrimarySortFunction(IEnumerable<Pawn> input) { foreach (Pawn p in input) p.UpdatePermissions(); return input; //return base.PrimarySortFunction(input); } //public static IEnumerable<Pawn> FilterPawns() //{ // return Find.CurrentMap.mapPawns.PawnsInFaction(Faction.OfPlayer).Where(p => xxx.is_animal(p)); //} } }
Korth95/rjw
1.5/Source/RJWTab/PawnTable_Humanlikes.cs
C#
mit
1,285
using System.Collections.Generic; using System.Linq; using HarmonyLib; using RimWorld; using Verse; using Sex = rjw.GenderHelper.Sex; namespace rjw { // Less straightforward than part removal as this recipe can potentially be applied on pawn generation public class Recipe_InstallPart : Recipe_InstallArtificialBodyPart { protected virtual bool CanApplyOnPart(Pawn pawn, BodyPartRecord record) { if (record.parent != null && !pawn.health.hediffSet.GetNotMissingParts().Contains(record.parent)) { return false; } return true; } public virtual bool ValidFor(Pawn pawn) => !xxx.is_slime(pawn); public override bool AvailableOnNow(Thing thing, BodyPartRecord part = null) { return base.AvailableOnNow(thing, part) && ValidFor((Pawn) thing); } public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { return MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn, (BodyPartRecord record) => CanApplyOnPart(pawn, record)); } public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill) { Sex before = GenderHelper.GetSex(pawn); if (billDoer != null && CheckSurgeryFail(billDoer, pawn, ingredients, part, bill)) { return; } OnSurgerySuccess(pawn, part, billDoer, ingredients, bill); Hediff addedPartHediff = SexPartAdder.recipePartAdder(recipe, pawn, part, ingredients); pawn.health.AddHediff(addedPartHediff, part); if (billDoer != null) { if (IsViolationOnPawn(pawn, part, billDoer.Faction)) { ReportViolation(pawn, billDoer, pawn.Faction, -80); } if (ModsConfig.IdeologyActive && !addedPartHediff.def.IsArtificialSexPart()) { Find.HistoryEventsManager.RecordEvent(new HistoryEvent(HistoryEventDefOf.InstalledProsthetic, billDoer.Named(HistoryEventArgsNames.Doer))); } } if (!PawnGenerator.IsBeingGenerated(pawn)) { // TODO: Incorporate sex changes into violation logic Sex after = GenderHelper.GetSex(pawn); GenderHelper.ChangeSex(pawn, before, after); } } protected override void OnSurgerySuccess(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill) { if (billDoer != null) { TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn); SurgeryHelper.RemoveAndSpawnSexParts(billDoer, pawn, part, isReplacement: true); MedicalRecipesUtility.SpawnNaturalPartIfClean(pawn, part, billDoer.Position, billDoer.Map); MedicalRecipesUtility.SpawnThingsFromHediffs(pawn, part, billDoer.Position, billDoer.Map); } pawn.health.RestorePart(part); } } public class Recipe_InstallGenitals : Recipe_InstallPart { public override bool ValidFor(Pawn p) { return base.ValidFor(p) && !Genital_Helper.genitals_blocked(p); } } public class Recipe_InstallBreasts : Recipe_InstallPart { public override bool ValidFor(Pawn p) { return base.ValidFor(p) && !Genital_Helper.breasts_blocked(p); } } public class Recipe_InstallAnus : Recipe_InstallPart { public override bool ValidFor(Pawn p) { return base.ValidFor(p) && !Genital_Helper.anus_blocked(p); } } }
Korth95/rjw
1.5/Source/Recipes/Install_Part/Recipe_InstallPart.cs
C#
mit
3,182
using System.Collections.Generic; using System.Linq; using RimWorld; using Verse; namespace rjw { public class Recipe_AddMultiPart : Recipe_InstallPart { // Record tale without removing pre-existing parts protected override void OnSurgerySuccess(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill) { if (billDoer != null) { TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn); } } protected override bool CanApplyOnPart(Pawn pawn, BodyPartRecord record) { return base.CanApplyOnPart(pawn, record) && !pawn.health.hediffSet.PartIsMissing(record); } public override bool ValidFor(Pawn pawn) { if (!base.ValidFor(pawn)) { return false; } var parts = pawn.GetGenitalsList(); GenitalFamily? genitalType = (recipe.addsHediff as HediffDef_SexPart).genitalFamily; //don't add if artificial parts present if (pawn.health.hediffSet.hediffs.Any((Hediff hed) => (hed.Part != null) && recipe.appliedOnFixedBodyParts.Contains(hed.Part.def) && hed is Hediff_AddedPart)) { return false; } return true; } public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { //don't add if artificial parts present foreach (var part in base.GetPartsToApplyOn(pawn, recipe)) { if (pawn.health.hediffSet.GetDirectlyAddedPartFor(part)?.def.organicAddedBodypart ?? true) { yield return part; } } } } }
Korth95/rjw
1.5/Source/Recipes/Recipe_AddMultiPart.cs
C#
mit
1,471
using System.Collections.Generic; using RimWorld; using Verse; using System.Linq; using System; namespace rjw { public class Recipe_GrowBreasts : Recipe_Surgery { public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill) { if (billDoer != null) { if (CheckSurgeryFail(billDoer, pawn, ingredients, part, bill)) { return; } TaleRecorder.RecordTale(TaleDefOf.DidSurgery, new object[] { billDoer, pawn }); } var oldBoobs = pawn.health.hediffSet.hediffs.FirstOrDefault(hediff => hediff.def == bill.recipe.removesHediff); var newBoobs = bill.recipe.addsHediff; var newSize = BreastSize_Helper.GetSize(newBoobs); GenderHelper.ChangeSex(pawn, () => { BreastSize_Helper.HurtBreasts(pawn, part, 3 * (newSize - 1)); if (pawn.health.hediffSet.PartIsMissing(part)) { return; } if (oldBoobs != null) { pawn.health.RemoveHediff(oldBoobs); } pawn.health.AddHediff(newBoobs, part); }); } public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipeDef) { yield break; var chest = Genital_Helper.get_breastsBPR(pawn); if (pawn.health.hediffSet.PartIsMissing(chest) || Genital_Helper.breasts_blocked(pawn)) { yield break; } var old = recipeDef.removesHediff; if (old == null ? BreastSize_Helper.HasNipplesOnly(pawn, chest) : pawn.health.hediffSet.HasHediff(old, chest)) { yield return chest; } } } }
Korth95/rjw
1.5/Source/Recipes/Recipe_GrowBreasts.cs
C#
mit
1,538
using RimWorld; using System.Collections.Generic; using Verse; namespace rjw { /// <summary> /// Removes heddifs (restraints/cocoon) /// </summary> public class Recipe_RemoveRestraints : Recipe_RemoveHediff { public override bool AvailableOnNow(Thing pawn, BodyPartRecord part = null) { return true; } public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { List<Hediff> allHediffs = pawn.health.hediffSet.hediffs; int i = 0; while (true) { if (i >= allHediffs.Count) { yield break; } if (allHediffs[i].def == recipe.removesHediff && allHediffs[i].Visible) { break; } i++; } yield return allHediffs[i].Part; } } }
Korth95/rjw
1.5/Source/Recipes/Recipe_Restraints.cs
C#
mit
734
using System.Collections.Generic; using RimWorld; using Verse; using System.Linq; using System; namespace rjw { public class Recipe_ShrinkBreasts : Recipe_Surgery { public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill) { if (billDoer != null) { if (CheckSurgeryFail(billDoer, pawn, ingredients, part, bill)) { return; } TaleRecorder.RecordTale(TaleDefOf.DidSurgery, new object[] { billDoer, pawn }); } if (!BreastSize_Helper.TryGetBreastSize(pawn, out var oldSize)) { throw new ApplicationException("Recipe_ShrinkBreasts could not find any breasts to shrink."); } var oldBoobs = pawn.health.hediffSet.GetFirstHediffOfDef(BreastSize_Helper.GetHediffDef(oldSize)); var newSize = oldSize - 1; var newBoobs = BreastSize_Helper.GetHediffDef(newSize); // I can't figure out how to spawn a stack of 2 meat. for (var i = 0; i < 2; i++) { GenSpawn.Spawn(pawn.RaceProps.meatDef, billDoer.Position, billDoer.Map); } GenderHelper.ChangeSex(pawn, () => { BreastSize_Helper.HurtBreasts(pawn, part, 5); if (pawn.health.hediffSet.PartIsMissing(part)) { return; } pawn.health.RemoveHediff(oldBoobs); pawn.health.AddHediff(newBoobs, part); }); } public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipeDef) { yield break; var chest = Genital_Helper.get_breastsBPR(pawn); if (Genital_Helper.breasts_blocked(pawn)) { yield break; } if (BreastSize_Helper.TryGetBreastSize(pawn, out var size) //&& size > BreastSize_Helper.GetSize(Genital_Helper.flat_breasts)) ) { yield return chest; } } } }
Korth95/rjw
1.5/Source/Recipes/Recipe_ShrinkBreasts.cs
C#
mit
1,755
using System.Collections.Generic; using RimWorld; using Verse; namespace rjw { public class Recipe_RemoveAnus : Recipe_RemovePart { protected override bool ValidFor(Pawn p) { return base.ValidFor(p) && Genital_Helper.has_anus(p) && !Genital_Helper.anus_blocked(p); } } }
Korth95/rjw
1.5/Source/Recipes/Remove_Part/Recipe_RemoveAnus.cs
C#
mit
286
using System.Collections.Generic; using RimWorld; using Verse; namespace rjw { public class Recipe_RemoveBreasts : Recipe_RemovePart { protected override bool ValidFor(Pawn p) { return base.ValidFor(p) && Genital_Helper.has_breasts(p) && !Genital_Helper.breasts_blocked(p); } } }
Korth95/rjw
1.5/Source/Recipes/Remove_Part/Recipe_RemoveBreasts.cs
C#
mit
295
using System.Collections.Generic; using RimWorld; using Verse; namespace rjw { public class Recipe_RemoveGenitals : Recipe_RemovePart { protected override bool ValidFor(Pawn p) { return base.ValidFor(p) && Genital_Helper.has_genitals(p) && !Genital_Helper.genitals_blocked(p); } } }
Korth95/rjw
1.5/Source/Recipes/Remove_Part/Recipe_RemoveGenitals.cs
C#
mit
298
using System.Collections.Generic; using Multiplayer.API; using RimWorld; using Verse; namespace rjw { public class Recipe_RemovePart : Recipe_RemoveBodyPart { private const int HarvestGoodwillPenalty = -80; protected virtual bool ValidFor(Pawn p) { return !xxx.is_slime(p);//|| xxx.is_demon(p) } public override bool AvailableOnNow(Thing thing, BodyPartRecord part = null) { return base.AvailableOnNow(thing, part) && ValidFor((Pawn)thing); } public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { return MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn); } public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill) { bool isHarvest = SurgeryHelper.IsHarvest(pawn, part); bool isViolation = isHarvest && IsViolationOnPawn(pawn, part, billDoer.Faction); if (billDoer != null) { if (CheckSurgeryFail(billDoer, pawn, ingredients, part, bill)) { return; } OnSurgerySuccess(pawn, part, billDoer, ingredients, bill); } DamagePart(pawn, part); pawn.Drawer.renderer.SetAllGraphicsDirty(); if (isHarvest) { ApplyThoughts(pawn, billDoer); } if (isViolation) { ReportViolation(pawn, billDoer, pawn.HomeFaction, HarvestGoodwillPenalty); } } protected override void OnSurgerySuccess(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill) { base.OnSurgerySuccess(pawn, part, billDoer, ingredients, bill); TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn); SurgeryHelper.RemoveAndSpawnSexParts(billDoer, pawn, part, isReplacement: false); MedicalRecipesUtility.SpawnNaturalPartIfClean(pawn, part, billDoer.Position, billDoer.Map); MedicalRecipesUtility.SpawnThingsFromHediffs(pawn, part, billDoer.Position, billDoer.Map); } public override string GetLabelWhenUsedOn(Pawn p, BodyPartRecord part) { return recipe.label.CapitalizeFirst(); } [SyncMethod] public override void DamagePart(Pawn pawn, BodyPartRecord part) { if (part.IsCorePart) { float damageAmount = part.def.hitPoints * Rand.Range(.5f, 1.5f) / 20f; pawn.TakeDamage(new DamageInfo(DamageDefOf.SurgicalCut, damageAmount, 999f, -1f, null, part)); } else { base.DamagePart(pawn, part); } } } }
Korth95/rjw
1.5/Source/Recipes/Remove_Part/Recipe_RemovePart.cs
C#
mit
2,368
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using RimWorld; using Verse; namespace rjw { public class PawnRelationWorker_Child_Beast : PawnRelationWorker_Child { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isChildOf(other, me); } } public class PawnRelationWorker_Sibling_Beast : PawnRelationWorker_Sibling { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isSiblingOf(other, me); } } public class PawnRelationWorker_HalfSibling_Beast : PawnRelationWorker_HalfSibling { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isHalfSiblingOf(other, me); } } public class PawnRelationWorker_Grandparent_Beast : PawnRelationWorker_Grandparent { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGrandchildOf(me, other); } } public class PawnRelationWorker_Grandchild_Beast : PawnRelationWorker_Grandchild { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGrandparentOf(me, other); //if other isGrandchildOf of me, me is their grandparent } } public class PawnRelationWorker_NephewOrNiece_Beast : PawnRelationWorker_NephewOrNiece { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isUncleOrAuntOf(me, other); } } public class PawnRelationWorker_UncleOrAunt_Beast : PawnRelationWorker_UncleOrAunt { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isNephewOrNieceOf(me, other); } } public class PawnRelationWorker_Cousin_Beast : PawnRelationWorker_Cousin { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isCousinOf(me, other); } } public class PawnRelationWorker_GreatGrandparent_Beast : PawnRelationWorker_GreatGrandparent { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGreatGrandChildOf(me, other); } } public class PawnRelationWorker_GreatGrandchild_Beast : PawnRelationWorker_GreatGrandchild { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGreatGrandparentOf(me, other); } } public class PawnRelationWorker_GranduncleOrGrandaunt_Beast : PawnRelationWorker_GranduncleOrGrandaunt { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGrandnephewOrGrandnieceOf(me, other); } } public class PawnRelationWorker_GrandnephewOrGrandniece_Beast : PawnRelationWorker_GrandnephewOrGrandniece { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGreatUncleOrAuntOf(me, other); } } public class PawnRelationWorker_CousinOnceRemoved_Beast : PawnRelationWorker_CousinOnceRemoved { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isCousinOnceRemovedOf(me, other); } } public class PawnRelationWorker_SecondCousin_Beast : PawnRelationWorker_SecondCousin { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isSecondCousinOf(me, other); } } /* public class PawnRelationWorker_Kin_Beast : PawnRelationWorker_Kin { public override bool InRelation(Pawn me, Pawn other) { if (!xxx.is_animal(other) || me == other) { return false; } if (base.InRelation(me, other) == true) { return true; } return false; } } */ }
Korth95/rjw
1.5/Source/Relations/BeastPawnRelationWorkers.cs
C#
mit
4,540
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using RimWorld; using Verse; namespace rjw { public class PawnRelationWorker_Child_Humanlike : PawnRelationWorker_Child { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isChildOf(other, me); } } public class PawnRelationWorker_Sibling_Humanlike : PawnRelationWorker_Sibling { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isSiblingOf(me, other); } } public class PawnRelationWorker_HalfSibling_Humanlike : PawnRelationWorker_HalfSibling { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isHalfSiblingOf(other, me); } } public class PawnRelationWorker_Grandparent_Humanlike : PawnRelationWorker_Grandparent { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGrandchildOf(me, other); } } public class PawnRelationWorker_Grandchild_Humanlike : PawnRelationWorker_Grandchild { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGrandparentOf(me, other); } } public class PawnRelationWorker_NephewOrNiece_Humanlike : PawnRelationWorker_NephewOrNiece { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isUncleOrAuntOf(me, other); } } public class PawnRelationWorker_UncleOrAunt_Humanlike : PawnRelationWorker_UncleOrAunt { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isNephewOrNieceOf(me, other); } } public class PawnRelationWorker_Cousin_Humanlike : PawnRelationWorker_Cousin { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isCousinOf(me, other); } } public class PawnRelationWorker_GreatGrandparent_Humanlike : PawnRelationWorker_GreatGrandparent { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGreatGrandChildOf(me, other); } } public class PawnRelationWorker_GreatGrandchild_Humanlike : PawnRelationWorker_GreatGrandchild { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGreatGrandparentOf(me, other); } } public class PawnRelationWorker_GranduncleOrGrandaunt_Humanlike : PawnRelationWorker_GranduncleOrGrandaunt { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGrandnephewOrGrandnieceOf(me, other); } } public class PawnRelationWorker_GrandnephewOrGrandniece_Humanlike : PawnRelationWorker_GrandnephewOrGrandniece { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isGreatUncleOrAuntOf(me, other); } } public class PawnRelationWorker_CousinOnceRemoved_Humanlike : PawnRelationWorker_CousinOnceRemoved { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isCousinOnceRemovedOf(me, other); } } public class PawnRelationWorker_SecondCousin_Humanlike : PawnRelationWorker_SecondCousin { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } return RelationChecker.isSecondCousinOf(me, other); } } public class PawnRelationWorker_Kin_Humanlike : PawnRelationWorker_Kin { public override bool InRelation(Pawn me, Pawn other) { if (xxx.is_animal(other) || me == other) { return false; } if (base.InRelation(me, other) == true) { return true; } return false; } } }
Korth95/rjw
1.5/Source/Relations/HumanlikeBloodRelationWorkers.cs
C#
mit
4,520
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using RimWorld; using Verse; namespace rjw { /// <summary> /// Checks for relations, workaround for relation checks that rely on other relation checks, since the vanilla inRelation checks have been prefixed. /// /// Return true if first pawn is specified relation of the second pawn /// /// If "me" isRelationOf "other" return true /// </summary> /// public static class RelationChecker { // like getMother() but without gender, and capable of pulling second parent of same gender private static Pawn getParent(Pawn pawn, bool skipFirst) { if (pawn == null) { return null; } if (!pawn.RaceProps.IsFlesh) { return null; } if (pawn.relations == null) { return null; } foreach (DirectPawnRelation directPawnRelation in pawn.relations.DirectRelations) { if (directPawnRelation.def == PawnRelationDefOf.Parent) { if (!skipFirst) { return directPawnRelation.otherPawn; } skipFirst = false; } } return null; } // unnecessary but make reading relations easier public static Pawn getParent(Pawn pawn) { return getParent(pawn, false); } public static Pawn getSecondParent(Pawn pawn) { return getParent(pawn, true); } // checks against all Parent direct relations, ignoring gender public static bool isChildOf(Pawn me, Pawn other) { if (me == null || other ==null || me == other) { return false; } if (!other.RaceProps.IsFlesh) { return false; } if (me.relations == null) { return false; } foreach (DirectPawnRelation directPawnRelation in me.relations.DirectRelations) { if (directPawnRelation.def == PawnRelationDefOf.Parent && directPawnRelation.otherPawn == other) { return true; } } return false; } public static bool isSiblingOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if (getParent(me) != null && getSecondParent(me) != null && ( getParent(me) == getParent(other) && getSecondParent(me) == getSecondParent(other) || // if both have same parents getParent(me) == getSecondParent(other) && getSecondParent(me) == getParent(other))) // if parents swapped roles, idk how such relation would be named, but without this they are kin, which is wrong { return true; } return false; } public static bool isHalfSiblingOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if (isSiblingOf(me, other)) { return false; } return getParent(me) != null && (getParent(me) == getParent(other) || getParent(me) == getSecondParent(other)) || getSecondParent(me) != null && (getSecondParent(me) == getParent(other) || getSecondParent(me) == getSecondParent(other)); } public static bool isAnySiblingOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if (getParent(me) != null && (getParent(me) == getParent(other) || getParent(me) == getSecondParent(other)) || getSecondParent(me) != null && (getSecondParent(me) == getParent(other) || getSecondParent(me) == getSecondParent(other))) { return true; } return false; } public static bool isGrandchildOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if ((getParent(me) != null && isChildOf(getParent(me), other)) || (getSecondParent(me) != null && isChildOf(getSecondParent(me), other))) { return true; } return false; } public static bool isGrandparentOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if (isGrandchildOf(other, me)) { return true; } return false; } public static bool isNephewOrNieceOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if ((getParent(me) != null && (isAnySiblingOf(other, getParent(me)))) || (getSecondParent(me) != null && (isAnySiblingOf(other, getSecondParent(me))))) { return true; } return false; } public static bool isUncleOrAuntOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if (isNephewOrNieceOf(other, me)) { return true; } return false; } public static bool isCousinOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if ((getParent(other) != null && isNephewOrNieceOf(me, getParent(other))) || (getSecondParent(other) != null && isNephewOrNieceOf(me, getSecondParent(other)))) { return true; } return false; } public static bool isGreatGrandparentOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } return isGreatGrandChildOf(other, me); } public static bool isGreatGrandChildOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if ((getParent(me) != null && isGrandchildOf(getParent(me), other)) || (getSecondParent(me) != null && isGrandchildOf(getSecondParent(me), other))) { return true; } return false; } public static bool isGreatUncleOrAuntOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } return isGrandnephewOrGrandnieceOf(other, me); } public static bool isGrandnephewOrGrandnieceOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if ((getParent(me) != null && isUncleOrAuntOf(other, getParent(me))) || (getSecondParent(me) != null && isUncleOrAuntOf(other, getSecondParent(me)))) { return true; } return false; } public static bool isCousinOnceRemovedOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } if ((getParent(other) != null && isCousinOf(me, getParent(other))) || (getSecondParent(other) != null && isCousinOf(me, getSecondParent(other)))) { return true; } if ((getParent(other) != null && isGrandnephewOrGrandnieceOf(me, getParent(other))) || (getSecondParent(other) != null && isGrandnephewOrGrandnieceOf(me, getSecondParent(other)))) { return true; } return false; } public static bool isSecondCousinOf(Pawn me, Pawn other) { if (me == null || me == other) { return false; } Pawn parent = getParent(other); if (parent != null && ((getParent(parent) != null && isGrandnephewOrGrandnieceOf(me, getParent(parent))) || (getSecondParent(parent) != null && isGrandnephewOrGrandnieceOf(me, getSecondParent(parent))))) { return true; } Pawn secondParent = getSecondParent(other); if (secondParent != null && (getParent(secondParent) != null && isGrandnephewOrGrandnieceOf(me, getParent(secondParent)) || (getSecondParent(secondParent) != null && isGrandnephewOrGrandnieceOf(me, getSecondParent(secondParent))))) { return true; } return false; } } }
Korth95/rjw
1.5/Source/Relations/RelationChecker.cs
C#
mit
7,015
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Verse; namespace rjw.RenderNodeWorkers { public class PawnRenderNodeWorker_Apparel_DrawNude : PawnRenderSubWorker { public override bool CanDrawNowSub(PawnRenderNode node, PawnDrawParms parms) { return false; } } }
Korth95/rjw
1.5/Source/RenderNodeWorkers/PawnRenderNodeWorker_Apparel_DrawNude.cs
C#
mit
353
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}</ProjectGuid> <OutputType>Library</OutputType> <NoStandardLibraries>false</NoStandardLibraries> <AssemblyName>RJW</AssemblyName> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <TargetFrameworkProfile /> <ShouldCreateLogs>True</ShouldCreateLogs> <AdvancedSettingsExpanded>True</AdvancedSettingsExpanded> <UpdateAssemblyVersion>True</UpdateAssemblyVersion> <UpdateAssemblyFileVersion>True</UpdateAssemblyFileVersion> <UpdateAssemblyInfoVersion>True</UpdateAssemblyInfoVersion> <AssemblyVersionSettings>None.None.IncrementOnDemand.Increment</AssemblyVersionSettings> <AssemblyFileVersionSettings>None.None.IncrementOnDemand.None</AssemblyFileVersionSettings> <AssemblyInfoVersionSettings>None.None.IncrementOnDemand.None</AssemblyInfoVersionSettings> <PrimaryVersionType>AssemblyVersionAttribute</PrimaryVersionType> <AssemblyVersion>1.6.0.493</AssemblyVersion> <LangVersion>10</LangVersion> <NuGetPackageImportStamp> </NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>..\Assemblies\</OutputPath> <DefineConstants>TRACE;DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <FileAlignment>4096</FileAlignment> <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>..\Assemblies\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <LangVersion>latest</LangVersion> <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <!-- Set the `BENCHMARK` environment variable to "1" to enable benchmarking. --> <PropertyGroup Condition="'$(BENCHMARK)' == '1'"> <DefineConstants>$(DefineConstants);BENCHMARK</DefineConstants> </PropertyGroup> <PropertyGroup> <RootNamespace>rjw</RootNamespace> </PropertyGroup> <Choose> <!-- Mod-folder Relative --> <When Condition="Exists('..\..\..\..\Mods')"> <PropertyGroup> <RWPath>..\..\..\..</RWPath> </PropertyGroup> </When> <!-- Windows x86 --> <When Condition="Exists('C:\Program Files (x86)\Steam\steamapps\common\RimWorld')"> <PropertyGroup> <RWPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld</RWPath> </PropertyGroup> </When> <!-- Windows x64 --> <When Condition="Exists('C:\Program Files\Steam\steamapps\common\RimWorld')"> <PropertyGroup> <RWPath>C:\Program Files\Steam\steamapps\common\RimWorld</RWPath> </PropertyGroup> </When> <!-- Linux --> <When Condition="Exists('$(HOME)\.steam\steam')"> <PropertyGroup> <RWPath>$(HOME)\.steam\steam\steamapps\common\RimWorld</RWPath> </PropertyGroup> </When> <!-- MacOS --> <When Condition="Exists('$(HOME)\Library\Application Support\Steam')"> <PropertyGroup> <RWPath>$(HOME)\Library\Application Support\Steam\steamapps\common\RimWorld</RWPath> </PropertyGroup> </When> <!-- Fallback option: define the RIMWORLD environment variable, pointing to RimWorld's install folder --> <When Condition="Exists('$(RIMWORLD)')"> <PropertyGroup> <RWPath>$(RIMWORLD)</RWPath> </PropertyGroup> </When> </Choose> <PropertyGroup> <ReferencePath> $(RWPath)\RimWorldWin_Data\Managed; $(RWPath)\RimWorldWin64_Data\Managed; $(RWPath)\RimWorldLinux_Data\Managed; $(RWPath)\RimWorldMac.app\Contents\Resources\Data\Managed; $(ReferencePath) </ReferencePath> </PropertyGroup> <!-- Prevents copying DLLs on build. --> <!-- If you do still get copies, wipe out the `obj` folder and re-run the `restore` task. --> <!-- You can do this on the command line with: `msbuild /t:restore` --> <ItemDefinitionGroup> <Reference> <Private>False</Private> </Reference> <ProjectReference> <Private>False</Private> </ProjectReference> <PackageReference> <ExcludeAssets>runtime</ExcludeAssets> </PackageReference> </ItemDefinitionGroup> <ItemGroup> <Compile Include=".\**\*.cs" /> <!-- Ignore files in `obj`; they'll be included else where, as needed. --> <Compile Remove=".\obj\**\*.cs" /> <!-- Things in trash are in trash for a reason, I presume. Maybe delete them? --> <Compile Remove=".\0trash\**\*.cs" /> <!-- Exclude files not currently in use here. --> <!-- Better yet, clean up your garbage. If we need it again, Git keeps a copy for us. --> <Compile Remove=".\Common\ExpandedPawnCharacterCard.cs" /> <Compile Remove=".\Common\Verb_Fuck.cs" /> <Compile Remove=".\JobDrivers\JobRJWSex.cs" /> <Compile Remove=".\JobDrivers\JobDriver_AbortMechPregnancy.cs" /> <Compile Remove=".\RJWTab\PawnColumnWorker_Master.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_BestialityForFemale.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_Quickie.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_ViolateCorpse.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_BestialityForMale.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_Masturbate_Quick.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_RapeEnemy.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_BestialityF.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_Rape.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_Sex.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_CleanSexStuff.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_RapeCP.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_Masturbate_Bed.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_BestialityM.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_Solicit.cs" /> <Compile Remove=".\WorkGivers\WorkGiver_Masturbate_Chair.cs" /> <Compile Remove=".\Harmony\patch_PartIsMissing.cs" /> <Compile Remove=".\Harmony\d.cs" /> <Compile Remove=".\Harmony\patch_need.cs" /> <Compile Remove=".\Harmony\test.cs" /> <Compile Remove=".\Harmony\Building_Bed_Patch.cs" /> <Compile Remove=".\Harmony\patch_AnimalTab.cs" /> <Compile Remove=".\DefOf\RJW_RecipeDefOf.cs" /> <Compile Remove=".\DefOf\JobDriver_AdjustParts.cs" /> <Compile Remove=".\DefOf\JobDefOf.cs" /> <Compile Remove=".\Modules\Bondage\Comps\CompCryptoStamped.cs" /> <Compile Remove=".\Modules\Genitals\Enums\LewdablePartKind.cs" /> <Compile Remove=".\Recipes\Recipe_ShrinkBreasts.cs" /> <Compile Remove=".\Recipes\Recipe_GrowBreasts.cs" /> </ItemGroup> <ItemGroup> <Reference Include="0MultiplayerAPI, Version=0.5.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\Assemblies\0MultiplayerAPI.dll</HintPath> </Reference> <Reference Include="Psychology"> <HintPath>0trash\modpackages\Psychology.2018-11-18\Assemblies\Psychology.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="SyrTraits"> <HintPath>0trash\modpackages\SYR.Individuality.1.1.7\1.1\Assemblies\SyrTraits.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Runtime.InteropServices.RuntimeInformation" /> <!-- RimWorld references --> <Reference Include="Assembly-CSharp" /> <Reference Include="ISharpZipLib" /> <Reference Include="Unity.TextMeshPro" /> <Reference Include="UnityEngine.AIModule" /> <Reference Include="UnityEngine.AccessibilityModule" /> <Reference Include="UnityEngine.AndroidJNIModule" /> <Reference Include="UnityEngine.AnimationModule" /> <Reference Include="UnityEngine.AssetBundleModule" /> <Reference Include="UnityEngine.AudioModule" /> <Reference Include="UnityEngine.ClothModule" /> <Reference Include="UnityEngine.ClusterInputModule" /> <Reference Include="UnityEngine.ClusterRendererModule" /> <Reference Include="UnityEngine.CoreModule" /> <Reference Include="UnityEngine.CrashReportingModule" /> <Reference Include="UnityEngine.DSPGraphModule" /> <Reference Include="UnityEngine.DirectorModule" /> <Reference Include="UnityEngine.GameCenterModule" /> <Reference Include="UnityEngine.GridModule" /> <Reference Include="UnityEngine.HotReloadModule" /> <Reference Include="UnityEngine.IMGUIModule" /> <Reference Include="UnityEngine.ImageConversionModule" /> <Reference Include="UnityEngine.InputLegacyModule" /> <Reference Include="UnityEngine.InputModule" /> <Reference Include="UnityEngine.JSONSerializeModule" /> <Reference Include="UnityEngine.LocalizationModule" /> <Reference Include="UnityEngine.ParticleSystemModule" /> <Reference Include="UnityEngine.PerformanceReportingModule" /> <Reference Include="UnityEngine.Physics2DModule" /> <Reference Include="UnityEngine.PhysicsModule" /> <Reference Include="UnityEngine.ProfilerModule" /> <Reference Include="UnityEngine.ScreenCaptureModule" /> <Reference Include="UnityEngine.SharedInternalsModule" /> <Reference Include="UnityEngine.SpriteMaskModule" /> <Reference Include="UnityEngine.SpriteShapeModule" /> <Reference Include="UnityEngine.StreamingModule" /> <Reference Include="UnityEngine.SubstanceModule" /> <Reference Include="UnityEngine.TLSModule" /> <Reference Include="UnityEngine.TerrainModule" /> <Reference Include="UnityEngine.TerrainPhysicsModule" /> <Reference Include="UnityEngine.TextCoreModule" /> <Reference Include="UnityEngine.TextRenderingModule" /> <Reference Include="UnityEngine.TilemapModule" /> <Reference Include="UnityEngine.UI" /> <Reference Include="UnityEngine.UIElementsModule" /> <Reference Include="UnityEngine.UIModule" /> <Reference Include="UnityEngine.UNETModule" /> <Reference Include="UnityEngine.UmbraModule" /> <Reference Include="UnityEngine.UnityAnalyticsModule" /> <Reference Include="UnityEngine.UnityConnectModule" /> <Reference Include="UnityEngine.UnityTestProtocolModule" /> <Reference Include="UnityEngine.UnityWebRequestAssetBundleModule" /> <Reference Include="UnityEngine.UnityWebRequestAudioModule" /> <Reference Include="UnityEngine.UnityWebRequestModule" /> <Reference Include="UnityEngine.UnityWebRequestTextureModule" /> <Reference Include="UnityEngine.UnityWebRequestWWWModule" /> <Reference Include="UnityEngine.VFXModule" /> <Reference Include="UnityEngine.VRModule" /> <Reference Include="UnityEngine.VehiclesModule" /> <Reference Include="UnityEngine.VideoModule" /> <Reference Include="UnityEngine.WindModule" /> <Reference Include="UnityEngine.XRModule" /> <Reference Include="UnityEngine" /> <!-- The following are not available on all platforms, IE Linux. --> <!-- <Reference Include="UnityEngine.ARModule" /> --> <!-- <Reference Include="NAudio" /> --> <!-- <Reference Include="NVorbis" /> --> <!-- end RimWorld references --> </ItemGroup> <ItemGroup> <PackageReference Include="Krafs.Publicizer"> <Version>2.*</Version> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <PrivateAssets>all</PrivateAssets> </PackageReference> <PackageReference Include="Lib.Harmony" Version="2.*" /> <PackageReference Include="UnlimitedHugs.Rimworld.HugsLib" Version="11.*" /> </ItemGroup> <ItemGroup> <Publicize Include="Assembly-CSharp" IncludeVirtualMembers="false" /> </ItemGroup> <ItemGroup /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio AllowExistingFolder="true" /> </ProjectExtensions> </Project>
Korth95/rjw
1.5/Source/RimJobWorld.Main.csproj
csproj
mit
12,343
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27130.2024 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RimJobWorld.Main", "RimJobWorld.Main.csproj", "{22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}.Debug|Any CPU.ActiveCfg = Release|Any CPU {22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}.Debug|Any CPU.Build.0 = Release|Any CPU {22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}.Release|Any CPU.ActiveCfg = Release|Any CPU {22F82FFF-8BD4-4CEE-9F22-C7DA71281E72}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {16BA61E5-4C97-4E73-926D-6718DE8E4776} EndGlobalSection EndGlobal
Korth95/rjw
1.5/Source/RimJobWorld.Main.sln
sln
mit
1,105
using System; using UnityEngine; using Verse; using System.Collections.Generic; namespace rjw { public class RJWDebugSettings : ModSettings { private static Vector2 scrollPosition; private static float height_modifier = 0f; public static void DoWindowContents(Rect inRect) { Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f); Rect viewRect = new Rect(0f, 0f, inRect.width - 16f, inRect.height + height_modifier); Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect); // scroll Listing_Standard listingStandard = new Listing_Standard(); listingStandard.maxOneColumn = true; listingStandard.ColumnWidth = viewRect.width / 2.05f; listingStandard.Begin(viewRect); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("submit_button_enabled".Translate(), ref RJWSettings.submit_button_enabled, "submit_button_enabled_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("RJW_designation_box".Translate(), ref RJWSettings.show_RJW_designation_box, "RJW_designation_box_desc".Translate()); listingStandard.Gap(5f); if (listingStandard.ButtonText("Rjw Parts " + RJWSettings.ShowRjwParts)) { Find.WindowStack.Add(new FloatMenu(new List<FloatMenuOption>() { new FloatMenuOption("Extended", (() => RJWSettings.ShowRjwParts = RJWSettings.ShowParts.Extended)), new FloatMenuOption("Show", (() => RJWSettings.ShowRjwParts = RJWSettings.ShowParts.Show)), //new FloatMenuOption("Known".Translate(), (() => RJWSettings.ShowRjwParts = RJWSettings.ShowParts.Known)), new FloatMenuOption("Hide", (() => RJWSettings.ShowRjwParts = RJWSettings.ShowParts.Hide)) })); } listingStandard.Gap(30f); GUI.contentColor = Color.yellow; listingStandard.Label("YOU PATHETIC CHEATER "); GUI.contentColor = Color.white; listingStandard.CheckboxLabeled("override_RJW_designation_checks_name".Translate(), ref RJWSettings.override_RJW_designation_checks, "override_RJW_designation_checks_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("override_control".Translate(), ref RJWSettings.override_control, "override_control_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_Rapist".Translate(), ref RJWSettings.AddTrait_Rapist, "AddTrait_Rapist_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_Masocist".Translate(), ref RJWSettings.AddTrait_Masocist, "AddTrait_Masocist_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_Nymphomaniac".Translate(), ref RJWSettings.AddTrait_Nymphomaniac, "AddTrait_Nymphomaniac_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_Necrophiliac".Translate(), ref RJWSettings.AddTrait_Necrophiliac, "AddTrait_Necrophiliac_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_Nerves".Translate(), ref RJWSettings.AddTrait_Nerves, "AddTrait_Nerves_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_Zoophiliac".Translate(), ref RJWSettings.AddTrait_Zoophiliac, "AddTrait_Zoophiliac_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_FootSlut".Translate(), ref RJWSettings.AddTrait_FootSlut, "AddTrait_FootSlut_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_CumSlut".Translate(), ref RJWSettings.AddTrait_CumSlut, "AddTrait_CumSlut_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("AddTrait_ButtSlut".Translate(), ref RJWSettings.AddTrait_ButtSlut, "AddTrait_ButtSlut_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("Allow_RMB_DeepTalk".Translate(), ref RJWSettings.Allow_RMB_DeepTalk, "Allow_RMB_DeepTalk_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("Disable_bestiality_pregnancy_relations".Translate(), ref RJWSettings.Disable_bestiality_pregnancy_relations, "Disable_bestiality_pregnancy_relations_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("Disable_egg_pregnancy_relations".Translate(), ref RJWSettings.Disable_egg_pregnancy_relations, "Disable_egg_pregnancy_relations_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("Disable_MeditationFocusDrain".Translate(), ref RJWSettings.Disable_MeditationFocusDrain, "Disable_MeditationFocusDrain_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("Disable_RecreationDrain".Translate(), ref RJWSettings.Disable_RecreationDrain, "Disable_RecreationDrain_desc".Translate()); listingStandard.Gap(5f); listingStandard.NewColumn(); listingStandard.Gap(4f); GUI.contentColor = Color.yellow; listingStandard.CheckboxLabeled("designated_freewill".Translate(), ref RJWSettings.designated_freewill, "designated_freewill_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("override_lovin".Translate(), ref RJWSettings.override_lovin, "override_lovin_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("override_matin".Translate(), ref RJWSettings.override_matin, "override_matin_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("matin_crossbreed".Translate(), ref RJWSettings.matin_crossbreed, "matin_crossbreed_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("DevMode_name".Translate(), ref RJWSettings.DevMode, "DevMode_desc".Translate()); listingStandard.Gap(5f); if (RJWSettings.DevMode) { listingStandard.CheckboxLabeled("WildMode_name".Translate(), ref RJWSettings.WildMode, "WildMode_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("HippieMode_name".Translate(), ref RJWSettings.HippieMode, "HippieMode_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("DebugLogJoinInBed".Translate(), ref RJWSettings.DebugLogJoinInBed, "DebugLogJoinInBed_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("DebugRape".Translate(), ref RJWSettings.DebugRape, "DebugRape_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("DebugInteraction".Translate(), ref RJWSettings.DebugInteraction, "DebugInteraction_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("DebugNymph".Translate(), ref RJWSettings.DebugNymph, "DebugNymph_desc".Translate()); listingStandard.Gap(5f); } else { RJWSettings.DebugLogJoinInBed = false; RJWSettings.DebugRape = false; } listingStandard.CheckboxLabeled("GenderlessAsFuta_name".Translate(), ref RJWSettings.GenderlessAsFuta, "GenderlessAsFuta_desc".Translate()); listingStandard.Gap(5f); GUI.contentColor = Color.white; listingStandard.Gap(30f); listingStandard.Label("maxDistanceCellsCasual_name".Translate() + ": " + (RJWSettings.maxDistanceCellsCasual), -1f, "maxDistanceCellsCasual_desc".Translate()); RJWSettings.maxDistanceCellsCasual = listingStandard.Slider((int)RJWSettings.maxDistanceCellsCasual, 0, 10000); listingStandard.Label("maxDistanceCellsRape_name".Translate() + ": " + (RJWSettings.maxDistanceCellsRape), -1f, "maxDistanceCellsRape_desc".Translate()); RJWSettings.maxDistanceCellsRape = listingStandard.Slider((int)RJWSettings.maxDistanceCellsRape, 0, 10000); listingStandard.Label("maxDistancePathCost_name".Translate() + ": " + (RJWSettings.maxDistancePathCost), -1f, "maxDistancePathCost_desc".Translate()); RJWSettings.maxDistancePathCost = listingStandard.Slider((int)RJWSettings.maxDistancePathCost, 0, 5000); listingStandard.End(); height_modifier = listingStandard.CurHeight; Widgets.EndScrollView(); } public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref RJWSettings.submit_button_enabled, "submit_button_enabled", RJWSettings.submit_button_enabled, true); Scribe_Values.Look(ref RJWSettings.show_RJW_designation_box, "show_RJW_designation_box", RJWSettings.show_RJW_designation_box, true); Scribe_Values.Look(ref RJWSettings.ShowRjwParts, "ShowRjwParts", RJWSettings.ShowRjwParts, true); Scribe_Values.Look(ref RJWSettings.maxDistanceCellsCasual, "maxDistanceCellsCasual", RJWSettings.maxDistanceCellsCasual, true); Scribe_Values.Look(ref RJWSettings.maxDistanceCellsRape, "maxDistanceCellsRape", RJWSettings.maxDistanceCellsRape, true); Scribe_Values.Look(ref RJWSettings.maxDistancePathCost, "maxDistancePathCost", RJWSettings.maxDistancePathCost, true); Scribe_Values.Look(ref RJWSettings.AddTrait_Rapist, "AddTrait_Rapist", RJWSettings.AddTrait_Rapist, true); Scribe_Values.Look(ref RJWSettings.AddTrait_Masocist, "AddTrait_Masocist", RJWSettings.AddTrait_Masocist, true); Scribe_Values.Look(ref RJWSettings.AddTrait_Nymphomaniac, "AddTrait_Nymphomaniac", RJWSettings.AddTrait_Nymphomaniac, true); Scribe_Values.Look(ref RJWSettings.AddTrait_Necrophiliac, "AddTrait_Necrophiliac", RJWSettings.AddTrait_Necrophiliac, true); Scribe_Values.Look(ref RJWSettings.AddTrait_Nerves, "AddTrait_Nerves", RJWSettings.AddTrait_Nerves, true); Scribe_Values.Look(ref RJWSettings.AddTrait_Zoophiliac, "AddTrait_Zoophiliac", RJWSettings.AddTrait_Zoophiliac, true); Scribe_Values.Look(ref RJWSettings.AddTrait_FootSlut, "AddTrait_FootSlut", RJWSettings.AddTrait_FootSlut, true); Scribe_Values.Look(ref RJWSettings.AddTrait_CumSlut, "AddTrait_CumSlut", RJWSettings.AddTrait_CumSlut, true); Scribe_Values.Look(ref RJWSettings.AddTrait_ButtSlut, "AddTrait_ButtSlut", RJWSettings.AddTrait_ButtSlut, true); Scribe_Values.Look(ref RJWSettings.Allow_RMB_DeepTalk, "Allow_RMB_DeepTalk", RJWSettings.Allow_RMB_DeepTalk, true); Scribe_Values.Look(ref RJWSettings.Allow_RMB_DeepTalk, "Allow_RMB_DeepTalk", RJWSettings.Allow_RMB_DeepTalk, true); Scribe_Values.Look(ref RJWSettings.Disable_bestiality_pregnancy_relations, "Disable_bestiality_pregnancy_relations", RJWSettings.Disable_bestiality_pregnancy_relations, true); Scribe_Values.Look(ref RJWSettings.Disable_egg_pregnancy_relations, "Disable_egg_pregnancy_relations", RJWSettings.Disable_egg_pregnancy_relations, true); Scribe_Values.Look(ref RJWSettings.Disable_MeditationFocusDrain, "Disable_MeditationFocusDrain", RJWSettings.Disable_MeditationFocusDrain, true); Scribe_Values.Look(ref RJWSettings.Disable_RecreationDrain, "Disable_RecreationDrain", RJWSettings.Disable_RecreationDrain, true); Scribe_Values.Look(ref RJWSettings.GenderlessAsFuta, "GenderlessAsFuta", RJWSettings.GenderlessAsFuta, true); Scribe_Values.Look(ref RJWSettings.override_lovin, "override_lovin", RJWSettings.override_lovin, true); Scribe_Values.Look(ref RJWSettings.override_matin, "override_matin", RJWSettings.override_matin, true); Scribe_Values.Look(ref RJWSettings.matin_crossbreed, "matin_crossbreed", RJWSettings.matin_crossbreed, true); Scribe_Values.Look(ref RJWSettings.WildMode, "Wildmode", RJWSettings.WildMode, true); Scribe_Values.Look(ref RJWSettings.HippieMode, "Hippiemode", RJWSettings.HippieMode, true); Scribe_Values.Look(ref RJWSettings.override_RJW_designation_checks, "override_RJW_designation_checks", RJWSettings.override_RJW_designation_checks, true); Scribe_Values.Look(ref RJWSettings.override_control, "override_control", RJWSettings.override_control, true); Scribe_Values.Look(ref RJWSettings.DevMode, "DevMode", RJWSettings.DevMode, true); Scribe_Values.Look(ref RJWSettings.DebugLogJoinInBed, "DebugLogJoinInBed", RJWSettings.DebugLogJoinInBed, true); Scribe_Values.Look(ref RJWSettings.DebugRape, "DebugRape", RJWSettings.DebugRape, true); Scribe_Values.Look(ref RJWSettings.DebugInteraction, "DebugInteraction", RJWSettings.DebugInteraction, true); Scribe_Values.Look(ref RJWSettings.DebugNymph, "DebugNymph", RJWSettings.DebugNymph, true); } } }
Korth95/rjw
1.5/Source/Settings/RJWDebugSettings.cs
C#
mit
12,065
using System; using UnityEngine; using Verse; namespace rjw { public class RJWHookupSettings : ModSettings { public static bool HookupsEnabled = true; public static bool QuickHookupsEnabled = true; public static bool NoHookupsDuringWorkHours = true; public static bool ColonistsCanHookup = true; public static bool ColonistsCanHookupWithVisitor = false; public static bool CanHookupWithPrisoner = false; public static bool VisitorsCanHookupWithColonists = false; public static bool VisitorsCanHookupWithVisitors = true; public static bool PrisonersCanHookupWithNonPrisoner = false; public static bool PrisonersCanHookupWithPrisoner = true; public static float HookupChanceForNonNymphos = 0.3f; public static float MinimumFuckabilityToHookup = 0.1f; public static float MinimumAttractivenessToHookup = 0.5f; public static float MinimumRelationshipToHookup = 20f; //public static bool NymphosCanPickAnyone = true; public static bool NymphosCanCheat = true; public static bool NymphosCanHomewreck = true; public static bool NymphosCanHomewreckReverse = true; private static Vector2 scrollPosition; private static float height_modifier = 0f; public static void DoWindowContents(Rect inRect) { MinimumFuckabilityToHookup = Mathf.Clamp(MinimumFuckabilityToHookup, 0.1f, 1f); MinimumAttractivenessToHookup = Mathf.Clamp(MinimumAttractivenessToHookup, 0.0f, 1f); MinimumRelationshipToHookup = Mathf.Clamp(MinimumRelationshipToHookup, -100, 100); Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f); Rect viewRect = new Rect(0f, 0f, inRect.width - 16f, inRect.height + height_modifier); Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect); // scroll Listing_Standard listingStandard = new Listing_Standard(); listingStandard.maxOneColumn = true; listingStandard.ColumnWidth = viewRect.width / 2.05f; listingStandard.Begin(viewRect); listingStandard.Gap(4f); // Casual sex settings listingStandard.CheckboxLabeled("SettingHookupsEnabled".Translate(), ref HookupsEnabled, "SettingHookupsEnabled_desc".Translate()); if(HookupsEnabled) listingStandard.CheckboxLabeled("SettingQuickHookupsEnabled".Translate(), ref QuickHookupsEnabled, "SettingQuickHookupsEnabled_desc".Translate()); listingStandard.CheckboxLabeled("SettingNoHookupsDuringWorkHours".Translate(), ref NoHookupsDuringWorkHours, "SettingNoHookupsDuringWorkHours_desc".Translate()); listingStandard.Gap(10f); listingStandard.CheckboxLabeled("SettingColonistsCanHookup".Translate(), ref ColonistsCanHookup, "SettingColonistsCanHookup_desc".Translate()); listingStandard.CheckboxLabeled("SettingColonistsCanHookupWithVisitor".Translate(), ref ColonistsCanHookupWithVisitor, "SettingColonistsCanHookupWithVisitor_desc".Translate()); listingStandard.CheckboxLabeled("SettingVisitorsCanHookupWithColonists".Translate(), ref VisitorsCanHookupWithColonists, "SettingVisitorsCanHookupWithColonists_desc".Translate()); listingStandard.CheckboxLabeled("SettingVisitorsCanHookupWithVisitors".Translate(), ref VisitorsCanHookupWithVisitors, "SettingVisitorsCanHookupWithVisitors_desc".Translate()); listingStandard.Gap(10f); listingStandard.CheckboxLabeled("SettingPrisonersCanHookupWithNonPrisoner".Translate(), ref PrisonersCanHookupWithNonPrisoner, "SettingPrisonersCanHookupWithNonPrisoner_desc".Translate()); listingStandard.CheckboxLabeled("SettingPrisonersCanHookupWithPrisoner".Translate(), ref PrisonersCanHookupWithPrisoner, "SettingPrisonersCanHookupWithPrisoner_desc".Translate()); listingStandard.CheckboxLabeled("SettingCanHookupWithPrisoner".Translate(), ref CanHookupWithPrisoner, "SettingCanHookupWithPrisoner_desc".Translate()); listingStandard.Gap(10f); //listingStandard.CheckboxLabeled("SettingNymphosCanPickAnyone".Translate(), ref NymphosCanPickAnyone, "SettingNymphosCanPickAnyone_desc".Translate()); listingStandard.CheckboxLabeled("SettingNymphosCanCheat".Translate(), ref NymphosCanCheat, "SettingNymphosCanCheat_desc".Translate()); listingStandard.CheckboxLabeled("SettingNymphosCanHomewreck".Translate(), ref NymphosCanHomewreck, "SettingNymphosCanHomewreck_desc".Translate()); listingStandard.CheckboxLabeled("SettingNymphosCanHomewreckReverse".Translate(), ref NymphosCanHomewreckReverse, "SettingNymphosCanHomewreckReverse_desc".Translate()); listingStandard.Gap(10f); listingStandard.Label("SettingHookupChanceForNonNymphos".Translate() + ": " + (int)(HookupChanceForNonNymphos * 100) + "%", -1f, "SettingHookupChanceForNonNymphos_desc".Translate()); HookupChanceForNonNymphos = listingStandard.Slider(HookupChanceForNonNymphos, 0.0f, 1.0f); listingStandard.Label("SettingMinimumFuckabilityToHookup".Translate() + ": " + (int)(MinimumFuckabilityToHookup * 100) + "%", -1f, "SettingMinimumFuckabilityToHookup_desc".Translate()); MinimumFuckabilityToHookup = listingStandard.Slider(MinimumFuckabilityToHookup, 0.1f, 1.0f); // Minimum must be above 0.0 to avoid breaking SexAppraiser.would_fuck()'s hard-failure cases that return 0f listingStandard.Label("SettingMinimumAttractivenessToHookup".Translate() + ": " + (int)(MinimumAttractivenessToHookup * 100) + "%", -1f, "SettingMinimumAttractivenessToHookup_desc".Translate()); MinimumAttractivenessToHookup = listingStandard.Slider(MinimumAttractivenessToHookup, 0.0f, 1.0f); listingStandard.Label("SettingMinimumRelationshipToHookup".Translate() + ": " + (MinimumRelationshipToHookup), -1f, "SettingMinimumRelationshipToHookup_desc".Translate()); MinimumRelationshipToHookup = listingStandard.Slider((int)MinimumRelationshipToHookup, -100f, 100f); listingStandard.NewColumn(); listingStandard.Gap(4f); listingStandard.End(); height_modifier = listingStandard.CurHeight; Widgets.EndScrollView(); } public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref HookupsEnabled, "SettingHookupsEnabled"); Scribe_Values.Look(ref QuickHookupsEnabled, "SettingQuickHookupsEnabled"); Scribe_Values.Look(ref NoHookupsDuringWorkHours, "NoHookupsDuringWorkHours"); Scribe_Values.Look(ref ColonistsCanHookup, "SettingColonistsCanHookup"); Scribe_Values.Look(ref ColonistsCanHookupWithVisitor, "SettingColonistsCanHookupWithVisitor"); Scribe_Values.Look(ref VisitorsCanHookupWithColonists, "SettingVisitorsCanHookupWithColonists"); Scribe_Values.Look(ref VisitorsCanHookupWithVisitors, "SettingVisitorsCanHookupWithVisitors"); // Prisoner settings Scribe_Values.Look(ref CanHookupWithPrisoner, "SettingCanHookupWithPrisoner"); Scribe_Values.Look(ref PrisonersCanHookupWithNonPrisoner, "SettingPrisonersCanHookupWithNonPrisoner"); Scribe_Values.Look(ref PrisonersCanHookupWithPrisoner, "SettingPrisonersCanHookupWithPrisoner"); // Nympho settings //Scribe_Values.Look(ref NymphosCanPickAnyone, "SettingNymphosCanPickAnyone"); Scribe_Values.Look(ref NymphosCanCheat, "SettingNymphosCanCheat"); Scribe_Values.Look(ref NymphosCanHomewreck, "SettingNymphosCanHomewreck"); Scribe_Values.Look(ref NymphosCanHomewreckReverse, "SettingNymphosCanHomewreckReverse"); Scribe_Values.Look(ref HookupChanceForNonNymphos, "SettingHookupChanceForNonNymphos"); Scribe_Values.Look(ref MinimumFuckabilityToHookup, "SettingMinimumFuckabilityToHookup"); Scribe_Values.Look(ref MinimumAttractivenessToHookup, "SettingMinimumAttractivenessToHookup"); Scribe_Values.Look(ref MinimumRelationshipToHookup, "SettingMinimumRelationshipToHookup"); } } }
Korth95/rjw
1.5/Source/Settings/RJWHookupSettings.cs
C#
mit
7,542
using System; using UnityEngine; using Verse; namespace rjw { public class RJWPregnancySettings : ModSettings { public static bool humanlike_pregnancy_enabled = true; public static bool animal_pregnancy_enabled = true; public static bool animal_pregnancy_notifications_enabled = true; public static bool bestial_pregnancy_enabled = true; public static bool insect_pregnancy_enabled = true; public static bool insect_anal_pregnancy_enabled = false; public static bool insect_oral_pregnancy_enabled = false; public static bool egg_pregnancy_implant_anyone = true; public static bool egg_pregnancy_fertilize_anyone = false; public static bool egg_pregnancy_genes = true; public static bool egg_pregnancy_fertOrificeCheck_enabled = true; public static float egg_pregnancy_eggs_size = 1.0f; public static float egg_pregnancy_ovipositor_capacity_factor = 1f; public static bool safer_mechanoid_pregnancy = false; public static bool mechanoid_pregnancy_enabled = true; public static bool use_parent_method = true; public static float humanlike_DNA_from_mother = 0.5f; public static float bestiality_DNA_inheritance = 0.5f; // human/beast slider public static float bestial_DNA_from_mother = 1.0f; // mother/father slider public static bool complex_interspecies = false; public static int animal_impregnation_chance = 25; public static int humanlike_impregnation_chance = 25; public static float interspecies_impregnation_modifier = 0.2f; public static float fertility_endage_male = 1.2f; public static float fertility_endage_female_humanlike = 0.58f; public static float fertility_endage_female_animal = 0.96f; public static bool phantasy_pregnancy = false; public static float normal_pregnancy_duration = 1.0f; public static float egg_pregnancy_duration = 1.0f; public static float max_num_momtraits_inherited = 3.0f; public static float max_num_poptraits_inherited = 3.0f; private static bool useVanillaPregnancy = true; public static bool UseVanillaPregnancy => useVanillaPregnancy && ModsConfig.BiotechActive; private static Vector2 scrollPosition; private static float height_modifier = 0f; public static void DoWindowContents(Rect inRect) { Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f); Rect viewRect = new Rect(0f, 30f, inRect.width - 16f, inRect.height + height_modifier); Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect); Listing_Standard listingStandard = new Listing_Standard(); listingStandard.maxOneColumn = true; listingStandard.ColumnWidth = viewRect.width / 2.05f; listingStandard.Begin(viewRect); listingStandard.Gap(4f); listingStandard.CheckboxLabeled("RJWH_pregnancy".Translate(), ref humanlike_pregnancy_enabled, "RJWH_pregnancy_desc".Translate()); listingStandard.Gap(5f); if (ModsConfig.BiotechActive) { listingStandard.CheckboxLabeled("UseVanillaPregnancy".Translate(), ref useVanillaPregnancy, "UseVanillaPregnancy_desc".Translate()); listingStandard.Gap(5f); } listingStandard.CheckboxLabeled("RJWA_pregnancy".Translate(), ref animal_pregnancy_enabled, "RJWA_pregnancy_desc".Translate()); if (animal_pregnancy_enabled) { listingStandard.Gap(3f); listingStandard.CheckboxLabeled(" " + "RJWA_pregnancy_notifications".Translate(), ref animal_pregnancy_notifications_enabled, "RJWA_pregnancy_notifications_desc".Translate()); } listingStandard.Gap(5f); listingStandard.CheckboxLabeled("RJWB_pregnancy".Translate(), ref bestial_pregnancy_enabled, "RJWB_pregnancy_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("RJWI_pregnancy".Translate(), ref insect_pregnancy_enabled, "RJWI_pregnancy_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("egg_pregnancy_implant_anyone".Translate(), ref egg_pregnancy_implant_anyone, "egg_pregnancy_implant_anyone_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("egg_pregnancy_fertilize_anyone".Translate(), ref egg_pregnancy_fertilize_anyone, "egg_pregnancy_fertilize_anyone_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("egg_pregnancy_genes".Translate(), ref egg_pregnancy_genes, "egg_pregnancy_genes_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("RJWI_analPregnancy".Translate(), ref insect_anal_pregnancy_enabled, "RJWI_analPregnancy_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("RJWI_oralPregnancy".Translate(), ref insect_oral_pregnancy_enabled, "RJWI_oralPregnancy_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("RJWI_FertilizationCheck".Translate(), ref egg_pregnancy_fertOrificeCheck_enabled, "RJWI_FertilizationCheck_desc".Translate()); listingStandard.Gap(5f); listingStandard.Gap(5f); int eggs_size = (int)(egg_pregnancy_eggs_size * 100); listingStandard.Label("egg_pregnancy_eggs_size".Translate() + ": " + eggs_size + "%", -1f, "egg_pregnancy_eggs_size_desc".Translate()); egg_pregnancy_eggs_size = listingStandard.Slider(egg_pregnancy_eggs_size, 0.0f, 1.0f); int ovipositor_capacity_factor_percentage = (int)(egg_pregnancy_ovipositor_capacity_factor * 100); listingStandard.Label("egg_pregnancy_ovipositor_capacity_factor".Translate() + ": " + ovipositor_capacity_factor_percentage + "%", -1, "egg_pregnancy_ovipositor_capacity_factor_desc".Translate()); // Note: Choose the domain any wider and a different input method has to be used or the slider width has to be increased! egg_pregnancy_ovipositor_capacity_factor = listingStandard.Slider(egg_pregnancy_ovipositor_capacity_factor, .1f, 5f); listingStandard.Gap(12f); listingStandard.CheckboxLabeled("UseParentMethod".Translate(), ref use_parent_method, "UseParentMethod_desc".Translate()); listingStandard.Gap(5f); if (use_parent_method) { if (humanlike_DNA_from_mother == 0.0f) { listingStandard.Label(" " + "OffspringLookLikeTheirMother".Translate() + ": " + "AlwaysFather".Translate(), -1f, "OffspringLookLikeTheirMother_desc".Translate()); humanlike_DNA_from_mother = listingStandard.Slider(humanlike_DNA_from_mother, 0.0f, 1.0f); } else if (humanlike_DNA_from_mother == 1.0f) { listingStandard.Label(" " + "OffspringLookLikeTheirMother".Translate() + ": " + "AlwaysMother".Translate(), -1f, "OffspringLookLikeTheirMother_desc".Translate()); humanlike_DNA_from_mother = listingStandard.Slider(humanlike_DNA_from_mother, 0.0f, 1.0f); } else { int value = (int)(humanlike_DNA_from_mother * 100); listingStandard.Label(" " + "OffspringLookLikeTheirMother".Translate() + ": " + value + "%", -1f, "OffspringLookLikeTheirMother_desc".Translate()); humanlike_DNA_from_mother = listingStandard.Slider(humanlike_DNA_from_mother, 0.0f, 1.0f); } if (bestial_DNA_from_mother == 0.0f) { listingStandard.Label(" " + "OffspringIsHuman".Translate() + ": " + "AlwaysFather".Translate(), -1f, "OffspringIsHuman_desc".Translate()); bestial_DNA_from_mother = listingStandard.Slider(bestial_DNA_from_mother, 0.0f, 1.0f); } else if (bestial_DNA_from_mother == 1.0f) { listingStandard.Label(" " + "OffspringIsHuman".Translate() + ": " + "AlwaysMother".Translate(), -1f, "OffspringIsHuman_desc".Translate()); bestial_DNA_from_mother = listingStandard.Slider(bestial_DNA_from_mother, 0.0f, 1.0f); } else { int value = (int)(bestial_DNA_from_mother * 100); listingStandard.Label(" " + "OffspringIsHuman".Translate() + ": " + value + "%", -1f, "OffspringIsHuman_desc".Translate()); bestial_DNA_from_mother = listingStandard.Slider(bestial_DNA_from_mother, 0.0f, 1.0f); } if (bestiality_DNA_inheritance == 0.0f) { listingStandard.Label(" " + "OffspringIsHuman2".Translate() + ": " + "AlwaysBeast".Translate(), -1f, "OffspringIsHuman2_desc".Translate()); bestiality_DNA_inheritance = listingStandard.Slider(bestiality_DNA_inheritance, 0.0f, 1.0f); } else if (bestiality_DNA_inheritance == 1.0f) { listingStandard.Label(" " + "OffspringIsHuman2".Translate() + ": " + "AlwaysHumanlike".Translate(), -1f, "OffspringIsHuman2_desc".Translate()); bestiality_DNA_inheritance = listingStandard.Slider(bestiality_DNA_inheritance, 0.0f, 1.0f); } else { listingStandard.Label(" " + "OffspringIsHuman2".Translate() + ": " + "UsesOffspringIsHuman".Translate(), -1f, "OffspringIsHuman2_desc".Translate()); bestiality_DNA_inheritance = listingStandard.Slider(bestiality_DNA_inheritance, 0.0f, 1.0f); } } else humanlike_DNA_from_mother = 100; listingStandard.Gap(5f); listingStandard.Label("max_num_momtraits_inherited".Translate() + ": " + (int)(max_num_momtraits_inherited)); max_num_momtraits_inherited = listingStandard.Slider(max_num_momtraits_inherited, 0.0f, 9.0f); listingStandard.Gap(5f); listingStandard.Label("max_num_poptraits_inherited".Translate() + ": " + (int)(max_num_poptraits_inherited)); max_num_poptraits_inherited = listingStandard.Slider(max_num_poptraits_inherited, 0.0f, 9.0f); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("MechanoidImplanting".Translate(), ref mechanoid_pregnancy_enabled, "MechanoidImplanting_desc".Translate()); listingStandard.Gap(5f); if (mechanoid_pregnancy_enabled) { listingStandard.CheckboxLabeled("SaferMechanoidImplanting".Translate(), ref safer_mechanoid_pregnancy, "SaferMechanoidImplanting_desc".Translate()); listingStandard.Gap(5f); } listingStandard.CheckboxLabeled("ComplexImpregnation".Translate(), ref complex_interspecies, "ComplexImpregnation_desc".Translate()); listingStandard.Gap(10f); GUI.contentColor = Color.cyan; listingStandard.Label("Base pregnancy chances:"); listingStandard.Gap(5f); if (humanlike_pregnancy_enabled) listingStandard.Label(" Humanlike/Humanlike (same race): " + humanlike_impregnation_chance + "%"); else listingStandard.Label(" Humanlike/Humanlike (same race): -DISABLED-"); if (humanlike_pregnancy_enabled && !(humanlike_impregnation_chance * interspecies_impregnation_modifier <= 0.0f) && !complex_interspecies) listingStandard.Label(" Humanlike/Humanlike (different race): " + Math.Round(humanlike_impregnation_chance * interspecies_impregnation_modifier, 1) + "%"); else if (complex_interspecies) listingStandard.Label(" Humanlike/Humanlike (different race): -DEPENDS ON SPECIES-"); else listingStandard.Label(" Humanlike/Humanlike (different race): -DISABLED-"); if (animal_pregnancy_enabled) listingStandard.Label(" Animal/Animal (same race): " + animal_impregnation_chance + "%"); else listingStandard.Label(" Animal/Animal (same race): -DISABLED-"); if (animal_pregnancy_enabled && !(animal_impregnation_chance * interspecies_impregnation_modifier <= 0.0f) && !complex_interspecies) listingStandard.Label(" Animal/Animal (different race): " + Math.Round(animal_impregnation_chance * interspecies_impregnation_modifier, 1) + "%"); else if (complex_interspecies) listingStandard.Label(" Animal/Animal (different race): -DEPENDS ON SPECIES-"); else listingStandard.Label(" Animal/Animal (different race): -DISABLED-"); if (RJWSettings.bestiality_enabled && bestial_pregnancy_enabled && !(animal_impregnation_chance * interspecies_impregnation_modifier <= 0.0f) && !complex_interspecies) listingStandard.Label(" Humanlike/Animal: " + Math.Round(animal_impregnation_chance * interspecies_impregnation_modifier, 1) + "%"); else if (complex_interspecies) listingStandard.Label(" Humanlike/Animal: -DEPENDS ON SPECIES-"); else listingStandard.Label(" Humanlike/Animal: -DISABLED-"); if (RJWSettings.bestiality_enabled && bestial_pregnancy_enabled && !(animal_impregnation_chance * interspecies_impregnation_modifier <= 0.0f) && !complex_interspecies) listingStandard.Label(" Animal/Humanlike: " + Math.Round(humanlike_impregnation_chance * interspecies_impregnation_modifier, 1) + "%"); else if (complex_interspecies) listingStandard.Label(" Animal/Humanlike: -DEPENDS ON SPECIES-"); else listingStandard.Label(" Animal/Humanlike: -DISABLED-"); GUI.contentColor = Color.white; listingStandard.NewColumn(); listingStandard.Gap(4f); listingStandard.Label("PregnantCoeffecientForHuman".Translate() + ": " + humanlike_impregnation_chance + "%", -1f, "PregnantCoeffecientForHuman_desc".Translate()); humanlike_impregnation_chance = (int)listingStandard.Slider(humanlike_impregnation_chance, 0.0f, 100f); listingStandard.Label("PregnantCoeffecientForAnimals".Translate() + ": " + animal_impregnation_chance + "%", -1f, "PregnantCoeffecientForAnimals_desc".Translate()); animal_impregnation_chance = (int)listingStandard.Slider(animal_impregnation_chance, 0.0f, 100f); if (!complex_interspecies) { switch (interspecies_impregnation_modifier) { case 0.0f: GUI.contentColor = Color.grey; listingStandard.Label("InterspeciesImpregnantionModifier".Translate() + ": " + "InterspeciesDisabled".Translate(), -1f, "InterspeciesImpregnantionModifier_desc".Translate()); GUI.contentColor = Color.white; break; case 1.0f: GUI.contentColor = Color.cyan; listingStandard.Label("InterspeciesImpregnantionModifier".Translate() + ": " + "InterspeciesMaximum".Translate(), -1f, "InterspeciesImpregnantionModifier_desc".Translate()); GUI.contentColor = Color.white; break; default: listingStandard.Label("InterspeciesImpregnantionModifier".Translate() + ": " + Math.Round(interspecies_impregnation_modifier * 100, 1) + "%", -1f, "InterspeciesImpregnantionModifier_desc".Translate()); break; } interspecies_impregnation_modifier = listingStandard.Slider(interspecies_impregnation_modifier, 0.0f, 1.0f); } listingStandard.Label("RJW_fertility_endAge_male".Translate() + ": " + (int)(fertility_endage_male * 80) + "In_human_years".Translate(), -1f, "RJW_fertility_endAge_male_desc".Translate()); fertility_endage_male = listingStandard.Slider(fertility_endage_male, 0.1f, 3.0f); listingStandard.Label("RJW_fertility_endAge_female_humanlike".Translate() + ": " + (int)(fertility_endage_female_humanlike * 80) + "In_human_years".Translate(), -1f, "RJW_fertility_endAge_female_humanlike_desc".Translate()); fertility_endage_female_humanlike = listingStandard.Slider(fertility_endage_female_humanlike, 0.1f, 3.0f); listingStandard.Label("RJW_fertility_endAge_female_animal".Translate() + ": " + (int)(fertility_endage_female_animal * 100) + "XofLifeExpectancy".Translate(), -1f, "RJW_fertility_endAge_female_animal_desc".Translate()); fertility_endage_female_animal = listingStandard.Slider(fertility_endage_female_animal, 0.1f, 3.0f); listingStandard.Gap(10f); listingStandard.CheckboxLabeled("phantasy_pregnancy".Translate(), ref phantasy_pregnancy, "phantasy_pregnancy_desc".Translate()); listingStandard.Gap(5f); listingStandard.Label("normal_pregnancy_duration".Translate() + ": " + (int)(normal_pregnancy_duration * 100) + "%", -1f, "normal_pregnancy_duration_desc".Translate()); normal_pregnancy_duration = listingStandard.Slider(normal_pregnancy_duration, 0.05f, 2.0f); listingStandard.Gap(5f); listingStandard.Label("egg_pregnancy_duration".Translate() + ": " + (int)(egg_pregnancy_duration * 100) + "%", -1f, "egg_pregnancy_duration_desc".Translate()); egg_pregnancy_duration = listingStandard.Slider(egg_pregnancy_duration, 0.05f, 2.0f); listingStandard.Gap(5f); listingStandard.End(); height_modifier = listingStandard.CurHeight; Widgets.EndScrollView(); } public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref humanlike_pregnancy_enabled, "humanlike_pregnancy_enabled", humanlike_pregnancy_enabled, true); Scribe_Values.Look(ref useVanillaPregnancy, "useVanillaPregnancy", useVanillaPregnancy, true); Scribe_Values.Look(ref animal_pregnancy_enabled, "animal_enabled", animal_pregnancy_enabled, true); Scribe_Values.Look(ref animal_pregnancy_notifications_enabled, "animal_notifications_enabled", animal_pregnancy_notifications_enabled, true); Scribe_Values.Look(ref bestial_pregnancy_enabled, "bestial_pregnancy_enabled", bestial_pregnancy_enabled, true); Scribe_Values.Look(ref insect_pregnancy_enabled, "insect_pregnancy_enabled", insect_pregnancy_enabled, true); Scribe_Values.Look(ref insect_anal_pregnancy_enabled, "insect_anal_pregnancy_enabled", insect_anal_pregnancy_enabled, true); Scribe_Values.Look(ref insect_oral_pregnancy_enabled, "insect_oral_pregnancy_enabled", insect_oral_pregnancy_enabled, true); Scribe_Values.Look(ref egg_pregnancy_implant_anyone, "egg_pregnancy_implant_anyone", egg_pregnancy_implant_anyone, true); Scribe_Values.Look(ref egg_pregnancy_fertilize_anyone, "egg_pregnancy_fertilize_anyone", egg_pregnancy_fertilize_anyone, true); Scribe_Values.Look(ref egg_pregnancy_genes, "egg_pregnancy_genes", egg_pregnancy_genes, true); Scribe_Values.Look(ref egg_pregnancy_fertOrificeCheck_enabled, "egg_pregnancy_fertOrificeCheck_enabled", egg_pregnancy_fertOrificeCheck_enabled, true); Scribe_Values.Look(ref egg_pregnancy_eggs_size, "egg_pregnancy_eggs_size", egg_pregnancy_eggs_size, true); Scribe_Values.Look(ref egg_pregnancy_ovipositor_capacity_factor, "egg_pregnancy_ovipositor_capacity_factor", egg_pregnancy_ovipositor_capacity_factor, true); Scribe_Values.Look(ref mechanoid_pregnancy_enabled, "mechanoid_enabled", mechanoid_pregnancy_enabled, true); Scribe_Values.Look(ref safer_mechanoid_pregnancy, "safer_mechanoid_pregnancy", safer_mechanoid_pregnancy, true); Scribe_Values.Look(ref use_parent_method, "use_parent_method", use_parent_method, true); Scribe_Values.Look(ref humanlike_DNA_from_mother, "humanlike_DNA_from_mother", humanlike_DNA_from_mother, true); Scribe_Values.Look(ref bestial_DNA_from_mother, "bestial_DNA_from_mother", bestial_DNA_from_mother, true); Scribe_Values.Look(ref bestiality_DNA_inheritance, "bestiality_DNA_inheritance", bestiality_DNA_inheritance, true); Scribe_Values.Look(ref humanlike_impregnation_chance, "humanlike_impregnation_chance", humanlike_impregnation_chance, true); Scribe_Values.Look(ref animal_impregnation_chance, "animal_impregnation_chance", animal_impregnation_chance, true); Scribe_Values.Look(ref interspecies_impregnation_modifier, "interspecies_impregnation_chance", interspecies_impregnation_modifier, true); Scribe_Values.Look(ref complex_interspecies, "complex_interspecies", complex_interspecies, true); Scribe_Values.Look(ref fertility_endage_male, "RJW_fertility_endAge_male", fertility_endage_male, true); Scribe_Values.Look(ref fertility_endage_female_humanlike, "fertility_endage_female_humanlike", fertility_endage_female_humanlike, true); Scribe_Values.Look(ref fertility_endage_female_animal, "fertility_endage_female_animal", fertility_endage_female_animal, true); Scribe_Values.Look(ref phantasy_pregnancy, "phantasy_pregnancy", phantasy_pregnancy, true); Scribe_Values.Look(ref normal_pregnancy_duration, "normal_pregnancy_duration", normal_pregnancy_duration, true); Scribe_Values.Look(ref egg_pregnancy_duration, "egg_pregnancy_duration", egg_pregnancy_duration, true); Scribe_Values.Look(ref max_num_momtraits_inherited, "max_num_momtraits_inherited", max_num_momtraits_inherited, true); Scribe_Values.Look(ref max_num_poptraits_inherited, "max_num_poptraits_inherited", max_num_poptraits_inherited, true); } } }
Korth95/rjw
1.5/Source/Settings/RJWPregnancySettings.cs
C#
mit
19,708
using System; using UnityEngine; using Verse; namespace rjw { public class RJWSettings : ModSettings { public static bool animal_on_animal_enabled = false; public static bool bestiality_enabled = false; public static bool necrophilia_enabled = false; private static bool overdrive = false; public static bool rape_enabled = false; public static bool designated_freewill = true; public static bool animal_CP_rape = false; public static bool visitor_CP_rape = false; public static bool colonist_CP_rape = false; public static bool rape_beating = false; public static bool gentle_rape_beating = false; public static bool rape_stripping = false; public static bool cum_filth = true; public static bool sounds_enabled = true; public static float sounds_sex_volume = 1.0f; public static float sounds_cum_volume = 1.0f; public static float sounds_voice_volume = 1.0f; public static float sounds_orgasm_volume = 1.0f; public static float sounds_animal_on_animal_volume = 0.5f; public static bool NymphTamed = false; public static bool NymphWild = true; public static bool NymphRaidEasy = false; public static bool NymphRaidHard = false; public static bool NymphRaidRP = false; public static bool NymphPermanentManhunter = false; public static bool NymphSappers = true; public static bool NymphFrustratedRape = true; public static bool FemaleFuta = false; public static bool MaleTrap = false; public static float male_nymph_chance = 0.0f; public static float futa_nymph_chance = 0.0f; public static float futa_natives_chance = 0.0f; public static float futa_spacers_chance = 0.5f; public static bool sexneed_fix = true; public static float sexneed_decay_rate = 1.0f; public static int Animal_mating_cooldown = 0; public static float nonFutaWomenRaping_MaxVulnerability = 0.8f; public static float rapee_MinVulnerability_human = 1.2f; public static bool RPG_hero_control = false; public static bool RPG_hero_control_HC = false; public static bool RPG_hero_control_Ironman = false; public static bool submit_button_enabled = true; public static bool show_RJW_designation_box = false; public static ShowParts ShowRjwParts = ShowParts.Show; public static float maxDistanceCellsCasual = 100; public static float maxDistanceCellsRape = 100; public static float maxDistancePathCost = 1000; public static bool WildMode = false; public static bool HippieMode = false; public static bool override_RJW_designation_checks = false; public static bool override_control = false; public static bool override_lovin = true; public static bool override_matin = true; public static bool matin_crossbreed = false; public static bool GenderlessAsFuta = false; public static bool DevMode = false; public static bool DebugLogJoinInBed = false; public static bool DebugRape = false; public static bool DebugInteraction = false; public static bool DebugNymph = false; public static bool AddTrait_Rapist = true; public static bool AddTrait_Masocist = true; public static bool AddTrait_Nymphomaniac = true; public static bool AddTrait_Necrophiliac = true; public static bool AddTrait_Nerves = true; public static bool AddTrait_Zoophiliac = true; public static bool AddTrait_FootSlut = true; public static bool AddTrait_CumSlut = true; public static bool AddTrait_ButtSlut = true; public static bool Allow_RMB_DeepTalk = false; public static bool Disable_bestiality_pregnancy_relations = false; public static bool Disable_egg_pregnancy_relations = false; public static bool Disable_MeditationFocusDrain = false; public static bool Disable_RecreationDrain = false; public static bool UseAdvancedAgeScaling = true; public static bool AllowYouthSex = true; public static bool sendTraitGainLetters = true; private static Vector2 scrollPosition; private static float height_modifier = 300f; public enum ShowParts { Extended, Show, Known, Hide }; public static void DoWindowContents(Rect inRect) { sexneed_decay_rate = Mathf.Clamp(sexneed_decay_rate, 0.0f, 10000.0f); nonFutaWomenRaping_MaxVulnerability = Mathf.Clamp(nonFutaWomenRaping_MaxVulnerability, 0.0f, 3.0f); rapee_MinVulnerability_human = Mathf.Clamp(rapee_MinVulnerability_human, 0.0f, 3.0f); Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f); Rect viewRect = new Rect(0f, 0f, inRect.width - 16f, inRect.height + height_modifier); Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect); // scroll Listing_Standard listingStandard = new Listing_Standard(); listingStandard.maxOneColumn = true; listingStandard.ColumnWidth = viewRect.width / 2.05f; listingStandard.Begin(viewRect); listingStandard.Gap(4f); listingStandard.CheckboxLabeled("animal_on_animal_enabled".Translate(), ref animal_on_animal_enabled, "animal_on_animal_enabled_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("bestiality_enabled".Translate(), ref bestiality_enabled, "bestiality_enabled_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("necrophilia_enabled".Translate(), ref necrophilia_enabled, "necrophilia_enabled_desc".Translate()); listingStandard.Gap(10f); listingStandard.CheckboxLabeled("rape_enabled".Translate(), ref rape_enabled, "rape_enabled_desc".Translate()); if (rape_enabled) { listingStandard.Gap(3f); listingStandard.CheckboxLabeled(" " + "rape_stripping".Translate(), ref rape_stripping, "rape_stripping_desc".Translate()); listingStandard.Gap(3f); listingStandard.CheckboxLabeled(" " + "ColonistCanCP".Translate(), ref colonist_CP_rape, "ColonistCanCP_desc".Translate()); listingStandard.Gap(3f); listingStandard.CheckboxLabeled(" " + "VisitorsCanCP".Translate(), ref visitor_CP_rape, "VisitorsCanCP_desc".Translate()); listingStandard.Gap(3f); //if (!bestiality_enabled) //{ // GUI.contentColor = Color.grey; // animal_CP_rape = false; //} //listingStandard.CheckboxLabeled(" " + "AnimalsCanCP".Translate(), ref animal_CP_rape, "AnimalsCanCP_desc".Translate()); //if (!bestiality_enabled) // GUI.contentColor = Color.white; listingStandard.Gap(3f); listingStandard.CheckboxLabeled(" " + "PrisonersBeating".Translate(), ref rape_beating, "PrisonersBeating_desc".Translate()); listingStandard.Gap(3f); listingStandard.CheckboxLabeled(" " + "GentlePrisonersBeating".Translate(), ref gentle_rape_beating, "GentlePrisonersBeating_desc".Translate()); } else { colonist_CP_rape = false; visitor_CP_rape = false; animal_CP_rape = false; rape_beating = false; } listingStandard.Gap(10f); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("cum_filth".Translate(), ref cum_filth, "cum_filth_desc".Translate()); listingStandard.Gap(5f); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("sounds_enabled".Translate(), ref sounds_enabled, "sounds_enabled_desc".Translate()); if (sounds_enabled) { listingStandard.Label("sounds_sex_volume".Translate() + ": " + Math.Round(sounds_sex_volume * 100f, 0) + "%", -1f, "sounds_sex_volume_desc".Translate()); sounds_sex_volume = listingStandard.Slider(sounds_sex_volume, 0f, 2f); listingStandard.Label("sounds_cum_volume".Translate() + ": " + Math.Round(sounds_cum_volume * 100f, 0) + "%", -1f, "sounds_cum_volume_desc".Translate()); sounds_cum_volume = listingStandard.Slider(sounds_cum_volume, 0f, 2f); listingStandard.Label("sounds_voice_volume".Translate() + ": " + Math.Round(sounds_voice_volume * 100f, 0) + "%", -1f, "sounds_voice_volume_desc".Translate()); sounds_voice_volume = listingStandard.Slider(sounds_voice_volume, 0f, 2f); listingStandard.Label("sounds_orgasm_volume".Translate() + ": " + Math.Round(sounds_orgasm_volume * 100f, 0) + "%", -1f, "sounds_orgasm_volume_desc".Translate()); sounds_orgasm_volume = listingStandard.Slider(sounds_orgasm_volume, 0f, 2f); listingStandard.Label("sounds_animal_on_animal_volume".Translate() + ": " + Math.Round(sounds_animal_on_animal_volume * 100f, 0) + "%", -1f, "sounds_animal_on_animal_volume_desc".Translate()); sounds_animal_on_animal_volume = listingStandard.Slider(sounds_animal_on_animal_volume, 0f, 2f); } listingStandard.Gap(10f); listingStandard.CheckboxLabeled("RPG_hero_control_name".Translate(), ref RPG_hero_control, "RPG_hero_control_desc".Translate()); listingStandard.Gap(5f); if (RPG_hero_control) { listingStandard.CheckboxLabeled("RPG_hero_control_HC_name".Translate(), ref RPG_hero_control_HC, "RPG_hero_control_HC_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("RPG_hero_control_Ironman_name".Translate(), ref RPG_hero_control_Ironman, "RPG_hero_control_Ironman_desc".Translate()); listingStandard.Gap(5f); } else { RPG_hero_control_HC = false; RPG_hero_control_Ironman = false; } listingStandard.Gap(10f); listingStandard.CheckboxLabeled("UseAdvancedAgeScaling".Translate(), ref UseAdvancedAgeScaling, "UseAdvancedAgeScaling_desc".Translate()); listingStandard.CheckboxLabeled("AllowYouthSex".Translate(), ref AllowYouthSex, "AllowYouthSex_desc".Translate()); listingStandard.NewColumn(); listingStandard.Gap(4f); GUI.contentColor = Color.white; if (sexneed_decay_rate < 2.5f) { overdrive = false; listingStandard.Label("sexneed_decay_rate_name".Translate() + ": " + Math.Round(sexneed_decay_rate * 100f, 0) + "%", -1f, "sexneed_decay_rate_desc".Translate()); sexneed_decay_rate = listingStandard.Slider(sexneed_decay_rate, 0.0f, 5.0f); } else if (sexneed_decay_rate <= 5.0f && !overdrive) { GUI.contentColor = Color.yellow; listingStandard.Label("sexneed_decay_rate_name".Translate() + ": " + Math.Round(sexneed_decay_rate * 100f, 0) + "% [Not recommended]", -1f, "sexneed_decay_rate_desc".Translate()); sexneed_decay_rate = listingStandard.Slider(sexneed_decay_rate, 0.0f, 5.0f); if (sexneed_decay_rate == 5.0f) { GUI.contentColor = Color.red; if (listingStandard.ButtonText("OVERDRIVE")) overdrive = true; } GUI.contentColor = Color.white; } else { GUI.contentColor = Color.red; listingStandard.Label("sexneed_decay_rate_name".Translate() + ": " + Math.Round(sexneed_decay_rate * 100f, 0) + "% [WARNING: UNSAFE]", -1f, "sexneed_decay_rate_desc".Translate()); GUI.contentColor = Color.white; sexneed_decay_rate = listingStandard.Slider(sexneed_decay_rate, 0.0f, 10000.0f); } listingStandard.Gap(5f); listingStandard.CheckboxLabeled("sexneed_fix_name".Translate(), ref sexneed_fix, "sexneed_fix_desc".Translate()); listingStandard.Gap(5f); listingStandard.Label("Animal_mating_cooldown".Translate() + ": " + Animal_mating_cooldown + "h", -1f, "Animal_mating_cooldown_desc".Translate()); Animal_mating_cooldown = (int)listingStandard.Slider(Animal_mating_cooldown, 0, 100); listingStandard.Gap(5f); if (rape_enabled) { listingStandard.Label("NonFutaWomenRaping_MaxVulnerability".Translate() + ": " + (int)(nonFutaWomenRaping_MaxVulnerability * 100), -1f, "NonFutaWomenRaping_MaxVulnerability_desc".Translate()); nonFutaWomenRaping_MaxVulnerability = listingStandard.Slider(nonFutaWomenRaping_MaxVulnerability, 0.0f, 3.0f); listingStandard.Label("Rapee_MinVulnerability_human".Translate() + ": " + (int)(rapee_MinVulnerability_human * 100), -1f, "Rapee_MinVulnerability_human_desc".Translate()); rapee_MinVulnerability_human = listingStandard.Slider(rapee_MinVulnerability_human, 0.0f, 3.0f); } listingStandard.Gap(20f); listingStandard.CheckboxLabeled("NymphTamed".Translate(), ref NymphTamed, "NymphTamed_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("NymphWild".Translate(), ref NymphWild, "NymphWild_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("NymphRaidEasy".Translate(), ref NymphRaidEasy, "NymphRaidEasy_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("NymphRaidHard".Translate(), ref NymphRaidHard, "NymphRaidHard_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("NymphRaidRP".Translate(), ref NymphRaidRP, "NymphRaidRP_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("NymphPermanentManhunter".Translate(), ref NymphPermanentManhunter, "NymphPermanentManhunter_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("NymphSappers".Translate(), ref NymphSappers, "NymphSappers_desc".Translate()); listingStandard.Gap(5f); listingStandard.CheckboxLabeled("NymphFrustratedRape".Translate(), ref NymphFrustratedRape, "NymphFrustratedRape_desc".Translate()); listingStandard.Gap(5f); // Save compatibility check for 1.9.7 // This can probably be safely removed at a later date, I doubt many players use old saves for long. if (male_nymph_chance > 1.0f || futa_nymph_chance > 1.0f || futa_natives_chance > 1.0f || futa_spacers_chance > 1.0f) { male_nymph_chance = 0.0f; futa_nymph_chance = 0.0f; futa_natives_chance = 0.0f; futa_spacers_chance = 0.0f; } listingStandard.CheckboxLabeled("FemaleFuta".Translate(), ref FemaleFuta, "FemaleFuta_desc".Translate()); listingStandard.CheckboxLabeled("MaleTrap".Translate(), ref MaleTrap, "MaleTrap_desc".Translate()); listingStandard.Label("male_nymph_chance".Translate() + ": " + (int)(male_nymph_chance * 100) + "%", -1f, "male_nymph_chance_desc".Translate()); male_nymph_chance = listingStandard.Slider(male_nymph_chance, 0.0f, 1.0f); if (FemaleFuta || MaleTrap) { listingStandard.Label("futa_nymph_chance".Translate() + ": " + (int)(futa_nymph_chance * 100) + "%", -1f, "futa_nymph_chance_desc".Translate()); futa_nymph_chance = listingStandard.Slider(futa_nymph_chance, 0.0f, 1.0f); } if (FemaleFuta || MaleTrap) { listingStandard.Label("futa_natives_chance".Translate() + ": " + (int)(futa_natives_chance * 100) + "%", -1f, "futa_natives_chance_desc".Translate()); futa_natives_chance = listingStandard.Slider(futa_natives_chance, 0.0f, 1.0f); listingStandard.Label("futa_spacers_chance".Translate() + ": " + (int)(futa_spacers_chance * 100) + "%", -1f, "futa_spacers_chance_desc".Translate()); futa_spacers_chance = listingStandard.Slider(futa_spacers_chance, 0.0f, 1.0f); } listingStandard.Gap(5f); listingStandard.CheckboxLabeled("SendTraitGainLetters".Translate(), ref RJWSettings.sendTraitGainLetters, "SendTraitGainLetters_desc".Translate()); listingStandard.End(); height_modifier = listingStandard.CurHeight; Widgets.EndScrollView(); } public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref animal_on_animal_enabled, "animal_on_animal_enabled", animal_on_animal_enabled, true); Scribe_Values.Look(ref bestiality_enabled, "bestiality_enabled", bestiality_enabled, true); Scribe_Values.Look(ref necrophilia_enabled, "necrophilia_enabled", necrophilia_enabled, true); Scribe_Values.Look(ref designated_freewill, "designated_freewill", designated_freewill, true); Scribe_Values.Look(ref rape_enabled, "rape_enabled", rape_enabled, true); Scribe_Values.Look(ref colonist_CP_rape, "colonist_CP_rape", colonist_CP_rape, true); Scribe_Values.Look(ref visitor_CP_rape, "visitor_CP_rape", visitor_CP_rape, true); Scribe_Values.Look(ref animal_CP_rape, "animal_CP_rape", animal_CP_rape, true); Scribe_Values.Look(ref rape_beating, "rape_beating", rape_beating, true); Scribe_Values.Look(ref gentle_rape_beating, "gentle_rape_beating", gentle_rape_beating, true); Scribe_Values.Look(ref rape_stripping, "rape_stripping", rape_stripping, true); Scribe_Values.Look(ref NymphTamed, "NymphTamed", NymphTamed, true); Scribe_Values.Look(ref NymphWild, "NymphWild", NymphWild, true); Scribe_Values.Look(ref NymphRaidEasy, "NymphRaidEasy", NymphRaidEasy, true); Scribe_Values.Look(ref NymphRaidHard, "NymphRaidHard", NymphRaidHard, true); Scribe_Values.Look(ref NymphRaidRP, "NymphRaidRP", NymphRaidRP, true); Scribe_Values.Look(ref NymphPermanentManhunter, "NymphPermanentManhunter", NymphPermanentManhunter, true); Scribe_Values.Look(ref NymphSappers, "NymphSappers", NymphSappers, true); Scribe_Values.Look(ref NymphFrustratedRape, "NymphFrustratedRape", NymphFrustratedRape, true); Scribe_Values.Look(ref FemaleFuta, "FemaleFuta", FemaleFuta, true); Scribe_Values.Look(ref MaleTrap, "MaleTrap", MaleTrap, true); Scribe_Values.Look(ref sounds_enabled, "sounds_enabled", sounds_enabled, true); Scribe_Values.Look(ref sounds_sex_volume, "sounds_sexvolume", sounds_sex_volume, true); Scribe_Values.Look(ref sounds_cum_volume, "sounds_cumvolume", sounds_cum_volume, true); Scribe_Values.Look(ref sounds_voice_volume, "sounds_voicevolume", sounds_voice_volume, true); Scribe_Values.Look(ref sounds_orgasm_volume, "sounds_orgasmvolume", sounds_orgasm_volume, true); Scribe_Values.Look(ref sounds_animal_on_animal_volume, "sounds_animal_on_animalvolume", sounds_animal_on_animal_volume, true); Scribe_Values.Look(ref cum_filth, "cum_filth", cum_filth, true); Scribe_Values.Look(ref sexneed_fix, "sexneed_fix", sexneed_fix, true); Scribe_Values.Look(ref sexneed_decay_rate, "sexneed_decay_rate", sexneed_decay_rate, true); Scribe_Values.Look(ref Animal_mating_cooldown, "Animal_mating_cooldown", Animal_mating_cooldown, true); Scribe_Values.Look(ref nonFutaWomenRaping_MaxVulnerability, "nonFutaWomenRaping_MaxVulnerability", nonFutaWomenRaping_MaxVulnerability, true); Scribe_Values.Look(ref rapee_MinVulnerability_human, "rapee_MinVulnerability_human", rapee_MinVulnerability_human, true); Scribe_Values.Look(ref male_nymph_chance, "male_nymph_chance", male_nymph_chance, true); Scribe_Values.Look(ref futa_nymph_chance, "futa_nymph_chance", futa_nymph_chance, true); Scribe_Values.Look(ref futa_natives_chance, "futa_natives_chance", futa_natives_chance, true); Scribe_Values.Look(ref futa_spacers_chance, "futa_spacers_chance", futa_spacers_chance, true); Scribe_Values.Look(ref RPG_hero_control, "RPG_hero_control", RPG_hero_control, true); Scribe_Values.Look(ref RPG_hero_control_HC, "RPG_hero_control_HC", RPG_hero_control_HC, true); Scribe_Values.Look(ref RPG_hero_control_Ironman, "RPG_hero_control_Ironman", RPG_hero_control_Ironman, true); Scribe_Values.Look(ref UseAdvancedAgeScaling, "UseAdvancedAgeScaling", UseAdvancedAgeScaling, true); Scribe_Values.Look(ref AllowYouthSex, "AllowTeenSex", AllowYouthSex, true); Scribe_Values.Look(ref sendTraitGainLetters, "sendTraitGainLetters", sendTraitGainLetters, true); } } }
Korth95/rjw
1.5/Source/Settings/RJWSettings.cs
C#
mit
18,853
using UnityEngine; using Verse; using Multiplayer.API; namespace rjw.Settings { public class RJWSettingsController : Mod { public RJWSettingsController(ModContentPack content) : base(content) { GetSettings<RJWSettings>(); } public override string SettingsCategory() { return "RJWSettingsOne".Translate(); } public override void DoSettingsWindowContents(Rect inRect) { if (MP.IsInMultiplayer) return; RJWSettings.DoWindowContents(inRect); } } public class RJWDebugController : Mod { public RJWDebugController(ModContentPack content) : base(content) { GetSettings<RJWDebugSettings>(); } public override string SettingsCategory() { return "RJWDebugSettings".Translate(); } public override void DoSettingsWindowContents(Rect inRect) { if (MP.IsInMultiplayer) return; RJWDebugSettings.DoWindowContents(inRect); } } public class RJWPregnancySettingsController : Mod { public RJWPregnancySettingsController(ModContentPack content) : base(content) { GetSettings<RJWPregnancySettings>(); } public override string SettingsCategory() { return "RJWSettingsTwo".Translate(); } public override void DoSettingsWindowContents(Rect inRect) { if (MP.IsInMultiplayer) return; //GUI.BeginGroup(inRect); //Rect outRect = new Rect(0f, 0f, inRect.width, inRect.height - 30f); //Rect viewRect = new Rect(0f, 0f, inRect.width - 16f, inRect.height + 10f); //Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect); RJWPregnancySettings.DoWindowContents(inRect); //Widgets.EndScrollView(); //GUI.EndGroup(); } } public class RJWPreferenceSettingsController : Mod { public RJWPreferenceSettingsController(ModContentPack content) : base(content) { GetSettings<RJWPreferenceSettings>(); } public override string SettingsCategory() { return "RJWSettingsThree".Translate(); } public override void DoSettingsWindowContents(Rect inRect) { if (MP.IsInMultiplayer) return; RJWPreferenceSettings.DoWindowContents(inRect); } } public class RJWHookupSettingsController : Mod { public RJWHookupSettingsController(ModContentPack content) : base(content) { GetSettings<RJWHookupSettings>(); } public override string SettingsCategory() { return "RJWSettingsFour".Translate(); } public override void DoSettingsWindowContents(Rect inRect) { if (MP.IsInMultiplayer) return; RJWHookupSettings.DoWindowContents(inRect); } } }
Korth95/rjw
1.5/Source/Settings/RJWSettingsController.cs
C#
mit
2,509
using System; using System.Collections.Generic; using UnityEngine; using Verse; namespace rjw { // TODO: Add option for logging pregnancy chance after sex (dev mode only?) // TODO: Add an alernate more complex system for pregnancy calculations, by using bodyparts, genitalia, and size (similar species -> higher chance, different -> lower chance) // TODO: Old settings that are not in use - evalute if they're needed and either convert these to settings, or delete them. /* public float significant_pain_threshold; // Updated public float extreme_pain_threshold; // Updated public float base_chance_to_hit_prisoner; // Updated public int min_ticks_between_hits; // Updated public int max_ticks_between_hits; // Updated public float max_nymph_fraction; // Updated public float comfort_prisoner_rape_mtbh_mul; // Updated public float whore_mtbh_mul; // Updated public static bool comfort_prisoners_enabled; // Updated //this one is in config.cs as well! public static bool ComfortColonist; // New public static bool ComfortAnimal; // New public static bool rape_me_sticky_enabled; // Updated public static bool bondage_gear_enabled; // Updated public static bool nymph_joiners_enabled; // Updated public static bool always_accept_whores; // Updated public static bool nymphs_always_JoinInBed; // Updated public static bool zoophis_always_rape; // Updated public static bool rapists_always_rape; // Updated public static bool pawns_always_do_fapping; // Updated public static bool whores_always_findjob; // Updated public bool show_regular_dick_and_vag; // Updated */ public class RJWPreferenceSettings : ModSettings { public static float vaginal = 1.20f; public static float anal = 0.80f; public static float fellatio = 0.80f; public static float cunnilingus = 0.80f; public static float rimming = 0.40f; public static float double_penetration = 0.60f; public static float breastjob = 0.50f; public static float handjob = 0.80f; public static float mutual_masturbation = 0.70f; public static float fingering = 0.50f; public static float footjob = 0.30f; public static float scissoring = 0.50f; public static float fisting = 0.30f; public static float sixtynine = 0.69f; public static float asexual_ratio = 0.02f; public static float pansexual_ratio = 0.03f; public static float heterosexual_ratio = 0.7f; public static float bisexual_ratio = 0.15f; public static float homosexual_ratio = 0.1f; public static bool FapEverywhere = false; public static bool FapInBed = true; public static bool FapInBelts = true; public static bool FapInArmbinders = false; public static bool ShowForCP = true; public static bool ShowForBreeding = true; public static Clothing sex_wear = Clothing.Nude; public static RapeAlert rape_attempt_alert = RapeAlert.Humanlikes; public static RapeAlert rape_alert = RapeAlert.Humanlikes; public static Rjw_sexuality sexuality_distribution = Rjw_sexuality.Vanilla; public static AllowedSex Malesex = AllowedSex.All; public static AllowedSex FeMalesex = AllowedSex.All; private static Vector2 scrollPosition; private static float height_modifier = 0f; // For checking whether the player has tried to pseudo-disable a particular sex type public static bool PlayerIsButtSlut => !(anal == 0.01f && rimming == 0.01f && fisting == 0.01f); // Omitting DP since that could also just be two tabs in one slot public static bool PlayerIsFootSlut => footjob != 0.01f; public static bool PlayerIsCumSlut => fellatio != 0.01f; // Not happy with this nomenclature but it matches the trait so is probably more "readable" public static int MaxQuirks = 1; public enum AllowedSex { All, Homo, Nohomo }; public enum Clothing { Nude, Headgear, Clothed }; public enum RapeAlert { Enabled, Colonists, Humanlikes, Silent, Disabled }; public enum Rjw_sexuality { Vanilla, RimJobWorld, Psychology, SYRIndividuality }; public static void DoWindowContents(Rect inRect) { Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f); Rect viewRect = new Rect(0f, 0f, inRect.width - 16f, inRect.height + height_modifier); Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect); // scroll Listing_Standard listingStandard = new Listing_Standard(); listingStandard.maxOneColumn = true; listingStandard.ColumnWidth = viewRect.width / 3.15f; listingStandard.Begin(viewRect); listingStandard.Gap(4f); listingStandard.Label("SexTypeFrequency".Translate()); listingStandard.Gap(6f); listingStandard.Label(" " + "vaginal".Translate() + ": " + Math.Round(vaginal * 100, 0), -1, "vaginal_desc".Translate()); vaginal = listingStandard.Slider(vaginal, 0.01f, 3.0f); listingStandard.Label(" " + "anal".Translate() + ": " + Math.Round(anal * 100, 0), -1, "anal_desc".Translate()); anal = listingStandard.Slider(anal, 0.01f, 3.0f); listingStandard.Label(" " + "double_penetration".Translate() + ": " + Math.Round(double_penetration * 100, 0), -1, "double_penetration_desc".Translate()); double_penetration = listingStandard.Slider(double_penetration, 0.01f, 3.0f); listingStandard.Label(" " + "fellatio".Translate() + ": " + Math.Round(fellatio * 100, 0), -1, "fellatio_desc".Translate()); fellatio = listingStandard.Slider(fellatio, 0.01f, 3.0f); listingStandard.Label(" " + "cunnilingus".Translate() + ": " + Math.Round(cunnilingus * 100, 0), -1, "cunnilingus_desc".Translate()); cunnilingus = listingStandard.Slider(cunnilingus, 0.01f, 3.0f); listingStandard.Label(" " + "rimming".Translate() + ": " + Math.Round(rimming * 100, 0), -1, "rimming_desc".Translate()); rimming = listingStandard.Slider(rimming, 0.01f, 3.0f); listingStandard.Label(" " + "sixtynine".Translate() + ": " + Math.Round(sixtynine * 100, 0), -1, "sixtynine_desc".Translate()); sixtynine = listingStandard.Slider(sixtynine, 0.01f, 3.0f); listingStandard.CheckboxLabeled("FapEverywhere".Translate(), ref FapEverywhere, "FapEverywhere_desc".Translate()); listingStandard.CheckboxLabeled("FapInBed".Translate(), ref FapInBed, "FapInBed_desc".Translate()); listingStandard.CheckboxLabeled("FapInBelts".Translate(), ref FapInBelts, "FapInBelts_desc".Translate()); listingStandard.CheckboxLabeled("FapInArmbinders".Translate(), ref FapInArmbinders, "FapInArmbinders_desc".Translate()); listingStandard.NewColumn(); listingStandard.Gap(4f); if (listingStandard.ButtonText("Reset".Translate())) { vaginal = 1.20f; anal = 0.80f; fellatio = 0.80f; cunnilingus = 0.80f; rimming = 0.40f; double_penetration = 0.60f; breastjob = 0.50f; handjob = 0.80f; mutual_masturbation = 0.70f; fingering = 0.50f; footjob = 0.30f; scissoring = 0.50f; fisting = 0.30f; sixtynine = 0.69f; } listingStandard.Gap(6f); listingStandard.Label(" " + "breastjob".Translate() + ": " + Math.Round(breastjob * 100, 0), -1, "breastjob_desc".Translate()); breastjob = listingStandard.Slider(breastjob, 0.01f, 3.0f); listingStandard.Label(" " + "handjob".Translate() + ": " + Math.Round(handjob * 100, 0), -1, "handjob_desc".Translate()); handjob = listingStandard.Slider(handjob, 0.01f, 3.0f); listingStandard.Label(" " + "fingering".Translate() + ": " + Math.Round(fingering * 100, 0), -1, "fingering_desc".Translate()); fingering = listingStandard.Slider(fingering, 0.01f, 3.0f); listingStandard.Label(" " + "fisting".Translate() + ": " + Math.Round(fisting * 100, 0), -1, "fisting_desc".Translate()); fisting = listingStandard.Slider(fisting, 0.01f, 3.0f); listingStandard.Label(" " + "mutual_masturbation".Translate() + ": " + Math.Round(mutual_masturbation * 100, 0), -1, "mutual_masturbation_desc".Translate()); mutual_masturbation = listingStandard.Slider(mutual_masturbation, 0.01f, 3.0f); listingStandard.Label(" " + "footjob".Translate() + ": " + Math.Round(footjob * 100, 0), -1, "footjob_desc".Translate()); footjob = listingStandard.Slider(footjob, 0.01f, 3.0f); listingStandard.Label(" " + "scissoring".Translate() + ": " + Math.Round(scissoring * 100, 0), -1, "scissoring_desc".Translate()); scissoring = listingStandard.Slider(scissoring, 0.01f, 3.0f); if (listingStandard.ButtonText("Malesex".Translate() + Malesex.ToString())) { Find.WindowStack.Add(new FloatMenu(new List<FloatMenuOption>() { new FloatMenuOption("AllowedSex.All".Translate(), (() => Malesex = AllowedSex.All)), new FloatMenuOption("AllowedSex.Homo".Translate(), (() => Malesex = AllowedSex.Homo)), new FloatMenuOption("AllowedSex.Nohomo".Translate(), (() => Malesex = AllowedSex.Nohomo)) })); } if (listingStandard.ButtonText("FeMalesex".Translate() + FeMalesex.ToString())) { Find.WindowStack.Add(new FloatMenu(new List<FloatMenuOption>() { new FloatMenuOption("AllowedSex.All".Translate(), (() => FeMalesex = AllowedSex.All)), new FloatMenuOption("AllowedSex.Homo".Translate(), (() => FeMalesex = AllowedSex.Homo)), new FloatMenuOption("AllowedSex.Nohomo".Translate(), (() => FeMalesex = AllowedSex.Nohomo)) })); } listingStandard.NewColumn(); listingStandard.Gap(4f); // TODO: Add translation if (listingStandard.ButtonText("SexClothing".Translate() + sex_wear.ToString())) { Find.WindowStack.Add(new FloatMenu(new List<FloatMenuOption>() { new FloatMenuOption("SexClothingNude".Translate(), (() => sex_wear = Clothing.Nude)), new FloatMenuOption("SexClothingHeadwear".Translate(), (() => sex_wear = Clothing.Headgear)), new FloatMenuOption("SexClothingFull".Translate(), (() => sex_wear = Clothing.Clothed)) })); } listingStandard.Gap(4f); if (listingStandard.ButtonText("RapeAttemptAlert".Translate() + rape_attempt_alert.ToString())) { Find.WindowStack.Add(new FloatMenu(new List<FloatMenuOption>() { new FloatMenuOption("RapeAttemptAlertAlways".Translate(), (() => rape_attempt_alert = RapeAlert.Enabled)), new FloatMenuOption("RapeAttemptAlertHumanlike".Translate(), (() => rape_attempt_alert = RapeAlert.Humanlikes)), new FloatMenuOption("RapeAttemptAlertColonist".Translate(), (() => rape_attempt_alert = RapeAlert.Colonists)), new FloatMenuOption("RapeAttemptAlertSilent".Translate(), (() => rape_attempt_alert = RapeAlert.Silent)), new FloatMenuOption("RapeAttemptAlertDisabled".Translate(), (() => rape_attempt_alert = RapeAlert.Disabled)) })); } if (listingStandard.ButtonText("RapeAlert".Translate() + rape_alert.ToString())) { Find.WindowStack.Add(new FloatMenu(new List<FloatMenuOption>() { new FloatMenuOption("RapeAlertAlways".Translate(), (() => rape_alert = RapeAlert.Enabled)), new FloatMenuOption("RapeAlertHumanlike".Translate(), (() => rape_alert = RapeAlert.Humanlikes)), new FloatMenuOption("RapeAlertColonist".Translate(), (() => rape_alert = RapeAlert.Colonists)), new FloatMenuOption("RapeAlertSilent".Translate(), (() => rape_alert = RapeAlert.Silent)), new FloatMenuOption("RapeAlertDisabled".Translate(), (() => rape_alert = RapeAlert.Disabled)) })); } listingStandard.CheckboxLabeled("RapeAlertCP".Translate(), ref ShowForCP, "RapeAlertCP_desc".Translate()); listingStandard.CheckboxLabeled("RapeAlertBreeding".Translate(), ref ShowForBreeding, "RapeAlertBreeding_desc".Translate()); listingStandard.Gap(26f); listingStandard.Label("SexualitySpread1".Translate(), -1, "SexualitySpread2".Translate()); if (listingStandard.ButtonText(sexuality_distribution.ToString())) { Find.WindowStack.Add(new FloatMenu(new List<FloatMenuOption>() { new FloatMenuOption("Vanilla", () => sexuality_distribution = Rjw_sexuality.Vanilla), //new FloatMenuOption("RimJobWorld", () => sexuality_distribution = Rjw_sexuality.RimJobWorld), new FloatMenuOption("SYRIndividuality", () => sexuality_distribution = Rjw_sexuality.SYRIndividuality), new FloatMenuOption("Psychology", () => sexuality_distribution = Rjw_sexuality.Psychology) })); } if (sexuality_distribution == Rjw_sexuality.RimJobWorld) { listingStandard.Label("SexualityAsexual".Translate() + Math.Round((asexual_ratio / GetTotal()) * 100, 1) + "%", -1, "SexualityAsexual_desc".Translate()); asexual_ratio = listingStandard.Slider(asexual_ratio, 0.0f, 1.0f); listingStandard.Label("SexualityPansexual".Translate() + Math.Round((pansexual_ratio / GetTotal()) * 100, 1) + "%", -1, "SexualityPansexual_desc".Translate()); pansexual_ratio = listingStandard.Slider(pansexual_ratio, 0.0f, 1.0f); listingStandard.Label("SexualityHeterosexual".Translate() + Math.Round((heterosexual_ratio / GetTotal()) * 100, 1) + "%", -1, "SexualityHeterosexual_desc".Translate()); heterosexual_ratio = listingStandard.Slider(heterosexual_ratio, 0.0f, 1.0f); listingStandard.Label("SexualityBisexual".Translate() + Math.Round((bisexual_ratio / GetTotal()) * 100, 1) + "%", -1, "SexualityBisexual_desc".Translate()); bisexual_ratio = listingStandard.Slider(bisexual_ratio, 0.0f, 1.0f); listingStandard.Label("SexualityGay".Translate() + Math.Round((homosexual_ratio / GetTotal()) * 100, 1) + "%", -1, "SexualityGay_desc".Translate()); homosexual_ratio = listingStandard.Slider(homosexual_ratio, 0.0f, 1.0f); } else { if (!xxx.IndividualityIsActive && sexuality_distribution == Rjw_sexuality.SYRIndividuality) sexuality_distribution = Rjw_sexuality.Vanilla; else if (sexuality_distribution == Rjw_sexuality.SYRIndividuality) listingStandard.Label("SexualitySpreadIndividuality".Translate()); else if (!xxx.PsychologyIsActive && sexuality_distribution == Rjw_sexuality.Psychology) sexuality_distribution = Rjw_sexuality.Vanilla; else if (sexuality_distribution == Rjw_sexuality.Psychology) listingStandard.Label("SexualitySpreadPsychology".Translate()); else listingStandard.Label("SexualitySpreadVanilla".Translate()); } listingStandard.Label("MaxQuirks".Translate() + ": " + MaxQuirks, -1f, "MaxQuirks_desc".Translate()); MaxQuirks = (int)listingStandard.Slider(MaxQuirks, 0, 10); listingStandard.End(); height_modifier = listingStandard.CurHeight; Widgets.EndScrollView(); } public static float GetTotal() { return asexual_ratio + pansexual_ratio + heterosexual_ratio + bisexual_ratio + homosexual_ratio; } public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref vaginal, "vaginal_frequency", vaginal, true); Scribe_Values.Look(ref anal, "anal_frequency", anal, true); Scribe_Values.Look(ref fellatio, "fellatio_frequency", fellatio, true); Scribe_Values.Look(ref cunnilingus, "cunnilingus_frequency", cunnilingus, true); Scribe_Values.Look(ref rimming, "rimming_frequency", rimming, true); Scribe_Values.Look(ref double_penetration, "double_penetration_frequency", double_penetration, true); Scribe_Values.Look(ref sixtynine, "sixtynine_frequency", sixtynine, true); Scribe_Values.Look(ref breastjob, "breastjob_frequency", breastjob, true); Scribe_Values.Look(ref handjob, "handjob_frequency", handjob, true); Scribe_Values.Look(ref footjob, "footjob_frequency", footjob, true); Scribe_Values.Look(ref fingering, "fingering_frequency", fingering, true); Scribe_Values.Look(ref fisting, "fisting_frequency", fisting, true); Scribe_Values.Look(ref mutual_masturbation, "mutual_masturbation_frequency", mutual_masturbation, true); Scribe_Values.Look(ref scissoring, "scissoring_frequency", scissoring, true); Scribe_Values.Look(ref asexual_ratio, "asexual_ratio", asexual_ratio, true); Scribe_Values.Look(ref pansexual_ratio, "pansexual_ratio", pansexual_ratio, true); Scribe_Values.Look(ref heterosexual_ratio, "heterosexual_ratio", heterosexual_ratio, true); Scribe_Values.Look(ref bisexual_ratio, "bisexual_ratio", bisexual_ratio, true); Scribe_Values.Look(ref homosexual_ratio, "homosexual_ratio", homosexual_ratio, true); Scribe_Values.Look(ref FapEverywhere, "FapEverywhere", FapEverywhere, true); Scribe_Values.Look(ref FapInBed, "FapInBed", FapInBed, true); Scribe_Values.Look(ref FapInBelts, "FapInBelts", FapInBelts, true); Scribe_Values.Look(ref FapInArmbinders, "FapInArmbinders", FapInArmbinders, true); Scribe_Values.Look(ref sex_wear, "sex_wear", sex_wear, true); Scribe_Values.Look(ref rape_attempt_alert, "rape_attempt_alert", rape_attempt_alert, true); Scribe_Values.Look(ref rape_alert, "rape_alert", rape_alert, true); Scribe_Values.Look(ref ShowForCP, "ShowForCP", ShowForCP, true); Scribe_Values.Look(ref ShowForBreeding, "ShowForBreeding", ShowForBreeding, true); Scribe_Values.Look(ref sexuality_distribution, "sexuality_distribution", sexuality_distribution, true); Scribe_Values.Look(ref Malesex, "Malesex", Malesex, true); Scribe_Values.Look(ref FeMalesex, "FeMalesex", FeMalesex, true); Scribe_Values.Look(ref MaxQuirks, "MaxQuirks", MaxQuirks, true); } } }
Korth95/rjw
1.5/Source/Settings/RJWSexSettings.cs
C#
mit
17,104
using HugsLib.Settings; using UnityEngine; using Verse; namespace rjw.Properties { // This class allows you to handle specific events on the settings class: // The SettingChanging event is raised before a setting's value is changed. // The PropertyChanged event is raised after a setting's value is changed. // The SettingsLoaded event is raised after the setting values are loaded. // The SettingsSaving event is raised before the setting values are saved. internal sealed partial class Settings { public Settings() { // // To add event handlers for saving and changing settings, uncomment the lines below: // // this.SettingChanging += this.SettingChangingEventHandler; // // this.SettingsSaving += this.SettingsSavingEventHandler; // } private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { // Add code to handle the SettingChangingEvent event here. } private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { // Add code to handle the SettingsSaving event here. } private static readonly Color SelectedOptionColor = new Color(0.5f, 1f, 0.5f, 1f); public static bool CustomDrawer_Tabs(Rect rect, SettingHandle<string> selected, string defaultValues) { int labelWidth = 140; //int offset = -287; int offset = 0; bool change = false; Rect buttonRect = new Rect(rect) { width = labelWidth }; buttonRect.position = new Vector2(buttonRect.position.x + offset, buttonRect.position.y); Color activeColor = GUI.color; bool isSelected = defaultValues == selected.Value; if (isSelected) GUI.color = SelectedOptionColor; bool clicked = Widgets.ButtonText(buttonRect, defaultValues); if (isSelected) GUI.color = activeColor; if (clicked) { selected.Value = selected.Value != defaultValues ? defaultValues : "none"; change = true; } offset += labelWidth; return change; } } }
Korth95/rjw
1.5/Source/Settings/Settings.cs
C#
mit
2,007
using Verse; namespace rjw { public class config : Def { // TODO: Clean these. public float minor_pain_threshold; // 0.3 public float significant_pain_threshold; // 0.6 public float extreme_pain_threshold; // 0.95 public float base_chance_to_hit_prisoner; // 50 public int min_ticks_between_hits; // 500 public int max_ticks_between_hits; // 700 public float max_nymph_fraction; public float comfort_prisoner_rape_mtbh_mul; } }
Korth95/rjw
1.5/Source/Settings/config.cs
C#
mit
464
using RimWorld; using Verse; namespace rjw { // used in Vulnerability StatDef calculation public class SkillNeed_CapableOfResisting : SkillNeed_BaseBonus { public override float ValueFor(Pawn pawn) { if (pawn.skills == null) { return 1f; } int level = NegateSkillBonus(pawn) ? 0 : pawn.skills.GetSkill(skill).Level; return ValueAtLevel(level); } protected virtual bool NegateSkillBonus(Pawn pawn) { // remove melee bonus for pawns: downed, sleeping/resting/lying, wearing armbinder return pawn.Downed || pawn.GetPosture() != PawnPosture.Standing // Simple verification on RJW side, but ideally this method should just be overridden in RJW-EX || (xxx.RjwExIsActive && pawn.health.hediffSet.HasHediff(xxx.RjwEx_Armbinder)); } } }
Korth95/rjw
1.5/Source/Stats/SkillNeed_CapableOfResisting.cs
C#
mit
786
using System; using UnityEngine; using Verse; using Verse.AI; using RimWorld; namespace rjw { public class ThinkNode_ChancePerHour_Bestiality : ThinkNode_ChancePerHour { protected override float MtbHours(Pawn pawn) { float base_mtb = xxx.config.comfort_prisoner_rape_mtbh_mul; // Default is 4.0 float desire_factor; { Need_Sex need_sex = pawn.needs.TryGetNeed<Need_Sex>(); if (need_sex != null) { if (need_sex.CurLevel <= need_sex.thresh_frustrated()) desire_factor = 0.40f; else if (need_sex.CurLevel <= need_sex.thresh_horny()) desire_factor = 0.80f; else desire_factor = 1.00f; } else desire_factor = 1.00f; } float personality_factor; { personality_factor = 1.0f; if (xxx.is_nympho(pawn)) personality_factor *= 0.5f; else if (xxx.is_prude(pawn) || pawn.story.traits.HasTrait(TraitDefOf.BodyPurist)) personality_factor *= 2f; if (pawn.story.traits.HasTrait(TraitDefOf.Nudist)) personality_factor *= 0.9f; // Pawns with no zoophile trait should first try to find other outlets. if (!xxx.is_zoophile(pawn)) personality_factor *= 8f; // Less likely to engage in bestiality if the pawn has a lover... unless the lover is an animal (there's mods for that, so need to check). if (!xxx.IsSingleOrPartnersNotHere(pawn) && !xxx.is_animal(LovePartnerRelationUtility.ExistingMostLikedLovePartner(pawn, false)) && !xxx.is_lecher(pawn) && !xxx.is_nympho(pawn)) personality_factor *= 2.5f; // Pawns with few or no prior animal encounters are more reluctant to engage in bestiality. if (pawn.records.GetValue(xxx.CountOfSexWithAnimals) < 3) personality_factor *= 3f; else if (pawn.records.GetValue(xxx.CountOfSexWithAnimals) > 10) personality_factor *= 0.8f; } float fun_factor; { if ((pawn.needs.joy != null) && (xxx.is_bloodlust(pawn))) fun_factor = Mathf.Clamp01(0.50f + pawn.needs.joy.CurLevel); else fun_factor = 1.00f; } return base_mtb * desire_factor * personality_factor * fun_factor; } public override ThinkResult TryIssueJobPackage(Pawn pawn, JobIssueParams jobParams) { try { return base.TryIssueJobPackage(pawn, jobParams); } catch (NullReferenceException) { //--ModLog.Message("ThinkNode_ChancePerHour_Bestiality:TryIssueJobPackage - error message" + e.Message); //--ModLog.Message("ThinkNode_ChancePerHour_Bestiality:TryIssueJobPackage - error stacktrace" + e.StackTrace); return ThinkResult.NoJob; ; } } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ChancePerHour_Bestiality.cs
C#
mit
2,560
using System; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Cooldown for breeding /// something like 4.0*0.2 = 0.8 hours /// </summary> public class ThinkNode_ChancePerHour_Breed : ThinkNode_ChancePerHour { protected override float MtbHours(Pawn pawn) { return xxx.config.comfort_prisoner_rape_mtbh_mul * 0.20f ; } public override ThinkResult TryIssueJobPackage(Pawn pawn, JobIssueParams jobParams) { try { return base.TryIssueJobPackage(pawn, jobParams); } catch (NullReferenceException) { return ThinkResult.NoJob; ; } } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ChancePerHour_Breed.cs
C#
mit
596
using RimWorld; using Verse; using Verse.AI; using System.Linq; namespace rjw { public class ThinkNode_ChancePerHour_Fappin : ThinkNode_ChancePerHour { public static float get_fappin_mtb_hours(Pawn pawn) { float result = 1f; result /= 1f - pawn.health.hediffSet.PainTotal; float efficiency = pawn.health.capacities.GetLevel(PawnCapacityDefOf.Consciousness); if (efficiency < 0.5f) { result /= efficiency * 2f; } if (!pawn.RaceProps.Humanlike) { return result * 4f; } if (RimWorld.LovePartnerRelationUtility.ExistingLovePartner(pawn) != null) { result *= 2f; //This is a factor which makes pawns with love partners less likely to do fappin/random raping/rapingCP/bestiality/necro. } else if (pawn.gender == Gender.Male) { result /= 1.25f; //This accounts for single men } result /= GenMath.FlatHill(0.0001f, 8f, 13f, 28f, 50f, 0.15f, pawn.ageTracker.AgeBiologicalYearsFloat);//this needs to be changed if (xxx.is_nympho(pawn)) { result /= 2f; } return result; } protected override float MtbHours(Pawn p) { // No fapping for animals... for now, at least. // Maybe enable this for monsters girls and such in future, but that'll need code changes to avoid errors. if (xxx.is_animal(p)) return -1.0f; bool is_horny = xxx.is_hornyorfrustrated(p); if (is_horny) { bool isAlone = !p.Map.mapPawns.AllPawnsSpawned.Any(x => p.CanSee(x) && xxx.is_human(x)); // More likely to fap if alone. float aloneFactor = isAlone ? 0.6f : 1.2f; if (xxx.has_quirk(p, "Exhibitionist")) aloneFactor = isAlone ? 1.0f : 0.6f; // More likely to fap if nude. float clothingFactor = p.apparel.PsychologicallyNude ? 0.8f : 1.0f; float SexNeedFactor = (4 - xxx.need_some_sex(p)) / 2f; return get_fappin_mtb_hours(p) * SexNeedFactor * aloneFactor * clothingFactor; } return -1.0f; } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ChancePerHour_Fappin.cs
C#
mit
1,925
using System; using UnityEngine; using Verse; using Verse.AI; using RimWorld; namespace rjw { /// <summary> /// Necro rape corpse /// </summary> public class ThinkNode_ChancePerHour_Necro : ThinkNode_ChancePerHour { protected override float MtbHours(Pawn pawn) { float base_mtb = xxx.config.comfort_prisoner_rape_mtbh_mul; // Default of 4.0 float desire_factor; { var need_sex = pawn.needs.TryGetNeed<Need_Sex>(); if (need_sex != null) { if (need_sex.CurLevel <= need_sex.thresh_frustrated()) desire_factor = 0.15f; else if (need_sex.CurLevel <= need_sex.thresh_horny()) desire_factor = 0.60f; else if (need_sex.CurLevel <= need_sex.thresh_satisfied()) desire_factor = 1.00f; else // Recently had sex. desire_factor = 2.00f; } else desire_factor = 1.00f; } float personality_factor; { personality_factor = 1.0f; if (xxx.is_nympho(pawn)) personality_factor *= 0.8f; if (xxx.is_prude(pawn) || pawn.story.traits.HasTrait(TraitDefOf.BodyPurist)) personality_factor *= 2f; if (xxx.is_psychopath(pawn)) personality_factor *= 0.5f; // Pawns with no necrophiliac trait should first try to find other outlets. if (!xxx.is_necrophiliac(pawn)) personality_factor *= 8f; else personality_factor *= 0.5f; // Less likely to engage in necrophilia if the pawn has a lover. if (!xxx.IsSingleOrPartnersNotHere(pawn)) personality_factor *= 1.25f; // Pawns with no records of prior necrophilia are less likely to engage in it. if (pawn.records.GetValue(xxx.CountOfSexWithCorpse) == 0) personality_factor *= 16f; else if (pawn.records.GetValue(xxx.CountOfSexWithCorpse) > 10) personality_factor *= 0.8f; } float fun_factor; { if ((pawn.needs.joy != null) && (xxx.is_necrophiliac(pawn))) fun_factor = Mathf.Clamp01(0.50f + pawn.needs.joy.CurLevel); else fun_factor = 1.00f; } // I'm normally against gender factors, but necrophilia is far more frequent among males. -Zaltys float gender_factor = (pawn.gender == Gender.Male) ? 1.0f : 3.0f; return base_mtb * desire_factor * personality_factor * fun_factor * gender_factor; } public override ThinkResult TryIssueJobPackage(Pawn pawn, JobIssueParams jobParams) { try { return base.TryIssueJobPackage(pawn, jobParams); } catch (NullReferenceException) { return ThinkResult.NoJob; } } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ChancePerHour_Necro.cs
C#
mit
2,481
using System; using RimWorld; using UnityEngine; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Colonists and prisoners try to rape CP /// </summary> public class ThinkNode_ChancePerHour_RapeCP : ThinkNode_ChancePerHour { protected override float MtbHours(Pawn pawn) { var base_mtb = xxx.config.comfort_prisoner_rape_mtbh_mul; //Default 4.0 float desire_factor; { var need_sex = pawn.needs.TryGetNeed<Need_Sex>(); if (need_sex != null) { if (need_sex.CurLevel <= need_sex.thresh_frustrated()) desire_factor = 0.10f; else if (need_sex.CurLevel <= need_sex.thresh_horny()) desire_factor = 0.50f; else desire_factor = 1.00f; } else desire_factor = 1.00f; } float personality_factor; { personality_factor = 1.0f; if (xxx.has_traits(pawn)) { // Most of the checks are done in the SexAppraiser.would_rape method. personality_factor = 1.0f; if (!RJWSettings.rape_beating) { if (xxx.is_bloodlust(pawn)) personality_factor *= 0.5f; } if (xxx.is_nympho(pawn)) personality_factor *= 0.5f; else if (xxx.is_prude(pawn) || pawn.story.traits.HasTrait(TraitDefOf.BodyPurist)) personality_factor *= 2f; if (xxx.is_rapist(pawn)) personality_factor *= 0.5f; if (xxx.is_psychopath(pawn)) personality_factor *= 0.75f; else if (xxx.is_kind(pawn)) personality_factor *= 5.0f; float rapeCount = pawn.records.GetValue(xxx.CountOfRapedHumanlikes) + pawn.records.GetValue(xxx.CountOfRapedAnimals) + pawn.records.GetValue(xxx.CountOfRapedInsects) + pawn.records.GetValue(xxx.CountOfRapedOthers); // Pawns with few or no rapes are more reluctant to rape CPs. if (rapeCount < 3.0f) personality_factor *= 1.5f; } } float fun_factor; { if ((pawn.needs.joy != null) && (xxx.is_rapist(pawn) || xxx.is_psychopath(pawn))) fun_factor = Mathf.Clamp01(0.50f + pawn.needs.joy.CurLevel); else fun_factor = 1.00f; } float animal_factor = 1.0f; if (xxx.is_animal(pawn)) { var parts = pawn.GetGenitalsList(); // Much slower for female animals. animal_factor = Genital_Helper.has_male_bits(pawn, parts) ? 2.5f : 6f; } //if (xxx.is_animal(pawn)) { Log.Message("Chance for " + pawn + " : " + base_mtb * desire_factor * personality_factor * fun_factor * animal_factor); } return base_mtb * desire_factor * personality_factor * fun_factor * animal_factor; } public override ThinkResult TryIssueJobPackage(Pawn pawn, JobIssueParams jobParams) { try { return base.TryIssueJobPackage(pawn, jobParams); } catch (NullReferenceException) { return ThinkResult.NoJob; ; } } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ChancePerHour_RapeCP.cs
C#
mit
2,822
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Called to determine if the non animal is eligible for a Bestiality job /// </summary> public class ThinkNode_ConditionalBestiality : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { //if (p.Faction != null && p.Faction.IsPlayer) // ModLog.Message("ThinkNode_ConditionalBestiality " + xxx.get_pawnname(p) + " is animal: " + xxx.is_animal(p)); // No bestiality for animals, animal-on-animal is handled in Breed job. if (xxx.is_animal(p)) return false; // Bestiality off if (!RJWSettings.bestiality_enabled) return false; // No free will while designated for rape. if (!RJWSettings.designated_freewill) if ((p.IsDesignatedComfort() || p.IsDesignatedBreeding())) return false; return true; } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalBestiality.cs
C#
mit
834
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Called to determine if the animal is eligible for a breed job /// </summary> public class ThinkNode_ConditionalCanBreed : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { //ModLog.Message("ThinkNode_ConditionalCanBreed " + p); //Rimworld of Magic polymorphed humanlikes also get animal think node //if (p.Faction != null && p.Faction.IsPlayer) // ModLog.Message("ThinkNode_ConditionalCanBreed " + xxx.get_pawnname(p) + " is animal: " + xxx.is_animal(p)); // No Breed jobs for humanlikes, that's handled by bestiality. if (!xxx.is_animal(p)) return false; // Animal stuff disabled. if (!RJWSettings.bestiality_enabled && !RJWSettings.animal_on_animal_enabled) return false; //return p.IsDesignatedBreedingAnimal() || RJWSettings.WildMode; return p.IsDesignatedBreedingAnimal(); } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalCanBreed.cs
C#
mit
919
using Verse; using Verse.AI; using RimWorld; namespace rjw { public class ThinkNode_ConditionalCanRapeCP : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { //ModLog.Message("ThinkNode_ConditionalCanRapeCP " + pawn); if (!RJWSettings.rape_enabled) return false; // Hostiles cannot use CP. if (p.HostileTo(Faction.OfPlayer)) return false; // Designated pawns are not allowed to rape other CP. if (!RJWSettings.designated_freewill) if ((p.IsDesignatedComfort() || p.IsDesignatedBreeding())) return false; // Animals cannot rape CP if the setting is disabled. //if (!(RJWSettings.bestiality_enabled && RJWSettings.animal_CP_rape) && xxx.is_animal(p) ) // return false; // Animals cannot rape CP if (xxx.is_animal(p)) return false; // colonists(humans) cannot rape CP if the setting is disabled. if (!RJWSettings.colonist_CP_rape && p.IsColonist && xxx.is_human(p)) return false; // Visitors(humans) cannot rape CP if the setting is disabled. if (!RJWSettings.visitor_CP_rape && p.Faction?.IsPlayer == false && xxx.is_human(p)) return false; // Visitors(animals/caravan) cannot rape CP if the setting is disabled. if (!RJWSettings.visitor_CP_rape && p.Faction?.IsPlayer == false && p.Faction != Faction.OfInsects && xxx.is_animal(p)) return false; // Wild animals, insects cannot rape CP. //if ((p.Faction == null || p.Faction == Faction.OfInsects) && xxx.is_animal(p)) // return false; return true; } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalCanRapeCP.cs
C#
mit
1,535
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Pawn frustrated /// </summary> public class ThinkNode_ConditionalFrustrated : ThinkNode_Conditional { protected override bool Satisfied (Pawn p) { return xxx.is_frustrated(p); } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalFrustrated.cs
C#
mit
263
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Pawn is horny /// </summary> public class ThinkNode_ConditionalHorny : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { return xxx.is_horny(p); } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalHorny.cs
C#
mit
250
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Pawn HornyOrFrustrated /// </summary> public class ThinkNode_ConditionalHornyOrFrustrated : ThinkNode_Conditional { protected override bool Satisfied (Pawn p) { return xxx.is_hornyorfrustrated(p); } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalHornyOrFrustrated.cs
C#
mit
284
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Called to determine if the animal can mate(vanilla reproductory sex) with animals. /// </summary> public class ThinkNode_ConditionalMate : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { //ModLog.Message("ThinkNode_ConditionalMate " + xxx.get_pawnname(p)); return (xxx.is_animal(p) && RJWSettings.animal_on_animal_enabled); } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalMate.cs
C#
mit
432
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Called to determine if the pawn can engage in necrophilia. /// </summary> public class ThinkNode_ConditionalNecro : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { //ModLog.Message("ThinkNode_ConditionalNecro " + p); if (!RJWSettings.necrophilia_enabled) return false; // No necrophilia for animals. At least for now. // This would be easy to enable, if we actually want to add it. if (xxx.is_animal(p)) return false; // No free will while designated for rape. if (!RJWSettings.designated_freewill) if ((p.IsDesignatedComfort() || p.IsDesignatedBreeding())) return false; return true; } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalNecro.cs
C#
mit
732
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Nymph nothing to do, seek sex-> join in bed /// </summary> public class ThinkNode_ConditionalNympho : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { //ModLog.Message("ThinkNode_ConditionalNympho " + p); if (xxx.is_nympho(p)) if (p.Faction == null || !p.Faction.IsPlayer) return false; else return true; return false; } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalNympho.cs
C#
mit
451
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Will nympho rape when frustrated? /// </summary> public class ThinkNode_ConditionalNymphoFrustratedRape : ThinkNode_Conditional { protected override bool Satisfied (Pawn p) { return RJWSettings.NymphFrustratedRape; } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalNymphoFrustratedRape.cs
C#
mit
303
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Rapist, chance to trigger random rape /// </summary> public class ThinkNode_ConditionalRapist : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { if (!RJWSettings.rape_enabled) return false; if (xxx.is_animal(p)) return false; if (!xxx.is_rapist(p)) return false; // No free will while designated for rape. if (!RJWSettings.designated_freewill) if ((p.IsDesignatedComfort() || p.IsDesignatedBreeding())) return false; if (!xxx.IsSingleOrPartnersNotHere(p)) { return false; } else return true; } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalRapist.cs
C#
mit
655
using RimWorld; using System.Collections.Generic; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Called to determine if the pawn can engage in sex. /// This should be used as the first conditional for sex-related thinktrees. /// </summary> public class ThinkNode_ConditionalSexChecks : ThinkNode_Conditional { protected override bool Satisfied(Pawn p) { //ModLog.Message("ThinkNode_ConditionalSexChecks " + xxx.get_pawnname(p)); //if (p.Faction != null && p.Faction.IsPlayer) // ModLog.Message("ThinkNode_ConditionalSexChecks " + xxx.get_pawnname(p) + " is animal: " + xxx.is_animal(p)); // Downed, Drafted and Awake are checked in core ThinkNode_ConditionalCanDoConstantThinkTreeJobNow. if (p.Map == null) return false; // Pawn(animal) is fogged, no sex, save tps if (p.Fogged()) return false; // Setting checks. if (!xxx.can_do_loving(p)) return false; else if (xxx.is_animal(p) && !RJWSettings.bestiality_enabled && !RJWSettings.animal_on_animal_enabled) return false; // State checks. No sex while trying to leave map. if (p.mindState?.duty?.def != null) if (p.mindState.duty.def == DutyDefOf.SleepForever) return false; else if (p.mindState.duty.def == VanillaDutyDefOf.EnterTransporter) return false; else if (p.mindState.duty.def == DutyDefOf.EnterTransporterAndDefendSelf) return false; else if (p.mindState.duty.def == DutyDefOf.ExitMapBest) return false; else if (p.mindState.duty.def == DutyDefOf.ExitMapBestAndDefendSelf) return false; else if (p.mindState.duty.def == DutyDefOf.ExitMapNearDutyTarget) return false; else if (p.mindState.duty.def == DutyDefOf.ExitMapRandom) return false; else if (p.mindState.duty.def == DutyDefOf.PrepareCaravan_CollectAnimals) return false; else if (p.mindState.duty.def == DutyDefOf.PrepareCaravan_GatherAnimals) return false; else if (p.mindState.duty.def == DutyDefOf.PrepareCaravan_GatherDownedPawns) return false; else if (p.mindState.duty.def == DutyDefOf.PrepareCaravan_GatherItems) return false; // No sex while starving or badly hurt. return ((!p.needs?.food?.Starving) ?? true && (xxx.is_healthy_enough(p) || !xxx.is_human(p))); } } }
Korth95/rjw
1.5/Source/ThinkTreeNodes/ThinkNode_ConditionalSexChecks.cs
C#
mit
2,284
using RimWorld; using Verse; namespace rjw { public class ThoughtWorker_FeelingBroken : ThoughtWorker { public static int Clamp(int value, int min, int max) { return (value < min) ? min : (value > max) ? max : value; } protected override ThoughtState CurrentStateInternal(Pawn p) { var brokenstages = p.health.hediffSet.GetFirstHediffOfDef(xxx.feelingBroken); if (brokenstages != null && brokenstages.CurStageIndex != 0) { if (xxx.is_masochist(p) && brokenstages.CurStageIndex >= 2) { return ThoughtState.ActiveAtStage(2); // begging for more } return ThoughtState.ActiveAtStage(Clamp(brokenstages.CurStageIndex - 1, 0, 1)); } return ThoughtState.Inactive; } } }
Korth95/rjw
1.5/Source/Thoughts/ThoughtWorker_FeelingBroken.cs
C#
mit
721
using RimWorld; using Verse; namespace rjw { public class ThoughtWorker_NeedSex : ThoughtWorker { protected override ThoughtState CurrentStateInternal(Pawn p) { var sex_need = p.needs.TryGetNeed<Need_Sex>(); if (sex_need != null) if (xxx.can_do_loving(p)) { var lev = sex_need.CurLevel; if (lev <= sex_need.thresh_frustrated()) return ThoughtState.ActiveAtStage(0); else if (lev <= sex_need.thresh_horny()) return ThoughtState.ActiveAtStage(1); else if (lev >= sex_need.thresh_satisfied()) return ThoughtState.ActiveAtStage(2); } return ThoughtState.Inactive; } } }
Korth95/rjw
1.5/Source/Thoughts/ThoughtWorker_NeedSex.cs
C#
mit
627
using RimWorld; using Verse; namespace rjw { //This thought system of RW is retarded AF. It needs separate thought handler for each hediff. public abstract class ThoughtWorker_SexChange : ThoughtWorker { public virtual HediffDef hediff_served { get; } protected override ThoughtState CurrentStateInternal(Pawn pawn) { //Log.Message(" "+this.GetType() + " is called for " + pawn +" and hediff" + hediff_served); Hediff denial = pawn.health.hediffSet.GetFirstHediffOfDef(hediff_served); //Log.Message("Hediff of the class is null " + (hediff_served == null)); if (denial != null && denial.CurStageIndex!=0) { //Log.Message("Current denial level is " + denial.CurStageIndex ); return ThoughtState.ActiveAtStage(denial.CurStageIndex-1); } return ThoughtState.Inactive; } } public class ThoughtWorker_MtT : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.m2t; } } } public class ThoughtWorker_MtF:ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.m2f; } } } public class ThoughtWorker_MtH : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.m2h; } } } public class ThoughtWorker_FtT : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.f2t; } } } public class ThoughtWorker_FtM : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.f2m; } } } public class ThoughtWorker_FtH : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.f2h; } } } public class ThoughtWorker_HtT : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.h2t; } } } public class ThoughtWorker_HtM : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.h2m; } } } public class ThoughtWorker_HtF : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.h2f; } } } public class ThoughtWorker_TtH : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.t2h; } } } public class ThoughtWorker_TtM : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.t2m; } } } public class ThoughtWorker_TtF : ThoughtWorker_SexChange { public override HediffDef hediff_served { get { return GenderHelper.t2f; } } } }
Korth95/rjw
1.5/Source/Thoughts/ThoughtWorker_SexChange.cs
C#
mit
2,531
using Verse; using Verse.AI.Group; namespace rjw { public class Trigger_SexSatisfy : TriggerFilter { private const int CheckInterval = 120; private const int TickTimeout = 900; private int currentTick = 0; public float targetValue = 0.3f; public Trigger_SexSatisfy(float t) { this.targetValue = t; currentTick = 0; } public override bool AllowActivation(Lord lord, TriggerSignal signal) { currentTick++; if (signal.type == TriggerSignalType.Tick && Find.TickManager.TicksGame % CheckInterval == 0) { float? avgValue = null; foreach (var pawn in lord.ownedPawns) { /*foreach(Pawn p in lord.Map.mapPawns.PawnsInFaction(Faction.OfPlayer)) { }*/ Need_Sex n = pawn.needs.TryGetNeed<Need_Sex>(); //if (n != null && pawn.gender == Gender.Male && !pawn.Downed) if(xxx.can_rape(pawn) && (xxx.is_healthy_enough(pawn) && xxx.IsTargetPawnOkay(pawn) || !xxx.is_human(pawn)) && Find.TickManager.TicksGame > pawn.mindState.canLovinTick) { avgValue = (avgValue == null) ? n.CurLevel : (avgValue + n.CurLevel) / 2f; } } //--Log.Message("[ABF]Trigger_SexSatisfy::ActivateOn Checked value :" + avgValue + "/" + targetValue); return avgValue == null || avgValue >= targetValue; } return currentTick >= TickTimeout; } } }
Korth95/rjw
1.5/Source/Triggers/Trigger_SexSatisfy.cs
C#
mit
1,320
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to rape a comfort prisoner /// </summary> public class WorkGiver_BestialityF : WorkGiver_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { if (!RJWSettings.rape_enabled) return false; Pawn target = t as Pawn; if (!RJWSettings.WildMode) { if (xxx.is_kind(pawn)) { JobFailReason.Is("refuses to rape"); return false; } //satisfied pawns //horny non rapists if ((xxx.need_some_sex(pawn) <= 1f) || (xxx.need_some_sex(pawn) <= 2f && !(xxx.is_rapist(pawn) || xxx.is_psychopath(pawn) || xxx.is_nympho(pawn)))) { JobFailReason.Is("not horny enough"); return false; } if (!target.IsDesignatedComfort()) { //JobFailReason.Is("not designated as CP", null); return false; } if (!xxx.is_healthy_enough(target) || !xxx.is_not_dying(target) && (xxx.is_bloodlust(pawn) || xxx.is_psychopath(pawn) || xxx.is_rapist(pawn) || xxx.has_quirk(pawn, "Somnophile"))) { //--Log.Message("[RJW]WorkGiver_RapeCP::HasJobOnThing called0 - target isn't healthy enough or is in a forbidden position."); JobFailReason.Is("target not healthy enough"); return false; } if (pawn.relations.OpinionOf(target) > 50 && !xxx.is_rapist(pawn) && !xxx.is_psychopath(pawn) && !xxx.is_masochist(target)) { JobFailReason.Is("refuses to rape a friend"); return false; } if (!xxx.can_rape(pawn)) { //--Log.Message("[RJW]WorkGiver_RapeCP::HasJobOnThing called1 - pawn don't need sex or is not healthy, or cannot rape"); JobFailReason.Is("cannot rape target (vulnerability too low, or age mismatch)"); return false; } if (!xxx.IsSingleOrPartnersNotHere(pawn) && !xxx.is_lecher(pawn) && !xxx.is_psychopath(pawn) && !xxx.is_nympho(pawn)) if (!LovePartnerRelationUtility.LovePartnerRelationExists(pawn, target)) { //--Log.Message("[RJW]WorkGiver_RapeCP::HasJobOnThing called2 - pawn is not single or has partner around"); JobFailReason.Is("cannot rape while in stable relationship"); return false; } } if (!pawn.CanReserve(target, xxx.max_rapists_per_prisoner, 0)) return false; //Log.Message("[RJW]" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { //--Log.Message("[RJW]WorkGiver_RapeCP::JobOnThing(" + xxx.get_pawnname(pawn) + "," + t.ToStringSafe() + ") is called."); return new Job(xxx.comfort_prisoner_rapin, t); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_BestialityF.cs
C#
mit
2,663
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to breed animal(passive) /// </summary> public class WorkGiver_BestialityForFemale : WorkGiver_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { //ModLog.Message("" + this.GetType().ToString() + ":: base checks: pass"); if (!RJWSettings.bestiality_enabled) return false; Pawn target = t as Pawn; if (!WorkGiverChecks(pawn, t, forced)) return false; if (!xxx.can_be_fucked(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("pawn cant be fucked"); return false; } if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) if (!RJWSettings.WildMode) { if (!xxx.is_zoophile(pawn) && !xxx.is_frustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not willing to have sex with animals"); return false; } if (!xxx.is_hornyorfrustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } if (!xxx.is_healthy_enough(target)) { if (RJWSettings.DevMode) JobFailReason.Is("target not healthy enough"); return false; } //ModLog.Message("WorkGiver_BestialityForFemale::" + SexAppraiser.would_fuck_animal(pawn, target)); if (SexAppraiser.would_fuck_animal(pawn, target) < 0.1f) { return false; } //add some more fancy conditions from JobGiver_Bestiality? } //ModLog.Message("" + this.GetType().ToString() + ":: extended checks: can start sex"); return true; } public override bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (!xxx.is_animal(target)) { return false; } Building_Bed bed = pawn.ownership.OwnedBed; if (bed == null) { if (RJWSettings.DevMode) JobFailReason.Is("pawn has no bed"); return false; } if (!target.CanReach(bed, PathEndMode.OnCell, Danger.Some) || target.Downed) { if (RJWSettings.DevMode) JobFailReason.Is("target cant reach bed"); return false; } return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { Building_Bed bed = pawn.ownership.OwnedBed; return JobMaker.MakeJob(xxx.bestialityForFemale, t, bed); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_BestialityForFemale.cs
C#
mit
2,338
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to breed animal(active) /// </summary> public class WorkGiver_BestialityForMale : WorkGiver_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { //ModLog.Message("" + this.GetType().ToString() + " base checks: pass"); if (!RJWSettings.bestiality_enabled) return false; Pawn target = t as Pawn; if (!WorkGiverChecks(pawn, t, forced)) return false; if (!xxx.can_be_fucked(target)) { if (RJWSettings.DevMode) JobFailReason.Is("target cant be fucked"); return false; } if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) if (!RJWSettings.WildMode) { if (!xxx.is_zoophile(pawn) && !xxx.is_frustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not willing to have sex with animals"); return false; } if (!xxx.is_hornyorfrustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } if (!xxx.is_healthy_enough(target) || !xxx.is_not_dying(target) && (xxx.is_bloodlust(pawn) || xxx.is_psychopath(pawn) || xxx.has_quirk(pawn, "Somnophile"))) { if (RJWSettings.DevMode) JobFailReason.Is("target not healthy enough"); return false; } //ModLog.Message("WorkGiver_BestialityForMale::" + SexAppraiser.would_fuck_animal(pawn, target)); if (SexAppraiser.would_fuck_animal(pawn, target) < 0.1f) { return false; } //add some more fancy conditions from JobGiver_Bestiality? } //ModLog.Message("" + this.GetType().ToString() + ":: extended checks: can start sex"); return true; } public override bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (!xxx.is_animal(target)) { return false; } if (!xxx.can_fuck(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("cant fuck"); return false; } return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.bestiality, t); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_BestialityForMale.cs
C#
mit
2,176
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to rape a comfort prisoner /// </summary> public class WorkGiver_BestialityM : WorkGiver_RJW_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { if (!RJWSettings.rape_enabled) return false; Pawn target = t as Pawn; if (!RJWSettings.WildMode) { if (xxx.is_kind(pawn)) { JobFailReason.Is("refuses to rape"); return false; } //satisfied pawns //horny non rapists if ((xxx.need_some_sex(pawn) <= 1f) || (xxx.need_some_sex(pawn) <= 2f && !(xxx.is_rapist(pawn) || xxx.is_psychopath(pawn) || xxx.is_nympho(pawn)))) { JobFailReason.Is("not horny enough"); return false; } if (!target.IsDesignatedComfort()) { //JobFailReason.Is("not designated as CP", null); return false; } if (!xxx.is_healthy_enough(target) || !xxx.is_not_dying(target) && (xxx.is_bloodlust(pawn) || xxx.is_psychopath(pawn) || xxx.is_rapist(pawn) || xxx.has_quirk(pawn, "Somnophile"))) { //--Log.Message("[RJW]WorkGiver_RapeCP::HasJobOnThing called0 - target isn't healthy enough or is in a forbidden position."); JobFailReason.Is("target not healthy enough"); return false; } if (pawn.relations.OpinionOf(target) > 50 && !xxx.is_rapist(pawn) && !xxx.is_psychopath(pawn) && !xxx.is_masochist(target)) { JobFailReason.Is("refuses to rape a friend"); return false; } if (!xxx.can_rape(pawn)) { //--Log.Message("[RJW]WorkGiver_RapeCP::HasJobOnThing called1 - pawn don't need sex or is not healthy, or cannot rape"); JobFailReason.Is("cannot rape target (vulnerability too low, or age mismatch)"); return false; } if (!xxx.IsSingleOrPartnersNotHere(pawn) && !xxx.is_lecher(pawn) && !xxx.is_psychopath(pawn) && !xxx.is_nympho(pawn)) if (!LovePartnerRelationUtility.LovePartnerRelationExists(pawn, target)) { //--Log.Message("[RJW]WorkGiver_RapeCP::HasJobOnThing called2 - pawn is not single or has partner around"); JobFailReason.Is("cannot rape while in stable relationship"); return false; } } if (!pawn.CanReserve(target, xxx.max_rapists_per_prisoner, 0)) return false; //Log.Message("[RJW]" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { //--Log.Message("[RJW]WorkGiver_RapeCP::JobOnThing(" + xxx.get_pawnname(pawn) + "," + t.ToStringSafe() + ") is called."); return new Job(xxx.comfort_prisoner_rapin, t); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_BestialityM.cs
C#
mit
2,667
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to cleanup/collect sex fluids /// </summary> //TODO: add sex fluid collection/cleaning public class WorkGiver_CleanSexStuff : WorkGiver_Sexchecks { public override ThingRequest PotentialWorkThingRequest => ThingRequest.ForGroup(ThingRequestGroup.filth); public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { return false; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return null; } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_CleanSexStuff.cs
C#
mit
561
using RimWorld; using Verse; using Verse.AI; using System.Linq; namespace rjw { /// <summary> /// Assigns a pawn to fap in bed /// </summary> public class WorkGiver_Masturbate_Bed : WorkGiver_Sexchecks { public override ThingRequest PotentialWorkThingRequest => ThingRequest.ForGroup(ThingRequestGroup.BuildingArtificial); public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { if (pawn.Position == t.Position) { //use quickfap return false; } //ModLog.Message("" + this.GetType().ToString() + " base checks: pass"); Building_Bed target = t as Building_Bed; if (!(target is Building_Bed)) { if (RJWSettings.DevMode) JobFailReason.Is("not a bed"); return false; } if (!pawn.CanReserve(target)) { //if (RJWSettings.DevMode) JobFailReason.Is("not a bed"); return false; } if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) if (!RJWSettings.WildMode) { if (!target.OwnersForReading.Contains(pawn) && !xxx.is_psychopath(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not my bed"); return false; } if (!xxx.is_nympho(pawn)) if (!xxx.is_hornyorfrustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } if (target.CurOccupants.Count() != 0) { if (target.CurOccupants.Count() == 1 && !target.CurOccupants.Contains(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("bed not empty"); return false; } if (target.CurOccupants.Count() > 1) { if (RJWSettings.DevMode) JobFailReason.Is("bed not empty"); return false; } } //TODO: more exhibitionsts checks? bool canbeseen = false; foreach (Pawn bystander in pawn.Map.mapPawns.AllPawnsSpawned.Where(x => xxx.is_human(x) && x != pawn)) { // dont see through walls, dont see whole map, only 15 cells around if (bystander.CanSee(target) && bystander.Position.DistanceTo(target.Position) < 15) { //if (!LovePartnerRelationUtility.LovePartnerRelationExists(pawn, bystander)) canbeseen = true; } } if (!xxx.has_quirk(pawn, "Exhibitionist") && canbeseen) { if (RJWSettings.DevMode) JobFailReason.Is("can be seen"); return false; } if (xxx.has_quirk(pawn, "Exhibitionist") && !canbeseen) { if (RJWSettings.DevMode) JobFailReason.Is("can not be seen"); return false; } } //ModLog.Message("" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.Masturbate, pawn, t, t.Position); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_Masturbate_Bed.cs
C#
mit
2,784
using RimWorld; using Verse; using Verse.AI; using System.Linq; namespace rjw { /// <summary> /// Assigns a pawn to fap in chair /// </summary> public class WorkGiver_Masturbate_Chair : WorkGiver_Sexchecks { public override ThingRequest PotentialWorkThingRequest => ThingRequest.ForGroup(ThingRequestGroup.BuildingArtificial); public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { if (pawn.Position == t.Position) { //use quickfap return false; } //ModLog.Message("" + this.GetType().ToString() + " base checks: pass"); Building target = t as Building; if (!(target is Building)) { if (RJWSettings.DevMode) JobFailReason.Is("not a building"); return false; } if (!(target.def.building.isSittable)) { if (RJWSettings.DevMode) JobFailReason.Is("not a sittable building"); return false; } if (!pawn.CanReserve(target)) { //if (RJWSettings.DevMode) JobFailReason.Is("not a bed"); return false; } if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) if (!RJWSettings.WildMode) { if (!xxx.is_nympho(pawn)) if (!xxx.is_hornyorfrustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } //TODO: more exhibitionsts checks? bool canbeseen = false; foreach (Pawn bystander in pawn.Map.mapPawns.AllPawnsSpawned.Where(x => xxx.is_human(x) && x != pawn)) { // dont see through walls, dont see whole map, only 15 cells around if (bystander.CanSee(target) && bystander.Position.DistanceTo(target.Position) < 15) { //if (!LovePartnerRelationUtility.LovePartnerRelationExists(pawn, bystander)) canbeseen = true; } } if (!xxx.has_quirk(pawn, "Exhibitionist") && canbeseen) { if (RJWSettings.DevMode) JobFailReason.Is("can be seen"); return false; } if (xxx.has_quirk(pawn, "Exhibitionist") && !canbeseen) { if (RJWSettings.DevMode) JobFailReason.Is("can not be seen"); return false; } } //ModLog.Message("" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.Masturbate, pawn, t, t.Position); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_Masturbate_Chair.cs
C#
mit
2,359
using RimWorld; using Verse; using Verse.AI; using System.Linq; namespace rjw { /// <summary> /// Assigns a pawn to fap /// </summary> public class WorkGiver_Masturbate : WorkGiver_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { //ModLog.Message("" + this.GetType().ToString() + " base checks: pass"); Pawn target = t as Pawn; if (target != pawn) { return false; } if (!pawn.CanReserve(target, xxx.max_rapists_per_prisoner, 0)) return false; if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) if (!RJWSettings.WildMode) { if (!xxx.is_nympho(pawn)) if (!xxx.is_hornyorfrustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } //TODO: more exhibitionsts checks? bool canbeseen = false; foreach (Pawn bystander in pawn.Map.mapPawns.AllPawnsSpawned.Where(x => xxx.is_human(x) && x != pawn)) { // dont see through walls, dont see whole map, only 15 cells around if (pawn.CanSee(bystander) && pawn.Position.DistanceTo(bystander.Position) < 15) { //if (!LovePartnerRelationUtility.LovePartnerRelationExists(pawn, bystander)) canbeseen = true; } } if (!xxx.has_quirk(pawn, "Exhibitionist") && canbeseen) { if (RJWSettings.DevMode) JobFailReason.Is("can be seen"); return false; } if (xxx.has_quirk(pawn, "Exhibitionist") && !canbeseen) { if (RJWSettings.DevMode) JobFailReason.Is("can not be seen"); return false; } } //experimental change textures of bed to whore bed //ModLog.Message(" bed " + t.GetType().ToString() + " path " + t.Graphic.data.texPath); //t.Graphic.data.texPath = "Things/Building/Furniture/Bed/DoubleBedWhore"; //t.Graphic.path = "Things/Building/Furniture/Bed/DoubleBedWhore"; //t.DefaultGraphic.data.texPath = "Things/Building/Furniture/Bed/DoubleBedWhore"; //t.DefaultGraphic.path = "Things/Building/Furniture/Bed/DoubleBedWhore"; //ModLog.Message(" bed " + t.GetType().ToString() + " texPath " + t.Graphic.data.texPath); //ModLog.Message(" bed " + t.GetType().ToString() + " drawSize " + t.Graphic.data.drawSize); //t.Draw(); //t.ExposeData(); //Scribe_Values.Look(ref t.Graphic.data.texPath, t.Graphic.data.texPath, "Things/Building/Furniture/Bed/DoubleBedWhore", true); //ModLog.Message("" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.Masturbate, pawn, null, t.Position); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_Masturbate_Quick.cs
C#
mit
2,688
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to rape /// </summary> public class WorkGiver_Quickie : WorkGiver_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (target == pawn) { //JobFailReason.Is("no self rape", null); return false; } if (!WorkGiverChecks(pawn, t, forced)) return false; if (!xxx.is_human(target)) { return false; } if(target.GetPosture() == PawnPosture.LayingInBed) { return false; } if (!pawn.CanReserve(target, xxx.max_rapists_per_prisoner, 0)) return false; if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) return false; //ModLog.Message("" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (pawn.HostileTo(target)) { return false; } return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.quick_sex, t as Pawn); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_Quickie.cs
C#
mit
1,197
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to rape /// </summary> public class WorkGiver_Rape : WorkGiver_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { if (RJWSettings.DebugRape) ModLog.Message("" + this.GetType().ToString() + " base checks: pass"); if (!RJWSettings.rape_enabled) return false; Pawn target = t as Pawn; if (target == pawn) { //JobFailReason.Is("no self rape", null); return false; } if (!WorkGiverChecks(pawn, t, forced)) return false; if (!xxx.is_human(target)) { return false; } if (!pawn.CanReserve(target, xxx.max_rapists_per_prisoner, 0)) return false; if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) if (!RJWSettings.WildMode) { if (xxx.is_kind(pawn) || xxx.is_masochist(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("refuses to rape"); return false; } if (pawn.relations.OpinionOf(target) > 50 && !xxx.is_rapist(pawn) && !xxx.is_psychopath(pawn) && !xxx.is_masochist(target)) { if (RJWSettings.DevMode) JobFailReason.Is("refuses to rape a friend"); return false; } if (!xxx.can_get_raped(target)) { if (RJWSettings.DevMode) JobFailReason.Is("cannot rape target"); return false; } //fail for: //satisfied pawns //horny non rapists if ((xxx.need_some_sex(pawn) <= 1f) || (xxx.need_some_sex(pawn) <= 2f && !(xxx.is_rapist(pawn) || xxx.is_psychopath(pawn) || xxx.is_nympho(pawn)))) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } if (!xxx.can_rape(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("cannot rape"); return false; } if (!xxx.is_healthy_enough(target) || !xxx.is_not_dying(target) && (xxx.is_bloodlust(pawn) || xxx.is_psychopath(pawn) || xxx.is_rapist(pawn) || xxx.has_quirk(pawn, "Somnophile"))) { if (RJWSettings.DevMode) JobFailReason.Is("target not healthy enough"); return false; } if (!xxx.is_lecher(pawn) && !xxx.is_psychopath(pawn) && !xxx.is_nympho(pawn)) if (!xxx.IsSingleOrPartnersNotHere(pawn)) if (!LovePartnerRelationUtility.LovePartnerRelationExists(pawn, target)) { if (RJWSettings.DevMode) JobFailReason.Is("cannot rape while partner around"); return false; } //ModLog.Message("WorkGiver_RapeCP::" + SexAppraiser.would_fuck(pawn, target)); if (SexAppraiser.would_fuck(pawn, target) < 0.1f) { return false; } } //ModLog.Message("" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (pawn.HostileTo(target) || target.IsDesignatedComfort()) { return false; } return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.RapeRandom, t); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_Rape.cs
C#
mit
3,121
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to rape a comfort prisoner /// </summary> public class WorkGiver_RapeCP : WorkGiver_Rape { public override bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (!target.IsDesignatedComfort()) { if (RJWSettings.DevMode) JobFailReason.Is("not designated for comfort", null); return false; } return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.RapeCP, t); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_RapeCP.cs
C#
mit
603
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to rape enemy /// </summary> public class WorkGiver_RapeEnemy : WorkGiver_Rape { public override bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (!pawn.HostileTo(target)) { if (RJWSettings.DevMode) JobFailReason.Is("not hostile", null); return false; } return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.RapeEnemy, t); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_RapeEnemy.cs
C#
mit
575
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to have sex with /// </summary> public class WorkGiver_Sex : WorkGiver_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { //ModLog.Message("" + this.GetType().ToString() + " base checks: pass"); Pawn target = t as Pawn; if (target == pawn) { //JobFailReason.Is("no self sex", null); return false; } if (!WorkGiverChecks(pawn, t, forced)) return false; if (!xxx.is_human(target)) { return false; } if (!pawn.CanReserve(target, xxx.max_rapists_per_prisoner, 0)) return false; if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) if (!RJWSettings.WildMode) { //check initiator //fail for: //satisfied non nymph pawns if (xxx.need_some_sex(pawn) <= 1f && !xxx.is_nympho(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } if (!xxx.IsTargetPawnOkay(target)) { if (RJWSettings.DevMode) JobFailReason.Is("target not healthy enough"); return false; } if (!xxx.is_lecher(pawn) && !xxx.is_psychopath(pawn) && !xxx.is_nympho(pawn)) if (!xxx.HasNonPolyPartner(pawn, onCurrentMap: true)) if (!LovePartnerRelationUtility.LovePartnerRelationExists(pawn, target)) { if (RJWSettings.DevMode) JobFailReason.Is("cannot have sex while partner around"); return false; } float relations = 0; float attraction = 0; if (!xxx.is_animal(target)) { relations = pawn.relations.OpinionOf(target); if (relations < RJWHookupSettings.MinimumRelationshipToHookup) { if (!(relations > 0 && xxx.is_nympho(pawn))) { if (RJWSettings.DevMode) JobFailReason.Is($"i don't like them:({relations})"); return false; } } attraction = pawn.relations.SecondaryRomanceChanceFactor(target); if (attraction < RJWHookupSettings.MinimumAttractivenessToHookup) { if (!(attraction > 0 && xxx.is_nympho(pawn))) { if (RJWSettings.DevMode) JobFailReason.Is($"i don't find them attractive:({attraction})"); return false; } } } //ModLog.Message("WorkGiver_Sex::" + SexAppraiser.would_fuck(pawn, target)); if (SexAppraiser.would_fuck(pawn, target) < 0.1f) { return false; } if (!xxx.is_animal(target)) { //check partner if (xxx.need_some_sex(target) <= 1f && !xxx.is_nympho(target)) { if (RJWSettings.DevMode) JobFailReason.Is("partner not horny enough"); return false; } if (!xxx.is_lecher(target) && !xxx.is_psychopath(target) && !xxx.is_nympho(target)) if (!xxx.HasNonPolyPartner(target, onCurrentMap: true)) if (!LovePartnerRelationUtility.LovePartnerRelationExists(pawn, target)) { if (RJWSettings.DevMode) JobFailReason.Is("partner cannot have sex while their partner around"); return false; } relations = target.relations.OpinionOf(pawn); if (relations <= RJWHookupSettings.MinimumRelationshipToHookup) { if (!(relations > 0 && xxx.is_nympho(target))) { if (RJWSettings.DevMode) JobFailReason.Is($"don't like me:({relations})"); return false; } } attraction = target.relations.SecondaryRomanceChanceFactor(pawn); if (attraction <= RJWHookupSettings.MinimumAttractivenessToHookup) { if (!(attraction > 0 && xxx.is_nympho(target))) { if (RJWSettings.DevMode) JobFailReason.Is($"doesn't find me attractive:({attraction})"); return false; } } } //ModLog.Message("WorkGiver_Sex::" + SexAppraiser.would_fuck(target, pawn)); if (SexAppraiser.would_fuck(target, pawn) < 0.1f) { return false; } } //ModLog.Message("" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (pawn.HostileTo(target) || target.IsDesignatedComfort()) { return false; } return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { //TODO:: fix bed stealing during join other pawn //Building_Bed bed = pawn.ownership.OwnedBed; //if (bed == null) // bed = (t as Pawn).ownership.OwnedBed; Building_Bed bed = (t as Pawn).CurrentBed(); if (bed == null) return null; //if (pawn.CurrentBed() != (t as Pawn).CurrentBed()) // return null; return JobMaker.MakeJob(xxx.casual_sex, t as Pawn, bed); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_Sex.cs
C#
mit
4,769
using RimWorld; using Verse; using Verse.AI; using Multiplayer.API; namespace rjw { /// <summary> /// Allow pawn to have sex /// dunno if this should be used to allow manual sex start or limit it behind sort of "hero" designator for RP purposes, so player can only control 1 pawn directly? /// </summary> public class WorkGiver_Sexchecks : WorkGiver_Scanner { public override int MaxRegionsToScanBeforeGlobalSearch => 4; public override PathEndMode PathEndMode => PathEndMode.OnCell; public override ThingRequest PotentialWorkThingRequest => ThingRequest.ForGroup(ThingRequestGroup.Pawn); public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false) { if (!forced) //if (!(forced || RJWSettings.WildMode)) { //ModLog.Message("WorkGiver_RJW_Sexchecks::not player interaction, exit:" + forced); return false; } var isHero = RJWSettings.RPG_hero_control && pawn.IsDesignatedHero(); if (!(RJWSettings.override_control || isHero)) { //ModLog.Message("WorkGiver_RJW_Sexchecks::direct_control disabled or not hero, exit"); return false; } //! if (!isHero) { if (!RJWSettings.override_control || MP.IsInMultiplayer) { //ModLog.Message("WorkGiver_RJW_Sexchecks::direct_control disabled or is in MP , exit"); return false; } } else if (!pawn.IsHeroOwner()) { //ModLog.Message("WorkGiver_RJW_Sexchecks::not hero owner, exit"); return false; } Pawn target = t as Pawn; if (t is Corpse) { Corpse corpse = t as Corpse; target = corpse.InnerPawn; //ModLog.Message("WorkGiver_RJW_Sexchecks::Pawn(" + xxx.get_pawnname(pawn) + "), Target corpse(" + xxx.get_pawnname(target) + ")"); } else { //ModLog.Message("WorkGiver_RJW_Sexchecks::Pawn(" + xxx.get_pawnname(pawn) + "), Target pawn(" + xxx.get_pawnname(target) + ")"); } //Log.Message("1"); if (t == null || t.Map == null) { return false; } //Log.Message("2"); if (!(xxx.can_fuck(pawn) || xxx.can_be_fucked(pawn))) { //ModLog.Message("WorkGiver_RJW_Sexchecks::JobOnThing(" + xxx.get_pawnname(pawn) + ") is cannot fuck or be fucked."); return false; } //Log.Message("3"); if (t is Pawn) if (!(xxx.can_fuck(target) || xxx.can_be_fucked(target))) { //ModLog.Message("WorkGiver_RJW_Sexchecks::JobOnThing(" + xxx.get_pawnname(target) + ") is cannot fuck or be fucked."); return false; } //Log.Message("4"); if (!RJWSettings.bestiality_enabled && xxx.is_animal(target)) { //if (RJWSettings.DevMode) JobFailReason.Is("bestiality disabled"); return false; } //investigate AoA, someday //move this? //if (xxx.is_animal(pawn) && xxx.is_animal(target) && !RJWSettings.animal_on_animal_enabled) //{ // return false; //} if (!xxx.is_human(pawn) && !(xxx.RoMIsActive && pawn.health.hediffSet.HasHediff(xxx.TM_ShapeshiftHD))) { return false; } //Log.Message("5"); if (!pawn.CanReach(t, PathEndMode, Danger.Some)) { if (RJWSettings.DevMode) JobFailReason.Is( pawn.CanReach(t, PathEndMode, Danger.Deadly) ? "unable to reach target safely" : "target unreachable"); return false; } //Log.Message("6"); if (t.IsForbidden(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("target is outside of allowed area"); return false; } //Log.Message("7"); if (!pawn.IsDesignatedHero()) { if (!RJWSettings.WildMode) { if (pawn.IsDesignatedComfort() || pawn.IsDesignatedBreeding()) { if (RJWSettings.DevMode) JobFailReason.Is("designated pawns cannot initiate sex"); return false; } if (!xxx.is_healthy_enough(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not healthy enough for sex"); return false; } if (xxx.is_asexual(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("refuses to have sex"); return false; } } } else { if (!pawn.IsHeroOwner()) { //ModLog.Message("WorkGiver_Sexchecks::player interaction for not owned hero, exit"); return false; } } if (!MoreChecks(pawn, t, forced)) return false; return true; } public virtual bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { return false; } public virtual bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return null; } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_Sexchecks.cs
C#
mit
4,512
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Try to solicit pawn to have sex with /// </summary> public class WorkGiver_Solicit : WorkGiver_Sexchecks { public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { //ModLog.Message("" + this.GetType().ToString() + " base checks: pass"); Pawn target = t as Pawn; if (target == pawn) { //JobFailReason.Is("no self solicit", null); return false; } if (!WorkGiverChecks(pawn, t, forced)) return false; if (!xxx.is_human(target)) { return false; } //if (!pawn.CanReserve(target, xxx.max_rapists_per_prisoner, 0)) // return false; //ModLog.Message("WorkGiver_Sex::" + SexAppraiser.would_fuck(target, pawn)); //if (SexAppraiser.would_fuck(target, pawn) < 0.1f) //{ // return false; //} //ModLog.Message("" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override bool WorkGiverChecks(Pawn pawn, Thing t, bool forced = false) { Pawn target = t as Pawn; if (pawn.HostileTo(target) || target.IsDesignatedComfort()) { return false; } return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { //TODO:: fix bed stealing during join other pawn //Building_Bed bed = pawn.ownership.OwnedBed; //if (bed == null) // bed = (t as Pawn).ownership.OwnedBed; Building_Bed bed = (pawn as Pawn).ownership.OwnedBed; if (bed == null) return null; //if (pawn.CurrentBed() != (t as Pawn).CurrentBed()) // return null; return JobMaker.MakeJob(xxx.whore_inviting_visitors, t as Pawn, bed); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_Solicit.cs
C#
mit
1,692
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Assigns a pawn to rape a corpse /// </summary> public class WorkGiver_ViolateCorpse : WorkGiver_Sexchecks { public override ThingRequest PotentialWorkThingRequest => ThingRequest.ForGroup(ThingRequestGroup.Corpse); public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false) { //ModLog.Message("" + this.GetType().ToString() + " base checks: pass"); if (!RJWSettings.necrophilia_enabled) return false; //Pawn target = (t as Corpse).InnerPawn; if (!pawn.CanReserve(t, xxx.max_rapists_per_prisoner, 0)) return false; if (!(pawn.IsDesignatedHero() || RJWSettings.override_control)) if (!RJWSettings.WildMode) { if (xxx.is_necrophiliac(pawn) && !xxx.is_hornyorfrustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } if (!xxx.is_necrophiliac(pawn)) if ((t as Corpse).CurRotDrawMode != RotDrawMode.Fresh) { if (RJWSettings.DevMode) JobFailReason.Is("refuse to rape rotten"); return false; } else if (!xxx.is_frustrated(pawn)) { if (RJWSettings.DevMode) JobFailReason.Is("not horny enough"); return false; } //ModLog.Message("WorkGiver_ViolateCorpse::" + SexAppraiser.would_fuck(pawn, t as Corpse)); if (SexAppraiser.would_fuck(pawn, t as Corpse) > 0.1f) { return false; } } //ModLog.Message("" + this.GetType().ToString() + " extended checks: can start sex"); return true; } public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false) { return JobMaker.MakeJob(xxx.RapeCorpse, t as Corpse); } } }
Korth95/rjw
1.5/Source/WorkGivers/WorkGiver_ViolateCorpse.cs
C#
mit
1,730
<?xml version="1.0" encoding="utf-8"?> <ModMetaData> <name>RimJobWorld</name> <author>Ed86</author> <url>https://gitgud.io/Ed86/rjw</url> <supportedVersions> <li>1.1</li> <li>1.2</li> <li>1.3</li> <li>1.4</li> <li>1.5</li> </supportedVersions> <packageId>rim.job.world</packageId> <modDependencies> <li> <packageId>brrainz.harmony</packageId> <displayName>Harmony</displayName> <steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl> <downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl> </li> <li> <packageId>UnlimitedHugs.HugsLib</packageId> <displayName>HugsLib</displayName> <downloadUrl>https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest</downloadUrl> <steamWorkshopUrl>steam://url/CommunityFilePage/818773962</steamWorkshopUrl> </li> </modDependencies> <loadAfter> <li>UnlimitedHugs.HugsLib</li> <li>brrainz.harmony</li> </loadAfter> <incompatibleWith> <li>gregorycurrie.AnimalGenetics</li><!-- Breaks CompHatcher.Hatch preventing eggs hatching --> <li>Dalrae.GaramRaceAddon</li><!-- Hijacks pawn generator fucking up pawn genders and who knows what else --> <li>IGNI.LostForest</li><!-- Intentionally breaks rjw jobs, hijacks storyteller to call raids and causes other issues when rjw detected --> <li>Sierra.RT.MedievalTalents</li><!-- Breaks pawn generator/pregnancies, causes pregnancies to instafail --> <li>com.yayo.raceQuestPawn</li><!-- Breaks pawn generator/pregnancies, wrong children outcome--> <li>Xenofell.HermaphroditeGene</li><!-- Transpiles same function(s) as RJW --> </incompatibleWith> <description> M for Mature Load mod at bottom of mod list: Harmony Core HugsLib ++Mods RimJobWorld RJW mods and patches Support dev: https://subscribestar.adult/Ed86 for crypto bros: USDT(TRC20):TAS9QbvuF6AquJ98TqG653bPDugC2a6mnk USDT(ERC20):0x6c61085700f4ad941df80234fbfb8a861b14b0de Forum: https://www.loverslab.com/files/file/7257-rimjobworld/ Discord: https://discord.gg/CXwHhv8 </description> </ModMetaData>
Korth95/rjw
About/About.xml
XML
mit
2,077
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Manifest> <identifier>RimJobWorld</identifier> <version>5.5.0.2</version> <dependencies> <li>HugsLib</li> </dependencies> <incompatibleWith /> <loadAfter> <li>HugsLib</li> </loadAfter> <suggests> </suggests> <manifestUri>https://gitgud.io/Ed86/rjw/raw/master/About/Manifest.xml</manifestUri> <downloadUri>https://gitgud.io/Ed86/rjw</downloadUri> </Manifest>
Korth95/rjw
About/Manifest.xml
XML
mit
429