Exemple #1
0
        public static void StartPrisonBreak(Pawn initiator)
        {
            PrisonBreakUtility.participatingRooms.Clear();
            foreach (IntVec3 current in GenRadial.RadialCellsAround(initiator.Position, 20f, true))
            {
                if (current.InBounds(initiator.Map))
                {
                    Room room = current.GetRoom(initiator.Map, RegionType.Set_Passable);
                    if (room != null && room.isPrisonCell)
                    {
                        PrisonBreakUtility.participatingRooms.Add(room);
                    }
                }
            }
            PrisonBreakUtility.RemoveRandomRooms(PrisonBreakUtility.participatingRooms, initiator);
            int sapperThingID = -1;

            if (Rand.Value < 0.5f)
            {
                sapperThingID = initiator.thingIDNumber;
            }
            PrisonBreakUtility.allEscapingPrisoners.Clear();
            foreach (Room current2 in PrisonBreakUtility.participatingRooms)
            {
                PrisonBreakUtility.StartPrisonBreakIn(current2, PrisonBreakUtility.allEscapingPrisoners, sapperThingID, PrisonBreakUtility.participatingRooms);
            }
            PrisonBreakUtility.participatingRooms.Clear();
            if (PrisonBreakUtility.allEscapingPrisoners.Any <Pawn>())
            {
                PrisonBreakUtility.SendPrisonBreakLetter(PrisonBreakUtility.allEscapingPrisoners);
            }
            PrisonBreakUtility.allEscapingPrisoners.Clear();
        }