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
using HarmonyLib; using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// disable meditation effects for nymphs (i.e meditation on throne) /// </summary> [HarmonyPatch(typeof(JobDriver_Meditate), "MeditationTick")] internal static class PATCH_JobDriver_Meditate_MeditationTick { [HarmonyPrefix] private static bool Disable_For_Nymph(JobDriver_Meditate __instance) { Pawn pawn = __instance.pawn; if (xxx.is_nympho(pawn)) { //ModLog.Message("JobGiver_Meditate::MeditationTick for nymph " + xxx.get_pawnname(pawn) + " __instance " + __instance); CompProperties_MeditationFocus t0 = __instance.Focus.Thing?.def?.comps?.Find(x => x is CompProperties_MeditationFocus) as CompProperties_MeditationFocus; if (t0 != null) if (t0.focusTypes.Contains(xxx.SexMeditationFocus)) return true; return false; } //ModLog.Message("JobGiver_Meditate::MeditationTick pass"); return true; } } [HarmonyPatch(typeof(JobGiver_Meditate), "TryGiveJob")] internal static class PATCH_JobGiver_Meditate_TryGiveJob { [HarmonyPostfix] public static void Disable_For_Nymph(ref Job __result, Pawn pawn) { if (__result != null) if (xxx.is_nympho(pawn)) { //ModLog.Message("JobGiver_Meditate::TryGiveJob for nymph " + xxx.get_pawnname(pawn) + " job " + __result); CompProperties_MeditationFocus t1 = __result.targetA.Thing?.def.comps.Find(x => x is CompProperties_MeditationFocus) as CompProperties_MeditationFocus; CompProperties_MeditationFocus t2 = __result.targetB.Thing?.def.comps.Find(x => x is CompProperties_MeditationFocus) as CompProperties_MeditationFocus; CompProperties_MeditationFocus t3 = __result.targetC.Thing?.def.comps.Find(x => x is CompProperties_MeditationFocus) as CompProperties_MeditationFocus; //ModLog.Message("JobGiver_Meditate::TryGiveJob targetA " + t1); //ModLog.Message("JobGiver_Meditate::TryGiveJob targetB " + t2); //ModLog.Message("JobGiver_Meditate::TryGiveJob targetC " + t3); if (t1 != null) if (t1.focusTypes.Contains(xxx.SexMeditationFocus)) return; if (t2 != null) if (t2.focusTypes.Contains(xxx.SexMeditationFocus)) return; if (t3 != null) if (t3.focusTypes.Contains(xxx.SexMeditationFocus)) return; //ModLog.Message("JobGiver_Meditate::Disable_For_Nymph no valid targets fail job"); __result = null; //ModLog.Message("JobGiver_Meditate::Disable_For_Nymph " + xxx.get_pawnname(pawn) + " job " + __result); } } } }
Korth95/rjw
1.2/Source/Harmony/patch_meditate.cs
C#
mit
2,541
namespace rjw { /* [HarmonyPatch(typeof(Pawn_NeedsTracker))] [HarmonyPatch("ShouldHaveNeed")] static class patches_need { [HarmonyPostfix] static void on_postfix(Pawn_NeedsTracker __instance, NeedDef nd, ref bool __result){ Pawn p=(Pawn)(typeof(Pawn_NeedsTracker).GetField("pawn", xxx.ins_public_or_no).GetValue(__instance)); __result = __result && (nd.defName != "Sex" || (p!=null && p.Map!=null)); } } */ }
Korth95/rjw
1.2/Source/Harmony/patch_need.cs
C#
mit
430
using HarmonyLib; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; using Multiplayer.API; namespace rjw { [HarmonyPatch(typeof(Hediff_Pregnant), "DoBirthSpawn")] internal static class PATCH_Hediff_Pregnant_DoBirthSpawn { /// <summary> /// This one overrides vanilla pregnancy hediff behavior. /// 0 - try to find suitable father for debug pregnancy /// 1st part if character pregnant and rjw pregnancies enabled - creates rjw pregnancy and instantly births it instead of vanilla /// 2nd part if character pregnant with rjw pregnancy - birth it /// 3rd part - debug - create rjw/vanila pregnancy and birth it /// </summary> /// <param name="mother"></param> /// <param name="father"></param> /// <returns></returns> [HarmonyPrefix] [SyncMethod] private static bool on_begin_DoBirthSpawn(ref Pawn mother, ref Pawn father) { //--Log.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn() called"); if (mother == null) { ModLog.Error("Hediff_Pregnant::DoBirthSpawn() - no mother defined -> exit"); return false; } //vanilla debug? if (mother.gender == Gender.Male) { ModLog.Error("Hediff_Pregnant::DoBirthSpawn() - mother is male -> exit"); return false; } // get a reference to the hediff we are applying //do birth for vanilla pregnancy Hediff //if using rjw pregnancies - add RJW pregnancy Hediff and birth it instead Hediff_Pregnant self = (Hediff_Pregnant)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("Pregnant")); if (self != null) { return ProcessVanillaPregnancy(self, mother, father); } // do birth for existing RJW pregnancies if (ProcessRJWPregnancy(mother, father)) { return false; } return ProcessDebugPregnancy(mother, father); } private static bool ProcessVanillaPregnancy(Hediff_Pregnant pregnancy, Pawn mother, Pawn father) { void CreateAndBirth<T>() where T : Hediff_BasePregnancy { T hediff = Hediff_BasePregnancy.Create<T>(mother, father); hediff.GiveBirth(); if (pregnancy != null) mother.health.RemoveHediff(pregnancy); } if (father == null) { father = Hediff_BasePregnancy.Trytogetfather(ref mother); } ModLog.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn():Vanilla_pregnancy birthing:" + xxx.get_pawnname(mother)); if (RJWPregnancySettings.animal_pregnancy_enabled && ((father == null || xxx.is_animal(father)) && xxx.is_animal(mother))) { //RJW Bestial pregnancy animal-animal ModLog.Message(" override as Bestial birthing(animal-animal): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother)); CreateAndBirth<Hediff_BestialPregnancy>(); return false; } else if (RJWPregnancySettings.bestial_pregnancy_enabled && ((xxx.is_animal(father) && xxx.is_human(mother)) || (xxx.is_human(father) && xxx.is_animal(mother)))) { //RJW Bestial pregnancy human-animal ModLog.Message(" override as Bestial birthing(human-animal): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother)); CreateAndBirth<Hediff_BestialPregnancy>(); return false; } else if (RJWPregnancySettings.humanlike_pregnancy_enabled && (xxx.is_human(father) && xxx.is_human(mother))) { //RJW Humanlike pregnancy ModLog.Message(" override as Humanlike birthing: Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother)); CreateAndBirth<Hediff_HumanlikePregnancy>(); return false; } else { ModLog.Warning("Hediff_Pregnant::DoBirthSpawn() - checks failed, vanilla pregnancy birth"); ModLog.Warning("Hediff_Pregnant::DoBirthSpawn(): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother)); //vanilla pregnancy code, no effects on rjw return true; } } private static bool ProcessRJWPregnancy(Pawn mother, Pawn father) { Hediff_BasePregnancy preg = (Hediff_BasePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy")) ?? //RJW Humanlike pregnancy (Hediff_BasePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_beast")) ?? //RJW Bestial pregnancy (Hediff_BasePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_mech")); //RJW Bestial pregnancy if (preg != null) { ModLog.Message($"patches_pregnancy::{preg.GetType().Name}::DoBirthSpawn() birthing:" + xxx.get_pawnname(mother)); preg.GiveBirth(); return true; } return false; } private static bool ProcessDebugPregnancy(Pawn mother, Pawn father) { void CreateAndBirth<T>() where T : Hediff_BasePregnancy { T hediff = Hediff_BasePregnancy.Create<T>(mother, father); hediff.GiveBirth(); } //CreateAndBirth<Hediff_HumanlikePregnancy>(); //CreateAndBirth<Hediff_BestialPregnancy>(); //CreateAndBirth<Hediff_MechanoidPregnancy>(); //return false; //debug, add RJW pregnancy and birth it ModLog.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn():Debug_pregnancy birthing:" + xxx.get_pawnname(mother)); if (father == null) { father = Hediff_BasePregnancy.Trytogetfather(ref mother); if (RJWPregnancySettings.bestial_pregnancy_enabled && ((xxx.is_animal(father) || xxx.is_animal(mother))) || (xxx.is_animal(mother) && RJWPregnancySettings.animal_pregnancy_enabled)) { //RJW Bestial pregnancy ModLog.Message(" override as Bestial birthing, mother: " + xxx.get_pawnname(mother)); CreateAndBirth<Hediff_BestialPregnancy>(); } else if (RJWPregnancySettings.humanlike_pregnancy_enabled && ((father == null || xxx.is_human(father)) && xxx.is_human(mother))) { //RJW Humanlike pregnancy ModLog.Message(" override as Humanlike birthing, mother: " + xxx.get_pawnname(mother)); CreateAndBirth<Hediff_HumanlikePregnancy>(); } else { ModLog.Warning("Hediff_Pregnant::DoBirthSpawn() - debug vanilla pregnancy birth"); return true; } } return false; } } [HarmonyPatch(typeof(Hediff_Pregnant), "Tick")] class PATCH_Hediff_Pregnant_Tick { [HarmonyPrefix] static bool abort_on_missing_genitals(Hediff_Pregnant __instance) { if (__instance.pawn.IsHashIntervalTick(1000)) { if (!Genital_Helper.has_vagina(__instance.pawn)) { __instance.pawn.health.RemoveHediff(__instance); } } return true; } } [HarmonyPatch(typeof(PawnColumnWorker_Pregnant), "GetIconFor")] public class PawnColumnWorker_Patch_Icon { public static void Postfix(Pawn pawn, ref Texture2D __result) { if (pawn.IsVisiblyPregnant()) __result = ContentFinder<Texture2D>.Get("UI/Icons/Animal/Pregnant", true); } } [HarmonyPatch(typeof(PawnColumnWorker_Pregnant), "GetTooltipText")] public class PawnColumnWorker_Patch_Tooltip { public static bool Prefix(Pawn pawn, ref string __result) { float gestationProgress = PregnancyHelper.GetPregnancy(pawn).Severity; int num = (int)(pawn.RaceProps.gestationPeriodDays * 60000f); int numTicks = (int)(gestationProgress * (float)num); __result = "PregnantIconDesc".Translate(numTicks.ToStringTicksToDays("F0"), num.ToStringTicksToDays("F0")); return false; } } [HarmonyPatch(typeof(TransferableUIUtility), "DoExtraAnimalIcons")] public class TransferableUIUtility_Patch_Icon { //private static readonly Texture2D PregnantIcon = ContentFinder<Texture2D>.Get("UI/Icons/Animal/Pregnant", true); public static void Postfix(Transferable trad, Rect rect, ref float curX, Texture2D ___PregnantIcon) { Pawn pawn = trad.AnyThing as Pawn; if (pawn?.health?.hediffSet != null && pawn.IsVisiblyPregnant()) { Rect rect3 = new Rect(curX - 24f, (rect.height - 24f) / 2f, 24f, 24f); curX -= 24f; if (Mouse.IsOver(rect3)) { TooltipHandler.TipRegion(rect3, PawnColumnWorker_Pregnant.GetTooltipText(pawn)); } GUI.DrawTexture(rect3, ___PregnantIcon); } } } }
Korth95/rjw
1.2/Source/Harmony/patch_pregnancy.cs
C#
mit
8,281
using System.Linq; using Verse; namespace rjw { /// <summary> /// Patch all races into rjw parts recipes /// </summary> [StaticConstructorOnStartup] public static class HarmonyPatches { static HarmonyPatches() { //summons carpet bombing //inject races into rjw recipes foreach (RecipeDef x in DefDatabase<RecipeDef>.AllDefsListForReading.Where(x => x.IsSurgery && (x.targetsBodyPart || !x.appliedOnFixedBodyParts.NullOrEmpty()))) { if (x.appliedOnFixedBodyParts.Contains(xxx.genitalsDef) || x.appliedOnFixedBodyParts.Contains(xxx.breastsDef) || x.appliedOnFixedBodyParts.Contains(xxx.anusDef) || x.modContentPack?.PackageId == "rim.job.world" || x.modContentPack?.PackageId == "Safe.Job.World" //*sigh* //|| x.modContentPack?.PackageId == "Abraxas.RJW.RaceSupport" // for udders? ) foreach (ThingDef thingDef in DefDatabase<ThingDef>.AllDefs.Where(thingDef => thingDef.race != null && ( thingDef.race.Humanlike || thingDef.race.Animal ))) { //filter out something, probably? //if (thingDef.race. == "Human") // continue; if (!x.recipeUsers.Contains(thingDef)) { x.recipeUsers.Add(item: thingDef); //Log.Message("recipe: " + x.defName + ", thing: " + thingDef.defName); } } } } } }
Korth95/rjw
1.2/Source/Harmony/patch_recipes.cs
C#
mit
1,347
using HarmonyLib; using RimWorld; using System; using Verse; namespace rjw { ///<summary> ///RJW Designators checks/update ///update designators only for selected pawn, once, instead of every tick(60 times per sec) ///</summary> [HarmonyPatch(typeof(Selector), "Select")] [StaticConstructorOnStartup] static class PawnSelect { [HarmonyPrefix] private static bool Update_Designators_Permissions(Selector __instance, ref object obj) { if (obj is Pawn) { //ModLog.Message("Selector patch"); Pawn pawn = (Pawn)obj; //ModLog.Message("pawn: " + xxx.get_pawnname(pawn)); pawn.UpdatePermissions(); } return true; } } //[HarmonyPatch(typeof(Dialog_InfoCard), "Setup")] ////[HarmonyPatch(typeof(Dialog_InfoCard), "Dialog_InfoCard", new Type[] {typeof(Def)})] //[StaticConstructorOnStartup] //static class Button //{ // [HarmonyPostfix] // public static bool Postfix() // { // ModLog.Message("InfoCardButton"); // return true; // } //} }
Korth95/rjw
1.2/Source/Harmony/patch_selector.cs
C#
mit
988
using System.Collections.Generic; using Verse; using HarmonyLib; using UnityEngine; using System; using RimWorld; using Multiplayer.API; namespace rjw { [HarmonyPatch(typeof(RimWorld.PawnWoundDrawer))] [HarmonyPatch("RenderOverBody")] [HarmonyPatch(new Type[] { typeof(Vector3), typeof(Mesh), typeof(Quaternion), typeof(bool) })] class patch_semenOverlay { [HarmonyPostfix] static void DrawSemen(RimWorld.PawnWoundDrawer __instance, Vector3 drawLoc, Mesh bodyMesh, Quaternion quat, bool forPortrait) { Pawn pawn = Traverse.Create(__instance).Field("pawn").GetValue<Pawn>();//get local variable //TODO add support for animals? unlikely as they has weird meshes //for now, only draw humans if (pawn.RaceProps.Humanlike && RJWSettings.cum_overlays) { //find bukkake hediff. if it exists, use its draw function List<Hediff> hediffs = pawn.health.hediffSet.hediffs; if (hediffs.Exists(x => x.def == RJW_SemenoOverlayHediffDefOf.Hediff_Bukkake)) { Hediff_Bukkake h = hediffs.Find(x => x.def == RJW_SemenoOverlayHediffDefOf.Hediff_Bukkake) as Hediff_Bukkake; quat.ToAngleAxis(out float angle, out Vector3 axis);//angle changes when pawn is e.g. downed //adjustments if the pawn is sleeping in a bed: bool inBed = false; Building_Bed building_Bed = pawn.CurrentBed(); if (building_Bed != null) { inBed = !building_Bed.def.building.bed_showSleeperBody; AltitudeLayer altLayer = (AltitudeLayer)Mathf.Max((int)building_Bed.def.altitudeLayer, 15); Vector3 vector2 = pawn.Position.ToVector3ShiftedWithAltitude(altLayer); vector2.y += 0.02734375f+0.01f;//just copied from rimworld code+0.01f drawLoc.y = vector2.y; } h.DrawSemen(drawLoc, quat, forPortrait, angle); } } } } //adds new gizmo for adding semen for testing [HarmonyPatch(typeof(Pawn), "GetGizmos")] class Patch_AddGizmo { [HarmonyPriority(99),HarmonyPostfix] static IEnumerable<Gizmo> AddSemen_test(IEnumerable<Gizmo> __result, Pawn __instance) { foreach (Gizmo entry in __result) { yield return entry; } if (Prefs.DevMode && RJWSettings.DevMode && !MP.IsInMultiplayer) { Command_Action addSemen = new Command_Action(); addSemen.defaultDesc = "AddSemenHediff"; addSemen.defaultLabel = "AddSemen"; addSemen.action = delegate () { Addsemen(__instance); }; yield return addSemen; } } [SyncMethod] static void Addsemen(Pawn pawn) { //Log.Message("add semen button is pressed for " + pawn); if (!pawn.Dead && pawn.records != null) { //get all acceptable body parts: IEnumerable<BodyPartRecord> filteredParts = SemenHelper.getAvailableBodyParts(pawn); //select random part: BodyPartRecord randomPart; //filteredParts.TryRandomElement<BodyPartRecord>(out randomPart); //for testing - choose either genitals or anus: //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); if (Rand.Value > 0.5f) { randomPart = pawn.RaceProps.body.AllParts.Find(x => x.def == xxx.anusDef); } else { randomPart = pawn.RaceProps.body.AllParts.Find(x => x.def == xxx.genitalsDef); } if (randomPart != null) { SemenHelper.cumOn(pawn, randomPart, 0.2f, null, SemenHelper.CUM_NORMAL); } }; } } }
Korth95/rjw
1.2/Source/Harmony/patch_semenOverlay.cs
C#
mit
3,345
namespace rjw { /// <summary> /// Patch: /// recipes /// </summary> //TODO: inject rjw recipes //[HarmonyPatch(typeof(HealthCardUtility), "GenerateSurgeryOption")] //internal static class PATCH_HealthCardUtility_recipes //{ // //private static FloatMenuOption GenerateSurgeryOption(Pawn pawn, Thing thingForMedBills, RecipeDef recipe, IEnumerable<ThingDef> missingIngredients, BodyPartRecord part = null) // //public FloatMenuOption(string label, Action action, MenuOptionPriority priority = MenuOptionPriority.Default, Action mouseoverGuiAction = null, Thing revalidateClickTarget = null, float extraPartWidth = 0, Func<Rect, bool> extraPartOnGUI = null, WorldObject revalidateWorldClickTarget = null); // //floatMenuOption = new FloatMenuOption(text, action, MenuOptionPriority.Default, null, null, 0f, null, null); // [HarmonyPostfix] // private static void Postfix(ref FloatMenuOption __result, ref Pawn pawn) // { // ModLog.Message("PATCH_HealthCardUtility_recipes"); // ModLog.Message("PATCH_HealthCardUtility_recipes list: " + __result); // //foreach (FloatMenuOption recipe in recipeOptionsMaker) // // { // // ModLog.Message("PATCH_HealthCardUtility_recipes: " + recipe); // // } // return; // } //} //erm.. idk ? //[HarmonyPatch(typeof(HealthCardUtility), "GetTooltip")] //internal static class PATCH_HealthCardUtility_GetTooltip //{ // [HarmonyPostfix] // private static void Postfix(Pawn pawn) // { // ModLog.Message("GetTooltip"); // //ModLog.Message("PATCH_HealthCardUtility_recipes list: " + floatMenuOption); // //foreach (FloatMenuOption recipe in recipeOptionsMaker) // // { // // ModLog.Message("PATCH_HealthCardUtility_recipes: " + recipe); // // } // return; // } //} //TODO: make toggle/floatmenu to parts switching //[HarmonyPatch(typeof(HealthCardUtility), "EntryClicked")] //internal static class PATCH_HealthCardUtility_EntryClicked //{ // [HarmonyPostfix] // private static void Postfix(Pawn pawn) // { // ModLog.Message("EntryClicked"); // //ModLog.Message("PATCH_HealthCardUtility_recipes list: " + floatMenuOption); // //foreach (FloatMenuOption recipe in recipeOptionsMaker) // // { // // ModLog.Message("PATCH_HealthCardUtility_recipes: " + recipe); // // } // return; // } //} }
Korth95/rjw
1.2/Source/Harmony/patch_surgery.cs
C#
mit
2,301
using System.Linq; using Verse; using System.Collections.Generic; using HarmonyLib; using RimWorld; namespace rjw { /// <summary> /// Patch ui for hero mode /// - disable pawn control for non owned hero /// - disable equipment management for non owned hero /// hardcore mode: /// - disable equipment management for non hero /// - disable pawn rmb menu for non hero /// - remove drafting widget for non hero /// </summary> //disable forced works(rmb workgivers) [HarmonyPatch(typeof(FloatMenuMakerMap), "CanTakeOrder")] [StaticConstructorOnStartup] static class disable_FloatMenuMakerMap { [HarmonyPostfix] static void NonHero_disable_controls(ref bool __result, Pawn pawn) { if (RJWSettings.RPG_hero_control) { if ((pawn.IsDesignatedHero() && !pawn.IsHeroOwner())) { __result = false; //not hero owner, disable menu return; } if (!pawn.IsDesignatedHero() && RJWSettings.RPG_hero_control_HC) { if (pawn.Drafted && pawn.CanChangeDesignationPrisoner() && pawn.CanChangeDesignationColonist()) { //allow control over drafted pawns, this is limited by below disable_Gizmos patch } else { __result = false; //not hero, disable menu } } } } } //TODO: disable equipment management /* //disable equipment management [HarmonyPatch(typeof(ITab_Pawn_Gear), "CanControl")] static class disable_equipment_management { [HarmonyPostfix] static bool this_is_postfix(ref bool __result, Pawn selPawnForGear) { Pawn pawn = selPawnForGear; if (RJWSettings.RPG_hero_control) { if ((pawn.IsDesignatedHero() && !pawn.IsHeroOwner())) //not hero owner, disable drafting { __result = false; //not hero owner, disable menu } else if (!pawn.IsDesignatedHero() && RJWSettings.RPG_hero_control_HC) //not hero, disable drafting { if (false) { //add some filter for bots and stuff? if there is such stuff //so it can be drafted and controlled for fighting } else { __result = false; //not hero, disable menu } } } return true; } } */ //TODO: allow shared control over non colonists(droids, etc)? //disable command gizmos [HarmonyPatch(typeof(Pawn), "GetGizmos")] [StaticConstructorOnStartup] static class disable_Gizmos { [HarmonyPostfix] [HarmonyPriority(100)] static IEnumerable<Gizmo> NonHero_disable_gizmos(IEnumerable<Gizmo> __result, Pawn __instance) { Pawn pawn = __instance; string disablementReason = string.Empty; if (RJWSettings.RPG_hero_control) { if ((pawn.IsDesignatedHero() && !pawn.IsHeroOwner())) //not hero owner, disable drafting { disablementReason = "ForHeroRefuse1Desc"; } else if (!pawn.IsDesignatedHero() && RJWSettings.RPG_hero_control_HC) //not hero, disable drafting { //no permission to change designation for NON prisoner hero/ other player if (pawn.CanChangeDesignationPrisoner() && pawn.CanChangeDesignationColonist() && (pawn.kindDef.race.defName.Contains("AIRobot") || (pawn.kindDef.race.defName.Contains("Droid") && !pawn.kindDef.race.defName.Contains("AndDroid")) || pawn.kindDef.race.defName.Contains("RPP_Bot") )) //if (false) { //add some filter for bots and stuff? if there is such stuff //so it can be drafted and controlled for fighting } else { disablementReason = "ForHeroRefuseHCDesc"; } } } foreach (var gizmo in __result) { if ( disablementReason.NullOrEmpty() || (!(gizmo is Command)) ) //we do not filter out non-command Gizmos, such as shield bar or psychic entropy { yield return gizmo; } //ModLog.Message("Gizmo for " + xxx.get_pawnname(__instance) + " type: " + gizmo.GetType()+ ": " + gizmo); if (!disablementReason.NullOrEmpty()) { if (gizmo is Verse.Command_VerbTarget) { //weapon icons gizmo.Disable(disablementReason.Translate()); yield return gizmo; } } //all other command gizmos are dropped } } } }
Korth95/rjw
1.2/Source/Harmony/patch_ui_hero.cs
C#
mit
4,092
using System.Collections.Generic; using System.Linq; using HarmonyLib; using RimWorld; using Verse; using UnityEngine; using Multiplayer.API; namespace rjw { /// <summary> /// Harmony patch to toggle the RJW designation box showing /// </summary> [HarmonyPatch(typeof(PlaySettings), "DoPlaySettingsGlobalControls")] [StaticConstructorOnStartup] public static class RJW_corner_toggle { static readonly Texture2D icon = ContentFinder<Texture2D>.Get("UI/Commands/ComfortPrisoner_off"); [HarmonyPostfix] public static void add_RJW_toggle(WidgetRow row, bool worldView) { if (worldView) return; row.ToggleableIcon(ref RJWSettings.show_RJW_designation_box, icon, "RJW_designation_box_desc".Translate()); } } ///<summary> ///Compact button group containing rjw designations on pawn ///</summary> [HarmonyPatch(typeof(Pawn), "GetGizmos")] [StaticConstructorOnStartup] static class Rjw_buttons { [HarmonyPostfix] [HarmonyPriority(99)] static IEnumerable<Gizmo> add_designation_box(IEnumerable<Gizmo> __result, Pawn __instance) { foreach (var gizmo in __result) { yield return gizmo; } if (!RJWSettings.show_RJW_designation_box) yield break; if (!(__instance.Faction == Faction.OfPlayer || __instance.IsPrisonerOfColony)) yield break; //ModLog.Message("Harmony patch submit_button is called"); var pawn = __instance; yield return new RJWdesignations(pawn); } } ///<summary> ///Submit gizmo ///</summary> [HarmonyPatch(typeof(Pawn), "GetGizmos")] [StaticConstructorOnStartup] static class submit_button { [HarmonyPostfix] [HarmonyPriority(101)] static IEnumerable<Gizmo> add_button(IEnumerable<Gizmo> __result, Pawn __instance) { foreach (var gizmo in __result) { yield return gizmo; } //ModLog.Message("Harmony patch submit_button is called"); var pawn = __instance; var enabled = RJWSettings.submit_button_enabled; if (enabled && pawn.IsColonistPlayerControlled && pawn.Drafted) if (pawn.CanChangeDesignationColonist()) if (!(pawn.kindDef.race.defName.Contains("Droid") && !AndroidsCompatibility.IsAndroid(pawn))) { yield return new Command_Action { defaultLabel = "CommandSubmit".Translate(), icon = submit_icon, defaultDesc = "CommandSubmitDesc".Translate(), action = delegate { LayDownAndAccept(pawn); }, hotKey = KeyBindingDefOf.Misc3 }; } } static Texture2D submit_icon = ContentFinder<Texture2D>.Get("UI/Commands/Submit", true); static HediffDef submit_hediff = HediffDef.Named("Hediff_Submitting"); [SyncMethod] static void LayDownAndAccept(Pawn pawn) { //Log.Message("Submit button is pressed for " + pawn); pawn.health.AddHediff(submit_hediff); } } }
Korth95/rjw
1.2/Source/Harmony/patch_ui_rjw_buttons.cs
C#
mit
2,792
using System; using RimWorld; using Verse; using HarmonyLib; namespace rjw { [HarmonyPatch(typeof(CompAbilityEffect_WordOfLove), "ValidateTarget")] internal static class PATCH_CompAbilityEffect_WordOfLove_ValidateTarget { [HarmonyPrefix] static bool GenderChecks(ref LocalTargetInfo target, LocalTargetInfo ___selectedTarget, ref bool __result) { Pawn pawn = ___selectedTarget.Pawn; Pawn pawn2 = target.Pawn; if (pawn != pawn2 && pawn != null && pawn2 != null) { __result = !xxx.is_asexual(pawn) && (xxx.is_bisexual(pawn) || xxx.is_pansexual(pawn) || (xxx.is_heterosexual(pawn) && pawn.gender != pawn2.gender) || (xxx.is_homosexual(pawn) && pawn.gender == pawn2.gender)); if (__result == false) { Messages.Message("AbilityCantApplyWrongAttractionGender".Translate(pawn, pawn2), pawn, MessageTypeDefOf.RejectInput, false); } return false; } return true; } } }
Korth95/rjw
1.2/Source/Harmony/patch_wordoflove.cs
C#
mit
906
using HarmonyLib; using RimWorld; using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; using System.Text; using Verse; using Verse.AI.Group; namespace rjw { class StatsReportUtilityPatch { [HarmonyPatch(typeof(StatsReportUtility))] [StaticConstructorOnStartup] public static class Patch_StatsReportUtility { private static StatDrawEntry DescriptionEntry(Hediff thing) { return new StatDrawEntry(StatCategoryDefOf.BasicsImportant, "Description".Translate(), "", thing.DescriptionFlavor, 99999, null, Dialog_InfoCard.DefsToHyperlinks(thing.def.descriptionHyperlinks), false); } } } class HediffPatch { [HarmonyPatch(typeof(Hediff))] [StaticConstructorOnStartup] public static class Patch_Hediff { public virtual string DescriptionFlavor { get { return this.def.description; } } } } }
Korth95/rjw
1.2/Source/Harmony/test.cs
C#
mit
892
using Verse; using RimWorld; namespace rjw { /// <summary> /// FeelingBroken raise/lower severity /// </summary> public class HediffCompProperties_FeelingBrokenSeverityReduce : HediffCompProperties { public HediffCompProperties_FeelingBrokenSeverityReduce() { this.compClass = typeof(HediffComp_FeelingBrokenSeverityReduce); } public SimpleCurve severityPerDayReduce; } class HediffComp_FeelingBrokenSeverityReduce : HediffComp_SeverityPerDay { private HediffCompProperties_FeelingBrokenSeverityReduce Props { get { return (HediffCompProperties_FeelingBrokenSeverityReduce)this.props; } } public override void CompPostTick(ref float severityAdjustment) { base.CompPostTick(ref severityAdjustment); if (base.Pawn.IsHashIntervalTick(SeverityUpdateInterval)) { float num = this.SeverityChangePerDay(); num *= 0.00333333341f; if (xxx.has_traits(Pawn)) { if (xxx.RoMIsActive) if (Pawn.story.traits.HasTrait(xxx.Succubus)) num *= 4.0f; if (Pawn.story.traits.HasTrait(TraitDefOf.Tough)) { num *= 2.0f; } if (Pawn.story.traits.HasTrait(TraitDefOf.Tough)) { num *= 2.0f; } if (Pawn.story.traits.HasTrait(TraitDef.Named("Wimp"))) { num *= 0.5f; } if (Pawn.story.traits.HasTrait(TraitDefOf.Nerves)) { int td = Pawn.story.traits.DegreeOfTrait(TraitDefOf.Nerves); switch (td) { case -2: num *= 2.0f; break; case -1: num *= 1.5f; break; case 1: num *= 0.5f; break; case 2: num *= 0.25f; break; } } } severityAdjustment += num; } } protected override float SeverityChangePerDay() { return this.Props.severityPerDayReduce.Evaluate(this.parent.ageTicks / 60000f); } } public class HediffCompProperties_FeelingBrokenSeverityIncrease : HediffCompProperties { public HediffCompProperties_FeelingBrokenSeverityIncrease() { this.compClass = typeof(HediffComp_FeelingBrokenSeverityIncrease); } public SimpleCurve severityPerDayIncrease; } class HediffComp_FeelingBrokenSeverityIncrease : AdvancedHediffComp { private HediffCompProperties_FeelingBrokenSeverityIncrease Props { get { return (HediffCompProperties_FeelingBrokenSeverityIncrease)this.props; } } public override void CompPostMerged(Hediff other) { float num = Props.severityPerDayIncrease.Evaluate(this.parent.ageTicks / 60000f); if (xxx.has_traits(Pawn)) { if (xxx.RoMIsActive) if (Pawn.story.traits.HasTrait(xxx.Succubus)) num *= 0.25f; if (Pawn.story.traits.HasTrait(TraitDefOf.Tough)) { num *= 0.5f; } if (Pawn.story.traits.HasTrait(TraitDef.Named("Wimp"))) { num *= 2.0f; } if (Pawn.story.traits.HasTrait(TraitDefOf.Nerves)) { int td = Pawn.story.traits.DegreeOfTrait(TraitDefOf.Nerves); switch (td) { case -2: num *= 0.25f; break; case -1: num *= 0.5f; break; case 1: num *= 1.5f; break; case 2: num *= 2.0f; break; } } } other.Severity *= num; } } public class AdvancedHediffWithComps : HediffWithComps { public override bool TryMergeWith(Hediff other) { for (int i = 0; i < this.comps.Count; i++) { if(this.comps[i] is AdvancedHediffComp) ((AdvancedHediffComp)this.comps[i]).CompBeforeMerged(other); } return base.TryMergeWith(other); } } public class AdvancedHediffComp : HediffComp { public virtual void CompBeforeMerged(Hediff other) { } } }
Korth95/rjw
1.2/Source/Hediffs/HediffComp_FeelingBroken.cs
C#
mit
3,657
using System.Linq; using Verse; using RimWorld; using System.Text; using Multiplayer.API; using UnityEngine; using System.Collections.Generic; namespace rjw { //TODO figure out how this thing works and move eggs to comps [StaticConstructorOnStartup] public class HediffDef_PartBase : HediffDef { public bool discovered = false; public string Eggs = ""; //for ovi eggs, maybe public string FluidType = ""; //cummies/milk - insectjelly/honey etc public string DefaultBodyPart = ""; //Bodypart to move this part to, after fucking up with pc or other mod public List<string> DefaultBodyPartList; //Bodypart list to move this part to, after fucking up with pc or other mod public float FluidAmmount = 0; //amount of Milk/Ejaculation/Wetness public bool produceEggs; //set in xml public int minEggTick = 12000; public int maxEggTick = 120000; } }
Korth95/rjw
1.2/Source/Hediffs/HediffDef_PartBase.cs
C#
mit
883
using RimWorld; using System.Collections.Generic; using System.Linq; using Verse; namespace rjw { public class Cocoon : HediffWithComps { public int tickNext; public override void PostMake() { Severity = 1.0f; SetNextTick(); } public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref tickNext, "tickNext", 1000, true); } public override void Tick() { if (Find.TickManager.TicksGame >= tickNext) { //Log.Message("Cocoon::Tick() " + base.xxx.get_pawnname(pawn)); HealWounds(); SatisfyHunger(); SatisfyThirst(); SetNextTick(); } } public void HealWounds() { IEnumerable<Hediff> enumerable = from hd in pawn.health.hediffSet.hediffs where !hd.IsTended() && hd.TendableNow() select hd; if (enumerable != null) { foreach (Hediff item in enumerable) { HediffWithComps val = item as HediffWithComps; if (val != null) if (val.Bleeding) { //Log.Message("TrySealWounds " + xxx.get_pawnname(pawn) + ", Bleeding " + item.Label); //HediffComp_TendDuration val2 = HediffUtility.TryGetComp<HediffComp_TendDuration>(val); val.Heal(0.5f); //val2.tendQuality = 1f; //val2.tendTicksLeft = 10000; //pawn.health.Notify_HediffChanged(item); } // tend infections // tend lifeThreatening chronic else if ((!val.def.chronic && val.def.lethalSeverity > 0f) || (val.CurStage?.lifeThreatening ?? false)) { //Log.Message("TryHeal " + xxx.get_pawnname(pawn) + ", infection(?) " + item.Label); HediffComp_TendDuration val2 = HediffUtility.TryGetComp<HediffComp_TendDuration>(val); val2.tendQuality = 1f; val2.tendTicksLeft = 10000; pawn.health.Notify_HediffChanged(item); } } } } public void SatisfyHunger() { Need_Food need = pawn.needs.TryGetNeed<Need_Food>(); if (need == null) { return; } //pawn.PositionHeld.IsInPrisonCell(pawn.Map) //Log.Message("Cocoon::SatisfyHunger() " + xxx.get_pawnname(pawn) + " IsInPrisonCell " + pawn.PositionHeld.IsInPrisonCell(pawn.Map)); //Log.Message("Cocoon::SatisfyHunger() " + xxx.get_pawnname(pawn) + " GetRoom " + pawn.PositionHeld.GetRoom(pawn.Map)); //Log.Message("Cocoon::SatisfyHunger() " + xxx.get_pawnname(pawn) + " GetRoom " + pawn.PositionHeld.GetZone(pawn.Map)); if (need.CurLevel < 0.15f) { //Log.Message("Cocoon::SatisfyHunger() " + xxx.get_pawnname(pawn) + " need to eat"); float nutrition_amount = need.MaxLevel / 5f; pawn.needs.food.CurLevel += nutrition_amount; } } public void SatisfyThirst() { if (!xxx.DubsBadHygieneIsActive) return; Need need = pawn.needs.AllNeeds.Find(x => x.def == xxx.DBHThirst); if (need == null) { return; } if (need.CurLevel < 0.15f) { //Log.Message("Cocoon::SatisfyThirst() " + xxx.get_pawnname(pawn) + " need to drink"); float nutrition_amount = need.MaxLevel / 5f; pawn.needs.TryGetNeed(need.def).CurLevel += nutrition_amount; } } public void SetNextTick() { //make actual tick every 16.6 sec tickNext = Find.TickManager.TicksGame + 1000; //Log.Message("Cocoon::SetNextTick() " + tickNext); } } }
Korth95/rjw
1.2/Source/Hediffs/Hediff_Cocoon.cs
C#
mit
3,255
using Verse; namespace rjw { public class Hediff_ID : Hediff { public override string LabelBase { get { if (!pawn.health.hediffSet.HasHediff(std.hiv.hediff_def)) return base.LabelBase; else return "AIDS"; } } } }
Korth95/rjw
1.2/Source/Hediffs/Hediff_ID.cs
C#
mit
252
using System.Linq; using Verse; using RimWorld; using System.Text; using Multiplayer.API; using UnityEngine; namespace rjw { public class Hediff_PartBaseArtifical : Hediff_Implant { public override bool ShouldRemove => false; public bool discovered = false; // Used for ovipositors. public int nextEggTick = -1; public float lastsize = -1; public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref this.nextEggTick, "nextEggTick"); Scribe_Values.Look(ref this.lastsize, "lastsize"); // Scribe_Values.Look(ref this.produceEggs, "produceEggs"); // Scribe_Defs.Look(ref this.pawnKindDefOverride, "pawnKindDefOverride"); // Scribe_Values.Look(ref this.genitalType, "genitalType"); } public override string LabelBase { get { /* * make patch to make/save capmods? if (CapMods.Count < 5) { PawnCapacityModifier pawnCapacityModifier = new PawnCapacityModifier(); pawnCapacityModifier.capacity = PawnCapacityDefOf.Moving; pawnCapacityModifier.offset += 0.5f; CapMods.Add(pawnCapacityModifier); } */ //name/kind return this.def.label; } } //public override string LabelInBrackets //{ // get // { // string size = "on fire!"; // size = (this.comps.Find(x => x is CompHediffBodyPart) as CompHediffBodyPart).Size; // return size; // //vanilla // //return (this.CurStage != null && !this.CurStage.label.NullOrEmpty()) ? this.CurStage.label : null; // } //} //overrides comps //public override string TipStringExtra //{ // get // { // StringBuilder stringBuilder = new StringBuilder(); // foreach (StatDrawEntry current in HediffStatsUtility.SpecialDisplayStats(this.CurStage, this)) // { // if (current.ShouldDisplay) // { // stringBuilder.AppendLine(current.LabelCap + ": " + current.ValueString); // } // } // //stringBuilder.AppendLine("Size: " + this.TryGetComp<CompHediffBodyPart>.Size); // //stringBuilder.AppendLine("1");// size? // //stringBuilder.AppendLine("2");// erm something? // return stringBuilder.ToString(); // } //} /// <summary> /// stack hediff in health tab? /// </summary> public override int UIGroupKey { get { if (RJWSettings.StackRjwParts) //(Label x count) return this.Label.GetHashCode(); else //dont return loadID; } } /// <summary> /// do not merge same rjw parts into one /// </summary> public override bool TryMergeWith(Hediff other) { return false; } /// <summary> /// show rjw parts in health tab or not /// </summary> public override bool Visible { get { if (RJWSettings.ShowRjwParts == RJWSettings.ShowParts.Hide) { discovered = false; } else if (!discovered) { if (RJWSettings.ShowRjwParts != RJWSettings.ShowParts.Hide) { discovered = true; return discovered; } //show at game start if (Current.ProgramState != ProgramState.Playing && Prefs.DevMode) return true; //show for hero if (pawn.IsDesignatedHero() && pawn.IsHeroOwner()) { discovered = true; return discovered; } //show if no clothes if (pawn.apparel != null)// animals? { bool hasPants; bool hasShirt; pawn.apparel.HasBasicApparel(out hasPants, out hasShirt);// naked? if (!hasPants) { bool flag3 = false; foreach (BodyPartRecord current in this.pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null, null)) { if (current.IsInGroup(BodyPartGroupDefOf.Legs)) { flag3 = true; break; } } if (!flag3) { hasPants = true; } } if (this.def.defName.ToLower().Contains("breast") || this.def.defName.ToLower().Contains("chest")) discovered = !hasShirt; else discovered = !hasPants; } } return discovered; } } /// <summary> /// egg production ticks /// </summary> public override void Tick() { ageTicks++; if (!pawn.IsHashIntervalTick(10000)) // run every ~3min { return; } var partBase = def as HediffDef_PartBase; if (partBase != null) { if (partBase.produceEggs) { //Log.Message("genital tick"); //Log.Message("pawn " + pawn.Label); //Log.Message("id " + pawn.ThingID); var IsPlayerFaction = pawn.Faction?.IsPlayer ?? false; //colonists/animals var IsPlayerHome = pawn.Map?.IsPlayerHome ?? false; if (IsPlayerHome || IsPlayerFaction || pawn.IsPrisonerOfColony) { //Log.Message("-1 "); if (nextEggTick < 0) { nextEggTick = TryGetnextEggTick(); return; } //Log.Message("-2 "); if (pawn.health.capacities.GetLevel(PawnCapacityDefOf.Moving) <= 0.5) { return; } //Log.Message("-3 "); if (nextEggTick > 0 && ageTicks >= nextEggTick) { float maxEggsSize = (pawn.BodySize / 5) * (xxx.has_quirk(pawn, "Incubator") ? 2f : 1f) * (Genital_Helper.has_ovipositorF(pawn) ? 2f : 0.5f); float eggedsize = 0; //Log.Message("-4 "); foreach (var ownEgg in pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>()) { if (ownEgg.father != null) eggedsize += ownEgg.father.RaceProps.baseBodySize / 5; else if (ownEgg.implanter != null) eggedsize += ownEgg.implanter.RaceProps.baseBodySize / 5; else //something fucked up, father/implanter null / immortal pawn reborn /egg is broken? eggedsize += ownEgg.eggssize; } //Log.Message("-5 "); if (RJWSettings.DevMode) ModLog.Message($"{xxx.get_pawnname(pawn)} filled with {eggedsize} out of max capacity of {maxEggsSize} eggs."); if (eggedsize < maxEggsSize) { HediffDef_InsectEgg egg = null; string defname = ""; //Log.Message("-6 "); while (egg == null) { if (defname == "") { if (RJWSettings.DevMode) ModLog.Message(" trying to find " + pawn.kindDef.defName + " egg"); defname = pawn.kindDef.defName; } else { if (RJWSettings.DevMode) ModLog.Message(" no " + defname + " egg found, defaulting to Unknown egg"); defname = "Unknown"; } //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); //Log.Message("-7 "); egg = TryGetEgg(defname); } //Log.Message("-8 "); if (RJWSettings.DevMode) ModLog.Message("I choose you " + egg + "!"); //Log.Message("-9 "); var genitals = Genital_Helper.get_genitalsBPR(pawn); if (genitals != null) { //Log.Message("-10 "); var addedEgg = pawn.health.AddHediff(egg, genitals) as Hediff_InsectEgg; //Log.Message("-11 "); addedEgg?.Implanter(pawn); } //Log.Message("-12 "); } // Reset for next egg. ageTicks = 0; nextEggTick = -1; } } } } } [SyncMethod] private int TryGetnextEggTick() { var partBase = def as HediffDef_PartBase; return Rand.Range(partBase.minEggTick, partBase.maxEggTick); } [SyncMethod] private HediffDef_InsectEgg TryGetEgg(string defname) { return (from x in DefDatabase<HediffDef_InsectEgg>.AllDefs where x.IsParent(defname) select x).RandomElement(); } } }
Korth95/rjw
1.2/Source/Hediffs/Hediff_PartBaseArtifical.cs
C#
mit
7,544
using System.Linq; using Verse; using RimWorld; using System.Text; using Multiplayer.API; using UnityEngine; namespace rjw { public class Hediff_PartBaseNatural : HediffWithComps { public override bool ShouldRemove => false; public bool discovered = false; // Used for ovipositors. public int nextEggTick = -1; public float lastsize = -1; public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref this.nextEggTick, "nextEggTick"); Scribe_Values.Look(ref this.lastsize, "lastsize"); // Scribe_Values.Look(ref this.produceEggs, "produceEggs"); // Scribe_Defs.Look(ref this.pawnKindDefOverride, "pawnKindDefOverride"); // Scribe_Values.Look(ref this.genitalType, "genitalType"); } public override string LabelBase { get { /* * make patch to make/save capmods? if (CapMods.Count < 5) { PawnCapacityModifier pawnCapacityModifier = new PawnCapacityModifier(); pawnCapacityModifier.capacity = PawnCapacityDefOf.Moving; pawnCapacityModifier.offset += 0.5f; CapMods.Add(pawnCapacityModifier); } */ //name/kind return this.def.label; } } //public override string LabelInBrackets //{ // get // { // string size = "on fire!"; // size = (this.comps.Find(x => x is CompHediffBodyPart) as CompHediffBodyPart).Size; // return size; // //vanilla // //return (this.CurStage != null && !this.CurStage.label.NullOrEmpty()) ? this.CurStage.label : null; // } //} //overrides comps //public override string TipStringExtra //{ // get // { // StringBuilder stringBuilder = new StringBuilder(); // foreach (StatDrawEntry current in HediffStatsUtility.SpecialDisplayStats(this.CurStage, this)) // { // if (current.ShouldDisplay) // { // stringBuilder.AppendLine(current.LabelCap + ": " + current.ValueString); // } // } // //stringBuilder.AppendLine("Size: " + this.TryGetComp<CompHediffBodyPart>.Size); // //stringBuilder.AppendLine("1");// size? // //stringBuilder.AppendLine("2");// erm something? // return stringBuilder.ToString(); // } //} /// <summary> /// stack hediff in health tab? /// </summary> public override int UIGroupKey { get { if (RJWSettings.StackRjwParts) //(Label x count) return this.Label.GetHashCode(); else //dont return loadID; } } /// <summary> /// do not merge same rjw parts into one /// </summary> public override bool TryMergeWith(Hediff other) { return false; } /// <summary> /// show rjw parts in health tab or not /// </summary> public override bool Visible { get { if (RJWSettings.ShowRjwParts == RJWSettings.ShowParts.Hide) { discovered = false; } else if (!discovered) { if (RJWSettings.ShowRjwParts != RJWSettings.ShowParts.Hide) { discovered = true; return discovered; } //show at game start if (Current.ProgramState != ProgramState.Playing && Prefs.DevMode) return true; //show for hero if (pawn.IsDesignatedHero() && pawn.IsHeroOwner()) { discovered = true; return discovered; } //show if no clothes if (pawn.apparel != null)// animals? { bool hasPants; bool hasShirt; pawn.apparel.HasBasicApparel(out hasPants, out hasShirt);// naked? if (!hasPants) { bool flag3 = false; foreach (BodyPartRecord current in this.pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null, null)) { if (current.IsInGroup(BodyPartGroupDefOf.Legs)) { flag3 = true; break; } } if (!flag3) { hasPants = true; } } if (this.def.defName.ToLower().Contains("breast") || this.def.defName.ToLower().Contains("chest")) discovered = !hasShirt; else discovered = !hasPants; } } return discovered; } } /// <summary> /// egg production ticks /// </summary> public override void Tick() { ageTicks++; if (pawn.IsHashIntervalTick(60000)) // run every day { //change pawn parts sizes for kids(?) //update size if pawn bodysize changed from last check if(pawn.BodySize != lastsize) { var t = this.TryGetComp<CompHediffBodyPart>(); if(t != null) { t.updatesize(); lastsize = pawn.BodySize; } } } if (!pawn.IsHashIntervalTick(10000)) // run every ~3min { return; } var partBase = def as HediffDef_PartBase; if (partBase != null) { if (partBase.produceEggs) { //Log.Message("genital tick"); //Log.Message("pawn " + pawn.Label); //Log.Message("id " + pawn.ThingID); var IsPlayerFaction = pawn.Faction?.IsPlayer ?? false; //colonists/animals var IsPlayerHome = pawn.Map?.IsPlayerHome ?? false; if (IsPlayerHome || IsPlayerFaction || pawn.IsPrisonerOfColony) { //Log.Message("-1 "); if (nextEggTick < 0) { nextEggTick = TryGetnextEggTick(); return; } //Log.Message("-2 "); if (pawn.health.capacities.GetLevel(PawnCapacityDefOf.Moving) <= 0.5) { return; } //Log.Message("-3 "); if (nextEggTick > 0 && ageTicks >= nextEggTick) { float maxEggsSize = (pawn.BodySize / 5) * (xxx.has_quirk(pawn, "Incubator") ? 2f : 1f) * (Genital_Helper.has_ovipositorF(pawn) ? 2f : 0.5f); float eggedsize = 0; //Log.Message("-4 "); foreach (var ownEgg in pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>()) { if (ownEgg.father != null) eggedsize += ownEgg.father.RaceProps.baseBodySize / 5; else if (ownEgg.implanter != null) eggedsize += ownEgg.implanter.RaceProps.baseBodySize / 5; else //something fucked up, father/implanter null / immortal pawn reborn /egg is broken? eggedsize += ownEgg.eggssize; } //Log.Message("-5 "); if (RJWSettings.DevMode) ModLog.Message($"{xxx.get_pawnname(pawn)} filled with {eggedsize} out of max capacity of {maxEggsSize} eggs."); if (eggedsize < maxEggsSize) { HediffDef_InsectEgg egg = null; string defname = ""; //Log.Message("-6 "); while (egg == null) { if (defname == "") { if (RJWSettings.DevMode) ModLog.Message(" trying to find " + pawn.kindDef.defName + " egg"); defname = pawn.kindDef.defName; } else { if (RJWSettings.DevMode) ModLog.Message(" no " + defname + " egg found, defaulting to Unknown egg"); defname = "Unknown"; } //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); //Log.Message("-7 "); egg = TryGetEgg(defname); } //Log.Message("-8 "); if (RJWSettings.DevMode) ModLog.Message("I choose you " + egg + "!"); //Log.Message("-9 "); var genitals = Genital_Helper.get_genitalsBPR(pawn); if (genitals != null) { //Log.Message("-10 "); var addedEgg = pawn.health.AddHediff(egg, genitals) as Hediff_InsectEgg; //Log.Message("-11 "); addedEgg?.Implanter(pawn); } //Log.Message("-12 "); } // Reset for next egg. ageTicks = 0; nextEggTick = -1; } } } } } [SyncMethod] private int TryGetnextEggTick() { var partBase = def as HediffDef_PartBase; return Rand.Range(partBase.minEggTick, partBase.maxEggTick); } [SyncMethod] private HediffDef_InsectEgg TryGetEgg(string defname) { return (from x in DefDatabase<HediffDef_InsectEgg>.AllDefs where x.IsParent(defname) select x).RandomElement(); } } }
Korth95/rjw
1.2/Source/Hediffs/Hediff_PartBaseNatural.cs
C#
mit
7,888
using System.Linq; using Verse; namespace rjw { public class Hediff_PartsSizeChangerPC : HediffWithComps { public override void PostAdd(DamageInfo? dinfo) { foreach (Hediff hed in pawn.health.hediffSet.hediffs.Where(x => x.Part != null && x.Part == Part && (x is Hediff_PartBaseNatural || x is Hediff_PartBaseArtifical)).ToList()) { CompHediffBodyPart CompHediff = hed.TryGetComp<rjw.CompHediffBodyPart>(); if (CompHediff != null) { //Log.Message(" Hediff_PartsSizeChanger: " + hed.Label); //Log.Message(" Hediff_PartsSizeChanger: " + hed.Severity); //Log.Message(" Hediff_PartsSizeChanger: " + CompHediff.SizeBase); //Log.Message(" Hediff_PartsSizeChanger: " + "-----"); //Log.Message(" Hediff_PartsSizeChanger: " + this.Label); //Log.Message(" Hediff_PartsSizeChanger: " + this.Severity); CompHediff.SizeBase = this.CurStage.minSeverity; CompHediff.initComp(reroll: true); CompHediff.updatesize(); //Log.Message(" Hediff_PartsSizeChanger: " + "-----"); //Log.Message(" Hediff_PartsSizeChanger: " + hed.Label); //Log.Message(" Hediff_PartsSizeChanger: " + hed.Severity); //Log.Message(" Hediff_PartsSizeChanger: " + CompHediff.SizeBase); } } pawn.health.RemoveHediff(this); } } public class Hediff_PartsSizeChangerCE : HediffWithComps { public override void PostAdd(DamageInfo? dinfo) { foreach (Hediff hed in pawn.health.hediffSet.hediffs.Where(x => x.Part != null && x.Part == Part && (x is Hediff_PartBaseNatural || x is Hediff_PartBaseArtifical)).ToList()) { CompHediffBodyPart CompHediff = hed.TryGetComp<rjw.CompHediffBodyPart>(); if (CompHediff != null) { CompHediff.SizeBase = this.def.initialSeverity; CompHediff.initComp(reroll: true); CompHediff.updatesize(); } } pawn.health.RemoveHediff(this); } } }
Korth95/rjw
1.2/Source/Hediffs/Hediff_PartsSizeChanger.cs
C#
mit
1,881
using Verse; //Hediff worker for pawns' "lay down and submit" button namespace rjw { public class Hediff_Submitting: HediffWithComps { public override bool ShouldRemove { get { Pawn daddy = pawn.CarriedBy; if (daddy != null && daddy.Faction == pawn.Faction) { return true; } else return base.ShouldRemove; } } } }
Korth95/rjw
1.2/Source/Hediffs/Hediff_Submitting.cs
C#
mit
364
using System.Collections.Generic; using Verse; namespace rjw { public class PartAdder { public float chance = 0f; public string rjwPart; public List<string> bodyParts; } }
Korth95/rjw
1.2/Source/Hediffs/PartAdder.cs
C#
mit
185
using System; using System.Collections.Generic; using System.Linq; using Verse; namespace rjw { public class PartProps : DefModExtension { /// <summary> /// just a text /// </summary> public List<string> props; public static bool TryGetProps(Hediff hediff, out List<string> p) { return TryGetPartProps(hediff, extension => extension.props, out p); } public static bool TryGetPartProps( Hediff hediff, Func<PartProps, List<string>> getList, out List<string> p) { if (!hediff.def.HasModExtension<PartProps>()) { p = null; return false; } var extension = hediff.def.GetModExtension<PartProps>(); var list = getList(extension); if (list == null) { p = null; return false; } p = list; return true; } } }
Korth95/rjw
1.2/Source/Hediffs/PartProps.cs
C#
mit
790
using System; using System.Collections.Generic; using System.Linq; using Verse; namespace rjw { public class PartSizeExtension : DefModExtension { /// <summary> /// Human standard would be 1.0. Null for no weight display. /// </summary> public bool? bodysizescale = false; // rescales parts sizes based on bodysize of initial owner race public float? density = null; public List<float> lengths; public List<float> girths; public List<float> cupSizes; public static bool TryGetLength(Hediff hediff, out float size) { return TryGetSizeFromCurve(hediff, extension => extension.lengths, true, out size); } public static bool TryGetGirth(Hediff hediff, out float size) { return TryGetSizeFromCurve(hediff, extension => extension.girths, true, out size); } public static bool TryGetCupSize(Hediff hediff, out float size) { // Cup size is already "scaled" because the same breast volume has a smaller cup size on a larger band size. return TryGetSizeFromCurve(hediff, extension => extension.cupSizes, false, out size); } public static float GetBandSize(Hediff hediff) { var size = GetUnderbustSize(hediff); size /= PartStagesDef.Instance.bandSizeInterval; size = (float)Math.Round(size, MidpointRounding.AwayFromZero); size *= PartStagesDef.Instance.bandSizeInterval; return size; } public static float GetUnderbustSize(Hediff hediff) { return PartStagesDef.Instance.bandSizeBase * GetLinearScale(hediff); } static float GetLinearScale(Hediff hediff) { return (float)Math.Pow(hediff.pawn.BodySize, 1.0 / 3.0); } public static bool TryGetOverbustSize(Hediff hediff, out float size) { if (!TryGetCupSize(hediff, out var cupSize)) { size = 0f; return false; } // Cup size is rounded up, so to do the math backwards subtract .9 size = GetUnderbustSize(hediff) + ((cupSize - .9f) * PartStagesDef.Instance.cupSizeInterval); return true; } static bool TryGetSizeFromCurve( Hediff hediff, Func<PartSizeExtension, List<float>> getList, bool shouldScale, out float size) { if (!hediff.def.HasModExtension<PartSizeExtension>()) { size = 0f; return false; } var extension = hediff.def.GetModExtension<PartSizeExtension>(); var list = getList(extension); if (list == null) { size = 0f; return false; } var curve = new SimpleCurve(hediff.def.stages.Zip(list, (stage, size) => new CurvePoint(stage.minSeverity, size))); var scaleFactor = shouldScale ? GetLinearScale(hediff) : 1.0f; size = curve.Evaluate(hediff.Severity) * scaleFactor; return true; } public static bool TryGetPenisWeight(Hediff hediff, out float weight) { if (!TryGetLength(hediff, out float length) || !TryGetGirth(hediff, out float girth)) { weight = 0f; return false; } var density = hediff.def.GetModExtension<PartSizeExtension>().density; if (density == null) { weight = 0f; return false; } var r = girth / (2.0 * Math.PI); var volume = r * r * Math.PI * length; weight = (float)(volume * density.Value / 1000f); return true; } public static bool TryGetBreastWeight(Hediff hediff, out float weight) { if (!TryGetCupSize(hediff, out float rawSize)) { weight = 0f; return false; } var density = hediff.def.GetModExtension<PartSizeExtension>().density; if (density == null) { weight = 0f; return false; } // Up a band size and down a cup size is about the same volume. var extraBandSize = PartStagesDef.Instance.bandSizeBase * (1.0f - GetLinearScale(hediff)); var extraCupSizes = extraBandSize / PartStagesDef.Instance.bandSizeInterval; var size = rawSize + extraCupSizes; var pounds = 0.765f + 0.415f * size + -0.0168f * size * size + 2.47E-03f * size * size * size; var kg = Math.Max(0, pounds * 0.45359237f); weight = kg * density.Value; return true; } } }
Korth95/rjw
1.2/Source/Hediffs/PartSizeExtension.cs
C#
mit
3,962
using System; using System.Collections.Generic; using System.Linq; using Verse; namespace rjw { public class InteractionExtension : DefModExtension { /// <summary> /// </summary> public string RMBLabelM = ""; // rmb menu for male public string RMBLabelF = ""; // rmb menu for female public string RMBLabel = ""; // rmb menu public string RMBDescription = ""; // rmb menu description for initiator public string i_role = ""; // initiator role passive/active /mutual?(69) public string sextype1 = ""; // Normal/Rape/Bestiality 0/1/2 public string rjwSextype = ""; // xxx.rjwSextype public List<string> tags; // tags for filtering/finding interaction public List<string> i_tags; // tags for what initiator does public List<string> r_tags; // tags for what receiver does public List<string> rulepack_defs; //rulepack(s) for this interaction } }
Korth95/rjw
1.2/Source/Interactions/InteractionExtension.cs
C#
mit
878
using System.Collections.Generic; using System.Text; using RimWorld; using Verse; namespace rjw { internal class InteractionWorker_AnalSexAttempt : InteractionWorker { //initiator - rapist //recipient - victim public static bool AttemptAnalSex(Pawn initiator, Pawn recipient) { //--Log.Message(xxx.get_pawnname(initiator) + " is attempting to anally rape " + xxx.get_pawnname(recipient)); return true; } public override float RandomSelectionWeight(Pawn initiator, Pawn recipient) { // this interaction is triggered by the jobdriver if (initiator == null || recipient == null) return 0.0f; return 0.0f; // base.RandomSelectionWeight(initiator, recipient); } public override void Interacted(Pawn initiator, Pawn recipient, List<RulePackDef> extraSentencePacks, out string letterText, out string letterLabel, out LetterDef letterDef, out LookTargets lookTargets) { //add something fancy here later? letterText = null; letterLabel = null; letterDef = null; lookTargets = recipient; //Find.LetterStack.ReceiveLetter("Rape attempt", "A wandering nymph has decided to join your colony.", LetterDefOf.NegativeEvent, recipient); if (initiator == null || recipient == null) return; //--ModLog.Message(" InteractionWorker_AnalRapeAttempt::Interacted( " + xxx.get_pawnname(initiator) + ", " + xxx.get_pawnname(recipient) + " ) called"); AttemptAnalSex(initiator, recipient); } } internal class InteractionWorker_VaginalSexAttempt : InteractionWorker { //initiator - rapist //recipient - victim public static bool AttemptAnalSex(Pawn initiator, Pawn recipient) { //--Log.Message(xxx.get_pawnname(initiator) + " is attempting to anally rape " + xxx.get_pawnname(recipient)); return false; } public override float RandomSelectionWeight(Pawn initiator, Pawn recipient) { // this interaction is triggered by the jobdriver if (initiator == null || recipient == null) return 0.0f; return 0.0f; // base.RandomSelectionWeight(initiator, recipient); } public override void Interacted(Pawn initiator, Pawn recipient, List<RulePackDef> extraSentencePacks, out string letterText, out string letterLabel, out LetterDef letterDef, out LookTargets lookTargets) { //add something fancy here later? letterText = null; letterLabel = null; letterDef = null; lookTargets = recipient; //Find.LetterStack.ReceiveLetter("Rape attempt", "A wandering nymph has decided to join your colony.", LetterDefOf.NegativeEvent, recipient); if (initiator == null || recipient == null) return; //--ModLog.Message(" InteractionWorker_AnalRapeAttempt::Interacted( " + xxx.get_pawnname(initiator) + ", " + xxx.get_pawnname(recipient) + " ) called"); AttemptAnalSex(initiator, recipient); } } internal class InteractionWorker_OtherSexAttempt : InteractionWorker { //initiator - rapist //recipient - victim public static bool AttemptAnalSex(Pawn initiator, Pawn recipient) { //--Log.Message(xxx.get_pawnname(initiator) + " is attempting to anally rape " + xxx.get_pawnname(recipient)); return false; } public override float RandomSelectionWeight(Pawn initiator, Pawn recipient) { // this interaction is triggered by the jobdriver if (initiator == null || recipient == null) return 0.0f; return 0.0f; // base.RandomSelectionWeight(initiator, recipient); } public override void Interacted(Pawn initiator, Pawn recipient, List<RulePackDef> extraSentencePacks, out string letterText, out string letterLabel, out LetterDef letterDef, out LookTargets lookTargets) { //add something fancy here later? letterText = null; letterLabel = null; letterDef = null; lookTargets = recipient; //Find.LetterStack.ReceiveLetter("Rape attempt", "A wandering nymph has decided to join your colony.", LetterDefOf.NegativeEvent, recipient); if (initiator == null || recipient == null) return; //--ModLog.Message(" InteractionWorker_AnalRapeAttempt::Interacted( " + xxx.get_pawnname(initiator) + ", " + xxx.get_pawnname(recipient) + " ) called"); AttemptAnalSex(initiator, recipient); } } }
Korth95/rjw
1.2/Source/Interactions/InteractionWorker_SexAttempt.cs
C#
mit
4,158
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; using Multiplayer.API; namespace rjw { public class JobDriver_BestialityForFemale : JobDriver_SexBaseInitiator { public IntVec3 SleepSpot => Bed.SleepPosOfAssignedPawn(pawn); public override bool TryMakePreToilReservations(bool errorOnFailed) { return pawn.Reserve(Target, job, 1, 0, null, errorOnFailed); } [SyncMethod] protected override IEnumerable<Toil> MakeNewToils() { setup_ticks(); this.FailOnDespawnedOrNull(iTarget); this.FailOnDespawnedNullOrForbidden(iBed); this.FailOn(() => !pawn.CanReserveAndReach(Partner, PathEndMode.Touch, Danger.Deadly)); this.FailOn(() => pawn.Drafted); this.FailOn(() => Partner.IsFighting()); this.FailOn(() => !Partner.CanReach(pawn, PathEndMode.Touch, Danger.Deadly)); yield return Toils_Reserve.Reserve(iTarget, 1, 0); Toil gotoAnimal = Toils_Goto.GotoThing(iTarget, PathEndMode.Touch); yield return gotoAnimal; Toil gotoBed = new Toil(); gotoBed.defaultCompleteMode = ToilCompleteMode.PatherArrival; gotoBed.FailOnBedNoLongerUsable(iBed); gotoBed.AddFailCondition(() => Partner.Downed); gotoBed.initAction = delegate { pawn.pather.StartPath(SleepSpot, PathEndMode.OnCell); Partner.jobs.StopAll(); Job job = JobMaker.MakeJob(JobDefOf.GotoMindControlled, SleepSpot); Partner.jobs.StartJob(job, JobCondition.InterruptForced); }; yield return gotoBed; Toil waitInBed = new Toil(); waitInBed.FailOn(() => pawn.GetRoom(RegionType.Set_Passable) == null); waitInBed.defaultCompleteMode = ToilCompleteMode.Delay; waitInBed.initAction = delegate { ticksLeftThisToil = 5000; }; waitInBed.tickAction = delegate { pawn.GainComfortFromCellIfPossible(); if (IsInOrByBed(Bed, Partner) && pawn.PositionHeld == Partner.PositionHeld) { ReadyForNextToil(); } }; yield return waitInBed; Toil StartPartnerJob = new Toil(); StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.initAction = delegate { var gettin_loved = JobMaker.MakeJob(xxx.gettin_loved, pawn, Bed); Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced); }; yield return StartPartnerJob; Toil SexToil = new Toil(); SexToil.AddFailCondition(() => Partner.Dead || !IsInOrByBed(Bed, Partner)); SexToil.socialMode = RandomSocialMode.Off; SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.handlingFacing = true; SexToil.initAction = delegate { Partner.pather.StopDead(); Partner.jobs.curDriver.asleep = false; usedCondom = CondomUtility.TryUseCondom(pawn); Start(); }; SexToil.AddPreTickAction(delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) if (xxx.is_zoophile(pawn)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); else ThrowMetaIcon(pawn.Position, pawn.Map, xxx.mote_noheart); SexTick(pawn, Partner); SexUtility.reduce_rest(pawn, 1); SexUtility.reduce_rest(Partner, 2); if (ticks_left <= 0) ReadyForNextToil(); }); SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; Toil afterSex = new Toil { initAction = delegate { //Log.Message("JobDriver_BestialityForFemale::MakeNewToils() - Calling aftersex"); SexUtility.ProcessSex(Partner, pawn, usedCondom: usedCondom, sextype: sexType); }, defaultCompleteMode = ToilCompleteMode.Instant }; yield return afterSex; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_BestialityForFemale.cs
C#
mit
3,609
using System.Collections.Generic; using System.Linq; using RimWorld; using Verse; using Verse.AI; using Multiplayer.API; namespace rjw { public class JobDriver_BestialityForMale : JobDriver_Rape { public override bool TryMakePreToilReservations(bool errorOnFailed) { return pawn.Reserve(Target, job, 1, 0, null, errorOnFailed); } [SyncMethod] protected override IEnumerable<Toil> MakeNewToils() { //--ModLog.Message(" JobDriver_BestialityForMale::MakeNewToils() called"); setup_ticks(); var PartnerJob = xxx.gettin_bred; //this.FailOn (() => (!Partner.health.capacities.CanBeAwake) || (!comfort_prisoners.is_designated (Partner))); // Fail if someone else reserves the prisoner before the pawn arrives or colonist can't reach animal this.FailOn(() => !pawn.CanReserveAndReach(Partner, PathEndMode.Touch, Danger.Deadly)); this.FailOn(() => Partner.HostileTo(pawn)); this.FailOnDespawnedNullOrForbidden(iTarget); this.FailOn(() => pawn.Drafted); yield return Toils_Reserve.Reserve(iTarget, 1, 0); //ModLog.Message(" JobDriver_BestialityForMale::MakeNewToils() - moving towards animal"); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.Touch); yield return Toils_Interpersonal.WaitToBeAbleToInteract(pawn); yield return Toils_Interpersonal.GotoInteractablePosition(iTarget); if (xxx.is_kind(pawn) || (xxx.CTIsActive && xxx.has_traits(pawn) && pawn.story.traits.HasTrait(xxx.RCT_AnimalLover))) { yield return TalkToAnimal(pawn, Partner); yield return TalkToAnimal(pawn, Partner); } if (Rand.Chance(0.6f)) yield return TalkToAnimal(pawn, Partner); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); SexUtility.RapeTargetAlert(pawn, Partner); Toil StartPartnerJob = new Toil(); StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.initAction = delegate { //--ModLog.Message(" JobDriver_BestialityForMale::MakeNewToils() - Setting animal job driver"); var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped; if (dri == null) { //wild animals may flee or attack if (pawn.Faction != Partner.Faction && Partner.RaceProps.wildness > Rand.Range(0.22f, 1.0f) && !(pawn.TicksPerMoveCardinal < (Partner.TicksPerMoveCardinal / 2) && !Partner.Downed && xxx.is_not_dying(Partner))) { Partner.jobs.StopAll(); // Wake up animal if sleeping. float aggro = Partner.kindDef.RaceProps.manhunterOnTameFailChance; if (Partner.kindDef.RaceProps.predator) aggro += 0.2f; else aggro -= 0.1f; //wild animals may attack if (Rand.Chance(aggro) && Partner.CanSee(pawn)) { Partner.rotationTracker.FaceTarget(pawn); LifeStageUtility.PlayNearestLifestageSound(Partner, (ls) => ls.soundAngry, 1.4f); ThrowMetaIcon(Partner.Position, Partner.Map, ThingDefOf.Mote_IncapIcon); ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_ColonistFleeing); //red '!' Partner.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.Manhunter); if (Partner.kindDef.RaceProps.herdAnimal && Rand.Chance(0.2f)) { // 20% chance of turning the whole herd hostile... List<Pawn> packmates = Partner.Map.mapPawns.AllPawnsSpawned.Where(x => x != Partner && x.def == Partner.def && x.Faction == Partner.Faction && x.Position.InHorDistOf(Partner.Position, 24f) && x.CanSee(Partner)).ToList(); foreach (Pawn packmate in packmates) { packmate.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.Manhunter); } } Messages.Message(pawn.Name.ToStringShort + " is being attacked by " + xxx.get_pawnname(Partner) + ".", pawn, MessageTypeDefOf.ThreatSmall); } //wild animals may flee else { ThrowMetaIcon(Partner.Position, Partner.Map, ThingDefOf.Mote_ColonistFleeing); LifeStageUtility.PlayNearestLifestageSound(Partner, (ls) => ls.soundCall); Partner.mindState.StartFleeingBecauseOfPawnAction(pawn); Partner.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.PanicFlee); } pawn.jobs.EndCurrentJob(JobCondition.Incompletable); } else { Job gettin_bred = JobMaker.MakeJob(PartnerJob, pawn, Partner); Partner.jobs.StartJob(gettin_bred, JobCondition.InterruptForced, null, true); } } }; yield return StartPartnerJob; Toil SexToil = new Toil(); SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.defaultDuration = duration; SexToil.handlingFacing = true; SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.initAction = delegate { Partner.pather.StopDead(); Partner.jobs.curDriver.asleep = false; Start(); }; SexToil.tickAction = delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) if (xxx.is_zoophile(pawn)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); else ThrowMetaIcon(pawn.Position, pawn.Map, xxx.mote_noheart); SexTick(pawn, Partner); //no hitting wild animals, and getting rect by their Manhunter /* if (pawn.IsHashIntervalTick (ticks_between_hits)) roll_to_hit (pawn, Partner); */ SexUtility.reduce_rest(Partner, 1); SexUtility.reduce_rest(pawn, 2); if (ticks_left <= 0) ReadyForNextToil(); }; SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { //ModLog.Message(" JobDriver_BestialityForMale::MakeNewToils() - creating aftersex toil"); SexUtility.ProcessSex(pawn, Partner, usedCondom: usedCondom, sextype: sexType); }, defaultCompleteMode = ToilCompleteMode.Instant }; } [SyncMethod] private Toil TalkToAnimal(Pawn pawn, Pawn animal) { Toil toil = new Toil(); toil.initAction = delegate { pawn.interactions.TryInteractWith(animal, SexUtility.AnimalSexChat); }; //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); toil.defaultCompleteMode = ToilCompleteMode.Delay; toil.defaultDuration = Rand.Range(120, 220); return toil; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_BestialityForMale.cs
C#
mit
6,300
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; using Multiplayer.API; namespace rjw { /// <summary> /// This is the driver for animals mounting breeders. /// </summary> public class JobDriver_Breeding : JobDriver_Rape { public override bool TryMakePreToilReservations(bool errorOnFailed) { return pawn.Reserve(Target, job, BreederHelper.max_animals_at_once, 0); } [SyncMethod] protected override IEnumerable<Toil> MakeNewToils() { setup_ticks(); var PartnerJob = xxx.gettin_raped; //--Log.Message("JobDriver_Breeding::MakeNewToils() - setting fail conditions"); this.FailOnDespawnedNullOrForbidden(iTarget); this.FailOn(() => !pawn.CanReserve(Partner, BreederHelper.max_animals_at_once, 0)); // Fail if someone else reserves the target before the animal arrives. this.FailOn(() => !pawn.CanReach(Partner, PathEndMode.Touch, Danger.Some)); // Fail if animal cannot reach target. this.FailOn(() => pawn.Drafted); // Path to target yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); //if (!(pawn.IsDesignatedBreedingAnimal() && Partner.IsDesignatedBreeding())); if (!(pawn.IsAnimal() && Partner.IsAnimal())) SexUtility.RapeTargetAlert(pawn, Partner); Toil StartPartnerJob = new Toil(); StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.initAction = delegate { var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped; if (dri == null) { Job gettin_raped = JobMaker.MakeJob(PartnerJob, pawn); Building_Bed Bed = null; if (Partner.GetPosture() == PawnPosture.LayingInBed) Bed = Partner.CurrentBed(); Partner.jobs.StartJob(gettin_raped, JobCondition.InterruptForced, null, false, true, null); if (Bed != null) (Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped)?.Set_bed(Bed); } }; yield return StartPartnerJob; // Breed target var SexToil = new Toil(); SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.defaultDuration = duration; SexToil.handlingFacing = true; SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.initAction = delegate { Partner.pather.StopDead(); Partner.jobs.curDriver.asleep = false; Start(); }; SexToil.tickAction = delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) if (xxx.is_zoophile(pawn) || xxx.is_animal(pawn)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); else ThrowMetaIcon(pawn.Position, pawn.Map, xxx.mote_noheart); SexTick(pawn, Partner); if (!Partner.Dead) SexUtility.reduce_rest(Partner, 1); SexUtility.reduce_rest(pawn, 2); if (ticks_left <= 0) ReadyForNextToil(); }; SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { //Log.Message("JobDriver_Breeding::MakeNewToils() - Calling aftersex"); //// Trying to add some interactions and social logs bool isRape = !(pawn.relations.DirectRelationExists(PawnRelationDefOf.Bond, Partner) || (xxx.is_animal(pawn) && (pawn.RaceProps.wildness - pawn.RaceProps.petness + 0.18f) > Rand.Range(0.36f, 1.8f))); SexUtility.ProcessSex(pawn, Partner, usedCondom: usedCondom, rape: isRape, sextype: sexType); }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_Breeding.cs
C#
mit
3,498
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; using Multiplayer.API; namespace rjw { public class JobDriver_Masturbate : JobDriver_SexBaseInitiator { public override bool TryMakePreToilReservations(bool errorOnFailed) { return true; // No reservations needed. } public virtual IntVec3 cell => (IntVec3)job.GetTarget(iCell); [SyncMethod] new public void setup_ticks() { base.setup_ticks(); // Faster fapping when frustrated. duration = (int)(xxx.is_frustrated(pawn) ? 2500.0f * Rand.Range(0.2f, 0.7f) : 2500.0f * Rand.Range(0.2f, 0.4f)); ticks_left = duration; } protected override IEnumerable<Toil> MakeNewToils() { setup_ticks(); //this.FailOn(() => PawnUtility.PlayerForcedJobNowOrSoon(pawn)); this.FailOn(() => pawn.health.Downed); this.FailOn(() => pawn.IsBurning()); this.FailOn(() => pawn.IsFighting()); this.FailOn(() => pawn.Drafted); Toil findfapspot = new Toil { initAction = delegate { pawn.pather.StartPath(cell, PathEndMode.OnCell); }, defaultCompleteMode = ToilCompleteMode.PatherArrival }; yield return findfapspot; //ModLog.Message(" Making new toil for QuickFap."); Toil SexToil = Toils_General.Wait(duration); SexToil.handlingFacing = true; SexToil.initAction = delegate { Start(); }; SexToil.tickAction = delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); SexTick(pawn, null); SexUtility.reduce_rest(pawn, 1); if (ticks_left <= 0) ReadyForNextToil(); }; SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { SexUtility.Aftersex(pawn, xxx.rjwSextype.Masturbation); if (!SexUtility.ConsiderCleaning(pawn)) return; LocalTargetInfo own_cum = pawn.PositionHeld.GetFirstThing<Filth>(pawn.Map); Job clean = JobMaker.MakeJob(JobDefOf.Clean); clean.AddQueuedTarget(TargetIndex.A, own_cum); pawn.jobs.jobQueue.EnqueueFirst(clean); }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_Masturbate.cs
C#
mit
2,197
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; using Multiplayer.API; namespace rjw { /// <summary> /// This is the driver for animals mating. /// </summary> public class JobDriver_Mating : JobDriver_Rape { public override bool TryMakePreToilReservations(bool errorOnFailed) { return pawn.Reserve(Target, job, BreederHelper.max_animals_at_once, 0, null, errorOnFailed); } [SyncMethod] protected override IEnumerable<Toil> MakeNewToils() { setup_ticks(); var PartnerJob = xxx.gettin_loved; //--Log.Message("JobDriver_Mating::MakeNewToils() - setting fail conditions"); this.FailOnDespawnedNullOrForbidden(iTarget); this.FailOn(() => !pawn.CanReserve(Partner, BreederHelper.max_animals_at_once, 0)); // Fail if someone else reserves the target before the animal arrives. this.FailOn(() => !pawn.CanReach(Partner, PathEndMode.Touch, Danger.Some)); // Fail if animal cannot reach target. this.FailOn(() => pawn.Drafted); // Path to target yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); Toil StartPartnerJob = new Toil(); StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.initAction = delegate { var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverLoved; if (dri == null) { Job gettin_loved = JobMaker.MakeJob(PartnerJob, pawn); Building_Bed Bed = null; if (Partner.GetPosture() == PawnPosture.LayingInBed) Bed = Partner.CurrentBed(); Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced, null, false, true, null); if (Bed != null) (Partner.jobs.curDriver as JobDriver_SexBaseRecieverLoved)?.Set_bed(Bed); } }; yield return StartPartnerJob; // Mate target var SexToil = new Toil(); SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.defaultDuration = duration; SexToil.handlingFacing = true; SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.initAction = delegate { Partner.pather.StopDead(); Partner.jobs.curDriver.asleep = false; Start(); }; SexToil.tickAction = delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); SexTick(pawn, Partner); if (!Partner.Dead) SexUtility.reduce_rest(Partner, 1); SexUtility.reduce_rest(pawn, 2); if (ticks_left <= 0) ReadyForNextToil(); }; SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { bool isRape = false; SexUtility.ProcessSex(pawn, Partner, usedCondom: usedCondom, rape: isRape, sextype: sexType); }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_Mating.cs
C#
mit
2,873
using System; using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; namespace rjw { public class JobDriver_Rape : JobDriver_SexBaseInitiator { public override bool TryMakePreToilReservations(bool errorOnFailed) { return pawn.Reserve(Target, job, xxx.max_rapists_per_prisoner, 0, null, errorOnFailed); } protected override IEnumerable<Toil> MakeNewToils() { if (RJWSettings.DebugRape) ModLog.Message("" + this.GetType().ToString() + "::MakeNewToils() called"); setup_ticks(); var PartnerJob = xxx.gettin_raped; this.FailOnDespawnedNullOrForbidden(iTarget); this.FailOn(() => !pawn.CanReserve(Partner, xxx.max_rapists_per_prisoner, 0)); // Fail if someone else reserves the prisoner before the pawn arrives this.FailOn(() => pawn.IsFighting()); this.FailOn(() => Partner.IsFighting()); this.FailOn(() => pawn.Drafted); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); SexUtility.RapeTargetAlert(pawn, Partner); Toil StartPartnerJob = new Toil(); StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.initAction = delegate { var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped; if (dri == null) { Job gettin_raped = JobMaker.MakeJob(PartnerJob, pawn); Building_Bed Bed = null; if (Partner.GetPosture() == PawnPosture.LayingInBed) Bed = Partner.CurrentBed(); Partner.jobs.StartJob(gettin_raped, JobCondition.InterruptForced, null, false, true, null); if (Bed != null) (Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped)?.Set_bed(Bed); } }; yield return StartPartnerJob; var SexToil = new Toil(); SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.defaultDuration = duration; SexToil.handlingFacing = true; SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.initAction = delegate { Partner.pather.StopDead(); Partner.jobs.curDriver.asleep = false; if (RJWSettings.rape_stripping && (Partner.IsColonist || pawn.IsColonist)) Partner.Strip(); Start(); }; SexToil.tickAction = delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); SexTick(pawn, Partner); SexUtility.reduce_rest(Partner, 1); SexUtility.reduce_rest(pawn, 2); if (ticks_left <= 0) ReadyForNextToil(); }; SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { //// Trying to add some interactions and social logs SexUtility.ProcessSex(pawn, Partner, usedCondom: usedCondom, rape: isRape, sextype: sexType); }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_Rape.cs
C#
mit
2,880
using System; using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; namespace rjw { public class JobDriver_RapeComfortPawn : JobDriver_Rape { protected override IEnumerable<Toil> MakeNewToils() { if (RJWSettings.DebugRape) ModLog.Message("" + this.GetType().ToString() + "::MakeNewToils() called"); setup_ticks(); var PartnerJob = xxx.gettin_raped; this.FailOnDespawnedNullOrForbidden(iTarget); //this.FailOn(() => (!Partner.health.capacities.CanBeAwake) || (!comfort_prisoners.is_designated(Partner)));//this is wrong this.FailOn(() => (!Partner.IsDesignatedComfort())); this.FailOn(() => !pawn.CanReserve(Partner, xxx.max_rapists_per_prisoner, 0)); // Fail if someone else reserves the prisoner before the pawn arrives this.FailOn(() => pawn.Drafted); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); SexUtility.RapeTargetAlert(pawn, Partner); Toil StartPartnerJob = new Toil(); StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.initAction = delegate { var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped; if (dri == null) { Job gettin_raped = JobMaker.MakeJob(PartnerJob, pawn); Building_Bed Bed = null; if (Partner.GetPosture() == PawnPosture.LayingInBed) Bed = Partner.CurrentBed(); Partner.jobs.StartJob(gettin_raped, JobCondition.InterruptForced, null, false, true, null); if (Bed != null) (Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped)?.Set_bed(Bed); } }; yield return StartPartnerJob; Toil SexToil = new Toil(); SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.defaultDuration = duration; SexToil.handlingFacing = true; SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.initAction = delegate { Partner.pather.StopDead(); Partner.jobs.curDriver.asleep = false; // Unlike normal rape try use comfort prisoner condom CondomUtility.GetCondomFromRoom(Partner); usedCondom = CondomUtility.TryUseCondom(Partner); if (RJWSettings.DebugRape) ModLog.Message("JobDriver_RapeComfortPawn::MakeNewToils() - reserving prisoner"); //pawn.Reserve(Partner, xxx.max_rapists_per_prisoner, 0); Start(); }; SexToil.tickAction = delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); SexTick(pawn, Partner); SexUtility.reduce_rest(Partner, 1); SexUtility.reduce_rest(pawn, 2); if (ticks_left <= 0) ReadyForNextToil(); }; SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { // Trying to add some interactions and social logs SexUtility.ProcessSex(pawn, Partner, usedCondom: usedCondom, rape: isRape, sextype: sexType); Partner.records.Increment(xxx.GetRapedAsComfortPawn); }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeComfortPawn.cs
C#
mit
3,098
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; using Verse.Sound; namespace rjw { public class JobDriver_ViolateCorpse : JobDriver_Rape { public override bool TryMakePreToilReservations(bool errorOnFailed) { return pawn.Reserve(Target, job, 1, -1, null, errorOnFailed); } protected override IEnumerable<Toil> MakeNewToils() { if (RJWSettings.DebugRape) ModLog.Message(" JobDriver_ViolateCorpse::MakeNewToils() called"); setup_ticks(); this.FailOnDespawnedNullOrForbidden(iTarget); this.FailOn(() => !pawn.CanReserve(Target, 1, 0)); // Fail if someone else reserves the prisoner before the pawn arrives this.FailOn(() => pawn.IsFighting()); this.FailOn(() => pawn.Drafted); this.FailOn(Target.IsBurning); if (RJWSettings.DebugRape) ModLog.Message(" JobDriver_ViolateCorpse::MakeNewToils() - moving towards Target"); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); var alert = RJWPreferenceSettings.rape_attempt_alert == RJWPreferenceSettings.RapeAlert.Disabled ? MessageTypeDefOf.SilentInput : MessageTypeDefOf.NeutralEvent; Messages.Message(xxx.get_pawnname(pawn) + " is trying to rape a corpse of " + xxx.get_pawnname(Partner), pawn, alert); setup_ticks();// re-setup ticks on arrival var SexToil = new Toil(); SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.defaultDuration = duration; SexToil.handlingFacing = true; SexToil.initAction = delegate { if (RJWSettings.DebugRape) ModLog.Message(" JobDriver_ViolateCorpse::MakeNewToils() - stripping Target"); (Target as Corpse).Strip(); Start(); }; SexToil.tickAction = delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) if (xxx.is_necrophiliac(pawn)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); else ThrowMetaIcon(pawn.Position, pawn.Map, xxx.mote_noheart); //if (pawn.IsHashIntervalTick (ticks_between_hits)) // roll_to_hit (pawn, Target); SexTick(pawn, Target); SexUtility.reduce_rest(pawn, 2); if (ticks_left <= 0) ReadyForNextToil(); }; SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { if (RJWSettings.DebugRape) ModLog.Message(" JobDriver_ViolateCorpse::MakeNewToils() - creating aftersex toil"); SexUtility.ProcessSex(pawn, Partner, usedCondom: usedCondom, rape: isRape, sextype: sexType); }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeCorpse.cs
C#
mit
2,574
using System; using System.Collections.Generic; using System.Linq; using RimWorld; using Verse; using Verse.AI; using Multiplayer.API; namespace rjw { internal class JobDef_RapeEnemy : JobDef { public List<JobDef> interruptJobs; public List<string> TargetDefNames = new List<string>(); public int priority = 0; protected JobDriver_RapeEnemy instance { get { if (_tmpInstance == null) { _tmpInstance = (JobDriver_RapeEnemy)Activator.CreateInstance(driverClass); } return _tmpInstance; } } private JobDriver_RapeEnemy _tmpInstance; public override void ResolveReferences() { base.ResolveReferences(); interruptJobs = new List<JobDef> { null, JobDefOf.LayDown, JobDefOf.Wait_Wander, JobDefOf.GotoWander, JobDefOf.AttackMelee }; } public virtual bool CanUseThisJobForPawn(Pawn rapist) { bool busy = !interruptJobs.Contains(rapist.CurJob?.def); if (RJWSettings.DebugRape) ModLog.Message(" JobDef_RapeEnemy::CanUseThisJobForPawn( " + xxx.get_pawnname(rapist) + " ) - busy:" + busy + " with current job: " + rapist.CurJob?.def?.ToString()); if (busy) return false; return instance.CanUseThisJobForPawn(rapist);// || TargetDefNames.Contains(rapist.def.defName); } public virtual Pawn FindVictim(Pawn rapist, Map m) { return instance.FindVictim(rapist, m); } } public class JobDriver_RapeEnemy : JobDriver_Rape { //override can_rape mechanics protected bool requireCanRape = true; public virtual bool CanUseThisJobForPawn(Pawn rapist) { return xxx.is_human(rapist); } // this is probably useseless, maybe there be something in future public virtual bool considerStillAliveEnemies => true; [SyncMethod] public virtual Pawn FindVictim(Pawn rapist, Map m) { if (RJWSettings.DebugRape) ModLog.Message($"{this.GetType().ToString()}::TryGiveJob({xxx.get_pawnname(rapist)}) map {m?.ToString()}"); if (rapist == null || m == null) return null; if (RJWSettings.DebugRape) ModLog.Message($" can rape = {xxx.can_rape(rapist)}"); if (requireCanRape && !xxx.can_rape(rapist)) return null; List<Pawn> validTargets = new List<Pawn>(); float min_fuckability = 0.10f; // Don't rape pawns with <10% fuckability float avg_fuckability = 0f; // Average targets fuckability, choose target higher than that var valid_targets = new Dictionary<Pawn, float>(); // Valid pawns and their fuckability Pawn chosentarget = null; // Final target pawn IEnumerable<Pawn> targets = m.mapPawns.AllPawnsSpawned.Where(x => !x.IsForbidden(rapist) && x != rapist && x.HostileTo(rapist) && IsValidTarget(rapist, x)) .ToList(); if (RJWSettings.DebugRape) ModLog.Message($" targets {targets.Count()}"); if (targets.Any(x => IsBlocking(rapist, x))) //If any of the targets is not downed and visible - don't proceed with rape (you have more pressing things to do). { //This is a bit whacky bearing in mind target selection. For example vulnerable pawns will block, but non-vulnearable will not return null; } foreach (var target in targets) { if (!xxx.cells_to_target_rape(rapist, target.Position)) { //if (RJWSettings.DebugRape) ModLog.Message($" {xxx.get_pawnname(target)} too far (cells) = {rapist.Position.DistanceToSquared(target.Position)}, skipping"); if (RJWSettings.DebugRape) ModLog.Message($" {xxx.get_pawnname(target)} too far (cells) = {rapist.Position.DistanceTo(target.Position)}, skipping"); continue;// too far } float fuc = GetFuckability(rapist, target); if (fuc > min_fuckability) { if (xxx.can_path_to_target(rapist, target.Position)) valid_targets.Add(target, fuc); else if (RJWSettings.DebugRape) ModLog.Message($" {xxx.get_pawnname(target)} too far (path), skipping"); } else if (RJWSettings.DebugRape) ModLog.Message($" {xxx.get_pawnname(target)} fuckability too low = {fuc}, skipping"); } if (RJWSettings.DebugRape) ModLog.Message($" fuckable targets {valid_targets.Count()}"); if (valid_targets.Any()) { avg_fuckability = valid_targets.Average(x => x.Value); if (RJWSettings.DebugRape) ModLog.Message($" avg_fuckability {avg_fuckability}"); // choose pawns to fuck with above average fuckability var valid_targetsFiltered = valid_targets.Where(x => x.Value >= avg_fuckability); if (RJWSettings.DebugRape) ModLog.Message($" targets above avg_fuckability {valid_targetsFiltered.Count()}"); if (valid_targetsFiltered.Any()) chosentarget = valid_targetsFiltered.RandomElement().Key; } return chosentarget; } bool IsBlocking(Pawn rapist, Pawn target) { return considerStillAliveEnemies && !target.Downed && rapist.CanSee(target); } bool IsValidTarget(Pawn rapist, Pawn target) { if (!RJWSettings.bestiality_enabled) { if (xxx.is_animal(target) && xxx.is_human(rapist)) { //bestiality disabled, skip. return false; } if (xxx.is_animal(rapist) && xxx.is_human(target)) { //bestiality disabled, skip. return false; } } if (!RJWSettings.animal_on_animal_enabled) if ((xxx.is_animal(target) && xxx.is_animal(rapist))) { //animal_on_animal disabled, skip. return false; } if ((xxx.is_mechanoid(rapist) && xxx.is_animal(target)) || (xxx.is_animal(rapist) && xxx.is_mechanoid(target))) return false; //no Mech on Animal action, ref JobDriver_RapeEnemyByMech::GetFuckability() if (target.CurJob?.def == xxx.gettin_raped || target.CurJob?.def == xxx.gettin_loved) { //already having sex with someone, skip, give chance to other victims. return false; } return Can_rape_Easily(target) && (xxx.is_human(target) || xxx.is_animal(target)) && rapist.CanReserveAndReach(target, PathEndMode.OnCell, Danger.Some, xxx.max_rapists_per_prisoner, 0); } public virtual float GetFuckability(Pawn rapist, Pawn target) { float fuckability = 0; if (target.health.hediffSet.HasHediff(xxx.submitting)) // it's not about attractiveness anymore, it's about showing who's whos bitch { fuckability = 2 * SexAppraiser.would_fuck(rapist, target, invert_opinion: true, ignore_bleeding: true, ignore_gender: true); } else if (SexAppraiser.would_rape(rapist, target)) { fuckability = SexAppraiser.would_fuck(rapist, target, invert_opinion: true, ignore_bleeding: true, ignore_gender: true); } if (RJWSettings.DebugRape) ModLog.Message($"JobDriver_RapeEnemy::GetFuckability({xxx.get_pawnname(rapist)}, {xxx.get_pawnname(target)})"); return fuckability; } protected bool Can_rape_Easily(Pawn pawn) { return xxx.can_get_raped(pawn) && !pawn.IsBurning(); } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeEnemy.cs
C#
mit
6,800
using RimWorld; using Verse; namespace rjw { internal class JobDriver_RapeEnemyByAnimal : JobDriver_RapeEnemy { public override bool CanUseThisJobForPawn(Pawn rapist) { if (rapist.CurJob != null && (rapist.CurJob.def != JobDefOf.LayDown || rapist.CurJob.def != JobDefOf.Wait_Wander || rapist.CurJob.def != JobDefOf.GotoWander)) return false; return xxx.is_animal(rapist) && !xxx.is_insect(rapist); } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeEnemyByAnimal.cs
C#
mit
424
using RimWorld; using Verse; namespace rjw { internal class JobDriver_RapeEnemyByHumanlike : JobDriver_RapeEnemy { public override bool CanUseThisJobForPawn(Pawn rapist) { if (rapist.CurJob != null && (rapist.CurJob.def != JobDefOf.LayDown || rapist.CurJob.def != JobDefOf.Wait_Wander || rapist.CurJob.def != JobDefOf.GotoWander)) return false; return xxx.is_human(rapist); } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeEnemyByHumanlike.cs
C#
mit
400
using System.Linq; using RimWorld; using Verse; namespace rjw { internal class JobDriver_RapeEnemyByInsect : JobDriver_RapeEnemy { public override bool CanUseThisJobForPawn(Pawn rapist) { if (rapist.CurJob != null && (rapist.CurJob.def != JobDefOf.LayDown || rapist.CurJob.def != JobDefOf.Wait_Wander || rapist.CurJob.def != JobDefOf.GotoWander)) return false; return xxx.is_insect(rapist); } public override float GetFuckability(Pawn rapist, Pawn target) { //Female plant Eggs to everyone. //if (rapist.gender == Gender.Female) //Genital_Helper.has_ovipositorF(rapist); //{ // //only rape when target dont have eggs yet // //if ((from x in target.health.hediffSet.GetHediffs<Hediff_InsectEgg>() where (x.IsParent(rapist)) select x).Count() > 0) // { // return 1f; // } //} ////Male rape to everyone. ////Feritlize eggs to target with planted eggs. //else //Genital_Helper.has_ovipositorM(rapist); //{ // //only rape target when can fertilize // //if ((from x in target.health.hediffSet.GetHediffs<Hediff_InsectEgg>() where (x.IsParent(rapist) && !x.fertilized) select x).Count() > 0) // if ((from x in target.health.hediffSet.GetHediffs<Hediff_InsectEgg>() where x.IsParent(rapist) select x).Count() > 0) // { // return 1f; // } //} return 1f; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeEnemyByInsect.cs
C#
mit
1,343
using RimWorld; using Verse; namespace rjw { internal class JobDriver_RapeEnemyByMech : JobDriver_RapeEnemy { public override bool CanUseThisJobForPawn(Pawn rapist) { if (rapist.CurJob != null && (rapist.CurJob.def != JobDefOf.LayDown || rapist.CurJob.def != JobDefOf.Wait_Wander || rapist.CurJob.def != JobDefOf.GotoWander)) return false; return xxx.is_mechanoid(rapist); } public override float GetFuckability(Pawn rapist, Pawn target) { //Plant stuff into humanlikes. if (xxx.is_human(target)) return 1f; else return 0f; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeEnemyByMech.cs
C#
mit
578
using RimWorld; using Verse; namespace rjw { internal class JobDriver_RapeEnemyToParasite : JobDriver_RapeEnemy { //not implemented public JobDriver_RapeEnemyToParasite() { this.requireCanRape = false; } public override bool CanUseThisJobForPawn(Pawn rapist) { if (rapist.CurJob != null && (rapist.CurJob.def != JobDefOf.LayDown || rapist.CurJob.def != JobDefOf.Wait_Wander || rapist.CurJob.def != JobDefOf.GotoWander)) return false; return false; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeEnemyToParasite.cs
C#
mit
489
using System; using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; using Verse.Sound; namespace rjw { public class JobDriver_RandomRape : JobDriver_Rape { //Add some stuff. planning became bersek when failed to rape. } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_RapeRandom.cs
C#
mit
256
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; using Verse.Sound; using Multiplayer.API; using System.Linq; namespace rjw { public abstract class JobDriver_Sex : JobDriver { public readonly TargetIndex iTarget = TargetIndex.A; //pawn or corpse public readonly TargetIndex iBed = TargetIndex.B; //bed(maybe some furniture in future?) public readonly TargetIndex iCell = TargetIndex.C; //cell/location to have sex at(fapping) public float satisfaction = 1.0f; public bool shouldreserve = true; public int stackCount = 0; public int ticks_between_hearts = 60; public int ticks_between_hits = 60; public int ticks_between_thrusts = 60; public int ticks_left = 1000; //toil ticks public int sex_ticks = 1000; //orgasm ticks public int orgasms = 0; public int orgasmstick = 180; // ~3 sec public int duration = 5000; public bool usedCondom = false; public bool isRape = false; public bool isWhoring = false; public bool face2face = false; public bool isEndytophile = false; public bool isAnimalOnAnimal = false; public bool shouldGainFocus = false; public bool shouldGainFocusP = false; public bool isSuccubus = false; public bool isSuccubusP = false; //toggles public bool beatings = false; public bool beatonce = false; public bool neverendingsex = false; public Thing Target // for reservation { get { return (Thing)job.GetTarget(TargetIndex.A); } } public Pawn Partner { get { if (Target is Pawn) return (Pawn)job.GetTarget(TargetIndex.A); else if (Target is Corpse) return ((Corpse)job.GetTarget(TargetIndex.A)).InnerPawn; else return null; } } public Building_Bed Bed { get { if (pBed != null) return pBed; else if ((Thing)job.GetTarget(TargetIndex.B) is Building_Bed) return (Building_Bed)job.GetTarget(TargetIndex.B); else return null; } } //not bed; chair, maybe something else in future public Building Building { get { if ((Thing)job.GetTarget(TargetIndex.B) is Building && !((Thing)job.GetTarget(TargetIndex.B) is Building_Bed)) return (Building)job.GetTarget(TargetIndex.B); else return null; } } public Building_Bed pBed = null; public SexProps Sexprops = null; public xxx.rjwSextype sexType = xxx.rjwSextype.None; [SyncMethod] public void setup_ticks() { ticks_left = (int)(2000.0f * Rand.Range(0.50f, 0.90f)); ticks_between_hearts = Rand.RangeInclusive(70, 130); ticks_between_hits = Rand.Range(xxx.config.min_ticks_between_hits, xxx.config.max_ticks_between_hits); if (xxx.is_bloodlust(pawn)) ticks_between_hits = (int)(ticks_between_hits * 0.75); if (xxx.is_brawler(pawn)) ticks_between_hits = (int)(ticks_between_hits * 0.90); ticks_between_thrusts = 120; duration = ticks_left; sex_ticks = Roll_Orgasm_Duration_Reset(); //if (isRape && orgasms < 1 && ticks_left < sex_ticks && pawn.jobs?.curDriver is JobDriver_SexBaseInitiator) // ticks_left += duration / 3; } public void Set_bed(Building_Bed newBed) { pBed = newBed; } public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref ticks_left, "ticks_left", 0, false); Scribe_Values.Look(ref ticks_between_hearts, "ticks_between_hearts", 0, false); Scribe_Values.Look(ref ticks_between_hits, "ticks_between_hits", 0, false); Scribe_Values.Look(ref ticks_between_thrusts, "ticks_between_thrusts", 0, false); Scribe_Values.Look(ref duration, "duration", 0, false); Scribe_Values.Look(ref sex_ticks, "sex_ticks", 0, false); Scribe_Values.Look(ref orgasms, "orgasms", 0, false); Scribe_Values.Look(ref orgasmstick, "orgasmstick", 0, false); Scribe_References.Look(ref pBed, "pBed"); //Scribe_Values.Look(ref Sexprops, "Sexprops"); ??? TODO:fix me ! Scribe_Values.Look(ref usedCondom, "usedCondom"); Scribe_Values.Look(ref isRape, "isRape"); Scribe_Values.Look(ref beatings, "beatings"); Scribe_Values.Look(ref beatonce, "beatonce"); Scribe_Values.Look(ref neverendingsex, "neverendingsex"); Scribe_Values.Look(ref isWhoring, "isWhoring"); Scribe_Values.Look(ref sexType, "sexType"); Scribe_Values.Look(ref face2face, "face2face"); Scribe_Values.Look(ref isEndytophile, "isEndytophile"); Scribe_Values.Look(ref shouldGainFocus, "shouldGainFocus"); Scribe_Values.Look(ref shouldGainFocusP, "shouldGainFocusP"); Scribe_Values.Look(ref isSuccubus, "isSuccubus"); Scribe_Values.Look(ref isSuccubusP, "isSuccubusP"); } public void SexTick(Pawn pawn, Thing target, bool pawnnude = true, bool partnernude = true) { ticks_left--; sex_ticks--; Orgasm(); var partner = target as Pawn; if (partner?.jobs?.curDriver is JobDriver_SexBaseReciever)//tick partner { ((JobDriver_SexBaseReciever)partner.jobs.curDriver as JobDriver_SexBaseReciever).ticks_left--; ((JobDriver_SexBaseReciever)partner.jobs.curDriver as JobDriver_SexBaseReciever).sex_ticks--; ((JobDriver_SexBaseReciever)partner.jobs.curDriver as JobDriver_SexBaseReciever).Orgasm(); } if (partner != null) if (pawn.jobs?.curDriver is JobDriver_SexBaseInitiator) { var hit = false; if (beatonce) { beatonce = false; SexUtility.Sex_Beatings_Dohit(pawn, Partner, isRape); } else if (pawn.IsHashIntervalTick(ticks_between_hits)) { Roll_to_hit(pawn, Partner); } if (hit) if (!isEndytophile) { SexUtility.DrawNude(pawn); if (partner != null) SexUtility.DrawNude(partner); } } if (pawn.IsHashIntervalTick(ticks_between_thrusts)) { ChangePsyfocus(pawn, partner); Animate(pawn, partner); PlaySexSound(); if (!isRape) { pawn.GainComfortFromCellIfPossible(); if (partner != null) partner.GainComfortFromCellIfPossible(); } } } /// <summary> /// simple rjw thrust animation /// </summary> public void Animate(Pawn pawn, Thing target) { RotatePawns(pawn, Partner); //attack/ride 1x2 cell cocksleeve/dildo? //if (Building != null) // target = Building; if (target != null) { pawn.Drawer.Notify_MeleeAttackOn(target); var partner = target as Pawn; if (partner != null && !isRape) partner.Drawer.Notify_MeleeAttackOn(pawn); //refresh DrawNude after beating and Notify_MeleeAttackOn // Endytophiles prefer clothed sex, everyone else gets nude. if (!isEndytophile) { SexUtility.DrawNude(pawn); if (partner != null) SexUtility.DrawNude(partner); } } else { //refresh DrawNude after beating and Notify_MeleeAttackOn // Endytophiles prefer clothed sex, everyone else gets nude. if (!isEndytophile) { SexUtility.DrawNude(pawn); } } } /// <summary> /// increase Psyfocus by having sex /// </summary> public void ChangePsyfocus(Pawn pawn, Thing target) { if (ModsConfig.RoyaltyActive) { if (pawn.jobs?.curDriver is JobDriver_ViolateCorpse) if (xxx.is_necrophiliac(pawn) && MeditationFocusTypeAvailabilityCache.PawnCanUse(pawn, DefDatabase<MeditationFocusDef>.GetNamedSilentFail("Morbid"))) { SexUtility.OffsetPsyfocus(pawn, 0.01f); } if (target != null) { var partner = target as Pawn; if (partner != null) { if (shouldGainFocus) SexUtility.OffsetPsyfocus(pawn, 0.01f); if (shouldGainFocusP) SexUtility.OffsetPsyfocus(partner, 0.01f); if (isSuccubus) SexUtility.OffsetPsyfocus(pawn, 0.01f); if (isSuccubusP) SexUtility.OffsetPsyfocus(partner, 0.01f); } } } } /// <summary> /// rotate pawns /// </summary> public void RotatePawns(Pawn pawn, Thing target) { if (Building != null) { if (face2face) pawn.Rotation = Building.Rotation.Opposite; else pawn.Rotation = Building.Rotation; return; } if (target == null) // solo { //pawn.Rotation = Rot4.South; return; } var partner = target as Pawn; if (partner == null || partner.Dead) // necro { pawn.rotationTracker.Face(target.DrawPos); return; } if (partner.jobs?.curDriver is JobDriver_SexBaseReciever) if (((JobDriver_SexBaseReciever)partner.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Count > 1) return; //maybe could do a hand check for monster girls but w/e //bool partnerHasHands = Receiver.health.hediffSet.GetNotMissingParts().Any(part => part.IsInGroup(BodyPartGroupDefOf.RightHand) || part.IsInGroup(BodyPartGroupDefOf.LeftHand)); // most of animal sex is likely doggystyle. if (isAnimalOnAnimal) { if (sexType == xxx.rjwSextype.Anal || sexType == xxx.rjwSextype.Vaginal || sexType == xxx.rjwSextype.DoublePenetration) { //>> //Log.Message("animal doggy"); pawn.rotationTracker.Face(partner.DrawPos); partner.Rotation = pawn.Rotation; } else { //>< //Log.Message("animal non doggy"); pawn.rotationTracker.Face(target.DrawPos); partner.rotationTracker.Face(pawn.DrawPos); } } else { if (this is JobDriver_BestialityForFemale) { if (sexType == xxx.rjwSextype.Anal || sexType == xxx.rjwSextype.Vaginal || sexType == xxx.rjwSextype.DoublePenetration) { //<< //Log.Message("bestialityFF doggy"); partner.rotationTracker.Face(pawn.DrawPos); pawn.Rotation = partner.Rotation; } else { //>< //Log.Message("bestialityFF non doggy"); pawn.rotationTracker.Face(target.DrawPos); partner.rotationTracker.Face(pawn.DrawPos); } } else if (partner.GetPosture() == PawnPosture.LayingInBed) { //x^ //Log.Message("loving/casualsex in bed"); // this could use better handling for cowgirl/reverse cowgirl and who pen who, if such would be implemented //until then... if (!face2face && sexType == xxx.rjwSextype.Anal || sexType == xxx.rjwSextype.Vaginal || sexType == xxx.rjwSextype.DoublePenetration || sexType == xxx.rjwSextype.Fisting) //if (xxx.is_female(pawn) && xxx.is_female(partner)) { // in bed loving face down pawn.Rotation = partner.CurrentBed().Rotation.Opposite; } //else if (!(xxx.is_male(pawn) && xxx.is_male(partner))) //{ // // in bed loving face down // pawn.Rotation = partner.CurrentBed().Rotation.Opposite; //} else { // in bed loving, face up pawn.Rotation = partner.CurrentBed().Rotation; } } // 30% chance of face-to-face regardless, for variety. else if (!face2face && (sexType == xxx.rjwSextype.Anal || sexType == xxx.rjwSextype.Vaginal || sexType == xxx.rjwSextype.DoublePenetration || sexType == xxx.rjwSextype.Fisting)) { //>> //Log.Message("doggy"); pawn.rotationTracker.Face(target.DrawPos); partner.Rotation = pawn.Rotation; } // non doggystyle, or face-to-face regardless else { //>< //Log.Message("non doggy"); pawn.rotationTracker.Face(target.DrawPos); partner.rotationTracker.Face(pawn.DrawPos); } } } [SyncMethod] public void Rollface2face(float chance = 0.3f) { Setface2face(Rand.Chance(chance)); } public void Setface2face(bool chance) { face2face = chance; } public void Roll_to_hit(Pawn Pawn, Pawn Partner) { if (beatings || (isRape && RJWSettings.rape_beating)) SexUtility.Sex_Beatings(Pawn, Partner, isRape); } public void ThrowMetaIcon(IntVec3 pos, Map map, ThingDef icon) { MoteMaker.ThrowMetaIcon(pos, map, icon); } public void PlaySexSound() { if (RJWSettings.sounds_enabled) { SoundInfo sound = new TargetInfo(pawn.Position, pawn.Map); sound.volumeFactor = RJWSettings.sounds_sex_volume; if(isAnimalOnAnimal) sound.volumeFactor *= RJWSettings.sounds_animal_on_animal_volume; SoundDef.Named("Sex").PlayOneShot(sound); } } public void PlayCumSound() { if (RJWSettings.sounds_enabled) { SoundInfo sound = new TargetInfo(pawn.Position, pawn.Map); sound.volumeFactor = RJWSettings.sounds_cum_volume; if (isAnimalOnAnimal) sound.volumeFactor *= RJWSettings.sounds_animal_on_animal_volume; SoundDef.Named("Cum").PlayOneShot(sound); } } public void PlaySexVoice() { //if (RJWSettings.sounds_enabled) //{ // SoundInfo sound = new TargetInfo(pawn.Position, pawn.Map); // sound.volumeFactor = RJWSettings.sounds_voice_volume; //if (isAnimalOnAnimal) // sound.volumeFactor *= RJWSettings.sounds_animal_on_animal_volume; // SoundDef.Named("Sex").PlayOneShot(sound); //} } public void PlayOrgasmVoice() { //if (RJWSettings.sounds_enabled) //{ // SoundInfo sound = new TargetInfo(pawn.Position, pawn.Map); // sound.volumeFactor = RJWSettings.sounds_orgasm_volume; //if (isAnimalOnAnimal) // sound.volumeFactor *= RJWSettings.sounds_animal_on_animal_volume; // SoundDef.Named("Orgasm").PlayOneShot(sound); //} } public void Orgasm() { if (sex_ticks > orgasmstick) //~3s at speed 1 { return; } orgasms++; PlayCumSound(); PlayOrgasmVoice(); CalculateSatisfactionPerTick(); if (pawn.jobs?.curDriver is JobDriver_SexBaseInitiator) SexUtility.SatisfyPersonal(pawn, Partner, sexType, isRape, true, satisfaction); else if (pawn.jobs?.curDriver is JobDriver_SexBaseRecieverRaped) SexUtility.SatisfyPersonal(pawn, ((JobDriver_SexBaseReciever)pawn.jobs?.curDriver).parteners.FirstOrFallback(), sexType, true, false, satisfaction); else SexUtility.SatisfyPersonal(pawn, ((JobDriver_SexBaseReciever)pawn.jobs?.curDriver).parteners.FirstOrFallback(), sexType, false, false, satisfaction); if (RJWSettings.DevMode) Log.Message(xxx.get_pawnname(pawn) + " Orgasmed"); sex_ticks = Roll_Orgasm_Duration_Reset(); if (neverendingsex) ticks_left = duration; } [SyncMethod] public int Roll_Orgasm_Duration_Reset() { var need = 1.0f + xxx.need_some_sex(pawn); //1-4 if (!xxx.is_human(pawn)) need = 1.0f; return (int)(duration / need * Rand.Range(0.75f, 0.90f)); //return (int)(duration * Rand.Range(0.50f, 1.0f)); } public void CalculateSatisfactionPerTick() { satisfaction = 0.4f; } public static bool IsInOrByBed(Building_Bed b, Pawn p) { for (int i = 0; i < b.SleepingSlotsCount; i++) { if (b.GetSleepingSlotPos(i).InHorDistOf(p.Position, 1f)) { return true; } } return false; } public override bool TryMakePreToilReservations(bool errorOnFailed) { return true; // No reservations needed. } protected override IEnumerable<Toil> MakeNewToils() { return null; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_Sex.cs
C#
mit
14,839
using RimWorld; using System.Linq; using Verse; using Verse.AI; namespace rjw { public abstract class JobDriver_SexBaseInitiator : JobDriver_Sex { public void Start() { if (Partner == null) //TODO: solo sex descriptions { isEndytophile = xxx.has_quirk(pawn, "Endytophile"); //Sexprops = SexUtility.SelectSextype(pawn, Partner, isRape, isWhoring, Partner); //sexType = Sexprops.SexType; //SexUtility.LogSextype(Sexprops.Giver, Sexprops.Reciever, Sexprops.RulePack, Sexprops.DictionaryKey); } else if (Partner.Dead) { isRape = true; isEndytophile = xxx.has_quirk(pawn, "Endytophile"); isAnimalOnAnimal = xxx.is_animal(pawn) && xxx.is_animal(Partner); if (Sexprops == null) Sexprops = SexUtility.SelectSextype(pawn, Partner, isRape, isWhoring, Partner); sexType = Sexprops.SexType; SexUtility.LogSextype(Sexprops.Giver, Sexprops.Reciever, Sexprops.RulePack, Sexprops.DictionaryKey); } else if (Partner.jobs?.curDriver is JobDriver_SexBaseReciever) { (Partner.jobs.curDriver as JobDriver_SexBaseReciever).parteners.AddDistinct(pawn); //prevent downed Receiver standing up and interrupting rape if (Partner.health.hediffSet.HasHediff(xxx.submitting)) Partner.health.AddHediff(xxx.submitting); //(Target.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Count; //TODO: add multipartner support so sex doesn't repeat, maybe, someday isRape = Partner?.CurJob.def == xxx.gettin_raped; isWhoring = pawn?.CurJob.def == xxx.whore_is_serving_visitors; isEndytophile = xxx.has_quirk(pawn, "Endytophile"); isAnimalOnAnimal = xxx.is_animal(pawn) && xxx.is_animal(Partner); //non succubus focus gain if (xxx.is_nympho(pawn)) { shouldGainFocus = true; SexUtility.OffsetPsyfocus(pawn, 0.01f); } else if (xxx.is_zoophile(pawn) && xxx.is_animal(Partner) && MeditationFocusTypeAvailabilityCache.PawnCanUse(pawn, MeditationFocusDefOf.Natural)) { shouldGainFocus = true; } if (xxx.is_nympho(Partner)) { shouldGainFocusP = true; } else if (xxx.is_zoophile(Partner) && xxx.is_animal(pawn) && MeditationFocusTypeAvailabilityCache.PawnCanUse(Partner, MeditationFocusDefOf.Natural)) { shouldGainFocusP = true; } //succubus focus gain if (xxx.RoMIsActive) { if (xxx.has_traits(pawn)) if (pawn.story.traits.HasTrait(xxx.Succubus)) { isSuccubus = true; } if (xxx.has_traits(Partner)) if (Partner.story.traits.HasTrait(xxx.Succubus)) { isSuccubusP = true; } } if (xxx.NightmareIncarnationIsActive) { if (xxx.has_traits(pawn)) foreach (var x in pawn.AllComps?.Where(x => x?.props?.ToStringSafe() == "NightmareIncarnation.CompProperties_SuccubusRace")) { isSuccubus = true; break; } if (xxx.has_traits(Partner)) foreach (var x in Partner.AllComps?.Where(x => x?.props?.ToStringSafe() == "NightmareIncarnation.CompProperties_SuccubusRace")) { isSuccubusP = true; break; } } if (Sexprops == null) Sexprops = SexUtility.SelectSextype(pawn, Partner, isRape, isWhoring, Partner); sexType = Sexprops.SexType; SexUtility.LogSextype(Sexprops.Giver, Sexprops.Reciever, Sexprops.RulePack, Sexprops.DictionaryKey); } //Log.Message("sexType: " + sexType.ToString()); //props = new SexProps(pawn, Partener, sexType, isRape);//maybe merge everything into this ? } //public void Change(xxx.rjwSextype sexType) //{ // if (pawn.jobs?.curDriver is JobDriver_SexBaseInitiator) // { // (pawn.jobs.curDriver as JobDriver_SexBaseInitiator).increase_time(duration); // Sexprops = SexUtility.SelectSextype(pawn, Partner, isRape, isWhoring, Partner); // sexType = Sexprops.SexType; // SexUtility.LogSextype(Sexprops.Giver, Sexprops.Reciever, Sexprops.RulePack, Sexprops.DictionaryKey); // } // if (Partner.jobs?.curDriver is JobDriver_SexBaseReciever) // { // (Partner.jobs.curDriver as JobDriver_SexBaseReciever).increase_time(duration); // Sexprops = SexUtility.SelectSextype(pawn, Partner, isRape, isWhoring, Partner); // sexType = Sexprops.SexType; // SexUtility.LogSextype(Sexprops.Giver, Sexprops.Reciever, Sexprops.RulePack, Sexprops.DictionaryKey); // } // sexType = sexType //} public void End() { if (xxx.is_human(pawn)) pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); if (Partner?.jobs?.curDriver is JobDriver_SexBaseReciever) { (Partner?.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Remove(pawn); } } public override bool TryMakePreToilReservations(bool errorOnFailed) { //ModLog.Message("shouldreserve " + shouldreserve); if (shouldreserve && Target != null) return pawn.Reserve(Target, job, xxx.max_rapists_per_prisoner, stackCount, null, errorOnFailed); else if (shouldreserve && Bed != null) return pawn.Reserve(Bed, job, Bed.SleepingSlotsCount, 0, null, errorOnFailed); else return true; // No reservations needed. //return this.pawn.Reserve(this.Partner, this.job, 1, 0, null) && this.pawn.Reserve(this.Bed, this.job, 1, 0, null); } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_SexBaseInitiator.cs
C#
mit
5,214
using System.Collections.Generic; using Verse; namespace rjw { public class JobDriver_SexBaseReciever : JobDriver_Sex { //give this poor driver some love other than (Partner.jobs?.curDriver is JobDriver_SexBaseReciever) public List<Pawn> parteners = new List<Pawn>(); public override void ExposeData() { base.ExposeData(); Scribe_Collections.Look(ref parteners, "parteners", LookMode.Reference); } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_SexBaseReciever.cs
C#
mit
422
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; using System; namespace rjw { public class JobDriver_SexBaseRecieverLoved : JobDriver_SexBaseReciever { protected override IEnumerable<Toil> MakeNewToils() { setup_ticks(); parteners.Add(Partner);// add job starter, so this wont fail, before Initiator starts his job //--ModLog.Message("JobDriver_GettinLoved::MakeNewToils is called"); //ModLog.Message("" + Partner.CurJob.def); // More/less hearts based on opinion. if (pawn.relations.OpinionOf(Partner) < 0) ticks_between_hearts += 50; else if (pawn.relations.OpinionOf(Partner) > 60) ticks_between_hearts -= 25; this.FailOnDespawnedOrNull(iTarget); this.FailOn(() => !Partner.health.capacities.CanBeAwake); this.FailOn(() => pawn.Drafted); this.FailOn(() => Partner.Drafted); if (Partner.CurJob.def == xxx.casual_sex) // sex in bed { this.KeepLyingDown(iBed); yield return Toils_Reserve.Reserve(iTarget, 1, 0); yield return Toils_Reserve.Reserve(iBed, Bed.SleepingSlotsCount, 0); var get_loved = MakeSexToil(); get_loved.FailOn(() => Partner.CurJob.def != xxx.casual_sex); yield return get_loved; } else if (Partner.CurJob.def == xxx.quick_sex) { yield return Toils_Reserve.Reserve(iTarget, 1, 0); var get_loved = MakeSexToil(); get_loved.handlingFacing = false; yield return get_loved; } else if (Partner.CurJob.def == xxx.whore_is_serving_visitors) { this.FailOn(() => Partner.CurJob == null); yield return Toils_Reserve.Reserve(iTarget, 1, 0); var get_loved = MakeSexToil(); get_loved.FailOn(() => (Partner.CurJob.def != xxx.whore_is_serving_visitors)); yield return get_loved; } else if (Partner.CurJob.def == xxx.bestialityForFemale) { this.FailOn(() => Partner.CurJob == null); yield return Toils_Reserve.Reserve(iTarget, 1, 0); var get_loved = MakeSexToil(); get_loved.FailOn(() => (Partner.CurJob.def != xxx.bestialityForFemale)); yield return get_loved; } else if (Partner.CurJob.def == xxx.animalMate) { this.FailOn(() => Partner.CurJob == null); yield return Toils_Reserve.Reserve(iTarget, 1, 0); var get_loved = MakeSexToil(); get_loved.FailOn(() => (Partner.CurJob.def != xxx.animalMate)); yield return get_loved; } } private Toil MakeSexToil() { Toil get_loved = new Toil(); if (Partner.CurJob.def == xxx.casual_sex) // sex in bed get_loved = Toils_LayDown.LayDown(iBed, true, false, false, false); get_loved.defaultCompleteMode = ToilCompleteMode.Never; get_loved.socialMode = RandomSocialMode.Off; get_loved.handlingFacing = true; //get_loved.initAction = delegate //{ //}; get_loved.tickAction = delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); }; get_loved.AddEndCondition(new Func<JobCondition>(() => { if (parteners.Count <= 0) { return JobCondition.Succeeded; } return JobCondition.Ongoing; })); get_loved.AddFinishAction(delegate { if (xxx.is_human(pawn)) pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); }); get_loved.socialMode = RandomSocialMode.Off; return get_loved; } } public class JobDriver_SexBaseRecieverQuickie : JobDriver_SexBaseRecieverLoved { } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_SexBaseRecieverLoved.cs
C#
mit
3,411
using System; using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; namespace rjw { public class JobDriver_SexBaseRecieverRaped : JobDriver_SexBaseReciever { protected override IEnumerable<Toil> MakeNewToils() { setup_ticks(); parteners.Add(Partner);// add job starter, so this wont fail, before Initiator starts his job var get_raped = new Toil(); get_raped.defaultCompleteMode = ToilCompleteMode.Never; get_raped.handlingFacing = true; get_raped.initAction = delegate { pawn.pather.StopDead(); pawn.jobs.curDriver.asleep = false; SexUtility.BeeingRapedAlert(Partner, pawn); }; get_raped.tickAction = delegate { if ((parteners.Count > 0) && (pawn.IsHashIntervalTick(ticks_between_hearts / parteners.Count))) if (pawn.IsHashIntervalTick(ticks_between_hearts)) if (xxx.is_masochist(pawn)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); else ThrowMetaIcon(pawn.Position, pawn.Map, xxx.mote_noheart); }; get_raped.AddEndCondition(new Func<JobCondition>(() => { if (parteners.Count <= 0) { return JobCondition.Succeeded; } return JobCondition.Ongoing; })); get_raped.AddFinishAction(delegate { if (xxx.is_human(pawn)) pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); if (Bed != null && pawn.Downed) { Job tobed = JobMaker.MakeJob(JobDefOf.Rescue, pawn, Bed); tobed.count = 1; Partner.jobs.jobQueue.EnqueueFirst(tobed); //Log.Message(xxx.get_pawnname(Initiator) + ": job tobed:" + tobed); } else if (pawn.HostileTo(Partner)) pawn.health.AddHediff(xxx.submitting); else if (RJWSettings.rape_beating) pawn.stances.stunner.StunFor(600, pawn); }); get_raped.socialMode = RandomSocialMode.Off; yield return get_raped; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_SexBaseRecieverRaped.cs
C#
mit
1,859
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; namespace rjw { public class JobDriver_JoinInBed : JobDriver_SexBaseInitiator { public override bool TryMakePreToilReservations(bool errorOnFailed) { return pawn.Reserve(Target, job, xxx.max_rapists_per_prisoner, 0, null, errorOnFailed); } protected override IEnumerable<Toil> MakeNewToils() { //ModLog.Message("" + this.GetType().ToString() + "::MakeNewToils() called"); setup_ticks(); this.FailOnDespawnedOrNull(iTarget); this.FailOnDespawnedOrNull(iBed); this.FailOn(() => !Partner.health.capacities.CanBeAwake); this.FailOn(() => !(Partner.InBed() || xxx.in_same_bed(Partner, pawn))); this.FailOn(() => pawn.Drafted); yield return Toils_Reserve.Reserve(iTarget, xxx.max_rapists_per_prisoner, 0); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); Toil StartPartnerJob = new Toil(); StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.initAction = delegate { Job gettin_loved = JobMaker.MakeJob(xxx.gettin_loved, pawn, Bed); Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced); }; yield return StartPartnerJob; Toil SexToil = new Toil(); SexToil.FailOn(() => Partner.CurJob.def != xxx.gettin_loved); SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.socialMode = RandomSocialMode.Off; SexToil.handlingFacing = true; SexToil.initAction = delegate { usedCondom = CondomUtility.TryUseCondom(pawn) || CondomUtility.TryUseCondom(Partner); Start(); }; SexToil.AddPreTickAction(delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); SexTick(pawn, Partner); SexUtility.reduce_rest(Partner, 1); SexUtility.reduce_rest(pawn, 2); if (ticks_left <= 0) ReadyForNextToil(); }); SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { // Trying to add some interactions and social logs SexUtility.ProcessSex(pawn, Partner, usedCondom: usedCondom, rape: isRape, whoring: isWhoring, sextype: sexType); }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_SexCasual.cs
C#
mit
2,377
using System; using System.Collections.Generic; using System.Linq; using Multiplayer.API; using RimWorld; using UnityEngine; using Verse; using Verse.AI; namespace rjw { public class JobDriver_SexQuick : JobDriver_SexBaseInitiator { public override bool TryMakePreToilReservations(bool errorOnFailed) { return pawn.Reserve(Target, job, xxx.max_rapists_per_prisoner, 0, null, errorOnFailed); } protected override IEnumerable<Toil> MakeNewToils() { //ModLog.Message("" + this.GetType().ToString() + "::MakeNewToils() called"); setup_ticks(); var PartnerJob = xxx.getting_quickie; this.FailOnDespawnedNullOrForbidden(iTarget); this.FailOn(() => !Partner.health.capacities.CanBeAwake); this.FailOn(() => pawn.Drafted); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); Toil findQuickieSpot = new Toil(); findQuickieSpot.defaultCompleteMode = ToilCompleteMode.PatherArrival; findQuickieSpot.initAction = delegate { //Needs this earlier to decide if current place is good enough var all_pawns = pawn.Map.mapPawns.AllPawnsSpawned.Where(x => x.Position.DistanceTo(pawn.Position) < 100 && xxx.is_human(x) && x != pawn && x != Partner ).ToList(); FloatRange temperature = pawn.ComfortableTemperatureRange(); float cellTemp = pawn.Position.GetTemperature(pawn.Map); if (Partner.IsPrisonerInPrisonCell() || (!CasualSex_Helper.MightBeSeen(all_pawns,pawn.Position,pawn,Partner) && (cellTemp > temperature.min && cellTemp < temperature.max))) { ReadyForNextToil(); } else { var spot = CasualSex_Helper.FindSexLocation(pawn, Partner); pawn.pather.StartPath(spot, PathEndMode.OnCell); Partner.jobs.StopAll(); //sometimes errors with stuff like vomiting Job job = JobMaker.MakeJob(JobDefOf.GotoMindControlled, spot); Partner.jobs.StartJob(job, JobCondition.InterruptForced); } }; yield return findQuickieSpot; Toil WaitForPartner = new Toil(); WaitForPartner.defaultCompleteMode = ToilCompleteMode.Delay; WaitForPartner.initAction = delegate { ticksLeftThisToil = 5000; }; WaitForPartner.tickAction = delegate { pawn.GainComfortFromCellIfPossible(); if (pawn.Position.DistanceTo(Partner.Position) <= 1f) { ReadyForNextToil(); } }; yield return WaitForPartner; Toil StartPartnerJob = new Toil(); StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; StartPartnerJob.socialMode = RandomSocialMode.Off; StartPartnerJob.initAction = delegate { Job gettingQuickie = JobMaker.MakeJob(PartnerJob, pawn, Partner); Partner.jobs.StartJob(gettingQuickie, JobCondition.InterruptForced); }; yield return StartPartnerJob; Toil SexToil = new Toil(); SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.socialMode = RandomSocialMode.Off; SexToil.defaultDuration = duration; SexToil.handlingFacing = true; SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.initAction = delegate { Partner.pather.StopDead(); Partner.jobs.curDriver.asleep = false; usedCondom = CondomUtility.TryUseCondom(pawn) || CondomUtility.TryUseCondom(Partner); Start(); }; SexToil.AddPreTickAction(delegate { if (pawn.IsHashIntervalTick(ticks_between_hearts)) ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); SexTick(pawn, Partner); SexUtility.reduce_rest(Partner, 1); SexUtility.reduce_rest(pawn, 1); if (ticks_left <= 0) ReadyForNextToil(); }); SexToil.AddFinishAction(delegate { End(); }); yield return SexToil; yield return new Toil { initAction = delegate { //// Trying to add some interactions and social logs SexUtility.ProcessSex(pawn, Partner, usedCondom: usedCondom, rape: isRape, sextype: sexType); }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/JobDrivers/JobDriver_SexQuick.cs
C#
mit
3,942
using System.Linq; using RimWorld; using Verse; using Verse.AI; using System.Collections.Generic; using Multiplayer.API; namespace rjw { //Rape to Prisoner of QuestPrisonerWillingToJoin class JobGiver_AIRapePrisoner : ThinkNode_JobGiver { [SyncMethod] public static Pawn find_victim(Pawn pawn, Map m) { float min_fuckability = 0.10f; // Don't rape pawns with <10% fuckability float avg_fuckability = 0f; // Average targets fuckability, choose target higher than that var valid_targets = new Dictionary<Pawn, float>(); // Valid pawns and their fuckability Pawn chosentarget = null; // Final target pawn IEnumerable<Pawn> targets = m.mapPawns.AllPawns.Where(x => x != pawn && IsPrisonerOf(x, pawn.Faction) && xxx.can_get_raped(x) && pawn.CanReserveAndReach(x, PathEndMode.Touch, Danger.Some, xxx.max_rapists_per_prisoner, 0) && !x.Position.IsForbidden(pawn) ); foreach (Pawn target in targets) { if (!xxx.cells_to_target_rape(pawn, target.Position)) continue;// too far float fuc = SexAppraiser.would_fuck(pawn, target, true, true); if (fuc > min_fuckability) if (xxx.can_path_to_target(pawn, target.Position)) valid_targets.Add(target, fuc); } if (valid_targets.Any()) { avg_fuckability = valid_targets.Average(x => x.Value); // choose pawns to fuck with above average fuckability var valid_targetsFiltered = valid_targets.Where(x => x.Value >= avg_fuckability); if (valid_targetsFiltered.Any()) chosentarget = valid_targetsFiltered.RandomElement().Key; } return chosentarget; } protected override Job TryGiveJob(Pawn pawn) { if (RJWSettings.DebugRape) ModLog.Message(" JobGiver_AIRapePrisoner::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) called "); if (!xxx.can_rape(pawn)) return null; if (SexUtility.ReadyForLovin(pawn) || xxx.is_hornyorfrustrated(pawn)) { // don't allow pawns marked as comfort prisoners to rape others if (xxx.is_healthy(pawn)) { Pawn prisoner = find_victim(pawn, pawn.Map); if (prisoner != null) { if (RJWSettings.DebugRape) ModLog.Message(" JobGiver_RandomRape::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) - found victim " + xxx.get_pawnname(prisoner)); return JobMaker.MakeJob(xxx.RapeRandom, prisoner); } } } return null; } protected static bool IsPrisonerOf(Pawn pawn,Faction faction) { if (pawn?.guest == null) return false; return pawn.guest.HostFaction == faction && pawn.guest.IsPrisoner; } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_AIRapePrisoner.cs
C#
mit
2,635
using RimWorld; using Verse; using Verse.AI; namespace rjw { /// <summary> /// Pawn tries to find animal to do loving/raping. /// </summary> public class JobGiver_Bestiality : ThinkNode_JobGiver { protected override Job TryGiveJob(Pawn pawn) { if (pawn.Drafted) return null; // Most checks are now done in ThinkNode_ConditionalBestiality if (!SexUtility.ReadyForLovin(pawn) && !xxx.is_frustrated(pawn)) return null; Pawn target = BreederHelper.find_breeder_animal(pawn, pawn.Map); if (target == null) return null; if (xxx.can_rape(pawn)) { return JobMaker.MakeJob(xxx.bestiality, target); } Building_Bed bed = pawn.ownership.OwnedBed; if (!xxx.can_be_fucked(pawn) || bed == null || !target.CanReach(bed, PathEndMode.OnCell, Danger.Some) || target.Downed) return null; // TODO: Should rename this to BestialityInBed or somesuch, since it's not limited to females. return JobMaker.MakeJob(xxx.bestialityForFemale, target, bed); } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_Bestiality.cs
C#
mit
1,000
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Attempts to give a breeding job to an eligible animal. /// </summary> public class JobGiver_Breed : ThinkNode_JobGiver { protected override Job TryGiveJob(Pawn animal) { //ModLog.Message(" JobGiver_Breed::TryGiveJob( " + xxx.get_pawnname(animal) + " ) ReadyForLovin " + (SexUtility.ReadyForLovin(animal))); if (!SexUtility.ReadyForLovin(animal)) return null; //ModLog.Message(" ready to breed::is_healthy " + xxx.is_healthy(animal) + " can_rape " + xxx.can_rape(animal)); if (xxx.is_healthy(animal) && xxx.can_rape(animal)) { //search for desiganted target to sex Pawn designated_target = BreederHelper.find_designated_breeder(animal, animal.Map); if (designated_target != null) { return JobMaker.MakeJob(xxx.animalBreed, designated_target); } } return null; } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_Breed.cs
C#
mit
892
using Verse; using Verse.AI; using RimWorld; using System.Collections.Generic; using System.Linq; using Multiplayer.API; namespace rjw { public class JobGiver_ComfortPrisonerRape : ThinkNode_JobGiver { [SyncMethod] public static Pawn find_targetCP(Pawn pawn, Map m) { if (!DesignatorsData.rjwComfort.Any()) return null; float min_fuckability = 0.10f; // Don't rape prisoners with <10% fuckability float avg_fuckability = 0f; // Average targets fuckability, choose target higher than that var valid_targets = new Dictionary<Pawn, float>(); // Valid pawns and their fuckability Pawn chosentarget = null; // Final target pawn string pawnName = xxx.get_pawnname(pawn); if (RJWSettings.DebugRape) ModLog.Message($"FindComfortPrisoner({pawnName})"); IEnumerable<Pawn> targets = DesignatorsData.rjwComfort.Where(x => x != pawn && xxx.can_get_raped(x) && pawn.CanReserveAndReach(x, PathEndMode.Touch, Danger.Some, xxx.max_rapists_per_prisoner, 0) && !x.IsForbidden(pawn) && SexAppraiser.would_rape(pawn, x) ); if (RJWSettings.DebugRape) ModLog.Message($"FindComfortPrisoner({pawnName}): found {targets.Count()}"); if (xxx.is_animal(pawn)) { // Animals only consider targets they can see, instead of seeking them out. targets = targets.Where(x => pawn.CanSee(x)).ToList(); } foreach (Pawn target in targets) { if (!xxx.cells_to_target_rape(pawn, target.Position)) continue;// too far float fuc = 0f; if (xxx.is_animal(target)) fuc = SexAppraiser.would_fuck_animal(pawn, target, true); else if (xxx.is_human(target)) fuc = SexAppraiser.would_fuck(pawn, target, true); if (RJWSettings.DebugRape) ModLog.Message($"FindComfortPrisoner({pawnName}): {fuc} has to be over {min_fuckability}"); if (fuc > min_fuckability) if (xxx.can_path_to_target(pawn, target.Position)) valid_targets.Add(target, fuc); } if (valid_targets.Any()) { // avg_fuckability = valid_targets.Average(x => x.Value); // disabled for CP // choose pawns to fuck with above average fuckability var valid_targetsFiltered = valid_targets.Where(x => x.Value >= avg_fuckability); if (valid_targetsFiltered.Any()) chosentarget = valid_targetsFiltered.RandomElement().Key; } return chosentarget; } protected override Job TryGiveJob(Pawn pawn) { if (RJWSettings.DebugRape) ModLog.Message($"JobGiver_ComfortPrisonerRape::TryGiveJob({xxx.get_pawnname(pawn)}) called"); if (!RJWSettings.WildMode) { // don't allow pawns marked as comfort prisoners to rape others if (RJWSettings.DebugRape) ModLog.Message($"JobGiver_ComfortPrisonerRape::TryGiveJob({xxx.get_pawnname(pawn)}): is healthy = {xxx.is_healthy(pawn)}, is cp = {pawn.IsDesignatedComfort()}, is ready = {SexUtility.ReadyForLovin(pawn)}, is frustrated = {xxx.is_frustrated(pawn)}"); if (!xxx.is_healthy(pawn) || pawn.IsDesignatedComfort() || (!SexUtility.ReadyForLovin(pawn) && !xxx.is_frustrated(pawn))) return null; } if (RJWSettings.DebugRape) ModLog.Message($"FindComfortPrisoner({xxx.get_pawnname(pawn)}): can rape = {xxx.can_rape(pawn)}, is drafted = {pawn.Drafted}"); if (pawn.Drafted || !xxx.can_rape(pawn)) return null; // It's unnecessary to include other job checks. Pawns seem to only look for new jobs when between jobs or laying down idle. if (!(pawn.jobs.curJob == null || pawn.jobs.curJob.def == JobDefOf.LayDown)) { if (RJWSettings.DebugRape) ModLog.Message($"FindComfortPrisoner({xxx.get_pawnname(pawn)}): I already have a job ({pawn.CurJobDef})"); return null; } // Faction check. if (!(pawn.Faction?.IsPlayer ?? false) && !pawn.IsPrisonerOfColony) { if (RJWSettings.DebugRape) ModLog.Message($"FindComfortPrisoner({xxx.get_pawnname(pawn)}): player faction: {pawn.Faction?.IsPlayer}, prisoner: {pawn.IsPrisonerOfColony}"); return null; } Pawn target = find_targetCP(pawn, pawn.Map); if (RJWSettings.DebugRape) ModLog.Message($"JobGiver_ComfortPrisonerRape::TryGiveJob({xxx.get_pawnname(pawn)}): (" + ((target == null) ? "no target found" : xxx.get_pawnname(target))+") is the prisoner"); if (target == null) return null; if (RJWSettings.DebugRape) ModLog.Message($"JobGiver_ComfortPrisonerRape::TryGiveJob({xxx.get_pawnname(pawn)}) with target {xxx.get_pawnname(target)}"); if (xxx.is_animal(target)) return JobMaker.MakeJob(xxx.bestiality, target); else return JobMaker.MakeJob(xxx.RapeCP, target); } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_ComfortPrisonerRape.cs
C#
mit
4,550
using System.Collections.Generic; using System.Linq; using RimWorld; using Verse; using Verse.AI; using Multiplayer.API; namespace rjw { public class JobGiver_DoQuickie : ThinkNode_JobGiver { /// <summary> Checks all of our potential partners to see if anyone's eligible, returning the most attractive and convenient one. </summary> protected override Job TryGiveJob(Pawn pawn) { if (!RJWHookupSettings.HookupsEnabled || !RJWHookupSettings.QuickHookupsEnabled) return null; if (pawn.Drafted) return null; if (!SexUtility.ReadyForHookup(pawn)) return null; // We increase the time right away to prevent the fairly expensive check from happening too frequently SexUtility.IncreaseTicksToNextHookup(pawn); // If the pawn is a whore, or recently had sex, skip the job unless they're really horny if (!xxx.is_frustrated(pawn) && (xxx.is_whore(pawn) || !SexUtility.ReadyForLovin(pawn))) return null; // This check attempts to keep groups leaving the map, like guests or traders, from turning around to hook up if (pawn.mindState?.duty?.def == DutyDefOf.TravelOrLeave) { // TODO: Some guest pawns keep the TravelOrLeave duty the whole time, I think the ones assigned to guard the pack animals. // That's probably ok, though it wasn't the intention. if (RJWSettings.DebugLogJoinInBed) ModLog.Message($" Quickie.TryGiveJob:({xxx.get_pawnname(pawn)}): has TravelOrLeave, no time for lovin!"); return null; } if (pawn.CurJob == null) { //--Log.Message(" checking pawn and abilities"); if (CasualSex_Helper.CanHaveSex(pawn)) { //--Log.Message(" finding partner"); Pawn partner = CasualSex_Helper.find_partner(pawn, pawn.Map, false); //--Log.Message(" checking partner"); if (partner == null) return null; // Interrupt current job. if (pawn.CurJob != null && pawn.jobs.curDriver != null) pawn.jobs.curDriver.EndJobWith(JobCondition.InterruptForced); //--Log.Message(" returning job"); return JobMaker.MakeJob(xxx.quick_sex, partner); } } return null; } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_DoQuickie.cs
C#
mit
2,119
using RimWorld; using Verse; using Verse.AI; namespace rjw { public class JobGiver_JoinInBed : ThinkNode_JobGiver { protected override Job TryGiveJob(Pawn pawn) { if (!RJWHookupSettings.HookupsEnabled) return null; if (pawn.Drafted) return null; if (!SexUtility.ReadyForHookup(pawn)) return null; // We increase the time right away to prevent the fairly expensive check from happening too frequently SexUtility.IncreaseTicksToNextHookup(pawn); // If the pawn is a whore, or recently had sex, skip the job unless they're really horny if (!xxx.is_frustrated(pawn) && (xxx.is_whore(pawn) || !SexUtility.ReadyForLovin(pawn))) return null; // This check attempts to keep groups leaving the map, like guests or traders, from turning around to hook up if (pawn.mindState?.duty?.def == DutyDefOf.TravelOrLeave) { // TODO: Some guest pawns keep the TravelOrLeave duty the whole time, I think the ones assigned to guard the pack animals. // That's probably ok, though it wasn't the intention. if (RJWSettings.DebugLogJoinInBed) ModLog.Message($"JoinInBed.TryGiveJob:({xxx.get_pawnname(pawn)}): has TravelOrLeave, no time for lovin!"); return null; } if (pawn.CurJob == null || pawn.CurJob.def == JobDefOf.LayDown) { //--Log.Message(" checking pawn and abilities"); if (CasualSex_Helper.CanHaveSex(pawn)) { //--Log.Message(" finding partner"); Pawn partner = CasualSex_Helper.find_partner(pawn, pawn.Map, true); //--Log.Message(" checking partner"); if (partner == null) return null; // Can never be null, since find checks for bed. Building_Bed bed = partner.CurrentBed(); // Interrupt current job. if (pawn.CurJob != null && pawn.jobs.curDriver != null) pawn.jobs.curDriver.EndJobWith(JobCondition.InterruptForced); //--Log.Message(" returning job"); return JobMaker.MakeJob(xxx.casual_sex, partner, bed); } } return null; } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_JoinInBed.cs
C#
mit
2,004
using Verse; using Verse.AI; namespace rjw { /// <summary> /// Attempts to give a lay egg job to an eligible humanoid. /// </summary> public class JobGiver_LayEgg : RimWorld.JobGiver_LayEgg { } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_LayEgg.cs
C#
mit
203
using RimWorld; using Verse; using Verse.AI; using System.Collections.Generic; using System.Linq; using Multiplayer.API; namespace rjw { public class JobGiver_Masturbate : ThinkNode_JobGiver { protected override Job TryGiveJob(Pawn pawn) { //--ModLog.Message(" JobGiver_Masturbate::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) called"); if (pawn.Drafted) return null; if (!xxx.can_masturbate(pawn)) return null; // Whores only fap if frustrated, unless imprisoned. if ((SexUtility.ReadyForLovin(pawn) && (!xxx.is_whore(pawn) || pawn.IsPrisoner || xxx.is_slave(pawn))) || xxx.is_frustrated(pawn)) { if (RJWPreferenceSettings.FapInBed && pawn.jobs.curDriver is JobDriver_LayDown) { Building_Bed bed = ((JobDriver_LayDown)pawn.jobs.curDriver).Bed; if (bed != null) { if ((xxx.is_frustrated(pawn) || xxx.has_quirk(pawn, "Exhibitionist")) || bed.GetRoom().Role == RoomRoleDefOf.Bedroom || bed.GetRoom().Role == RoomRoleDefOf.PrisonCell) return JobMaker.MakeJob(xxx.Masturbate, null, bed, bed.Position); } } else if (RJWPreferenceSettings.FapEverywhere && (xxx.is_frustrated(pawn) || xxx.has_quirk(pawn, "Exhibitionist"))) { return JobMaker.MakeJob(xxx.Masturbate, null, null, CasualSex_Helper.FindSexLocation(pawn)); } } return null; } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_Masturbate.cs
C#
mit
1,334
using System.Linq; using RimWorld; using Verse; using Verse.AI; using System.Collections.Generic; using Multiplayer.API; namespace rjw { public class JobGiver_RandomRape : ThinkNode_JobGiver { [SyncMethod] public Pawn find_victim(Pawn pawn, Map m) { float min_fuckability = 0.10f; // Don't rape pawns with <10% fuckability float avg_fuckability = 0f; // Average targets fuckability, choose target higher than that var valid_targets = new Dictionary<Pawn, float>(); // Valid pawns and their fuckability Pawn chosentarget = null; // Final target pawn // could be prisoner, colonist, or non-hostile outsider IEnumerable<Pawn> targets = m.mapPawns.AllPawnsSpawned.Where(x => x != pawn && xxx.is_not_dying(x) && xxx.can_get_raped(x) && !x.Suspended && !x.Drafted && !x.IsForbidden(pawn) && pawn.CanReserveAndReach(x, PathEndMode.Touch, Danger.Some, xxx.max_rapists_per_prisoner, 0) && !x.HostileTo(pawn) ); //Zoo rape Animal if (xxx.is_zoophile(pawn) && RJWSettings.bestiality_enabled) { foreach (Pawn target in targets.Where(x => xxx.is_animal(x))) { if (!xxx.cells_to_target_rape(pawn, target.Position)) continue;// too far float fuc = SexAppraiser.would_fuck(pawn, target, true, true); if (fuc > min_fuckability) if (xxx.can_path_to_target(pawn, target.Position)) valid_targets.Add(target, fuc); } if (valid_targets.Any()) { avg_fuckability = valid_targets.Average(x => x.Value); // choose pawns to fuck with above average fuckability var valid_targetsFilteredAnimals = valid_targets.Where(x => x.Value >= avg_fuckability); if (valid_targetsFilteredAnimals.Any()) chosentarget = valid_targetsFilteredAnimals.RandomElement().Key; return chosentarget; } } valid_targets = new Dictionary<Pawn, float>(); // rape Humanlike foreach (Pawn target in targets.Where(x => !xxx.is_animal(x))) { if (!xxx.cells_to_target_rape(pawn, target.Position)) continue;// too far float fuc = SexAppraiser.would_fuck(pawn, target, true, true); if (fuc > min_fuckability) if (xxx.can_path_to_target(pawn, target.Position)) valid_targets.Add(target, fuc); } if (valid_targets.Any()) { avg_fuckability = valid_targets.Average(x => x.Value); // choose pawns to fuck with above average fuckability var valid_targetsFilteredAnimals = valid_targets.Where(x => x.Value >= avg_fuckability); if (valid_targetsFilteredAnimals.Any()) chosentarget = valid_targetsFilteredAnimals.RandomElement().Key; } return chosentarget; } protected override Job TryGiveJob(Pawn pawn) { //ModLog.Message(" JobGiver_RandomRape::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) called"); if (!xxx.can_rape(pawn)) return null; if (pawn.health.hediffSet.HasHediff(HediffDef.Named("Hediff_RapeEnemyCD"))) return null; pawn.health.AddHediff(HediffDef.Named("Hediff_RapeEnemyCD"), null, null, null); Pawn victim = find_victim(pawn, pawn.Map); if (victim == null) return null; //ModLog.Message(" JobGiver_RandomRape::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) - found victim " + xxx.get_pawnname(victim)); return JobMaker.MakeJob(xxx.RapeRandom, victim); } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_RandomRape.cs
C#
mit
3,360
using Verse; using Verse.AI; using RimWorld; namespace rjw { /// <summary> /// Pawn try to find enemy to rape. /// </summary> public class JobGiver_RapeEnemy : ThinkNode_JobGiver { protected override Job TryGiveJob(Pawn pawn) { if (RJWSettings.DebugRape) ModLog.Message(" JobGiver_RapeEnemy::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) called0"); //ModLog.Message(" JobGiver_RapeEnemy::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) 0 " + SexUtility.ReadyForLovin(pawn)); //ModLog.Message(" JobGiver_RapeEnemy::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) 1 " + (xxx.need_some_sex(pawn) <= 1f)); //ModLog.Message(" JobGiver_RapeEnemy::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) 2 " + !(SexUtility.ReadyForLovin(pawn) || xxx.need_some_sex(pawn) <= 1f)); //ModLog.Message(" JobGiver_RapeEnemy::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) 1 " + Find.TickManager.TicksGame); //ModLog.Message(" JobGiver_RapeEnemy::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) 2 " + pawn.mindState.canLovinTick); if (pawn.Drafted) return null; if (pawn.health.hediffSet.HasHediff(HediffDef.Named("Hediff_RapeEnemyCD")) || !pawn.health.capacities.CanBeAwake || !(SexUtility.ReadyForLovin(pawn) || xxx.need_some_sex(pawn) <= 1f)) //if (pawn.health.hediffSet.HasHediff(HediffDef.Named("Hediff_RapeEnemyCD")) || !pawn.health.capacities.CanBeAwake || (SexUtility.ReadyForLovin(pawn) || xxx.is_human(pawn) ? xxx.need_some_sex(pawn) <= 1f : false)) return null; if (!xxx.can_rape(pawn)) return null; if (RJWSettings.DebugRape) ModLog.Message(" JobGiver_RapeEnemy::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) can rape"); JobDef_RapeEnemy rapeEnemyJobDef = null; int? highestPriority = null; foreach (JobDef_RapeEnemy job in DefDatabase<JobDef_RapeEnemy>.AllDefs) { if (job.CanUseThisJobForPawn(pawn)) { if (highestPriority == null) { rapeEnemyJobDef = job; highestPriority = job.priority; } else if (job.priority > highestPriority) { rapeEnemyJobDef = job; highestPriority = job.priority; } } } if (RJWSettings.DebugRape) ModLog.Message(" JobGiver_RapeEnemy::ChoosedJobDef( " + xxx.get_pawnname(pawn) + " ) - " + rapeEnemyJobDef.ToString() + " choosen"); Pawn victim = rapeEnemyJobDef?.FindVictim(pawn, pawn.Map); if (RJWSettings.DebugRape) ModLog.Message(" JobGiver_RapeEnemy::FoundVictim( " + xxx.get_pawnname(victim) + " )"); //prevents 10 job stacks error, no idea whats the prob with JobDriver_Rape //if (victim != null) pawn.health.AddHediff(HediffDef.Named("Hediff_RapeEnemyCD"), null, null, null); return victim != null ? JobMaker.MakeJob(rapeEnemyJobDef, victim) : null; /* else { if (RJWSettings.DebugRape) ModLog.Message("" + this.GetType().ToString() + "::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) - unable to find victim"); pawn.mindState.canLovinTick = Find.TickManager.TicksGame + Rand.Range(75, 150); } */ //else { if (RJWSettings.DebugRape) ModLog.Message(" JobGiver_RapeEnemy::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) - too fast to play next"); } } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_RapeEnemy.cs
C#
mit
3,137
using RimWorld; using Verse; using Verse.AI; using System.Collections.Generic; using System.Linq; namespace rjw { public class JobGiver_ViolateCorpse : ThinkNode_JobGiver { public static Corpse find_corpse(Pawn pawn, Map m) { float min_fuckability = 0.10f; // Don't rape pawns with <10% fuckability float avg_fuckability = 0f; // Average targets fuckability, choose target higher than that var valid_targets = new Dictionary<Corpse, float>(); // Valid pawns and their fuckability Corpse chosentarget = null; // Final target pawn IEnumerable<Thing> targets = m.spawnedThings.Where(x => x is Corpse && pawn.CanReserveAndReach(x, PathEndMode.OnCell, Danger.Some) && !x.IsForbidden(pawn) ); foreach (Corpse target in targets) { if (!xxx.cells_to_target_rape(pawn, target.Position)) continue;// too far // Filter out rotters if not necrophile. if (!xxx.is_necrophiliac(pawn) && target.CurRotDrawMode != RotDrawMode.Fresh) continue; float fuc = SexAppraiser.would_fuck(pawn, target, false, false); if (fuc > min_fuckability) if (xxx.can_path_to_target(pawn, target.Position)) valid_targets.Add(target, fuc); } if (valid_targets.Any()) { avg_fuckability = valid_targets.Average(x => x.Value); // choose pawns to fuck with above average fuckability var valid_targetsFilteredAnimals = valid_targets.Where(x => x.Value >= avg_fuckability); if (valid_targetsFilteredAnimals.Any()) chosentarget = valid_targetsFilteredAnimals.RandomElement().Key; } return chosentarget; } protected override Job TryGiveJob(Pawn pawn) { // Most checks are done in ThinkNode_ConditionalNecro. // filter out necro for nymphs if (!RJWSettings.necrophilia_enabled) return null; if (pawn.Drafted) return null; //--ModLog.Message(" JobGiver_ViolateCorpse::TryGiveJob for ( " + xxx.get_pawnname(pawn) + " )"); if (SexUtility.ReadyForLovin(pawn) || xxx.is_hornyorfrustrated(pawn)) { //--ModLog.Message(" JobGiver_ViolateCorpse::TryGiveJob, can love "); if (!xxx.can_rape(pawn)) return null; var target = find_corpse(pawn, pawn.Map); //--ModLog.Message(" JobGiver_ViolateCorpse::TryGiveJob - target is " + (target == null ? "NULL" : "Found")); if (target != null) { return JobMaker.MakeJob(xxx.RapeCorpse, target); } // Ticks should only be increased after successful sex. } return null; } } }
Korth95/rjw
1.2/Source/JobGivers/JobGiver_ViolateCorpse.cs
C#
mit
2,557
using System.Collections.Generic; using System.Linq; using System; using Verse; using RimWorld; using RimWorld.Planet; namespace rjw.MainTab { public class MainTabWindow_Brothel : MainTabWindow_PawnTable { private static PawnTableDef pawnTableDef; protected override PawnTableDef PawnTableDef => pawnTableDef ?? (pawnTableDef = DefDatabase<PawnTableDef>.GetNamed("RJW_Brothel")); protected override IEnumerable<Pawn> Pawns => Find.CurrentMap.mapPawns.AllPawns.Where(p => xxx.is_human(p) && (p.IsColonist || p.IsPrisonerOfColony)); public override void PostOpen() { base.PostOpen(); Find.World.renderer.wantedMode = WorldRenderMode.None; } } }
Korth95/rjw
1.2/Source/MainTab/MainTabWindow_Brothel.cs
C#
mit
671
using System; using System.Collections.Generic; using System.Linq; using Verse; using UnityEngine; using RimWorld; using Verse.Sound; namespace rjw.MainTab { public abstract class PawnColumnCheckbox_Whore : PawnColumnWorker { public const int HorizontalPadding = 2; public override void DoCell(Rect rect, Pawn pawn, PawnTable table) { if (!this.HasCheckbox(pawn)) { return; } 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); 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)); } bool disabled = this.GetDisabled(pawn); bool value; if (disabled) { value = false; } else { value = this.GetValue(pawn); } bool flag = value; Vector2 topLeft = vector; WhoreCheckbox.Checkbox(topLeft, ref value, 24f, disabled, WhoreCheckbox.WhoreCheckboxOnTex, WhoreCheckbox.WhoreCheckboxOffTex, WhoreCheckbox.WhoreCheckboxDisabledTex); if (Mouse.IsOver(rect2)) { string tip = this.GetTip(pawn); if (!tip.NullOrEmpty()) { TooltipHandler.TipRegion(rect2, tip); } } if (value != flag) { this.SetValue(pawn, value); } } public override int GetMinWidth(PawnTable table) { return Mathf.Max(base.GetMinWidth(table), 28); } public override int GetMaxWidth(PawnTable table) { return Mathf.Min(base.GetMaxWidth(table), this.GetMinWidth(table)); } public override int GetMinCellHeight(Pawn pawn) { return Mathf.Max(base.GetMinCellHeight(pawn), 24); } public override int Compare(Pawn a, Pawn b) { return this.GetValueToCompare(a).CompareTo(this.GetValueToCompare(b)); } private int GetValueToCompare(Pawn pawn) { if (!this.HasCheckbox(pawn)) { return 0; } if (!this.GetValue(pawn)) { return 1; } return 2; } protected virtual string GetTip(Pawn pawn) { return null; } protected virtual bool HasCheckbox(Pawn pawn) { return true; } protected abstract bool GetValue(Pawn pawn); protected abstract void SetValue(Pawn pawn, bool value); protected abstract bool GetDisabled(Pawn pawn); protected override void HeaderClicked(Rect headerRect, PawnTable table) { base.HeaderClicked(headerRect, table); if (Event.current.shift) { List<Pawn> pawnsListForReading = table.PawnsListForReading; for (int i = 0; i < pawnsListForReading.Count; i++) { if (this.HasCheckbox(pawnsListForReading[i])) { if (Event.current.button == 0) { if (!this.GetValue(pawnsListForReading[i])) { this.SetValue(pawnsListForReading[i], true); } } else if (Event.current.button == 1 && this.GetValue(pawnsListForReading[i])) { this.SetValue(pawnsListForReading[i], false); } } } if (Event.current.button == 0) { SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera(null); } else if (Event.current.button == 1) { SoundDefOf.Checkbox_TurnedOff.PlayOneShotOnCamera(null); } } } protected override string GetHeaderTip(PawnTable table) { return base.GetHeaderTip(table) + "\n" + "CheckboxShiftClickTip".Translate(); } } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnCheckbox_Whore.cs
C#
mit
3,626
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] public class PawnColumnWorker_AverageMoneyByWhore : PawnColumnWorker_TextCenter { protected override string GetTextFor(Pawn pawn) { return ((int)GetValueToCompare(pawn)).ToString(); } public override int Compare(Pawn a, Pawn b) { return GetValueToCompare(a).CompareTo(GetValueToCompare(b)); } private float GetValueToCompare(Pawn pawn) { float total = pawn.records.GetValue(xxx.EarnedMoneyByWhore); float count = pawn.records.GetValue(xxx.CountOfWhore); if ((int)count == 0) { return 0; } return (total / count); } } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnWorker_AverageMoneyByWhore.cs
C#
mit
771
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] public class PawnColumnWorker_CountOfWhore : PawnColumnWorker_TextCenter { protected override string GetTextFor(Pawn pawn) { return GetValueToCompare(pawn).ToString(); } public override int Compare(Pawn a, Pawn b) { return GetValueToCompare(a).CompareTo(GetValueToCompare(b)); } private int GetValueToCompare(Pawn pawn) { return pawn.records.GetAsInt(xxx.CountOfWhore); } } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnWorker_CountOfWhore.cs
C#
mit
609
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] public class PawnColumnWorker_EarnedMoneyByWhore : PawnColumnWorker_TextCenter { protected override string GetTextFor(Pawn pawn) { return GetValueToCompare(pawn).ToString(); } public override int Compare(Pawn a, Pawn b) { return GetValueToCompare(a).CompareTo(GetValueToCompare(b)); } private int GetValueToCompare(Pawn pawn) { return pawn.records.GetAsInt(xxx.EarnedMoneyByWhore); } } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnWorker_EarnedMoneyByWhore.cs
C#
mit
621
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] public class PawnColumnWorker_IsPrisoner : PawnColumnWorker_Icon { private static readonly Texture2D comfortOn = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_on"); private readonly Texture2D comfortOff = ContentFinder<Texture2D>.Get("UI/Tab/ComfortPrisoner_off"); protected override Texture2D GetIconFor(Pawn pawn) { return pawn.IsPrisonerOfColony || xxx.is_slave(pawn) ? comfortOn : null; } } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnWorker_IsPrisoner.cs
C#
mit
621
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] public class PawnColumnWorker_IsWhore : PawnColumnCheckbox_Whore { protected override bool GetDisabled(Pawn pawn) { return !pawn.CanDesignateService(); } protected override bool GetValue(Pawn pawn) { return pawn.IsDesignatedService() && xxx.is_human(pawn); } protected override void SetValue(Pawn pawn, bool value) { if (value == this.GetValue(pawn)) return; pawn.ToggleService(); } /* private static readonly Texture2D serviceOn = ContentFinder<Texture2D>.Get("UI/Tab/Service_on"); private static readonly Texture2D serviceOff = ContentFinder<Texture2D>.Get("UI/Tab/Service_off"); protected override Texture2D GetIconFor(Pawn pawn) { return pawn.IsDesignatedService() ? serviceOn : null; }*/ } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnWorker_IsWhore.cs
C#
mit
953
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] public class PawnColumnWorker_Mood : PawnColumnWorker_TextCenter { protected override string GetTextFor(Pawn pawn) { return GetValueToCompare(pawn).ToStringPercent(); } public override int Compare(Pawn a, Pawn b) { return GetValueToCompare(a).CompareTo(GetValueToCompare(b)); } private float GetValueToCompare(Pawn pawn) { return pawn.needs.mood.CurLevelPercentage; } } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnWorker_Mood.cs
C#
mit
605
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] public class PawnColumnWorker_PriceRangeOfWhore : PawnColumnWorker_TextCenter { protected internal int min; protected internal int max; protected override string GetTextFor(Pawn pawn) { min = WhoringHelper.WhoreMinPrice(pawn); max = WhoringHelper.WhoreMaxPrice(pawn); return string.Format("{0} - {1}", min, max); } public override int Compare(Pawn a, Pawn b) { return GetValueToCompare(a).CompareTo(GetValueToCompare(b)); } protected override string GetTip(Pawn pawn) { string minPriceTip = string.Format( " Base: {0}\n Traits: {1}", WhoringHelper.baseMinPrice, (WhoringHelper.WhoreTraitAdjustmentMin(pawn) -1f).ToStringPercent() ); string maxPriceTip = string.Format( " Base: {0}\n Traits: {1}", WhoringHelper.baseMaxPrice, (WhoringHelper.WhoreTraitAdjustmentMax(pawn) -1f).ToStringPercent() ); string bothTip = string.Format( " Gender: {0}\n Age: {1}\n Injuries: {2}", (WhoringHelper.WhoreGenderAdjustment(pawn) - 1f).ToStringPercent(), (WhoringHelper.WhoreAgeAdjustment(pawn) - 1f).ToStringPercent(), (WhoringHelper.WhoreInjuryAdjustment(pawn) - 1f).ToStringPercent() ); return string.Format("Min:\n{0}\nMax:\n{1}\nBoth:\n{2}", minPriceTip, maxPriceTip, bothTip); } private int GetValueToCompare(Pawn pawn) { return min; } } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnWorker_PriceRangeOfWhore.cs
C#
mit
1,549
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.2/Source/MainTab/PawnColumnWorker_TextCenter.cs
C#
mit
803
using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using RimWorld.Planet; using UnityEngine; using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] public class PawnColumnWorker_WhoreExperience : PawnColumnWorker_TextCenter { public static readonly HashSet<string> backstories = new HashSet<string>(DefDatabase<StringListDef>.GetNamed("WhoreBackstories").strings); protected override string GetTextFor(Pawn pawn) { int b = backstories.Contains(pawn.story?.adulthood?.titleShort) ? 30 : 0; int score = pawn.records.GetAsInt(xxx.CountOfWhore); return (score + b).ToString(); } } }
Korth95/rjw
1.2/Source/MainTab/PawnColumnWorker_WhoreExperience.cs
C#
mit
653
using System; using System.Collections.Generic; using System.Linq; using RimWorld; using Verse; namespace rjw.MainTab { public class PawnTable_Whores : PawnTable { public PawnTable_Whores(PawnTableDef def, Func<IEnumerable<Pawn>> pawnsGetter, int uiWidth, int uiHeight) : base(def, pawnsGetter, uiWidth, uiHeight) { } protected override IEnumerable<Pawn> LabelSortFunction(IEnumerable<Pawn> input) { //return input.OrderBy(p => p.Name?.Numerical != false).ThenBy(p => (p.Name as NameSingle)?.Number ?? 0).ThenBy(p => p.def.label); return input.OrderBy(p => xxx.get_pawnname(p)); } protected override IEnumerable<Pawn> PrimarySortFunction(IEnumerable<Pawn> input) { ///return input.OrderByDescending(p => p.Faction?.Name); //return input.OrderBy(p => xxx.get_pawnname(p)); foreach (Pawn p in input) p.UpdatePermissions(); return input.OrderByDescending(p => p.IsColonist); } } }
Korth95/rjw
1.2/Source/MainTab/PawnTable_Whores.cs
C#
mit
922
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 WhoreCheckbox { public static readonly Texture2D WhoreCheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_on"); public static readonly Texture2D WhoreCheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_off"); public static readonly Texture2D WhoreCheckboxDisabledTex = 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) { WhoreCheckbox.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); WhoreCheckbox.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; WhoreCheckbox.checkboxPainting = true; WhoreCheckbox.checkboxPaintingState = checkOn; } if (Mouse.IsOver(rect) && WhoreCheckbox.checkboxPainting && Input.GetMouseButton(0) && checkOn != WhoreCheckbox.checkboxPaintingState) { checkOn = WhoreCheckbox.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)) ? WhoreCheckbox.WhoreCheckboxDisabledTex : texDisabled); } else if (active) { image = ((!(texChecked != null)) ? WhoreCheckbox.WhoreCheckboxOnTex : texChecked); } else { image = ((!(texUnchecked != null)) ? WhoreCheckbox.WhoreCheckboxOffTex : texUnchecked); } Rect position = new Rect(x, y, size, size); GUI.DrawTexture(position, image); } } }
Korth95/rjw
1.2/Source/MainTab/WhoreCheckbox.cs
C#
mit
2,919
using System; using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using Verse.AI; using Verse; namespace rjw { public class MentalState_RandomRape : SexualMentalState { public override void PostStart(string reason) { base.PostStart(reason); this.pawn.mindState.canLovinTick = -1; } public override bool ForceHostileTo(Thing t) { /* //planning random raper hostile to other colonists. but now, injured raper wont rape. if ((this.pawn.jobs != null) && (this.pawn.jobs.curDriver != null) && (this.pawn.jobs.curDriver as JobDriver_Rape != null)) { return true; }*/ return false; } public override bool ForceHostileTo(Faction f) { /* if ((this.pawn.jobs != null) && (this.pawn.jobs.curDriver != null) && (this.pawn.jobs.curDriver as JobDriver_Rape != null)) { return true; }*/ return false; } public override RandomSocialMode SocialModeMax() { return RandomSocialMode.Off; } } }
Korth95/rjw
1.2/Source/MentalStates/MentalState_RandomRape.cs
C#
mit
1,007
using System; using System.Collections.Generic; using System.Linq; using System.Text; using RimWorld; using Verse.AI; using Verse; namespace rjw { public class SexualMentalState : MentalState { public override void MentalStateTick() { if (this.pawn.IsHashIntervalTick(150)) { if (xxx.is_satisfied(pawn)) { this.RecoverFromState(); return; } } base.MentalStateTick(); } } public class SexualMentalStateWorker : MentalStateWorker { public override bool StateCanOccur(Pawn pawn) { if (base.StateCanOccur(pawn)) { return xxx.is_human(pawn) && xxx.can_rape(pawn) && xxx.is_hornyorfrustrated(pawn); } else { return false; } } } public class SexualMentalBreakWorker : MentalBreakWorker { public override float CommonalityFor(Pawn pawn, bool moodCaused = false) { if (xxx.is_human(pawn)) { var need_sex = pawn.needs.TryGetNeed<Need_Sex>(); if (need_sex != null) return base.CommonalityFor(pawn) * (def as SexualMentalBreakDef).commonalityMultiplierBySexNeed.Evaluate(need_sex.CurLevelPercentage * 100f); else return 0; } else { return 0; } } } public class SexualMentalStateDef : MentalStateDef { } public class SexualMentalBreakDef : MentalBreakDef { public SimpleCurve commonalityMultiplierBySexNeed; } }
Korth95/rjw
1.2/Source/MentalStates/SexualMentalState.cs
C#
mit
1,344
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Verse; namespace rjw { /// <summary> /// Helper class for ChJees's Androids mod. /// </summary> [StaticConstructorOnStartup] public static class AndroidsCompatibility { public static Type androidCompatType; public static readonly string typeName = "Androids.SexualizeAndroidRJW"; private static bool foundType; static AndroidsCompatibility() { try { androidCompatType = Type.GetType(typeName); foundType = true; //Log.Message("Found Type: Androids.SexualizeAndroidRJW"); } catch { foundType = false; //Log.Message("Did NOT find Type: Androids.SexualizeAndroidRJW"); } } /*private static bool TestPredicate(DefModExtension extension) { if (extension == null) return false; Log.Message($"Predicate: {extension} : {extension.GetType()?.FullName}"); return extension.GetType().FullName == typeName; }*/ public static bool IsAndroid(ThingDef def) { if (def == null || !foundType) { return false; } return def.modExtensions != null && def.modExtensions.Any(extension => extension.GetType().FullName == typeName); } public static bool IsAndroid(Thing thing) { return IsAndroid(thing.def); } public static bool AndroidPenisFertility(Pawn pawn) { //androids only fertile with archotech parts BodyPartRecord Part = Genital_Helper.get_genitalsBPR(pawn); return (pawn.health.hediffSet.hediffs.Any((Hediff hed) => (hed.Part == Part) && (hed.def == Genital_Helper.archotech_penis) )); } public static bool AndroidVaginaFertility(Pawn pawn) { //androids only fertile with archotech parts BodyPartRecord Part = Genital_Helper.get_genitalsBPR(pawn); return (pawn.health.hediffSet.hediffs.Any((Hediff hed) => (hed.Part == Part) && (hed.def == Genital_Helper.archotech_vagina) )); } } }
Korth95/rjw
1.2/Source/Modules/Androids/AndroidsCompatibility.cs
C#
mit
1,934
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; // Adds options to the right-click menu for bondage gear to equip the gear on prisoners/downed pawns namespace rjw { public class CompBondageGear : CompUsable { public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn pawn) { if ((pawn.Map != null) && (pawn.Map == Find.CurrentMap))// && (pawn.Map.mapPawns.PrisonersOfColonyCount > 0) { if (!pawn.CanReserve(parent)) yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " on (" + "Reserved".Translate() + ")", null, MenuOptionPriority.DisabledOption); else if (pawn.CanReach(parent, PathEndMode.Touch, Danger.Some)) foreach (Pawn other in pawn.Map.mapPawns.AllPawns) if ((other != pawn) && other.Spawned && (other.Downed || other.IsPrisonerOfColony || xxx.is_slave(other))) yield return this.make_option(FloatMenuOptionLabel(pawn) + " on " + xxx.get_pawnname(other), pawn, other, (other.IsPrisonerOfColony || xxx.is_slave(other)) ? WorkTypeDefOf.Warden : null); } } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Comps/CompBondageGear.cs
C#
mit
1,074
using System; using RimWorld; using Verse; using Multiplayer.API; namespace rjw { public class CompCryptoStamped : ThingComp { public string name; public string key; [SyncMethod] public string random_hex_byte() { //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); var rv = Rand.RangeInclusive(0x00, 0xFF); var padding = (rv < 0x10) ? "0" : ""; return padding + rv.ToString("X"); } public override void Initialize(CompProperties pro) { name = NameGenerator.GenerateName(RulePackDef.Named("EngravedName")); key = ""; for (int i = 0; i < 16; ++i) key += random_hex_byte(); } public override void PostExposeData() { base.PostExposeData(); Scribe_Values.Look<string>(ref name, "engraved_name"); Scribe_Values.Look<string>(ref key, "cryptostamp"); } public override bool AllowStackWith(Thing t) { return false; } public override string CompInspectStringExtra() { var inspect_engraving = "Engraved with the name \"" + name + "\""; var inspect_key = "Cryptostamp: " + key; return base.CompInspectStringExtra() + inspect_engraving + "\n" + inspect_key; } public override string TransformLabel(string lab) { return lab + " \"" + name + "\""; } public bool matches(CompHoloCryptoStamped other) { return String.Equals(key, other.key); } public void copy_stamp_from(CompHoloCryptoStamped other) { name = other.name; key = other.key; } } public class CompProperties_CryptoStamped : CompProperties { public CompProperties_CryptoStamped() { compClass = typeof(CompHoloCryptoStamped); } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Comps/CompCryptoStamped.cs
C#
mit
1,637
using RimWorld; using Verse; namespace rjw { public class CompGetBondageGear : CompUseEffect { public override float OrderPriority { get { return -79; } } public override void DoEffect(Pawn p) { base.DoEffect(p); var app = parent as Apparel; if ((p.apparel != null) && (app != null)) p.apparel.Wear(app); } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Comps/CompGetBondageGear.cs
C#
mit
356
using System; using RimWorld; using Verse; using Multiplayer.API; namespace rjw { public class CompHoloCryptoStamped : ThingComp { public string name; public string key; [SyncMethod] public string random_hex_byte() { //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); var rv = Rand.RangeInclusive(0x00, 0xFF); var padding = (rv < 0x10) ? "0" : ""; return padding + rv.ToString("X"); } public override void Initialize(CompProperties pro) { name = NameGenerator.GenerateName(RulePackDef.Named("EngravedName")); key = ""; for (int i = 0; i < 16; ++i) key += random_hex_byte(); } public override void PostExposeData() { base.PostExposeData(); Scribe_Values.Look<string>(ref name, "engraved_name"); Scribe_Values.Look<string>(ref key, "cryptostamp"); } public override bool AllowStackWith(Thing t) { return false; } public override string CompInspectStringExtra() { var inspect_engraving = "Engraved with the name \"" + name + "\""; var inspect_key = "Cryptostamp: " + key; return base.CompInspectStringExtra() + inspect_engraving + "\n" + inspect_key; } public override string TransformLabel(string lab) { return lab + " \"" + name + "\""; } public bool matches(CompHoloCryptoStamped other) { return String.Equals(key, other.key); } public void copy_stamp_from(CompHoloCryptoStamped other) { name = other.name; key = other.key; } } public class CompProperties_HoloCryptoStamped : CompProperties { public CompProperties_HoloCryptoStamped() { compClass = typeof(CompHoloCryptoStamped); } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Comps/CompHoloCryptoStamped.cs
C#
mit
1,649
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; // Adds unlock options to right-click menu for holokeys. namespace rjw { public class CompStampedApparelKey : CompUsable { protected string make_label(Pawn pawn, Pawn other) { return FloatMenuOptionLabel(pawn) + " on " + ((other == null) ? "self" : xxx.get_pawnname(other)); } public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn pawn) { if (!pawn.CanReserve(parent)) yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "Reserved".Translate() + ")", null, MenuOptionPriority.DisabledOption); else if (pawn.CanReach(parent, PathEndMode.Touch, Danger.Some)) { // Option for the pawn to use the key on themself if (!pawn.is_wearing_locked_apparel()) yield return new FloatMenuOption("Not wearing locked apparel", null, MenuOptionPriority.DisabledOption); else yield return this.make_option(make_label(pawn, null), pawn, null, null); if ((pawn.Map != null) && (pawn.Map == Find.CurrentMap)) { // Options for use on colonists foreach (var other in pawn.Map.mapPawns.FreeColonists) if ((other != pawn) && other.is_wearing_locked_apparel()) yield return this.make_option(make_label(pawn, other), pawn, other, null); // Options for use on prisoners foreach (var prisoner in pawn.Map.mapPawns.PrisonersOfColony) if (prisoner.is_wearing_locked_apparel()) yield return this.make_option(make_label(pawn, prisoner), pawn, prisoner, WorkTypeDefOf.Warden); // Options for use on corpses foreach (var q in pawn.Map.listerThings.ThingsInGroup(ThingRequestGroup.Corpse)) { var corpse = q as Corpse; if (corpse.InnerPawn.is_wearing_locked_apparel()) yield return this.make_option(make_label(pawn, corpse.InnerPawn), pawn, corpse, null); } } } } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Comps/CompStampedApparelKey.cs
C#
mit
1,904
using RimWorld; using Verse; namespace rjw { public class CompUnlockBondageGear : CompUseEffect { public override float OrderPriority { get { return -69; } } public override void DoEffect(Pawn p) { base.DoEffect(p); var key_stamp = parent.GetComp<CompHoloCryptoStamped>(); if ((key_stamp == null) || (p.MapHeld == null) || (p.apparel == null)) return; Apparel locked_app = null; var any_locked = false; { foreach (var app in p.apparel.WornApparel) { var app_stamp = app.GetComp<CompHoloCryptoStamped>(); if (app_stamp != null) { any_locked = true; if (app_stamp.matches(key_stamp)) { locked_app = app; break; } } } } if (locked_app != null) { //locked_app.Notify_Stripped (p); // TODO This was removed. Necessary? p.apparel.Remove(locked_app); Thing dropped = null; GenThing.TryDropAndSetForbidden(locked_app, p.Position, p.MapHeld, ThingPlaceMode.Near, out dropped, false); //this will create a new key somehow. if (dropped != null) { Messages.Message("Unlocked " + locked_app.def.label, p, MessageTypeDefOf.SilentInput); IntVec3 keyPostition = parent.Position; parent.Destroy(); } else if (PawnUtility.ShouldSendNotificationAbout(p)) { Messages.Message("Couldn't drop " + locked_app.def.label, p, MessageTypeDefOf.NegativeEvent); } } else if (any_locked) Messages.Message("The key doesn't fit!", p, MessageTypeDefOf.NegativeEvent); } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Comps/CompUnlockBondageGear.cs
C#
mit
1,547
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; namespace rjw { public class JobDriver_StruggleInBondageGear : JobDriver { public Apparel target_gear { get { return (Apparel)TargetA.Thing; } } public override bool TryMakePreToilReservations(bool errorOnFailed) { return this.pawn.Reserve(this.target_gear, this.job, 1, -1, null, errorOnFailed); } protected override IEnumerable<Toil> MakeNewToils() { yield return new Toil { initAction = delegate { pawn.pather.StopDead(); }, defaultCompleteMode = ToilCompleteMode.Delay, defaultDuration = 60 }; yield return new Toil { initAction = delegate { if (PawnUtility.ShouldSendNotificationAbout(pawn)) { var pro = (pawn.gender == Gender.Male) ? "his" : "her"; Messages.Message(xxx.get_pawnname(pawn) + " struggles to remove " + pro + " " + target_gear.def.label + ". It's no use!", pawn, MessageTypeDefOf.NegativeEvent); } }, defaultCompleteMode = ToilCompleteMode.Instant }; } } }
Korth95/rjw
1.2/Source/Modules/Bondage/JobDrivers/JobDriver_StruggleInBondageGear.cs
C#
mit
1,085
using System.Collections.Generic; using RimWorld; using Verse; using Verse.AI; namespace rjw { public class JobDriver_UseItemOn : JobDriver_UseItem { public static Toil pickup_item(Pawn p, Thing item) { return new Toil { initAction = delegate { p.carryTracker.TryStartCarry(item, 1); if (item.Spawned) // If the item is still spawned that means the pawn failed to pick it up p.jobs.curDriver.EndJobWith(JobCondition.Incompletable); }, defaultCompleteMode = ToilCompleteMode.Instant }; } protected TargetIndex iitem = TargetIndex.A; protected TargetIndex itar = TargetIndex.B; protected Thing item { get { return base.job.GetTarget(iitem).Thing; } } protected Thing tar { get { return base.job.GetTarget(itar).Thing; } } protected override IEnumerable<Toil> MakeNewToils() { if (tar == null) foreach (var toil in base.MakeNewToils()) yield return toil; else { // Find the pawn to use the item on. Pawn other; { var corpse = tar as Corpse; other = (corpse == null) ? (Pawn)tar : corpse.InnerPawn; } this.FailOnDespawnedNullOrForbidden(itar); if (!other.Dead) this.FailOnAggroMentalState(itar); yield return Toils_Reserve.Reserve(itar); if ((pawn.inventory != null) && pawn.inventory.Contains(item)) { yield return Toils_Misc.TakeItemFromInventoryToCarrier(pawn, iitem); } else { yield return Toils_Reserve.Reserve(iitem); yield return Toils_Goto.GotoThing(iitem, PathEndMode.ClosestTouch).FailOnForbidden(iitem); yield return pickup_item(pawn, item); } yield return Toils_Goto.GotoThing(itar, PathEndMode.Touch); yield return new Toil { initAction = delegate { if (!other.Dead) PawnUtility.ForceWait(other, 60); }, defaultCompleteMode = ToilCompleteMode.Delay, defaultDuration = 60 }; yield return new Toil { initAction = delegate { var effective_item = item; // Drop the item if it's some kind of apparel. This is because ApparelTracker.Wear only works properly // if the apparel to wear is spawned. (I'm just assuming that DoEffect for apparel wears it, which is // true for bondage gear) if ((effective_item as Apparel) != null) { Thing dropped_thing; if (pawn.carryTracker.TryDropCarriedThing(pawn.Position, ThingPlaceMode.Near, out dropped_thing)) effective_item = dropped_thing as Apparel; else { ModLog.Error("Unable to drop " + effective_item.Label + " for use on " + xxx.get_pawnname(other) + " (apparel must be dropped before use)"); effective_item = null; } } if (effective_item != null) { var eff = effective_item.TryGetComp<CompUseEffect>(); if (eff != null) eff.DoEffect(other); else ModLog.Error("Unable to get CompUseEffect for use of " + effective_item.Label + " on " + xxx.get_pawnname(other) + " by " + xxx.get_pawnname(pawn)); } }, defaultCompleteMode = ToilCompleteMode.Instant }; } } } }
Korth95/rjw
1.2/Source/Modules/Bondage/JobDrivers/JobDriver_UseItemOn.cs
C#
mit
3,171
using System.Collections.Generic; using RimWorld; using Verse; namespace rjw { public class Recipe_InstallChastityBelt : Recipe_InstallImplant { public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn p, RecipeDef r) { return base.GetPartsToApplyOn(p, r); } } public class Recipe_UnlockChastityBelt : Recipe_InstallImplant { public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn p, RecipeDef r) { return base.GetPartsToApplyOn(p, r); } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Recipes/Recipe_ChastityBelt.cs
C#
mit
492
using System.Collections.Generic; using RimWorld; using Verse; using Multiplayer.API; namespace rjw { public class Recipe_ForceOffGear : Recipe_Surgery { public static bool is_wearing(Pawn p, ThingDef apparel_def) { if (p.apparel != null) foreach (var app in p.apparel.WornApparel) if (app.def == apparel_def) return true; return false; } public static BodyPartRecord find_part_record(BodyPartDef part_def, Pawn p) { return p.RaceProps.body.AllParts.Find((BodyPartRecord bpr) => bpr.def == part_def); } // Puts the recipe in the operations list only if "p" is wearing the relevant apparel. The little trick here is that yielding // null causes the game to put the recipe in the list but not actually apply it to a body part. public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn p, RecipeDef generic_def) { var r = (force_off_gear_def)generic_def; if (is_wearing(p, r.removes_apparel)) yield return null; } [SyncMethod] public static void apply_burns(Pawn p, List<BodyPartDef> parts, float min_severity, float max_severity) { foreach (var part in parts) { var rec = find_part_record(part, p); if (rec != null) { //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); var to_deal = Rand.Range(min_severity, max_severity) * part.GetMaxHealth(p); var dealt = 0.0f; var counter = 0; while ((counter < 100) && (dealt < to_deal) && (!p.health.hediffSet.PartIsMissing(rec))) { var dam = Rand.RangeInclusive(3, 5); p.TakeDamage(new DamageInfo(DamageDefOf.Burn, dam, 999, -1.0f, null, rec, null)); ++counter; dealt += (float)dam; } } } } [SyncMethod] public override void ApplyOnPawn(Pawn p, BodyPartRecord null_part, Pawn surgeon, List<Thing> ingredients,Bill bill) { var r = (force_off_gear_def)recipe; if ((surgeon != null) && (p.apparel != null) && (!CheckSurgeryFail(surgeon, p, ingredients, find_part_record(r.failure_affects, p),bill))) { // Remove apparel foreach (var app in p.apparel.WornApparel) if (app.def == r.removes_apparel) { p.apparel.Remove(app); break; } // Destroy parts //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); var def_to_destroy = r.destroys_one_of.RandomElement<BodyPartDef>(); if (def_to_destroy != null) { var record_to_destroy = find_part_record(def_to_destroy, p); if (record_to_destroy != null) { var dam = (int)(1.5f * def_to_destroy.GetMaxHealth(p)); p.TakeDamage(new DamageInfo(DamageDefOf.Burn, dam, 999, -1.0f, null, record_to_destroy, null)); } } if (r.major_burns_on != null) apply_burns(p, r.major_burns_on, 0.30f, 0.60f); if (r.minor_burns_on != null) apply_burns(p, r.minor_burns_on, 0.15f, 0.35f); } } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Recipes/Recipe_ForceOffGear.cs
C#
mit
2,904
using RimWorld; using Verse; namespace rjw { public class ThoughtWorker_Bound : ThoughtWorker { protected override ThoughtState CurrentStateInternal(Pawn p) { if (p.apparel != null) { bool bound = false, gagged = false; foreach (var app in p.apparel.WornApparel) { var gear_def = app.def as bondage_gear_def; if (gear_def != null) { bound |= gear_def.gives_bound_moodlet; gagged |= gear_def.gives_gagged_moodlet; } } if (bound && gagged) return ThoughtState.ActiveAtStage(2); else if (gagged) return ThoughtState.ActiveAtStage(1); else if (bound) return ThoughtState.ActiveAtStage(0); } return ThoughtState.Inactive; } } }
Korth95/rjw
1.2/Source/Modules/Bondage/Thoughts/ThoughtWorker_Bound.cs
C#
mit
723
using System; using System.Collections.Generic; using System.Linq; using RimWorld; using Verse; using Verse.AI; namespace rjw { //public static class bondage_gear_tradeability //{ // public static void init() // { // // Allows bondage gear to be selled by traders // if (xxx.config.bondage_gear_enabled) // { // foreach (var def in DefDatabase<bondage_gear_def>.AllDefs) // def.tradeability = Tradeability.Sellable; // } // // Forbids bondage gear to be selled by traders // else // { // foreach (var def in DefDatabase<bondage_gear_def>.AllDefs) // def.tradeability = Tradeability.None; // } // } //} public static class bondage_gear_extensions { public static bool has_lock(this Apparel app) { return (app.TryGetComp<CompHoloCryptoStamped>() != null); } public static bool is_wearing_locked_apparel(this Pawn p) { if (p.apparel != null) foreach (var app in p.apparel.WornApparel) if (app.has_lock()) return true; return false; } // Tries to get p started on the job of using an item on either another pawn or on themself (if "other" is null). // Of course in order for this method to work, the item's useJob has to be able to handle use on another pawn. This // is true for the holokey and bondage gear in RJW but not the items in the core game public static void start_job(this CompUsable usa, Pawn p, LocalTargetInfo tar) { if (p.CanReserveAndReach(usa.parent, PathEndMode.Touch, Danger.Some) && ((tar == null) || p.CanReserveAndReach(tar, PathEndMode.Touch, Danger.Some))) { var comfor = usa.parent.GetComp<CompForbiddable>(); if (comfor != null) comfor.Forbidden = false; var job = JobMaker.MakeJob(((CompProperties_Usable)usa.props).useJob, usa.parent, tar); p.jobs.TryTakeOrderedJob(job); } } // Creates a menu option to use an item. "tar" is expected to be a pawn, corpse or null if it doesn't apply (in which // case the pawn will presumably use the item on themself). "required_work" can also be null. public static FloatMenuOption make_option(this CompUsable usa, string label, Pawn p, LocalTargetInfo tar, WorkTypeDef required_work) { if ((tar != null) && (!p.CanReserve(tar))) { string key = "Reserved"; string text = TranslatorFormattedStringExtensions.Translate(key); return new FloatMenuOption(label + " (" + text + ")", null, MenuOptionPriority.DisabledOption); } else if ((tar != null) && (!p.CanReach(tar, PathEndMode.Touch, Danger.Some))) { string key = "NoPath"; string text = TranslatorFormattedStringExtensions.Translate(key); return new FloatMenuOption(label + " (" + text + ")", null, MenuOptionPriority.DisabledOption); } else if ((required_work != null) && p.WorkTagIsDisabled(required_work.workTags)) { string key = "CannotPrioritizeWorkTypeDisabled"; string text = TranslatorFormattedStringExtensions.Translate(key, required_work.gerundLabel); return new FloatMenuOption(label + " (" + text + ")", null, MenuOptionPriority.DisabledOption); } else return new FloatMenuOption( label, delegate { usa.start_job(p, tar); }, MenuOptionPriority.Default); } } public class bondage_gear_def : ThingDef { public Type soul_type; public HediffDef equipped_hediff = null; public bool gives_bound_moodlet = false; public bool gives_gagged_moodlet = false; public bool blocks_hands = false; public bool blocks_oral = false; public bool blocks_penis = false; public bool blocks_vagina = false; public bool blocks_anus = false; public bool blocks_breasts = false; private bondage_gear_soul soul_ins = null; public List<BodyPartDef> HediffTargetBodyPartDefs; //field for optional list of targeted parts for hediff applying public List<BodyPartGroupDef> BoundBodyPartGroupDefs; //field for optional list of groups restrained of verbcasting public bondage_gear_soul soul { get { if (soul_ins == null) soul_ins = (bondage_gear_soul)Activator.CreateInstance(soul_type); return soul_ins; } } } public class bondage_gear_soul { // Adds the bondage gear's associated HediffDef and spawns a matching holokey public virtual void on_wear(Pawn wearer, Apparel gear) { var def = (bondage_gear_def)gear.def; if (def.equipped_hediff != null && def.HediffTargetBodyPartDefs != null) { foreach (BodyPartDef partDef in def.HediffTargetBodyPartDefs) //getting BodyPartDef, for example "Arm" { foreach (BodyPartRecord partRec in wearer.RaceProps.body.GetPartsWithDef(partDef)) //applying hediff to every single arm found on pawn { wearer.health.AddHediff(def.equipped_hediff, partRec); } } } else if (def.equipped_hediff != null && def.HediffTargetBodyPartDefs == null) //backward compatibility/simplified gear define without HediffTargetBodyPartDefs { //Hediff applyed to whole body wearer.health.AddHediff(def.equipped_hediff); } var gear_stamp = gear.TryGetComp<CompHoloCryptoStamped>(); if (gear_stamp != null) { var key = ThingMaker.MakeThing(ThingDef.Named("Holokey")); var key_stamp = key.TryGetComp<CompHoloCryptoStamped>(); key_stamp.copy_stamp_from(gear_stamp); if (wearer.Map != null) GenSpawn.Spawn(key, wearer.Position, wearer.Map); else wearer.inventory.TryAddItemNotForSale(key); } } // Removes the gear's HediffDef public virtual void on_remove(Apparel gear, Pawn former_wearer) { var def = (bondage_gear_def)gear.def; if (def.equipped_hediff != null && def.HediffTargetBodyPartDefs != null) { //getting all Hediffs according with equipped_hediff def List<Hediff> hediffs = former_wearer.health.hediffSet.hediffs.Where(x => x.def == def.equipped_hediff).ToList(); foreach (Hediff hedToRemove in hediffs) { if (def.HediffTargetBodyPartDefs.Contains(hedToRemove.Part.def)) //removing if applyed by this bondage_gear former_wearer.health.RemoveHediff(hedToRemove); //assuming there can be several different bondages } //with the same equipped_hediff def } else if (def.equipped_hediff != null && def.HediffTargetBodyPartDefs == null) //backward compatibility/simplified gear define without HediffTargetBodyPartDefs { var hed = former_wearer.health.hediffSet.GetFirstHediffOfDef(def.equipped_hediff); if (hed != null) former_wearer.health.RemoveHediff(hed); } } } // Give bondage gear an extremely low score when it's not being worn so pawns never equip it on themselves and give // it an extremely high score when it is being worn so pawns never try to take it off to equip something "better". public class bondage_gear : Apparel { public override float GetSpecialApparelScoreOffset() { return (Wearer == null) ? -1e5f : 1e5f; } // made this method universal for any bondage_gear, won't affect anything if gear's BoundBodyPartGroupDefs is empty or null public override bool AllowVerbCast(IntVec3 root, Map map, LocalTargetInfo targ, Verb verb) { if ((this.def as bondage_gear_def).BoundBodyPartGroupDefs != null && verb.tool != null && (this.def as bondage_gear_def).BoundBodyPartGroupDefs.Contains(verb.tool.linkedBodyPartsGroup)) { return false; } return true; } //needed for save compatibility only public override void ExposeData() { base.ExposeData(); //if (Scribe.mode == LoadSaveMode.PostLoadInit) // CheckHediffs(); } //save compatibility insurance, will prevent Armbinder hediff with 0part efficiency on whole body private void CheckHediffs() { var def = (bondage_gear_def)this.def; if (this.Wearer == null || def.equipped_hediff == null) return; bool changedHediff = false; void ApplyHediffDirect(HediffDef hedDef, BodyPartRecord partRec) { Hediff hediff = (Hediff)HediffMaker.MakeHediff(hedDef, Wearer); if (partRec != null) hediff.Part = partRec; Wearer.health.hediffSet.AddDirect(hediff); changedHediff = true; } void RemoveHediffDirect(Hediff hed) { Wearer.health.hediffSet.hediffs.Remove(hed); changedHediff = true; } List<bondage_gear> wornBondageGear = Wearer.apparel.WornApparel.Where(x => x is bondage_gear).Cast<bondage_gear>().ToList(); List<Hediff> hediffs = new List<Hediff>(); foreach (Hediff h in this.Wearer.health.hediffSet.hediffs) hediffs.Add(h); //checking current hediffs defined by bondage_gear for being on defined place, cleaning up the misplaced bool equippedHediff; bool onPlace; foreach (Hediff hed in hediffs) { equippedHediff = false; onPlace = false; foreach (bondage_gear gear in wornBondageGear) { if (hed.def == (gear.def as bondage_gear_def).equipped_hediff) { //if hediff from bondage_gear and on it's defined place then don't touch it else remove //assuming there can be several different bondages with the same equipped_hediff def and different hediff target parts, don't know why equippedHediff = true; if ((hed.Part != null && (gear.def as bondage_gear_def).HediffTargetBodyPartDefs == null)) { //pass } else if ((hed.Part == null && (gear.def as bondage_gear_def).HediffTargetBodyPartDefs == null)) { onPlace = true; break; } else if (hed.Part != null && (gear.def as bondage_gear_def).HediffTargetBodyPartDefs.Contains(hed.Part.def)) { onPlace = true; break; } } } if (equippedHediff && !onPlace) { ModLog.Message("Removing Hediff " + hed.Label + " from " + Wearer + (hed.Part == null ? "'s body" : "'s " + hed.Part)); RemoveHediffDirect(hed); } } // now iterating every gear for having all hediffs in place, adding missing foreach (bondage_gear gear in wornBondageGear) { if ((gear.def as bondage_gear_def).equipped_hediff == null) continue; if ((gear.def as bondage_gear_def).HediffTargetBodyPartDefs == null) //handling gear without HediffTargetBodyPartDefs { Hediff hed = Wearer.health.hediffSet.hediffs.Find(x => (x.def == (gear.def as bondage_gear_def).equipped_hediff && x.Part == null));//checking hediff defined by gear on whole body if (hed == null) //if no legit hediff, adding { ModLog.Message("Adding missing Hediff " + (gear.def as bondage_gear_def).equipped_hediff.label + " to " + Wearer + "'s body"); ApplyHediffDirect((gear.def as bondage_gear_def).equipped_hediff, null); } } else //handling gear with defined HediffTargetBodyPartDefs { foreach (BodyPartDef partDef in (gear.def as bondage_gear_def).HediffTargetBodyPartDefs) //getting every partDef { foreach (BodyPartRecord partRec in Wearer.RaceProps.body.GetPartsWithDef(partDef)) //checking all parts of def for applyed hediff { Hediff hed = Wearer.health.hediffSet.hediffs.Find(x => (x.def == (gear.def as bondage_gear_def).equipped_hediff && x.Part == partRec));//checking hediff defined by gear on defined place if (hed == null) //if hediff missing, adding { ModLog.Message("Adding missing Hediff " + (gear.def as bondage_gear_def).equipped_hediff.label + " to " + Wearer + "'s " + partRec.Label); ApplyHediffDirect((gear.def as bondage_gear_def).equipped_hediff, partRec); } } } } //possibility of several different items with THE SAME equipped_hediff def ON THE SAME PART is not considered, that's sick } if (changedHediff) { //Possible error in current toil on Notify_HediffChanged() if capacity.Manipulation is involved so making it in the end. //Probably harmless, shouldn't happen again after corrected hediffs will be saved Wearer.health.Notify_HediffChanged(null); } } } public class armbinder : bondage_gear { // Prevents pawns in armbinders from melee attacking //public override bool AllowVerbCast (IntVec3 root, TargetInfo targ) //{ // return false; //} } public class yoke : bondage_gear { // Prevents pawns in armbinders from melee attacking //public override bool AllowVerbCast (IntVec3 root, TargetInfo targ) //{ // return false; //} } public class Restraints : bondage_gear { // Prevents pawns in armbinders from melee attacking //public override bool AllowVerbCast (IntVec3 root, TargetInfo targ) //{ // return false; //} } public class force_off_gear_def : RecipeDef { public ThingDef removes_apparel; public BodyPartDef failure_affects; public List<BodyPartDef> destroys_one_of = null; public List<BodyPartDef> major_burns_on = null; public List<BodyPartDef> minor_burns_on = null; } }
Korth95/rjw
1.2/Source/Modules/Bondage/bondage_gear.cs
C#
mit
13,282
using RimWorld; using Verse; namespace rjw { public class CompMilkableHuman : CompHasGatherableBodyResource { protected override int GatherResourcesIntervalDays => Props.milkIntervalDays; protected override int ResourceAmount => Props.milkAmount; protected override ThingDef ResourceDef => Props.milkDef; protected override string SaveKey => "milkFullness"; public CompProperties_MilkableHuman Props => (CompProperties_MilkableHuman)props; protected override bool Active { get { if (!Active) { return false; } Pawn pawn = parent as Pawn; if (pawn != null) { //idk should probably remove non rjw stuff //should merge Lactating into .cs hediff? //vanilla //C&P? //rjw human //rjw animal if ((!pawn.health.hediffSet.HasHediff(HediffDef.Named("RJW_lactating"), false)) && ((pawn.health.hediffSet.HasHediff(HediffDef.Named("Pregnant"), false) && pawn.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("Pregnant"), false).Visible) //|| (pawn.health.hediffSet.HasHediff(HediffDef.Named("HumanPregnancy"), false) && pawn.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("HumanPregnancy"), false).Visible) || (pawn.health.hediffSet.HasHediff(HediffDef.Named("RJW_pregnancy"), false) && pawn.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy"), false).Visible) || (pawn.health.hediffSet.HasHediff(HediffDef.Named("RJW_pregnancy_beast"), false) && pawn.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_beast"), false).Visible))) { pawn.health.AddHediff(HediffDef.Named("RJW_lactating"), null, null, null); } if ((!Props.milkFemaleOnly || pawn.gender == Gender.Female) && (pawn.ageTracker.CurLifeStage.reproductive) && (pawn.RaceProps.Humanlike) && (pawn.health.hediffSet.HasHediff(HediffDef.Named("RJW_lactating"), false) //|| pawn.health.hediffSet.HasHediff(HediffDef.Named("Lactating_Permanent"), false) //|| pawn.health.hediffSet.HasHediff(HediffDef.Named("Lactating_Natural"), false) //|| pawn.health.hediffSet.HasHediff(HediffDef.Named("Lactating_Drug"), false) )) { return true; } } return false; } } public override string CompInspectStringExtra() { if (!Active) { return null; } return Translator.Translate("MilkFullness") + ": " + GenText.ToStringPercent(this.Fullness); } } }
Korth95/rjw
1.2/Source/Modules/Milking/Comps/CompMilkableHuman.cs
C#
mit
2,444
using Verse; namespace rjw { public class CompProperties_MilkableHuman : CompProperties { public int milkIntervalDays; public int milkAmount = 8; public ThingDef milkDef; public bool milkFemaleOnly = true; public CompProperties_MilkableHuman() { compClass = typeof(CompMilkableHuman); } } }
Korth95/rjw
1.2/Source/Modules/Milking/Comps/CompProperties_MilkableHuman.cs
C#
mit
316
using RimWorld; using Verse; namespace rjw { [DefOf] public static class JobDefOfZ { public static JobDef MilkHuman; static JobDefOfZ() { DefOfHelper.EnsureInitializedInCtor(typeof(JobDefOf)); } } }
Korth95/rjw
1.2/Source/Modules/Milking/JobDrivers/JobDefOfZ.cs
C#
mit
216
using RimWorld; using System; using System.Collections.Generic; using Verse; using Verse.AI; namespace rjw { public abstract class JobDriver_GatherHumanBodyResources : JobDriver_GatherAnimalBodyResources { private float gatherProgress; /* //maybe change? protected abstract int GatherResourcesIntervalDays { get; } //add breastsize modifier? protected abstract int ResourceAmount { get; } //add more milks? protected abstract ThingDef ResourceDef { get; } */ protected override IEnumerable<Toil> MakeNewToils() { ToilFailConditions.FailOnDespawnedNullOrForbidden<JobDriver_GatherHumanBodyResources>(this, TargetIndex.A); ToilFailConditions.FailOnNotCasualInterruptible<JobDriver_GatherHumanBodyResources>(this, TargetIndex.A); yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch); Toil wait = new Toil(); wait.initAction = delegate { Pawn milker = base.pawn; LocalTargetInfo target = base.job.GetTarget(TargetIndex.A); Pawn target2 = (Pawn)target.Thing; milker.pather.StopDead(); PawnUtility.ForceWait(target2, 15000, null, true); }; wait.tickAction = delegate { Pawn milker = base.pawn; milker.skills.Learn(SkillDefOf.Animals, 0.13f, false); gatherProgress += StatExtension.GetStatValue(milker, StatDefOf.AnimalGatherSpeed, true); if (gatherProgress >= WorkTotal) { GetComp((Pawn)base.job.GetTarget(TargetIndex.A)).Gathered(base.pawn); milker.jobs.EndCurrentJob(JobCondition.Succeeded, true); } }; wait.AddFinishAction((Action)delegate { Pawn milker = base.pawn; LocalTargetInfo target = base.job.GetTarget(TargetIndex.A); Pawn target2 = (Pawn)target.Thing; if (target2 != null && target2.CurJobDef == JobDefOf.Wait_MaintainPosture) { milker.jobs.EndCurrentJob(JobCondition.InterruptForced, true); } }); ToilFailConditions.FailOnDespawnedOrNull<Toil>(wait, TargetIndex.A); ToilFailConditions.FailOnCannotTouch<Toil>(wait, TargetIndex.A, PathEndMode.Touch); wait.AddEndCondition((Func<JobCondition>)delegate { if (GetComp((Pawn)base.job.GetTarget(TargetIndex.A)).ActiveAndFull) { return JobCondition.Ongoing; } return JobCondition.Incompletable; }); wait.defaultCompleteMode = ToilCompleteMode.Never; ToilEffects.WithProgressBar(wait, TargetIndex.A, (Func<float>)(() => gatherProgress / WorkTotal), false, -0.5f); wait.activeSkill = (() => SkillDefOf.Animals); yield return wait; } } }
Korth95/rjw
1.2/Source/Modules/Milking/JobDrivers/JobDriver_GatherHumanBodyResources.cs
C#
mit
2,524
using RimWorld; using Verse; namespace rjw { public class JobDriver_MilkHuman : JobDriver_GatherHumanBodyResources { protected override float WorkTotal => 400f; protected override CompHasGatherableBodyResource GetComp(Pawn animal) { return ThingCompUtility.TryGetComp<CompMilkableHuman>(animal); } } }
Korth95/rjw
1.2/Source/Modules/Milking/JobDrivers/JobDriver_MilkHuman.cs
C#
mit
318
using RimWorld; using System.Collections.Generic; using Verse; using Verse.AI; namespace rjw { public abstract class WorkGiver_GatherHumanBodyResources : WorkGiver_GatherAnimalBodyResources { public override IEnumerable<Thing> PotentialWorkThingsGlobal(Pawn pawn) { //List<Pawn> pawns = pawn.Map.mapPawns.SpawnedPawnsInFaction(pawn.Faction); //int i = 0; //if (i < pawns.Count) //{ // yield return (Thing)pawns[i]; /*Error: Unable to find new state assignment for yield return*/ // ; //} foreach (Pawn targetpawn in pawn.Map.mapPawns.FreeColonistsAndPrisonersSpawned) { yield return targetpawn; } } public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false) { Pawn pawn2 = t as Pawn; if (pawn2 == null || !pawn2.RaceProps.Humanlike) { return false; } CompHasGatherableBodyResource comp = GetComp(pawn2); if (comp != null && comp.ActiveAndFull && PawnUtility.CanCasuallyInteractNow(pawn2, false) && pawn2 != pawn) { LocalTargetInfo target = pawn2; bool ignoreOtherReservations = forced; if (ReservationUtility.CanReserve(pawn, target, 1, -1, null, ignoreOtherReservations)) { return true; } } return false; } } }
Korth95/rjw
1.2/Source/Modules/Milking/WorkGivers/WorkGiver_GatherHumanBodyResources.cs
C#
mit
1,240
using RimWorld; using Verse; namespace rjw { public class WorkGiver_MilkHuman : WorkGiver_GatherHumanBodyResources { protected override JobDef JobDef => JobDefOfZ.MilkHuman; protected override CompHasGatherableBodyResource GetComp(Pawn animal) { return ThingCompUtility.TryGetComp<CompMilkableHuman>(animal); } } }
Korth95/rjw
1.2/Source/Modules/Milking/WorkGivers/WorkGiver_MilkHuman.cs
C#
mit
331
using Verse; using RimWorld; using Multiplayer.API; namespace rjw { [StaticConstructorOnStartup] public static class RJW_Multiplayer { static RJW_Multiplayer() { if (!MP.enabled) return; // This is where the magic happens and your attributes // auto register, similar to Harmony's PatchAll. MP.RegisterAll(); /* Log.Message("RJW MP compat testing"); var type = AccessTools.TypeByName("rjw.RJWdesignations"); //Log.Message("rjw MP compat " + type.Name); Log.Message("is host " + MP.IsHosting); Log.Message("PlayerName " + MP.PlayerName); Log.Message("IsInMultiplayer " + MP.IsInMultiplayer); //MP.RegisterSyncMethod(type, "Comfort"); /* MP.RegisterSyncMethod(type, "<GetGizmos>Service"); MP.RegisterSyncMethod(type, "<GetGizmos>BreedingHuman"); MP.RegisterSyncMethod(type, "<GetGizmos>BreedingAnimal"); MP.RegisterSyncMethod(type, "<GetGizmos>Breeder"); MP.RegisterSyncMethod(type, "<GetGizmos>Milking"); MP.RegisterSyncMethod(type, "<GetGizmos>Hero"); */ // You can choose to not auto register and do it manually // with the MP.Register* methods. // Use MP.IsInMultiplayer to act upon it in other places // user can have it enabled and not be in session } //generate PredictableSeed for Verse.Rand public static int PredictableSeed() { int seed = 0; try { Map map = Find.CurrentMap; //int seedHourOfDay = GenLocalDate.HourOfDay(map); //int seedDayOfYear = GenLocalDate.DayOfYear(map); //int seedYear = GenLocalDate.Year(map); seed = (GenLocalDate.HourOfDay(map) + GenLocalDate.DayOfYear(map)) * GenLocalDate.Year(map); //int seed = (seedHourOfDay + seedDayOfYear) * seedYear; //Log.Warning("seedHourOfDay: " + seedHourOfDay + "\nseedDayOfYear: " + seedDayOfYear + "\nseedYear: " + seedYear + "\n" + seed); } catch { seed = Rand.Int; } return seed; } //generate PredictableSeed for Verse.Rand [SyncMethod] public static float RJW_MP_RAND() { return Rand.Value; } } }
Korth95/rjw
1.2/Source/Modules/Multiplayer/Multiplayer.cs
C#
mit
2,049
using System.Linq; using RimWorld; using Verse; using Multiplayer.API; namespace rjw { public class IncidentWorker_NymphJoins : IncidentWorker { protected override bool CanFireNowSub(IncidentParms parms) { if (!RJWSettings.NymphTamed) return false; Map map = (Map)parms.target; float colonist_count = map.mapPawns.FreeColonistsCount; float nymph_count = map.mapPawns.FreeColonists.Count(xxx.is_nympho); float nymph_fraction = nymph_count / colonist_count; return colonist_count >= 1 && (nymph_fraction < xxx.config.max_nymph_fraction); } [SyncMethod] protected override bool TryExecuteWorker(IncidentParms parms) { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() called"); if (!RJWSettings.NymphTamed) return false; if (MP.IsInMultiplayer) return false; Map map = (Map) parms.target; if (map == null) { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is null, abort!"); return false; } else { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is ok"); } //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); if (!RCellFinder.TryFindRandomPawnEntryCell(out IntVec3 loc, map, CellFinder.EdgeRoadChance_Friendly + 0.2f)) { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - no entry, abort!"); return false; } Pawn pawn = Nymph_Generator.GenerateNymph(loc, ref map); //generates with null faction, mod conflict ?! pawn.SetFaction(Faction.OfPlayer); GenSpawn.Spawn(pawn, loc, map); Find.LetterStack.ReceiveLetter("Nymph Joins", "A wandering nymph has decided to join your settlement.", LetterDefOf.PositiveEvent, pawn); return true; } } }
Korth95/rjw
1.2/Source/Modules/Nymphs/Incidents/IncidentWorker_NymphJoins.cs
C#
mit
1,721
using System.Linq; using RimWorld; using Verse; using Multiplayer.API; namespace rjw { public class IncidentWorker_NymphVisitor : IncidentWorker { [SyncMethod] protected override bool TryExecuteWorker(IncidentParms parms) { //--Log.Message("IncidentWorker_NymphVisitor::TryExecute() called"); if (!RJWSettings.NymphWild) return false; if (MP.IsInMultiplayer) return false; Map map = (Map) parms.target; if (map == null) { //--Log.Message("IncidentWorker_NymphVisitor::TryExecute() - map is null, abort!"); return false; } else { //--Log.Message("IncidentWorker_NymphVisitor::TryExecute() - map is ok"); } //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); if (!RCellFinder.TryFindRandomPawnEntryCell(out IntVec3 loc, map, CellFinder.EdgeRoadChance_Friendly + 0.2f)) { //--Log.Message("IncidentWorker_NymphVisitor::TryExecute() - no entry, abort!"); return false; } Pawn pawn = Nymph_Generator.GenerateNymph(loc, ref map); //generates with null faction, mod conflict ?! GenSpawn.Spawn(pawn, loc, map); pawn.ChangeKind(PawnKindDefOf.WildMan); //if (pawn.Faction != null) // pawn.SetFaction(null); if (RJWSettings.NymphPermanentManhunter) pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.ManhunterPermanent); else pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.Manhunter); Find.LetterStack.ReceiveLetter("Nymph! ", "A wandering nymph has decided to visit your settlement.", LetterDefOf.ThreatSmall, pawn); return true; } } }
Korth95/rjw
1.2/Source/Modules/Nymphs/Incidents/IncidentWorker_NymphVisitor.cs
C#
mit
1,608
using RimWorld; using Verse; using Multiplayer.API; namespace rjw { public class IncidentWorker_NymphVisitorGroupEasy : IncidentWorker_NeutralGroup { private static readonly SimpleCurve PointsCurve = new SimpleCurve { new CurvePoint(45f, 0f), new CurvePoint(50f, 1f), new CurvePoint(100f, 1f), new CurvePoint(200f, 0.25f), new CurvePoint(300f, 0.1f), new CurvePoint(500f, 0f) }; [SyncMethod] protected override void ResolveParmsPoints(IncidentParms parms) { if (!(parms.points >= 0f)) { parms.points = Rand.ByCurve(PointsCurve); } } [SyncMethod] protected override bool TryExecuteWorker(IncidentParms parms) { //--Log.Message("IncidentWorker_NymphVisitorGroup::TryExecute() called"); if (!RJWSettings.NymphRaidEasy) return false; if (MP.IsInMultiplayer) return false; Map map = (Map)parms.target; if (map == null) { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is null, abort!"); return false; } else { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is ok"); } //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); if (!RCellFinder.TryFindRandomPawnEntryCell(out IntVec3 loc, map, CellFinder.EdgeRoadChance_Friendly + 0.2f)) { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - no entry, abort!"); return false; } //var PlayerHomeMap = Find.Maps.Find(map => map.IsPlayerHome); var count = (Find.World.worldPawns.AllPawnsAlive.Count + map.mapPawns.FreeColonistsAndPrisonersSpawnedCount); //Log.Message("IncidentWorker_NymphJoins::TryExecute() -count:" + count + " map:" + PlayerHomeMap); for (int i = 1; i <= count || i <= 100; ++i) { Pawn pawn = Nymph_Generator.GenerateNymph(loc, ref map); //pawn.SetFaction(Faction.OfPlayer); GenSpawn.Spawn(pawn, loc, map); pawn.ChangeKind(PawnKindDefOf.WildMan); //if (pawn.Faction != null) // pawn.SetFaction(null); if (RJWSettings.NymphPermanentManhunter) pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.ManhunterPermanent); else pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.Manhunter); } Find.LetterStack.ReceiveLetter("Nymphs!!!", "A group of nymphs has wandered into your settlement.", LetterDefOf.ThreatBig, null); return true; } } }
Korth95/rjw
1.2/Source/Modules/Nymphs/Incidents/IncidentWorker_NymphVisitorGroupE.cs
C#
mit
2,383
using RimWorld; using Verse; using Multiplayer.API; namespace rjw { public class IncidentWorker_NymphVisitorGroupHard : IncidentWorker_NeutralGroup { private static readonly SimpleCurve PointsCurve = new SimpleCurve { new CurvePoint(45f, 0f), new CurvePoint(50f, 1f), new CurvePoint(100f, 1f), new CurvePoint(200f, 0.25f), new CurvePoint(300f, 0.1f), new CurvePoint(500f, 0f) }; [SyncMethod] protected override void ResolveParmsPoints(IncidentParms parms) { if (!(parms.points >= 0f)) { parms.points = Rand.ByCurve(PointsCurve); } } [SyncMethod] protected override bool TryExecuteWorker(IncidentParms parms) { //--Log.Message("IncidentWorker_NymphVisitorGroup::TryExecute() called"); if (!RJWSettings.NymphRaidHard) return false; if (MP.IsInMultiplayer) return false; Map map = (Map)parms.target; if (map == null) { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is null, abort!"); return false; } else { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is ok"); } //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); if (!RCellFinder.TryFindRandomPawnEntryCell(out IntVec3 loc, map, CellFinder.EdgeRoadChance_Friendly + 0.2f)) { //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - no entry, abort!"); return false; } var count = map.mapPawns.AllPawnsSpawnedCount; //Log.Message("IncidentWorker_NymphJoins::TryExecute() -count:" + count); for (int i = 1; i <= count || i <= 1000; ++i) { Pawn pawn = Nymph_Generator.GenerateNymph(loc, ref map); //pawn.SetFaction(Faction.OfPlayer); GenSpawn.Spawn(pawn, loc, map); pawn.ChangeKind(PawnKindDefOf.WildMan); //if (pawn.Faction != null) // pawn.SetFaction(null); if (RJWSettings.NymphPermanentManhunter) pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.ManhunterPermanent); else pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.Manhunter); } Find.LetterStack.ReceiveLetter("Nymphs!!!", "A huge group of nymphs has wandered into your settlement.", LetterDefOf.ThreatBig, null); return true; } } }
Korth95/rjw
1.2/Source/Modules/Nymphs/Incidents/IncidentWorker_NymphVisitorGroupH.cs
C#
mit
2,233
using System; using RimWorld; using Verse; using Multiplayer.API; namespace rjw { public class IncidentWorker_TestInc : IncidentWorker { public static void list_backstories() { foreach (var bs in BackstoryDatabase.allBackstories.Values) ModLog.Message("Backstory \"" + bs.title + "\" has identifier \"" + bs.identifier + "\""); } public static void inject_designator() { //var des = new Designator_ComfortPrisoner(); //Find.ReverseDesignatorDatabase.AllDesignators.Add(des); //Find.ReverseDesignatorDatabase.AllDesignators.Add(new Designator_Breed()); } // Applies permanent damage to a randomly chosen colonist, to test that this works [SyncMethod] public static void damage_virally(Map m) { var vir_dam = DefDatabase<DamageDef>.GetNamed("ViralDamage"); var p = m.mapPawns.FreeColonists.RandomElement(); var lun = p.RaceProps.body.AllParts.Find((BodyPartRecord bpr) => String.Equals(bpr.def.defName, "LeftLung")); var dam_def = HealthUtility.GetHediffDefFromDamage(vir_dam, p, lun); var inj = (Hediff_Injury)HediffMaker.MakeHediff(dam_def, p, null); inj.Severity = 2.0f; inj.TryGetComp<HediffComp_GetsPermanent>().IsPermanent = true; p.health.AddHediff(inj, lun, null); } // Gives all colonists on the map a severe syphilis or HIV infection [SyncMethod] public static void infect_the_colonists(Map m) { foreach (var p in m.mapPawns.FreeColonists) { if (Rand.Value < 0.50f) std_spreader.infect(p, std.syphilis); // var std_hed_def = (Rand.Value < 0.50f) ? std.syphilis.hediff_def : std.hiv.hediff_def; // p.health.AddHediff (std_hed_def); // p.health.hediffSet.GetFirstHediffOfDef (std_hed_def).Severity = Rand.Range (0.50f, 0.90f); } } // Reduces the sex need of the selected pawn public static void reduce_sex_need_on_select(Map m) { Pawn pawn = Find.Selector.SingleSelectedThing as Pawn; if (pawn != null) { if (pawn.needs.TryGetNeed<Need_Sex>() != null) { //--ModLog.Message("TestInc::reduce_sex_need_on_select is called"); pawn.needs.TryGetNeed<Need_Sex>().CurLevel -= 0.5f; } } } protected override bool TryExecuteWorker(IncidentParms parms) { var m = (Map)parms.target; // list_backstories (); // inject_designator (); // spawn_nymphs (m); // damage_virally (m); //infect_the_colonists(m); reduce_sex_need_on_select(m); return true; } } }
Korth95/rjw
1.2/Source/Modules/Nymphs/Incidents/IncidentWorker_TestInc.cs
C#
mit
2,434
using RimWorld; using UnityEngine; using Verse; namespace rjw { public class IncidentWorker_TestInc2 : IncidentWorker { // Testing the mechanism of some build-in functions public static void test_funcion() { float a = Mathf.InverseLerp(0, 2, 3); //gives 1 float b = Mathf.InverseLerp(0.2f, 2, 0.1f); //gives 0 float c = Mathf.InverseLerp(2f, 1, 2.5f); //gives 0 //--ModLog.Message("TestInc2::test_function is called - value a is " + a); //--ModLog.Message("TestInc2::test_function is called - value b is " + b); //--ModLog.Message("TestInc2::test_function is called - value c is " + c); } // Gives the wanted information of the selected thing public static void info_on_select(Map m) { Pawn p = Find.Selector.SingleSelectedThing as Pawn; if (p != null) { //--ModLog.Message("TestInc2::info_on_select is called"); foreach (var q in m.mapPawns.AllPawns) { SexAppraiser.would_fuck(p, q, true); } } } protected override bool TryExecuteWorker(IncidentParms parms) { var m = (Map)parms.target; info_on_select(m); return true; } } }
Korth95/rjw
1.2/Source/Modules/Nymphs/Incidents/IncidentWorker_TestInc2.cs
C#
mit
1,154
using System; using System.Linq; using Verse; using Verse.AI; using Verse.AI.Group; using RimWorld; namespace rjw { // Token: 0x020006B5 RID: 1717 public class JobGiver_NymphSapper : ThinkNode_JobGiver { // Token: 0x06002E54 RID: 11860 RVA: 0x001041A7 File Offset: 0x001023A7 public override ThinkNode DeepCopy(bool resolve = true) { JobGiver_NymphSapper jobGiver_NymphSapper = (JobGiver_NymphSapper)base.DeepCopy(resolve); jobGiver_NymphSapper.canMineMineables = this.canMineMineables; jobGiver_NymphSapper.canMineNonMineables = this.canMineNonMineables; return jobGiver_NymphSapper; } // Token: 0x06002E55 RID: 11861 RVA: 0x001041D0 File Offset: 0x001023D0 protected override Job TryGiveJob(Pawn pawn) { if (!RJWSettings.NymphSappers) return null; if (!xxx.is_nympho(pawn)) return null; IntVec3 intVec; { IAttackTarget attackTarget; if (!(from x in pawn.Map.mapPawns.FreeColonistsAndPrisonersSpawned where !x.ThreatDisabled(pawn) && pawn.CanReach(x, PathEndMode.OnCell, Danger.Deadly, false, TraverseMode.PassAllDestroyableThings) select x).TryRandomElement(out attackTarget)) { return null; } intVec = attackTarget.Thing.Position; } using (PawnPath pawnPath = pawn.Map.pathFinder.FindPath(pawn.Position, intVec, TraverseParms.For(pawn, Danger.Deadly, TraverseMode.PassDoors, false), PathEndMode.OnCell)) { IntVec3 cellBeforeBlocker; Thing thing = pawnPath.FirstBlockingBuilding(out cellBeforeBlocker, pawn); if (thing != null) { Job job = DigUtility.PassBlockerJob(pawn, thing, cellBeforeBlocker, this.canMineMineables, this.canMineNonMineables); if (job != null) { return job; } } } return JobMaker.MakeJob(JobDefOf.Goto, intVec, 500, true); } // Token: 0x04001A64 RID: 6756 private bool canMineMineables = false; // Token: 0x04001A65 RID: 6757 private bool canMineNonMineables = false; // Token: 0x04001A66 RID: 6758 private const float ReachDestDist = 10f; // Token: 0x04001A67 RID: 6759 private const int CheckOverrideInterval = 500; } }
Korth95/rjw
1.2/Source/Modules/Nymphs/JobGivers/JobGiver_NymphSapper.cs
C#
mit
2,117