Example #1
0
 private static bool IsInOrByBed(Building_WhoreBed b, Pawn p)
 {
     for (int i = 0; i < b.SleepingSlotsCount; i++)
     {
         if (b.GetSleepingSlotPos(i).InHorDistOf(p.Position, 1f))
         {
             return(true);
         }
     }
     return(false);
 }
Example #2
0
 private static IntVec3 GetSleepingSpot(Building_WhoreBed bed, IntVec3 exceptPosition)
 {
     for (int i = 0; i < bed.SleepingSlotsCount; i++)
     {
         if (bed.GetCurOccupant(i) == null && bed.GetSleepingSlotPos(i) != exceptPosition)
         {
             return(bed.GetSleepingSlotPos(i));
         }
     }
     return(exceptPosition);
 }
Example #3
0
 private static IntVec3 GetSleepingSpot(Building_WhoreBed bed)
 {
     for (int i = 0; i < bed.SleepingSlotsCount; i++)
     {
         if (bed.GetCurOccupant(i) == null)
         {
             return(bed.GetSleepingSlotPos(i));
         }
     }
     return(bed.GetSleepingSlotPos(0));
 }
            public static void Postfix(Building_Bed __instance)
            {
                if (!__instance.ForPrisoners)
                {
                    return;
                }

                if (__instance is Building_WhoreBed)
                {
                    Building_WhoreBed.Swap(__instance);
                }
            }
Example #5
0
        protected override Job TryGiveJob(Pawn pawn)
        {
            //--Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::TryGiveJob( " + pawn.NameStringShort + " ) called0");
            if (pawn == null || !InteractionUtility.CanInitiateInteraction(pawn))
            {
                return(null);
            }
            if (PawnUtility.WillSoonHaveBasicNeed(pawn) || !xxx.is_healthy(pawn) || !xxx.can_be_fucked(pawn))             //As long as pawns is older than minimum sex age, they can be assigned as w****s.
            {
                return(null);
            }

            if (Find.TickManager.TicksGame >= pawn.mindState.canLovinTick && pawn.CurJob == null)
            {
                int  price;
                Pawn pawn2 = FindAttractivePawn(pawn, out price);
                //--Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::TryGiveJob( " + pawn.NameStringShort + " ) called1 - pawn2 is " + (pawn2 == null ? "NULL" : pawn2.NameStringShort));
                if (pawn2 == null)
                {
                    return(null);
                }
                Building_WhoreBed whorebed = xxx.FindWhoreBed(pawn);
                if ((whorebed == null) || !xxx.CanUse(pawn, whorebed) || (100f * Rand.Value) > percentRate)
                {
                    //--Log.Message("resetting ticks");
                    if (xxx.config.whores_always_findjob)
                    {
                        pawn.mindState.canLovinTick = Find.TickManager.TicksGame + 5;
                    }
                    else
                    {
                        pawn.mindState.canLovinTick = Find.TickManager.TicksGame + Rand.Range(75, 150);
                    }
                    return(null);
                }
                //--Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::TryGiveJob( " + pawn.NameStringShort + " ) called2 - " + pawn2.NameStringShort + " is pawn2.");
                whorebed.priceOfWhore = price;
                return(new Job(xxx.inviting_visitors, pawn2, whorebed));
            }
            return(null);
        }
 private static IEnumerable <Gizmo> Process(Building_Bed __instance, IEnumerable <Gizmo> __result)
 {
     foreach (var gizmo in __result)
     {
         yield return(gizmo);
     }
     if (__instance != null && !__instance.ForPrisoners && !__instance.Medical && __instance.def.building.bed_humanlike)
     {
         //--Log.Message("[RJW]Building_Bed_Patch::Process - before new Command_Toggle is called");
         yield return
             (new Command_Toggle
         {
             defaultLabel = "CommandBedSetAsWhoreLabel".Translate(),
             defaultDesc = "CommandBedSetAsWhoreDesc".Translate(),
             icon = ContentFinder <Texture2D> .Get("UI/Commands/AsWhore"),
             isActive = () => __instance is Building_WhoreBed,
             toggleAction = () => Building_WhoreBed.Swap(__instance),
             hotKey = KeyBindingDefOf.Misc4
         });
     }
 }