public static TaleData_Surroundings GenerateFrom(IntVec3 c, Map map)
        {
            TaleData_Surroundings taleData_Surroundings = new TaleData_Surroundings();

            taleData_Surroundings.tile = map.Tile;
            Room roomOrAdjacent = c.GetRoomOrAdjacent(map, RegionType.Set_All);

            if (roomOrAdjacent != null)
            {
                if (roomOrAdjacent.PsychologicallyOutdoors)
                {
                    taleData_Surroundings.weather = map.weatherManager.CurWeatherPerceived;
                }
                taleData_Surroundings.roomRole           = roomOrAdjacent.Role;
                taleData_Surroundings.roomImpressiveness = roomOrAdjacent.GetStat(RoomStatDefOf.Impressiveness);
                taleData_Surroundings.roomBeauty         = roomOrAdjacent.GetStat(RoomStatDefOf.Beauty);
                taleData_Surroundings.roomCleanliness    = roomOrAdjacent.GetStat(RoomStatDefOf.Cleanliness);
            }
            if (!GenTemperature.TryGetTemperatureForCell(c, map, out taleData_Surroundings.temperature))
            {
                taleData_Surroundings.temperature = 21f;
            }
            taleData_Surroundings.snowDepth = map.snowGrid.GetDepth(c);
            return(taleData_Surroundings);
        }
示例#2
0
 public Tale_SinglePawn(Pawn pawn)
 {
     pawnData = TaleData_Pawn.GenerateFrom(pawn);
     if (pawn.SpawnedOrAnyParentSpawned)
     {
         surroundings = TaleData_Surroundings.GenerateFrom(pawn.PositionHeld, pawn.MapHeld);
     }
 }
示例#3
0
 public virtual void GenerateTestData()
 {
     if (Find.CurrentMap == null)
     {
         Log.Error("Can't generate test data because there is no map.", false);
     }
     this.date         = Rand.Range(-108000000, -7200000);
     this.surroundings = TaleData_Surroundings.GenerateRandom(Find.CurrentMap);
 }
示例#4
0
 public Tale_DoublePawn(Pawn firstPawn, Pawn secondPawn)
 {
     firstPawnData = TaleData_Pawn.GenerateFrom(firstPawn);
     if (secondPawn != null)
     {
         secondPawnData = TaleData_Pawn.GenerateFrom(secondPawn);
     }
     if (firstPawn.SpawnedOrAnyParentSpawned)
     {
         surroundings = TaleData_Surroundings.GenerateFrom(firstPawn.PositionHeld, firstPawn.MapHeld);
     }
 }
示例#5
0
 public static TaleData_Surroundings GenerateRandom(Map map)
 {
     return(TaleData_Surroundings.GenerateFrom(CellFinder.RandomCell(map), map));
 }