Example #1
0
 /// <returns>Key is towards surface; Value is deeper</returns>
 public KeyValuePair <Map, Map>?NavigatePoliceStation(Map x)
 {
     if (PoliceStation_OfficesLevel.TheMap == x)
     {
         return(new KeyValuePair <Map, Map>(x.District.EntryMap, PoliceStation_JailsLevel.TheMap));
     }
     if (PoliceStation_JailsLevel.TheMap == x)
     {
         return(new KeyValuePair <Map, Map>(PoliceStation_OfficesLevel.TheMap, null));
     }
     return(null);
 }
Example #2
0
 // numerical representation
 public int PoliceStationDepth(Map x)
 {
     if (PoliceStation_OfficesLevel.TheMap == x)
     {
         return(1);
     }
     if (PoliceStation_JailsLevel.TheMap == x)
     {
         return(2);
     }
     return(0);
 }
Example #3
0
        private void init_SewersThing(BaseTownGenerator tgen)
        {
#if DEBUG
            if (null != TheSewersThing)
            {
                throw new InvalidOperationException("only call UniqueActors::init_SewersThing once");
            }
#endif
            Map        map    = tgen.RandomDistrictInCity().SewersMap;
            Actor      named  = GameActors.SewersThing.CreateNamed(GameFactions.TheUndeads, "The Sewers Thing", 0);
            DiceRoller roller = new DiceRoller(map.Seed);
            if (!MapGenerator.ActorPlace(roller, map, named))
            {
                throw new InvalidOperationException("could not spawn unique The Sewers Thing");
            }
            Zone zoneByPartialName = map.GetZoneByPartialName("Sewers Maintenance");
            if (zoneByPartialName != null)
            {
                MapGenerator.MapObjectPlaceInGoodPosition(map, zoneByPartialName.Bounds, pt => {
                    return(map.IsWalkable(pt) && !map.HasActorAt(in pt) && !map.HasItemsAt(pt) && !map.HasExitAt(in pt));
                }, roller, pt => BaseMapGenerator.MakeObjBoard(GameImages.OBJ_BOARD, new string[] {
Example #4
0
 /// <returns>Key is towards surface; Value is deeper</returns>
 public KeyValuePair <Map, Map>?NavigateHospital(Map x)
 {
     if (Hospital_Admissions.TheMap == x)
     {
         return(new KeyValuePair <Map, Map>(x.District.EntryMap, Hospital_Offices.TheMap));
     }
     if (Hospital_Offices.TheMap == x)
     {
         return(new KeyValuePair <Map, Map>(Hospital_Admissions.TheMap, Hospital_Patients.TheMap));
     }
     if (Hospital_Patients.TheMap == x)
     {
         return(new KeyValuePair <Map, Map>(Hospital_Offices.TheMap, Hospital_Storage.TheMap));
     }
     if (Hospital_Storage.TheMap == x)
     {
         return(new KeyValuePair <Map, Map>(Hospital_Patients.TheMap, Hospital_Power.TheMap));
     }
     if (Hospital_Power.TheMap == x)
     {
         return(new KeyValuePair <Map, Map>(Hospital_Storage.TheMap, null));
     }
     return(null);
 }
Example #5
0
 public int HospitalDepth(Map x)
 {
     if (Hospital_Admissions.TheMap == x)
     {
         return(1);
     }
     if (Hospital_Offices.TheMap == x)
     {
         return(2);
     }
     if (Hospital_Patients.TheMap == x)
     {
         return(3);
     }
     if (Hospital_Storage.TheMap == x)
     {
         return(4);
     }
     if (Hospital_Power.TheMap == x)
     {
         return(5);
     }
     return(0);
 }