rjw-whoring/1.5/Source/Mod/Location/Brothel_Room.cs
2024-05-24 16:03:45 +03:00

28 lines
No EOL
638 B
C#

using Verse;
using RimWorld;
namespace rjwwhoring
{
public class RoomRoleWorker_Brothel : RoomRoleWorker
{
public override float GetScore(Room room)
{
int num = 0;
var allContainedThings = room.ContainedAndAdjacentThings;
foreach (var thing in allContainedThings)
{
var building_Bed = thing as Building_Bed;
if (building_Bed?.def.building.bed_humanlike == true)
{
if (building_Bed.ForPrisoners) return 0;
if (building_Bed.IsAllowedForWhoringAll()) num++;
}
}
if (num < 1) return 0;
return num * 110001; // higher than guest beds or "regular" beds when counting barracks
}
}
}