Elin Decompiled Documentation EA 23.359.1 Nightly
Loading...
Searching...
No Matches
Map Class Reference
Inheritance diagram for Map:
MapBounds IPathfindGrid EClass

Public Member Functions

void CreateNew (int size, bool setReference=true)
 
void SetZone (Zone _zone)
 
void SetReference ()
 
void OnDeactivate ()
 
void Resize (int newSize)
 
void Shift (Vector2Int offset)
 
void Reload ()
 
void ReloadRoom ()
 
void Reset ()
 
void ResetEditorPos ()
 
void Save (string path, ZoneExportData export=null, PartialMap partial=null)
 
byte[] TryLoadFile (string path, string s, int size)
 
void Load (string path, bool import=false, PartialMap partial=null)
 
void ValidateVersion ()
 
void OnLoad ()
 
void OnImport (ZoneExportData data)
 
void ExportMetaData (string _path, string id, PartialMap partial=null)
 
void AddCardOnActivate (Card c)
 
void OnCardAddedToZone (Card t, int x, int z)
 
void OnCardRemovedFromZone (Card t)
 
void MoveCard (Point p, Card t)
 
void _AddCard (int x, int z, Card t, bool onAddToZone)
 
void _RemoveCard (Card t)
 
Cell GetCell (int index)
 
void SetSeen (int x, int z, bool seen=true, bool refresh=true)
 
void RevealAll (bool reveal=true)
 
void Reveal (Point center, int power=100)
 
void RefreshFOV (int x, int z, int radius=6, bool recalculate=false)
 
void RefreshFOVAll ()
 
void SetFloor (int x, int z, int idMat=0, int idFloor=0)
 
void SetFloor (int x, int z, int idMat, int idFloor, int dir)
 
void SetDeco (int x, int z, int idMat, int idDeco)
 
void SetBridge (int x, int z, int height=0, int idMat=0, int idBridge=0, int dir=0, int idPillar=0, bool hidePillar=false)
 
void SetRoofBlock (int x, int z, int idMat, int idBlock, int dir, int height)
 
void SetBlock (int x, int z, int idMat=0, int idBlock=0)
 
void SetBlock (int x, int z, int idMat, int idBlock, int dir)
 
void OnSetBlockOrDoor (int x, int z)
 
void TryRemoveRoom (int x, int z)
 
void TryAddRoom (int x, int z)
 
void SetBlockDir (int x, int z, int dir)
 
void ModFire (int x, int z, int amount)
 
void TryShatter (Point pos, int ele, int power, Card CC=null)
 
void Burn (int x, int z, bool instant=false)
 
void SetLiquid (int x, int z, CellEffect effect=null)
 
void SetLiquid (int x, int z, int id, int value=1)
 
void SetEffect (int x, int z, CellEffect effect=null)
 
void ModLiquid (int x, int z, int amount)
 
void ClearRainAndDecal ()
 
void SetObj (int x, int z, int id=0, int value=1, int dir=0)
 
void SetObj (int x, int z, int idMat, int idObj, int value, int dir, bool ignoreRandomMat=false)
 
void AddBackerTree (bool draw)
 
SourceBacker.Row GetBackerObj (Point p)
 
void ApplyBackerObj (Point p, int id=-1)
 
void DropBlockComponent (Point point, TileRow r, SourceMaterial.Row mat, bool recoverBlock, bool isPlatform=false, Chara c=null)
 
void MineBlock (Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
 
void MineRamp (Point point, int ramp, bool recoverBlock=false)
 
void MineFloor (Point point, Chara c=null, bool recoverBlock=false, bool removePlatform=true)
 
void RefreshShadow (int x, int z)
 
void TrySmoothPick (Cell cell, Thing t, Chara c)
 
void TrySmoothPick (Point p, Thing t, Chara c)
 
void DestroyObj (Point point)
 
void MineObj (Point point, Task task=null, Chara c=null)
 
void MineObjSound (Point point)
 
PlantData TryGetPlant (Point p)
 
PlantData TryGetPlant (Cell c)
 
PlantData AddPlant (Point pos, Thing seed)
 
void RemovePlant (Point pos)
 
void ValidateInstalled (Point p)
 
void _ValidateInstalled (int x, int y)
 
void RemoveLonelyRamps (Cell cell)
 
void DestroyBlock (int x, int z)
 
void AddDecal (int x, int z, int id, int amount=1, bool refresh=true)
 
void SetDecal (int x, int z, int id=0, int amount=1, bool refresh=true)
 
void SetFoormark (Point pos, int id, int angle, int offset=0)
 
int AngleToIndex (int a)
 
void RefreshSingleTile (int x, int z)
 
void RefreshAllTiles ()
 
void RefreshNeighborTiles (int x, int z)
 
void QuickRefreshTile (int x, int z)
 
int GetRampDir (int x, int z, TileType blockType=null)
 
Cell GetDependedRamp (Cell cell)
 
Point GetRandomPoint (Point center, int radius, int tries=100, bool mustBeWalkable=true, bool requireLos=true)
 
new Point GetRandomEdge (int r=3)
 
Point GetNearbyResourcePoint (Point center)
 
List< Point > ListPointsInCircle (Point center, float radius, bool mustBeWalkable=true, bool los=true)
 
List< Point > ListPointsInSquare (Point center, int radius, bool mustBeWalkable=true, bool los=true)
 
List< Point > ListPointsOnEdge (Point center, int destDist, bool mustBeWalkable=true, bool los=true)
 
List< Chara > ListCharasInCircle (Point center, float radius, bool los=true)
 
List< Point > ListPointsInArc (Point center, Point to, int radius, float angle)
 
List< Point > ListPointsInLine (Point center, Point to, int radius, bool returnOnBlocked=true)
 
void SetBounds (int size)
 
void SetBounds (MapBounds b)
 
new void ForeachCell (Action< Cell > action)
 
new void ForeachPoint (Action< Point > action)
 
new void ForeachXYZ (Action< int, int > action)
 
void ForeachSphere (int _x, int _z, float r, Action< Point > action)
 
void ForeachSquare (int _x, int _z, int r, Action< Point > action)
 
void ForeachNeighbor (Point center, Action< Point > action)
 
void Quake ()
 
int CountChara (Faction faction)
 
int CountGuest ()
 
int CountHostile ()
 
int CountWildAnimal ()
 
int CountNonHostile ()
 
List< Chara > ListChara (Faction faction)
 
List< Thing > ListThing< T > ()
 
bool PutAway (Card c)
 
Chara FindChara (string id)
 
Chara FindChara (int uid)
 
Thing FindThing (Func< Thing, bool > func)
 
Thing FindThing (int uid)
 
T FindThing< T > ()
 
Thing FindThing (Type type, Chara c=null)
 
Thing FindThing (Type type, BaseArea area1, BaseArea area2=null)
 
Thing FindThing (string workTag, BaseArea area1=null, BaseArea area2=null)
 
Thing FindThing (string workTag, Chara c)
 
BaseArea FindPublicArea ()
 
void RefreshSunMap ()
 
- Public Member Functions inherited from MapBounds
void SetBounds (int _x, int _z, int _maxX, int _maxZ)
 
bool Contains (int dx, int dz)
 
bool Contains (Point p)
 
Point GetCenterPos ()
 
Point GetRandomTopPos ()
 
Point GetRandomRightPos ()
 
Point GetRandomBottomPos ()
 
Point GetRandomLeftPos ()
 
Point GetTopPos (float rate=-1f)
 
Point GetRightPos (float rate=-1f)
 
Point GetBottomPos (float rate=-1f)
 
Point GetLeftPos (float rate=-1f)
 
Point GetRandomPoint ()
 
Point GetSpawnPos (int x, int z, int maxX, int maxZ)
 
bool CanExpand (int a)
 
void Expand (int a)
 
Point GetSurface (int x, int z, bool walkable=true)
 
Point GetRandomSurface (int x, int z, int radius, bool walkable=true, bool allowWater=false)
 
Point GetRandomSurface (bool centered=false, bool walkable=true, bool allowWater=false)
 
Point GetRandomSpawnPos ()
 
Point GetRandomEdge (int r=3)
 
Point GetRandomSpace (int width, int height, int tries=100)
 
void ForeachCell (Action< Cell > action)
 
void ForeachPoint (Action< Point > action)
 
void ForeachXYZ (Action< int, int > action)
 

Static Public Member Functions

static MapMetaData GetMetaData (string pathZip)
 
static void UpdateMetaData (string pathZip, PartialMap partial=null)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Public Attributes

int seed
 
int _bits
 
IO.Compression compression
 
Dictionary< string, int > cellWidths = new Dictionary<string, int>()
 
Version version
 
RoomManager rooms = new RoomManager()
 
TaskManager tasks = new TaskManager()
 
MapConfig config = new MapConfig()
 
CustomData custom
 
List< Chara > serializedCharas = new List<Chara>()
 
List< Chara > deadCharas = new List<Chara>()
 
List< Thing > things = new List<Thing>()
 
MapBounds bounds = new MapBounds()
 
List< int > _plDay = new List<int>()
 
List< int > _plNight = new List<int>()
 
Dictionary< int, int > gatherCounts = new Dictionary<int, int>()
 
Dictionary< int, CellEffect > cellEffects = new Dictionary<int, CellEffect>()
 
Dictionary< int, int > backerObjs = new Dictionary<int, int>()
 
Dictionary< int, PlantData > plants = new Dictionary<int, PlantData>()
 
MapExportSetting exportSetting
 
BitArray32 bits
 
Playlist plDay
 
Playlist plNight
 
List< Chara > charas = new List<Chara>()
 
List< TransAnime > pointAnimes = new List<TransAnime>()
 
Cell[,] cells
 
Zone zone
 
CellEffectManager effectManager = new CellEffectManager()
 
PropsManager props = new PropsManager()
 
FloodSpiller flood = new FloodSpiller()
 
BiomeProfile[,] biomes
 
POIMap poiMap
 
List< Footmark > footmarks = new List<Footmark>()
 
FowProfile fowProfile
 
bool revealed
 
- Public Attributes inherited from MapBounds
int x
 
int z
 
int maxX
 
int maxZ
 
int Size
 

Static Public Attributes

static HashSet< int > sunMap = new HashSet<int>()
 
static bool isDirtySunMap
 
- Static Public Attributes inherited from EClass
static Core core
 

Protected Member Functions

virtual void OnSerializing ()
 

Properties

bool isBreakerDown [get, set]
 
PropsStocked Stocked [get]
 
PropsInstalled Installed [get]
 
PropsRoaming Roaming [get]
 
float sizeModifier [get]
 
bool isGenerated [get]
 
bool IsIndoor [get]
 
int SizeXZ [get]
 
IEnumerable< Card > Cards [get]
 
- Properties inherited from MapBounds
int CenterX [get]
 
int CenterZ [get]
 
int Width [get]
 
int Height [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Private Member Functions

void OnSerializing (StreamingContext context)
 
void OnDeserialized (StreamingContext context)
 
int[] ReadCellIds (string file, string s, int size, int width)
 

Static Private Member Functions

static string CellIdPath (string path, int width)
 
static int WriteCellIds (string path, int[] ids, IO.Compression compression)
 

Private Attributes

HashSet< int > roomHash = new HashSet<int>()
 
List< Thing > _things = new List<Thing>()
 

Static Private Attributes

static readonly int[] CellIdWidths = new int[3] { 1, 2, 4 }
 

Detailed Description

Definition at line 12 of file Map.cs.

Member Function Documentation

◆ _AddCard()

void Map._AddCard ( int  x,
int  z,
Card  t,
bool  onAddToZone 
)
inline

Definition at line 958 of file Map.cs.

959 {
960 if (!onAddToZone)
961 {
962 _RemoveCard(t);
963 }
964 t.lastPos.Set(t.pos);
965 t.pos.Set(x, z);
966 if (t.IsMultisize)
967 {
968 t.ForeachPoint(delegate(Point p, bool main)
969 {
970 p.cell.AddCard(t);
971 });
972 }
973 else
974 {
975 t.Cell.AddCard(t);
976 }
977 t.CalculateFOV();
978 if (t.isThing && !t.trait.IDActorEx.IsEmpty())
979 {
981 }
982 }
virtual bool IsMultisize
Definition: Card.cs:2212
virtual bool isThing
Definition: Card.cs:2133
void CalculateFOV()
Definition: Card.cs:6984
void ForeachPoint(Action< Point, bool > action)
Definition: Card.cs:8411
Point pos
Definition: Card.cs:60
Trait trait
Definition: Card.cs:54
Cell Cell
Definition: Card.cs:2107
Point lastPos
Definition: Card.cs:62
void AddCard(Card c)
Definition: Cell.cs:1622
Definition: EClass.cs:6
static Scene scene
Definition: EClass.cs:31
int x
Definition: MapBounds.cs:8
void _RemoveCard(Card t)
Definition: Map.cs:984
Definition: Point.cs:9
Point Set(int _x, int _z)
Definition: Point.cs:499
Cell cell
Definition: Point.cs:47
void AddActorEx(Card c, Action< ActorEx > onBeforeSetOwner=null)
Definition: Scene.cs:1021
virtual string IDActorEx
Definition: Trait.cs:187

References _RemoveCard(), Scene.AddActorEx(), Cell.AddCard(), Card.CalculateFOV(), Card.Cell, Point.cell, Card.ForeachPoint(), Trait.IDActorEx, Card.IsMultisize, Card.isThing, Card.lastPos, Card.pos, EClass.scene, Point.Set(), Card.trait, MapBounds.x, and MapBounds.z.

Referenced by AddCardOnActivate(), MoveCard(), and OnCardAddedToZone().

◆ _RemoveCard()

void Map._RemoveCard ( Card  t)
inline

Definition at line 984 of file Map.cs.

985 {
986 if (t.IsMultisize)
987 {
988 t.ForeachPoint(delegate(Point p, bool main)
989 {
990 p.cell.RemoveCard(t);
991 });
992 }
993 else
994 {
995 t.Cell.RemoveCard(t);
996 }
997 t.ClearFOV();
998 }
void ClearFOV()
Definition: Card.cs:7074
void RemoveCard(Card c)
Definition: Cell.cs:1638

References Card.Cell, Point.cell, Card.ClearFOV(), Card.ForeachPoint(), Card.IsMultisize, and Cell.RemoveCard().

Referenced by _AddCard(), and OnCardRemovedFromZone().

◆ _ValidateInstalled()

void Map._ValidateInstalled ( int  x,
int  y 
)
inline

Definition at line 2137 of file Map.cs.

2138 {
2139 Point point = Point.shared.Set(x, y);
2140 if (!point.IsValid)
2141 {
2142 return;
2143 }
2144 List<Card> list = point.ListCards();
2145 CellDetail detail = point.cell.detail;
2146 if (detail == null)
2147 {
2148 return;
2149 }
2150 foreach (Card item in list)
2151 {
2152 if (!item.isThing || !item.trait.CanBeDestroyed || !item.IsInstalled)
2153 {
2154 continue;
2155 }
2156 HitResult hitResult = item.TileType._HitTest(point, item.Thing, canIgnore: false);
2157 if (item.Thing.stackOrder != detail.things.IndexOf(item.Thing) || (hitResult != HitResult.Valid && hitResult != HitResult.Warning))
2158 {
2159 if (EClass._zone.IsPCFaction || (!item.isNPCProperty && !(item.trait is TraitHarvest)))
2160 {
2161 item.SetPlaceState(PlaceState.roaming);
2162 }
2163 else if (item.rarity < Rarity.Legendary)
2164 {
2165 item.Die();
2166 }
2167 }
2168 }
2169 }
HitResult
Definition: HitResult.cs:2
PlaceState
Definition: PlaceState.cs:2
Rarity
Definition: Rarity.cs:2
Definition: Card.cs:11
List< Thing > things
Definition: CellDetail.cs:11
CellDetail detail
Definition: Cell.cs:112
static Zone _zone
Definition: EClass.cs:21
static Point shared
Definition: Point.cs:20
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1053
bool IsValid
Definition: Point.cs:84
bool IsPCFaction
Definition: Zone.cs:480

References EClass._zone, Point.cell, Cell.detail, Zone.IsPCFaction, Point.IsValid, item, Point.ListCards(), Point.Set(), and Point.shared.

◆ AddBackerTree()

void Map.AddBackerTree ( bool  draw)
inline

Definition at line 1737 of file Map.cs.

1738 {
1740 int num = ((!draw) ? 1 : 2);
1741 EClass._map.bounds.ForeachCell(delegate(Cell c)
1742 {
1743 if (num > 0 && c.growth != null && c.growth.IsTree && c.growth.IsMature && (!EClass.player.doneBackers.Contains(item.id) || EClass.core.config.test.ignoreBackerDestoryFlag) && (c.sourceObj.alias == item.tree || item.tree == "random"))
1744 {
1745 backerObjs[c.index] = item.id;
1746 Debug.Log(c.index + "/" + c.x + "/" + c.z + "/" + item.id + "/" + item.Name + "/" + item.tree);
1747 num--;
1749 }
1750 });
1751 }
static int indexTree
Definition: BackerContent.cs:3
Definition: Cell.cs:7
GrowSystem growth
Definition: Cell.cs:247
byte z
Definition: Cell.cs:78
byte x
Definition: Cell.cs:76
int index
Definition: Cell.cs:136
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:578
CoreConfig config
Definition: Core.cs:70
static Core core
Definition: EClass.cs:7
static Map _map
Definition: EClass.cs:19
static SourceManager sources
Definition: EClass.cs:43
static Player player
Definition: EClass.cs:13
virtual bool IsMature
Definition: GrowSystem.cs:117
virtual bool IsTree
Definition: GrowSystem.cs:101
void ForeachCell(Action< Cell > action)
Definition: MapBounds.cs:279
Dictionary< int, int > backerObjs
Definition: Map.cs:70
MapBounds bounds
Definition: Map.cs:55
HashSet< int > doneBackers
Definition: Player.cs:1152
List< Row > listTree
SourceBacker backers

References EClass._map, SourceManager.backers, bounds, Core.config, EClass.core, Debug, Player.doneBackers, MapBounds.ForeachCell(), Cell.growth, CoreConfig.Test.ignoreBackerDestoryFlag, Cell.index, BackerContent.indexTree, GrowSystem.IsMature, GrowSystem.IsTree, item, SourceBacker.listTree, EClass.player, EClass.sources, CoreConfig.test, Cell.x, and Cell.z.

Referenced by Zone_Field.OnGenerateMap().

◆ AddCardOnActivate()

void Map.AddCardOnActivate ( Card  c)
inline

Definition at line 895 of file Map.cs.

896 {
897 c.parent = zone;
899 Chara chara = c.Chara;
900 if (chara != null)
901 {
902 chara.currentZone = EClass._zone;
903 }
904 if (c.isChara)
905 {
906 if (!c.pos.IsInBounds)
907 {
909 }
910 }
911 else if (!c.pos.IsValid)
912 {
914 }
915 _AddCard(c.pos.x, c.pos.z, c, onAddToZone: true);
916 }
virtual Chara Chara
Definition: Card.cs:2122
virtual bool isChara
Definition: Card.cs:2135
Definition: Chara.cs:10
Point GetCenterPos()
Definition: MapBounds.cs:52
void _AddCard(int x, int z, Card t, bool onAddToZone)
Definition: Map.cs:958
PropsManager props
Definition: Map.cs:94
Zone zone
Definition: Map.cs:90
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool IsInBounds
Definition: Point.cs:100
void OnCardAddedToZone(Card c)
Definition: PropsManager.cs:25

References _AddCard(), EClass._map, EClass._zone, Card.Chara, MapBounds.GetCenterPos(), Card.isChara, Point.IsInBounds, Point.IsValid, PropsManager.OnCardAddedToZone(), Card.pos, props, Point.Set(), Point.x, Point.z, and zone.

Referenced by Zone.AddGlobalCharasOnActivate().

◆ AddDecal()

void Map.AddDecal ( int  x,
int  z,
int  id,
int  amount = 1,
bool  refresh = true 
)
inline

Definition at line 2190 of file Map.cs.

2191 {
2192 if (x < 0 || z < 0 || x >= Size || z >= Size)
2193 {
2194 return;
2195 }
2196 Cell cell = cells[x, z];
2197 if (cell.sourceFloor.tileType.AllowBlood && (cell.decal / 8 == id || cell.decal % 8 <= amount))
2198 {
2199 if (cell.decal / 8 != id && cell.decal % 8 == 0)
2200 {
2201 amount--;
2202 }
2203 int num = Mathf.Clamp(((cell.decal / 8 == id) ? (cell.decal % 8) : 0) + amount, 0, 7);
2204 cell.decal = (byte)(id * 8 + num);
2205 if (refresh)
2206 {
2208 }
2209 }
2210 }
SourceFloor.Row sourceFloor
Definition: Cell.cs:1092
byte decal
Definition: Cell.cs:70
int Size
Definition: MapBounds.cs:20
void RefreshNeighborTiles(int x, int z)
Definition: Map.cs:2280
Cell[,] cells
Definition: Map.cs:88

References Cell.decal, and Cell.sourceFloor.

Referenced by Card.AddBlood(), SourceMaterial.Row.AddBlood(), AM_MoveInstalled.HitTest(), and CoreDebug.UpdateInput().

◆ AddPlant()

PlantData Map.AddPlant ( Point  pos,
Thing  seed 
)
inline

Definition at line 2113 of file Map.cs.

2114 {
2115 PlantData plantData = new PlantData
2116 {
2117 seed = seed
2118 };
2119 plants[pos.index] = plantData;
2120 return plantData;
2121 }
int seed
Definition: Map.cs:19
Dictionary< int, PlantData > plants
Definition: Map.cs:73
int index
Definition: Point.cs:45

References Point.index, and seed.

Referenced by Zone.Generate(), TraitFertilizer.OnSimulateHour(), ZoneEventHarvest.OnVisit(), and TraitSeed.TrySprout().

◆ AngleToIndex()

int Map.AngleToIndex ( int  a)
inline

Definition at line 2235 of file Map.cs.

2236 {
2237 if (EClass._zone.IsRegion)
2238 {
2239 return a switch
2240 {
2241 135 => 7,
2242 180 => 0,
2243 225 => 1,
2244 -90 => 2,
2245 -45 => 3,
2246 0 => 4,
2247 45 => 5,
2248 _ => 6,
2249 };
2250 }
2251 return a switch
2252 {
2253 135 => 0,
2254 180 => 1,
2255 225 => 2,
2256 -90 => 3,
2257 -45 => 4,
2258 0 => 5,
2259 45 => 6,
2260 _ => 7,
2261 };
2262 }
virtual bool IsRegion
Definition: Spatial.cs:515

References EClass._zone, and Spatial.IsRegion.

◆ ApplyBackerObj()

void Map.ApplyBackerObj ( Point  p,
int  id = -1 
)
inline

Definition at line 1762 of file Map.cs.

1763 {
1764 if (!p.HasObj)
1765 {
1766 return;
1767 }
1768 bool flag = p.sourceObj.id == 82;
1769 SourceBacker.Row row = ((id != -1) ? EClass.sources.backers.map.TryGetValue(id) : (flag ? EClass.sources.backers.listRemain.NextItem(ref BackerContent.indexRemain) : EClass.sources.backers.listTree.NextItem(ref BackerContent.indexTree)));
1770 if (row == null)
1771 {
1772 return;
1773 }
1775 {
1776 backerObjs[p.index] = row.id;
1777 if (flag)
1778 {
1779 p.cell.objDir = row.skin;
1780 }
1781 }
1782 else
1783 {
1784 backerObjs.Remove(p.index);
1785 }
1786 }
static int indexRemain
Definition: BackerContent.cs:5
bool HasObj
Definition: Point.cs:133
List< Row > listRemain

References SourceManager.backers, Core.config, EClass.core, Player.doneBackers, Point.HasObj, SourceBacker.Row.id, CoreConfig.Test.ignoreBackerDestoryFlag, Point.index, BackerContent.indexRemain, BackerContent.indexTree, SourceBacker.listRemain, SourceBacker.listTree, EClass.player, SourceBacker.Row.skin, EClass.sources, and CoreConfig.test.

Referenced by BackerContentInspector.ContentObj.Apply().

◆ Burn()

void Map.Burn ( int  x,
int  z,
bool  instant = false 
)
inline

Definition at line 1570 of file Map.cs.

1571 {
1572 Cell cell = cells[x, z];
1573 Point sharedPoint = cell.GetSharedPoint();
1574 if ((instant || EClass.rnd(10) == 0) && cell.HasObj)
1575 {
1576 if (cell.sourceObj.tileType is TileTypeTree)
1577 {
1578 SetObj(x, z, cell.matObj_fixed.id, 59, 0, EClass.rnd(4));
1579 }
1580 else
1581 {
1582 SetObj(x, z);
1583 if (EClass.rnd(2) == 0)
1584 {
1585 EClass._zone.AddCard(ThingGen.Create((EClass.rnd(2) == 0) ? "ash" : "ash2"), sharedPoint);
1586 }
1587 }
1588 }
1589 if ((instant || EClass.rnd(5) == 0) && cell._block != 0 && cell._block != 96)
1590 {
1591 if (EClass.rnd(10) == 0 || !cell.sourceBlock.tileType.IsWall)
1592 {
1593 cell._block = 0;
1594 }
1595 else
1596 {
1597 cell._block = 96;
1598 }
1599 SetObj(x, z);
1600 if (cell.room != null)
1601 {
1602 cell.room.SetDirty();
1603 }
1605 }
1606 if (instant || EClass.rnd(10) == 0)
1607 {
1608 if (EClass.rnd(4) != 0)
1609 {
1610 cell._floor = 49;
1611 }
1612 if (cell._bridge != 0 && EClass.rnd(5) != 0)
1613 {
1614 cell._bridge = 49;
1615 }
1616 }
1617 foreach (Card item in sharedPoint.ListCards())
1618 {
1619 if (item.trait.CanBeDestroyed && !item.trait.IsDoor && !item.isFireproof && !item.category.IsChildOf("currency") && item.rarity < Rarity.Legendary && !(item.trait is TraitFigure) && item.isThing)
1620 {
1621 if (instant)
1622 {
1623 item.Destroy();
1624 EClass._zone.AddCard(ThingGen.Create((EClass.rnd(2) == 0) ? "ash" : "ash2"), sharedPoint);
1625 }
1626 else
1627 {
1628 item.DamageHP(30L, 910);
1629 }
1630 }
1631 }
1632 if (instant)
1633 {
1634 cell.effect = null;
1635 }
1636 }
Room room
Definition: Cell.cs:122
SourceBlock.Row sourceBlock
Definition: Cell.cs:1090
Point GetSharedPoint()
Definition: Cell.cs:1146
SourceObj.Row sourceObj
Definition: Cell.cs:1112
bool HasObj
Definition: Cell.cs:677
int _bridge
Definition: Cell.cs:54
SourceMaterial.Row matObj_fixed
Definition: Cell.cs:1077
int _block
Definition: Cell.cs:42
static int rnd(long a)
Definition: EClass.cs:59
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
Definition: Map.cs:1696
void SetDirty()
Definition: Room.cs:210
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Card AddCard(Card t, Point point)
Definition: Zone.cs:2160

References Cell._block, Cell._bridge, EClass._zone, Zone.AddCard(), ThingGen.Create(), Cell.GetSharedPoint(), Cell.HasObj, item, Cell.matObj_fixed, EClass.rnd(), Cell.room, Room.SetDirty(), Cell.sourceBlock, and Cell.sourceObj.

Referenced by LogicalFire.Update().

◆ CellIdPath()

static string Map.CellIdPath ( string  path,
int  width 
)
inlinestaticprivate

Definition at line 575 of file Map.cs.

576 {
577 if (width != 1)
578 {
579 return path + ".w" + width;
580 }
581 return path;
582 }

Referenced by Load(), and WriteCellIds().

◆ ClearRainAndDecal()

void Map.ClearRainAndDecal ( )
inline

Definition at line 1687 of file Map.cs.

1688 {
1689 ForeachCell(delegate(Cell c)
1690 {
1691 c.effect = null;
1692 c.decal = 0;
1693 });
1694 }
new void ForeachCell(Action< Cell > action)
Definition: Map.cs:2533

Referenced by Zone.Export().

◆ CountChara()

int Map.CountChara ( Faction  faction)
inline

Definition at line 2648 of file Map.cs.

2649 {
2650 int num = 0;
2651 foreach (Chara chara in charas)
2652 {
2653 if (chara.faction == faction)
2654 {
2655 num++;
2656 }
2657 }
2658 return num;
2659 }
Faction faction
Definition: Chara.cs:433
List< Chara > charas
Definition: Map.cs:84

References Chara.faction.

◆ CountGuest()

int Map.CountGuest ( )
inline

Definition at line 2661 of file Map.cs.

2662 {
2663 int num = 0;
2664 foreach (Chara chara in charas)
2665 {
2666 if (chara.IsGuest())
2667 {
2668 num++;
2669 }
2670 }
2671 return num;
2672 }
bool IsGuest()
Definition: Chara.cs:7073

References Chara.IsGuest().

◆ CountHostile()

int Map.CountHostile ( )
inline

Definition at line 2674 of file Map.cs.

2675 {
2676 int num = 0;
2677 foreach (Chara chara in charas)
2678 {
2679 if (!chara.IsPCFaction && chara.IsHostile())
2680 {
2681 num++;
2682 }
2683 }
2684 return num;
2685 }
override bool IsPCFaction
Definition: Chara.cs:691
bool IsHostile()
Definition: Chara.cs:6982

References Chara.IsHostile(), and Chara.IsPCFaction.

◆ CountNonHostile()

int Map.CountNonHostile ( )
inline

Definition at line 2700 of file Map.cs.

2701 {
2702 int num = 0;
2703 foreach (Chara chara in charas)
2704 {
2705 if (!chara.IsPCFaction && !chara.IsHostile())
2706 {
2707 num++;
2708 }
2709 }
2710 return num;
2711 }

References Chara.IsHostile(), and Chara.IsPCFaction.

◆ CountWildAnimal()

int Map.CountWildAnimal ( )
inline

Definition at line 2687 of file Map.cs.

2688 {
2689 int num = 0;
2690 foreach (Chara chara in charas)
2691 {
2692 if (!chara.IsPCFaction && chara.IsAnimal)
2693 {
2694 num++;
2695 }
2696 }
2697 return num;
2698 }
bool IsAnimal
Definition: Chara.cs:923

References Chara.IsAnimal, and Chara.IsPCFaction.

◆ CreateNew()

void Map.CreateNew ( int  size,
bool  setReference = true 
)
inline

Definition at line 158 of file Map.cs.

159 {
160 Debug.Log("Map CreateNew:");
161 Size = size;
162 cells = new Cell[Size, Size];
163 bounds = new MapBounds
164 {
165 x = 0,
166 z = 0,
167 maxX = Size - 1,
168 maxZ = Size - 1,
169 Size = Size
170 };
171 SetBounds(0, 0, Size - 1, Size - 1);
172 ForeachXYZ(delegate(int x, int z)
173 {
174 cells[x, z] = new Cell
175 {
176 x = (byte)x,
177 z = (byte)z
178 };
179 });
180 if (setReference)
181 {
182 SetReference();
183 }
184 }
int maxZ
Definition: MapBounds.cs:17
int maxX
Definition: MapBounds.cs:14
new void ForeachXYZ(Action< int, int > action)
Definition: Map.cs:2556
void SetBounds(int size)
Definition: Map.cs:2518
void SetReference()
Definition: Map.cs:200

References bounds, cells, Debug, ForeachXYZ(), MapBounds.maxX, MapBounds.maxZ, SetBounds(), SetReference(), MapBounds.Size, MapBounds.x, and MapBounds.z.

Referenced by MapGen.OnGenerateTerrain(), MapGenDungen.OnGenerateTerrain(), and MapGenRegion.OnGenerateTerrain().

◆ DestroyBlock()

void Map.DestroyBlock ( int  x,
int  z 
)
inline

Definition at line 2185 of file Map.cs.

2186 {
2187 SetBlock(x, z);
2188 }
void SetBlock(int x, int z, int idMat=0, int idBlock=0)
Definition: Map.cs:1133

Referenced by OnCardAddedToZone().

◆ DestroyObj()

void Map.DestroyObj ( Point  point)
inline

Definition at line 1986 of file Map.cs.

1987 {
1988 Cell cell = point.cell;
1989 SourceObj.Row sourceObj = cell.sourceObj;
1990 SourceMaterial.Row row = (cell.isObjDyed ? sourceObj.DefaultMaterial : cell.matObj);
1991 if (sourceObj.tileType.IsBlockPass)
1992 {
1993 Effect.Get("smoke").Play(point);
1994 }
1995 Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
1996 .Emit(10 + EClass.rnd(10));
1997 point.PlaySound(row.GetSoundDead());
1998 row.AddBlood(point, 3);
1999 }
SourceMaterial.Row matObj
Definition: Cell.cs:1074
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:80
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1255
TileType tileType
Definition: RenderRow.cs:77
void AddBlood(Point p, int a=1)
string GetSoundDead(RenderRow c=null)
virtual bool IsBlockPass
Definition: TileType.cs:161

References SourceMaterial.Row.AddBlood(), Point.cell, Effect.Get(), SourceMaterial.Row.GetColor(), SourceMaterial.Row.GetSoundDead(), TileType.IsBlockPass, Cell.matObj, Effect.Play(), Point.PlaySound(), EClass.rnd(), Cell.sourceObj, and RenderRow.tileType.

Referenced by TaskHarvest.OnCreateProgress().

◆ DropBlockComponent()

void Map.DropBlockComponent ( Point  point,
TileRow  r,
SourceMaterial::Row  mat,
bool  recoverBlock,
bool  isPlatform = false,
Chara  c = null 
)
inline

Definition at line 1788 of file Map.cs.

1789 {
1791 {
1792 return;
1793 }
1794 Thing thing = null;
1795 if (r.components.Length == 0)
1796 {
1797 return;
1798 }
1800 if (recoverBlock)
1801 {
1802 thing = ((!(r is SourceFloor.Row)) ? ThingGen.CreateBlock(r.id, mat.id) : ThingGen.CreateFloor(r.id, mat.id, isPlatform));
1803 }
1804 else
1805 {
1806 RecipeSource recipeSource = RecipeManager.Get(r.RecipeID + (isPlatform ? "-b" : ""));
1807 if (recipeSource == null)
1808 {
1809 return;
1810 }
1811 string iDIngredient = recipeSource.GetIDIngredient();
1812 if (iDIngredient == null)
1813 {
1814 return;
1815 }
1816 thing = ThingGen.Create(iDIngredient);
1817 thing.ChangeMaterial(mat.alias);
1818 }
1820 {
1821 PutAway(thing);
1822 }
1823 else
1824 {
1825 TrySmoothPick(point, thing, c);
1826 }
1827 }
virtual bool IsBuildMode
Definition: ActionMode.cs:181
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3217
bool godBuild
Definition: CoreDebug.cs:320
static Game game
Definition: EClass.cs:9
static CoreDebug debug
Definition: EClass.cs:49
bool disableUsermapBenefit
GamePrincipal principal
Definition: Game.cs:225
void TrySmoothPick(Cell cell, Thing t, Chara c)
Definition: Map.cs:1965
bool PutAway(Card c)
Definition: Map.cs:2739
static void BuildList()
static RecipeSource Get(string id)
string GetIDIngredient()
virtual string RecipeID
Definition: RenderRow.cs:108
string[] components
Definition: RenderRow.cs:52
ActionMode actionMode
Definition: Scene.cs:79
static Thing CreateBlock(int id, int idMat)
Definition: ThingGen.cs:101
static Thing CreateFloor(int id, int idMat, bool platform=false)
Definition: ThingGen.cs:108
Definition: Thing.cs:8
int id
Definition: TileRow.cs:9
virtual bool IsUserZone
Definition: Zone.cs:278

References EClass._zone, Scene.actionMode, RecipeManager.BuildList(), Card.ChangeMaterial(), RenderRow.components, ThingGen.Create(), ThingGen.CreateBlock(), ThingGen.CreateFloor(), EClass.debug, GamePrincipal.disableUsermapBenefit, EClass.game, RecipeManager.Get(), RecipeSource.GetIDIngredient(), CoreDebug.godBuild, TileRow.id, ActionMode.IsBuildMode, Zone.IsUserZone, Game.principal, RenderRow.RecipeID, and EClass.scene.

◆ ExportMetaData()

void Map.ExportMetaData ( string  _path,
string  id,
PartialMap  partial = null 
)
inline

Definition at line 832 of file Map.cs.

833 {
834 if (custom == null)
835 {
836 custom = new CustomData();
837 }
838 MapMetaData mapMetaData = new MapMetaData
839 {
840 name = EClass._zone.Name,
842 tag = (EClass._map.exportSetting?.tag ?? ""),
843 partial = partial,
844 underwater = EClass._zone.IsUnderwater
845 };
846 custom.id = (mapMetaData.id = id);
847 IO.SaveFile(_path + "meta", mapMetaData);
848 }
Version version
Definition: BaseCore.cs:17
static BaseCore Instance
Definition: BaseCore.cs:11
Definition: IO.cs:10
static void SaveFile(string path, object obj, bool compress=false, JsonSerializerSettings setting=null)
Definition: IO.cs:88
CustomData custom
Definition: Map.cs:43
MapExportSetting exportSetting
Definition: Map.cs:76
Version version
Definition: Map.cs:31
virtual string Name
Definition: Spatial.cs:509
virtual bool IsUnderwater
Definition: Zone.cs:276
int GetInt()
Definition: Version.cs:39

References EClass._map, EClass._zone, custom, exportSetting, Version.GetInt(), BaseCore.Instance, Zone.IsUnderwater, Spatial.Name, MapExportSetting.tag, version, and BaseCore.version.

Referenced by Zone.Export(), and UpdateMetaData().

◆ FindChara() [1/2]

Chara Map.FindChara ( int  uid)
inline

Definition at line 2787 of file Map.cs.

2788 {
2789 foreach (Chara chara in charas)
2790 {
2791 if (chara.uid == uid)
2792 {
2793 return chara;
2794 }
2795 }
2796 return null;
2797 }
int uid
Definition: Card.cs:125

References Card.uid.

◆ FindChara() [2/2]

◆ FindPublicArea()

BaseArea Map.FindPublicArea ( )
inline

Definition at line 2926 of file Map.cs.

2927 {
2928 return (from a in ((IEnumerable<BaseArea>)rooms.listArea).Concat((IEnumerable<BaseArea>)rooms.listRoom)
2929 where a.type.IsPublicArea
2930 select a).RandomItem();
2931 }
RoomManager rooms
Definition: Map.cs:34
List< Room > listRoom
Definition: RoomManager.cs:13
List< Area > listArea
Definition: RoomManager.cs:10

References RoomManager.listArea, and RoomManager.listRoom.

Referenced by GoalSleep.OnSimulatePosition(), and GoalSleep.Run().

◆ FindThing() [1/6]

◆ FindThing() [2/6]

Thing Map.FindThing ( int  uid)
inline

Definition at line 2811 of file Map.cs.

2812 {
2813 foreach (Thing thing in things)
2814 {
2815 if (thing.uid == uid)
2816 {
2817 return thing;
2818 }
2819 }
2820 return null;
2821 }

References Card.uid.

◆ FindThing() [3/6]

Thing Map.FindThing ( string  workTag,
BaseArea  area1 = null,
BaseArea  area2 = null 
)
inline

Definition at line 2886 of file Map.cs.

2887 {
2888 if (area1 == null && area2 == null)
2889 {
2890 return null;
2891 }
2892 Thing thing = null;
2893 PropSet orCreate = EClass._map.Installed.workMap.GetOrCreate(workTag);
2894 if (area1 != null)
2895 {
2896 IEnumerable<Card> enumerable = orCreate.Where((Card a) => a.pos.HasRoomOrArea(area1));
2897 if (enumerable.Count() > 0)
2898 {
2899 thing = enumerable.RandomItem() as Thing;
2900 }
2901 }
2902 if (thing == null && area2 != null)
2903 {
2904 IEnumerable<Card> enumerable2 = orCreate.Where((Card a) => a.pos.HasRoomOrArea(area2));
2905 if (enumerable2.Count() > 0)
2906 {
2907 thing = enumerable2.RandomItem() as Thing;
2908 }
2909 }
2910 return thing;
2911 }
PropsInstalled Installed
Definition: Map.cs:128
bool HasRoomOrArea(BaseArea a)
Definition: Point.cs:417
Dictionary< string, PropSet > workMap
Definition: Props.cs:16

References EClass._map, Point.HasRoomOrArea(), Installed, Card.pos, and Props.workMap.

◆ FindThing() [4/6]

Thing Map.FindThing ( string  workTag,
Chara  c 
)
inline

Definition at line 2913 of file Map.cs.

2914 {
2915 Thing result = null;
2916 IEnumerable<Card> enumerable = from a in EClass._map.Installed.workMap.GetOrCreate(workTag)
2917 where a.pos.IsPublicSpace()
2918 select a;
2919 if (enumerable.Count() > 0)
2920 {
2921 result = enumerable.RandomItem() as Thing;
2922 }
2923 return result;
2924 }

References EClass._map, Installed, and Props.workMap.

◆ FindThing() [5/6]

Thing Map.FindThing ( Type  type,
BaseArea  area1,
BaseArea  area2 = null 
)
inline

Definition at line 2856 of file Map.cs.

2857 {
2858 if (type == null || (area1 == null && area2 == null))
2859 {
2860 return null;
2861 }
2862 Thing thing = Find(area1);
2863 if (thing == null && area2 != null)
2864 {
2865 thing = Find(area2);
2866 }
2867 return thing;
2868 Thing Find(BaseArea a)
2869 {
2870 _things.Clear();
2871 foreach (Thing thing2 in EClass._map.props.installed.things)
2872 {
2873 if (type.IsAssignableFrom(thing2.trait.GetType()) && thing2.pos.HasRoomOrArea(a))
2874 {
2875 _things.Add(thing2);
2876 }
2877 }
2878 if (_things.Count <= 0)
2879 {
2880 return null;
2881 }
2882 return _things.RandomItem();
2883 }
2884 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
List< Thing > _things
Definition: Map.cs:112
PropsInstalled installed
Definition: PropsManager.cs:8
List< Thing > things
Definition: Props.cs:20

References EClass._map, Card.Add(), Point.HasRoomOrArea(), PropsManager.installed, Card.pos, props, Props.things, and Card.trait.

◆ FindThing() [6/6]

Thing Map.FindThing ( Type  type,
Chara  c = null 
)
inline

Definition at line 2835 of file Map.cs.

2836 {
2837 if (type == null)
2838 {
2839 return null;
2840 }
2841 _things.Clear();
2842 foreach (Thing thing in EClass._map.props.installed.things)
2843 {
2844 if (type.IsAssignableFrom(thing.trait.GetType()) && thing.pos.IsPublicSpace())
2845 {
2846 _things.Add(thing);
2847 }
2848 }
2849 if (_things.Count <= 0)
2850 {
2851 return null;
2852 }
2853 return _things.RandomItem();
2854 }
bool IsPublicSpace()
Definition: Point.cs:445

References EClass._map, Card.Add(), PropsManager.installed, Point.IsPublicSpace(), Card.pos, props, Props.things, and Card.trait.

◆ FindThing< T >()

T Map.FindThing< T > ( )
inline
Type Constraints
T :Trait 

Definition at line 2823 of file Map.cs.

2823 : Trait
2824 {
2825 foreach (Thing thing in things)
2826 {
2827 if (thing.trait is T)
2828 {
2829 return thing.trait as T;
2830 }
2831 }
2832 return null;
2833 }
Definition: Trait.cs:7

References Card.trait.

◆ ForeachCell()

◆ ForeachNeighbor()

void Map.ForeachNeighbor ( Point  center,
Action< Point >  action 
)
inline

Definition at line 2608 of file Map.cs.

2609 {
2610 int num = center.x;
2611 int num2 = center.z;
2612 Point point = new Point();
2613 for (int i = num - 1; i < num + 2; i++)
2614 {
2615 if (i < 0 || i >= Size)
2616 {
2617 continue;
2618 }
2619 for (int j = num2 - 1; j < num2 + 2; j++)
2620 {
2621 if (j >= 0 && j < Size)
2622 {
2623 point.Set(i, j);
2624 action(point);
2625 }
2626 }
2627 }
2628 }

References Point.Set(), Point.x, and Point.z.

◆ ForeachPoint()

new void Map.ForeachPoint ( Action< Point >  action)
inline

Definition at line 2544 of file Map.cs.

2545 {
2546 Point point = new Point();
2547 for (int i = 0; i < Size; i++)
2548 {
2549 for (int j = 0; j < Size; j++)
2550 {
2551 action(point.Set(i, j));
2552 }
2553 }
2554 }

References Point.Set().

Referenced by BaseTileSelector.ProcessFillTiles().

◆ ForeachSphere()

void Map.ForeachSphere ( int  _x,
int  _z,
float  r,
Action< Point >  action 
)
inline

Definition at line 2567 of file Map.cs.

2568 {
2569 Point point = new Point();
2570 int num = (int)Mathf.Ceil(r);
2571 for (int i = _x - num; i < _x + num + 1; i++)
2572 {
2573 if (i < 0 || i >= Size)
2574 {
2575 continue;
2576 }
2577 for (int j = _z - num; j < _z + num + 1; j++)
2578 {
2579 if (j >= 0 && j < Size && (float)((i - _x) * (i - _x) + (j - _z) * (j - _z)) < r * r)
2580 {
2581 point.Set(i, j);
2582 action(point);
2583 }
2584 }
2585 }
2586 }

References Point.Set().

Referenced by SurvivalManager.GetRandomPoint(), Trait.ListPoints(), TraitLightSun.ListPoints(), Act.OnMarkMapHighlights(), AM_Populate.OnProcessTiles(), AM_Terrain.OnProcessTiles(), AM_BaseTerrain.OnRenderTile(), RefreshFOV(), Reveal(), ActWait.Search(), GameUpdater.Update(), and VirtualRoom.VirtualRoom().

◆ ForeachSquare()

void Map.ForeachSquare ( int  _x,
int  _z,
int  r,
Action< Point >  action 
)
inline

Definition at line 2588 of file Map.cs.

2589 {
2590 Point point = new Point();
2591 for (int i = _x - r; i < _x + r + 1; i++)
2592 {
2593 if (i < 0 || i >= Size)
2594 {
2595 continue;
2596 }
2597 for (int j = _z - r; j < _z + r + 1; j++)
2598 {
2599 if (j >= 0 && j < Size)
2600 {
2601 point.Set(i, j);
2602 action(point);
2603 }
2604 }
2605 }
2606 }

References Point.Set().

◆ ForeachXYZ()

new void Map.ForeachXYZ ( Action< int, int >  action)
inline

Definition at line 2556 of file Map.cs.

2557 {
2558 for (int i = 0; i < Size; i++)
2559 {
2560 for (int j = 0; j < Size; j++)
2561 {
2562 action(i, j);
2563 }
2564 }
2565 }

Referenced by CreateNew().

◆ GetBackerObj()

SourceBacker.Row Map.GetBackerObj ( Point  p)
inline

Definition at line 1753 of file Map.cs.

1754 {
1755 if (!backerObjs.ContainsKey(p.index))
1756 {
1757 return null;
1758 }
1759 return EClass.sources.backers.map.TryGetValue(backerObjs[p.index]);
1760 }

References SourceManager.backers, Point.index, and EClass.sources.

Referenced by TaskHarvest.OnCreateProgress().

◆ GetCell()

Cell Map.GetCell ( int  index)
inline

Definition at line 1000 of file Map.cs.

1001 {
1002 return cells[index % Size, index % SizeXZ / Size];
1003 }
int SizeXZ
Definition: Map.cs:138

References cells, MapBounds.Size, and SizeXZ.

Referenced by Zone.Activate(), MapSubset.Apply(), Fov.ClearVisible(), Fov.Perform(), and ActionMode.RefreshTexts().

◆ GetDependedRamp()

Cell Map.GetDependedRamp ( Cell  cell)
inline

Definition at line 2351 of file Map.cs.

2352 {
2353 Cell right = cell.Right;
2354 if (right.HasRamp && !right.HasStairs && right.blockDir == 1)
2355 {
2356 return right;
2357 }
2358 Cell front = cell.Front;
2359 if (front.HasRamp && !front.HasStairs && front.blockDir == 0)
2360 {
2361 return front;
2362 }
2363 Cell left = cell.Left;
2364 if (left.HasRamp && !left.HasStairs && left.blockDir == 3)
2365 {
2366 return left;
2367 }
2368 Cell back = cell.Back;
2369 if (back.HasRamp && !back.HasStairs && back.blockDir == 2)
2370 {
2371 return back;
2372 }
2373 return null;
2374 }
Cell Back
Definition: Cell.cs:175
bool HasStairs
Definition: Cell.cs:891
Cell Front
Definition: Cell.cs:151
Cell Left
Definition: Cell.cs:187
Cell Right
Definition: Cell.cs:163
bool HasRamp
Definition: Cell.cs:873
int blockDir
Definition: Cell.cs:934

References Cell.Back, back, Cell.blockDir, Cell.Front, Cell.HasRamp, Cell.HasStairs, Cell.Left, left, Cell.Right, and right.

◆ GetMetaData()

static MapMetaData Map.GetMetaData ( string  pathZip)
inlinestatic

Definition at line 850 of file Map.cs.

851 {
852 try
853 {
854 using ZipFile zipFile = ZipFile.Read(pathZip);
855 ZipEntry zipEntry = zipFile["meta"];
856 if (zipEntry != null)
857 {
858 using (MemoryStream stream = new MemoryStream())
859 {
860 zipEntry.Extract(stream);
861 MapMetaData mapMetaData = IO.LoadStreamJson<MapMetaData>(stream);
862 mapMetaData.path = pathZip;
863 return mapMetaData;
864 }
865 }
866 }
867 catch (Exception message)
868 {
869 if (Application.isEditor)
870 {
871 Debug.Log(message);
872 }
873 }
874 return null;
875 }

References Debug.

Referenced by Zone.IsImportValid(), TraitMoongate.ListSavedUserMap(), PartialMap.Load(), PartialMapMenu.Refresh(), and TraitMoongate.UseMoongate().

◆ GetNearbyResourcePoint()

Point Map.GetNearbyResourcePoint ( Point  center)
inline

Definition at line 2419 of file Map.cs.

2420 {
2421 Point point = new Point();
2422 int num = ((EClass.rnd(2) == 0) ? 1 : (-1));
2423 int num2 = ((EClass.rnd(2) == 0) ? 1 : (-1));
2424 for (int i = 0; i < 3; i++)
2425 {
2426 point.x = center.x - num + i * num;
2427 for (int j = 0; j < 3; j++)
2428 {
2429 point.z = center.z - num2 + j * num2;
2430 if (point.IsValid && point.area == null && point.cell.CanHarvest())
2431 {
2432 return point;
2433 }
2434 }
2435 }
2436 return Point.Invalid;
2437 }
bool CanHarvest()
Definition: Cell.cs:1736
static Point Invalid
Definition: Point.cs:28
Area area
Definition: Point.cs:69

References Point.area, Cell.CanHarvest(), Point.cell, Point.Invalid, Point.IsValid, and EClass.rnd().

◆ GetRampDir()

int Map.GetRampDir ( int  x,
int  z,
TileType  blockType = null 
)
inline

Definition at line 2314 of file Map.cs.

2315 {
2316 Cell cell = cells[x, z];
2317 if (cell.HasFullBlock)
2318 {
2319 if (blockType == null)
2320 {
2321 blockType = cell.sourceBlock.tileType;
2322 }
2323 Cell right = cell.Right;
2324 Cell front = cell.Front;
2325 Cell left = cell.Left;
2326 Cell back = cell.Back;
2327 if (!right.HasBlock && !right.IsVoid && left.HasFullBlock && front.CanBuildRamp(1) && back.CanBuildRamp(1))
2328 {
2329 return 1;
2330 }
2331 if (!front.HasBlock && !front.IsVoid && back.HasFullBlock && left.CanBuildRamp(0) && right.CanBuildRamp(0))
2332 {
2333 return 0;
2334 }
2335 if (!left.HasBlock && !left.IsVoid && right.HasFullBlock && front.CanBuildRamp(3) && back.CanBuildRamp(3))
2336 {
2337 return 3;
2338 }
2339 if (!back.HasBlock && !back.IsVoid && front.HasFullBlock && left.CanBuildRamp(2) && right.CanBuildRamp(2))
2340 {
2341 return 2;
2342 }
2343 if (!blockType.IsRamp)
2344 {
2345 return 0;
2346 }
2347 }
2348 return -1;
2349 }
bool HasBlock
Definition: Cell.cs:679
bool CanBuildRamp(int dir)
Definition: Cell.cs:1183
bool HasFullBlock
Definition: Cell.cs:853
bool IsVoid
Definition: Cell.cs:995
bool IsRamp
Definition: TileType.cs:155

References Cell.Back, back, Cell.CanBuildRamp(), Cell.Front, Cell.HasBlock, Cell.HasFullBlock, Cell.IsVoid, Cell.Left, left, Cell.Right, right, and Cell.sourceBlock.

Referenced by TaskMine.GetHitResult(), and MineRamp().

◆ GetRandomEdge()

new Point Map.GetRandomEdge ( int  r = 3)
inline

Definition at line 2394 of file Map.cs.

2395 {
2396 int num = 0;
2397 int num2 = 0;
2398 for (int i = 0; i < 10000; i++)
2399 {
2400 if (EClass.rnd(2) == 0)
2401 {
2402 num = ((EClass.rnd(2) == 0) ? EClass.rnd(r) : (Size - 1 - EClass.rnd(r)));
2403 num2 = EClass.rnd(Size);
2404 }
2405 else
2406 {
2407 num2 = ((EClass.rnd(2) == 0) ? EClass.rnd(r) : (Size - 1 - EClass.rnd(r)));
2408 num = EClass.rnd(Size);
2409 }
2410 Point surface = GetSurface(num, num2, walkable: false);
2411 if (surface.IsValid)
2412 {
2413 return surface;
2414 }
2415 }
2416 return GetSurface(Size / 2, Size / 2, walkable: false);
2417 }
Point GetSurface(int x, int z, bool walkable=true)
Definition: MapBounds.cs:171

References Point.IsValid, and EClass.rnd().

Referenced by ZoneEventSiege.GetSpawnPos(), and MapGen.MakeRiver().

◆ GetRandomPoint()

Point Map.GetRandomPoint ( Point  center,
int  radius,
int  tries = 100,
bool  mustBeWalkable = true,
bool  requireLos = true 
)
inline

Definition at line 2376 of file Map.cs.

2377 {
2378 Point point = new Point();
2379 for (int i = 0; i < tries; i++)
2380 {
2381 point.x = center.x + EClass.rnd(radius * 2 + 1) - radius;
2382 point.z = center.z + EClass.rnd(radius * 2 + 1) - radius;
2383 point.Clamp();
2384 if ((!mustBeWalkable || !point.cell.blocked) && (!requireLos || Los.IsVisible(center, point)))
2385 {
2386 return point;
2387 }
2388 }
2389 Debug.Log("GetRandomPoint failed center:" + center?.ToString() + " rad:" + radius);
2390 point.IsValid = false;
2391 return point;
2392 }
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167
Point Clamp(bool useBounds=false)
Definition: Point.cs:1010

References Algorithms.WeightCell.blocked, Point.cell, Point.Clamp(), Debug, Los.IsVisible(), and EClass.rnd().

Referenced by Zone.Generate(), MapBounds.GetRandomSpawnPos(), MapGenDungen.OnGenerateTerrain(), MapGen.Populate(), and TraitSpotSpawn.Update().

◆ ListChara()

List< Chara > Map.ListChara ( Faction  faction)
inline

Definition at line 2713 of file Map.cs.

2714 {
2715 List<Chara> list = new List<Chara>();
2716 foreach (Chara chara in charas)
2717 {
2718 if (chara.faction == faction)
2719 {
2720 list.Add(chara);
2721 }
2722 }
2723 return list;
2724 }

References Chara.faction.

Referenced by ContentPopulation.Refresh().

◆ ListCharasInCircle()

List< Chara > Map.ListCharasInCircle ( Point  center,
float  radius,
bool  los = true 
)
inline

Definition at line 2478 of file Map.cs.

2479 {
2480 List<Chara> list = new List<Chara>();
2481 foreach (Point item in ListPointsInCircle(center, radius, mustBeWalkable: false, los))
2482 {
2483 CellDetail detail = item.detail;
2484 if (detail == null || detail.charas.Count <= 0)
2485 {
2486 continue;
2487 }
2488 foreach (Chara chara in item.detail.charas)
2489 {
2490 list.Add(chara);
2491 }
2492 }
2493 return list;
2494 }
List< Chara > charas
Definition: CellDetail.cs:13
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2439

References CellDetail.charas, and item.

Referenced by AI_PlayMusic.Run().

◆ ListPointsInArc()

List< Point > Map.ListPointsInArc ( Point  center,
Point  to,
int  radius,
float  angle 
)
inline

Definition at line 2496 of file Map.cs.

2497 {
2498 Point to2 = new Point((to.x > center.x) ? 1 : ((to.x < center.x) ? (-1) : 0), (to.z > center.z) ? 1 : ((to.z < center.z) ? (-1) : 0));
2499 Point point = new Point(0, 0);
2500 List<Point> list = new List<Point>();
2501 float diff = point.GetAngle2(to2);
2502 ForeachSphere(center.x, center.z, radius, delegate(Point p)
2503 {
2504 float angle2 = center.GetAngle2(p);
2505 if ((Mathf.Abs(diff - angle2) < angle || Mathf.Abs(diff - angle2 + 360f) < angle || Mathf.Abs(360f - diff + angle2) < angle) && Los.IsVisible(center, p) && !p.IsBlocked)
2506 {
2507 list.Add(p.Copy());
2508 }
2509 });
2510 return list;
2511 }
void ForeachSphere(int _x, int _z, float r, Action< Point > action)
Definition: Map.cs:2567
bool IsBlocked
Definition: Point.cs:359
float GetAngle2(Point to)
Definition: Point.cs:614

References Point.GetAngle2(), Point.IsBlocked, Los.IsVisible(), Point.x, and Point.z.

Referenced by ActEffect.ProcAt().

◆ ListPointsInCircle()

List< Point > Map.ListPointsInCircle ( Point  center,
float  radius,
bool  mustBeWalkable = true,
bool  los = true 
)
inline

Definition at line 2439 of file Map.cs.

2440 {
2441 List<Point> list = new List<Point>();
2442 ForeachSphere(center.x, center.z, radius, delegate(Point p)
2443 {
2444 if ((!mustBeWalkable || !p.cell.blocked) && (!los || Los.IsVisible(center, p)))
2445 {
2446 list.Add(p.Copy());
2447 }
2448 });
2449 return list;
2450 }

References Algorithms.WeightCell.blocked, Point.cell, Los.IsVisible(), Point.x, and Point.z.

Referenced by TaskClean.GetTarget(), Point.ListWitnesses(), ActComet.OnMarkMapHighlights(), ActFlare.OnMarkMapHighlights(), and ActEffect.ProcAt().

◆ ListPointsInLine()

List< Point > Map.ListPointsInLine ( Point  center,
Point  to,
int  radius,
bool  returnOnBlocked = true 
)
inline

Definition at line 2513 of file Map.cs.

2514 {
2515 return Los.ListVisible(center, to, radius, null, returnOnBlocked);
2516 }
static List< Point > ListVisible(Point p1, Point p2, int radius, Action< Point, bool > _onVisit=null, bool returnOnBlocked=true)
Definition: Los.cs:90

References Los.ListVisible().

Referenced by ActMelee.Attack(), ActTelekinesis.ListPath(), ActBolt.OnMarkMapHighlights(), ActRanged.Perform(), and ActEffect.ProcAt().

◆ ListPointsInSquare()

List< Point > Map.ListPointsInSquare ( Point  center,
int  radius,
bool  mustBeWalkable = true,
bool  los = true 
)
inline

Definition at line 2452 of file Map.cs.

2453 {
2454 List<Point> list = new List<Point>();
2455 ForeachSquare(center.x, center.z, radius, delegate(Point p)
2456 {
2457 if ((!mustBeWalkable || !p.cell.blocked) && (!los || Los.IsVisible(center, p)))
2458 {
2459 list.Add(p.Copy());
2460 }
2461 });
2462 return list;
2463 }
void ForeachSquare(int _x, int _z, int r, Action< Point > action)
Definition: Map.cs:2588

References Algorithms.WeightCell.blocked, Point.cell, Los.IsVisible(), Point.x, and Point.z.

Referenced by TaskDrawWater.OnCreateProgress(), TaskPlow.OnCreateProgress(), TaskPourWater.OnCreateProgress(), TaskDig.OnProgressComplete(), ActWater.Perform(), AI_Shear.Run(), TaskClean.Run(), and TaskWater.Run().

◆ ListPointsOnEdge()

List< Point > Map.ListPointsOnEdge ( Point  center,
int  destDist,
bool  mustBeWalkable = true,
bool  los = true 
)
inline

Definition at line 2465 of file Map.cs.

2466 {
2467 List<Point> list = new List<Point>();
2468 ForeachSphere(center.x, center.z, destDist, delegate(Point p)
2469 {
2470 if (center.Distance(p) == destDist && (!mustBeWalkable || !p.cell.blocked) && (!los || Los.IsVisible(center, p)))
2471 {
2472 list.Add(p.Copy());
2473 }
2474 });
2475 return list;
2476 }
int Distance(Point p)
Definition: Point.cs:991

References Algorithms.WeightCell.blocked, Point.cell, Point.Distance(), Los.IsVisible(), Point.x, and Point.z.

Referenced by ActEffect.GetShortTeleportPos().

◆ ListThing< T >()

List< Thing > Map.ListThing< T > ( )
inline
Type Constraints
T :Trait 

Definition at line 2726 of file Map.cs.

2726 : Trait
2727 {
2728 List<Thing> list = new List<Thing>();
2729 foreach (Thing thing in things)
2730 {
2731 if (thing.IsInstalled && thing.trait is T)
2732 {
2733 list.Add(thing);
2734 }
2735 }
2736 return list;
2737 }
bool IsInstalled
Definition: Card.cs:2451

References Card.IsInstalled, and Card.trait.

◆ Load()

void Map.Load ( string  path,
bool  import = false,
PartialMap  partial = null 
)
inline

Definition at line 641 of file Map.cs.

642 {
643 if (partial == null)
644 {
645 Debug.Log("Map Load:" + compression.ToString() + ": " + path);
646 }
647 int num = Size;
648 int num2 = Size;
649 if (partial != null)
650 {
651 num = partial.w;
652 num2 = partial.h;
653 Debug.Log(compression.ToString() + ": " + num + "/" + num2);
654 }
655 int size = num * num2;
656 cells = new Cell[num, num2];
657 if (bounds.maxX == 0)
658 {
659 bounds.SetBounds(0, 0, num - 1, num2 - 1);
660 }
661 SetBounds(0, 0, num - 1, num2 - 1);
662 byte[] data = TryLoad("objVals");
663 int[] data2 = TryLoadIds("blockMats");
664 int[] data3 = TryLoadIds("blocks");
665 int[] data4 = TryLoadIds("floorMats");
666 int[] data5 = TryLoadIds("floors");
667 int[] data6 = TryLoadIds("objs");
668 int[] data7 = TryLoadIds("objMats");
669 byte[] data8 = TryLoad("decal");
670 int[] data9 = TryLoadIds("decos");
671 int[] data10 = TryLoadIds("decoMats");
672 byte[] data11 = TryLoad("dirs");
673 byte[] data12 = TryLoad("flags");
674 byte[] data13 = TryLoad("flags2");
675 byte[] data14 = TryLoad("heights");
676 int[] data15 = TryLoadIds("bridges");
677 int[] data16 = TryLoadIds("bridgeMats");
678 byte[] data17 = TryLoad("bridgeHeights");
679 int[] data18 = TryLoadIds("bridgePillars");
680 int[] data19 = TryLoadIds("roofBlocks");
681 int[] data20 = TryLoadIds("roofBlockMats");
682 byte[] data21 = TryLoad("roofBlockDirs");
683 if (data18.Length < size)
684 {
685 data18 = new int[size];
686 }
687 if (data.Length < size)
688 {
689 data = new byte[size];
690 }
691 if (data13.Length < size)
692 {
693 data13 = new byte[size];
694 }
695 Validate<byte>(ref data, "objVals");
696 Validate<int>(ref data2, "blockMats");
697 Validate<int>(ref data3, "blocks");
698 Validate<int>(ref data4, "floorMats");
699 Validate<int>(ref data5, "floors");
700 Validate<int>(ref data6, "objs");
701 Validate<int>(ref data7, "objMats");
702 Validate<byte>(ref data8, "decal");
703 Validate<int>(ref data9, "decos");
704 Validate<int>(ref data10, "decoMats");
705 Validate<byte>(ref data11, "dirs");
706 Validate<byte>(ref data12, "flags");
707 Validate<byte>(ref data13, "flags2");
708 Validate<byte>(ref data14, "heights");
709 Validate<int>(ref data15, "bridges");
710 Validate<int>(ref data16, "bridgeMats");
711 Validate<byte>(ref data17, "bridgeHeights");
712 Validate<int>(ref data18, "bridgePillars");
713 Validate<int>(ref data19, "roofBlocks");
714 Validate<int>(ref data20, "roofBlockMats");
715 Validate<byte>(ref data21, "roofBlockDirs");
716 int num3 = 0;
717 for (int i = 0; i < num; i++)
718 {
719 for (int j = 0; j < num2; j++)
720 {
721 Cell cell = (cells[i, j] = new Cell
722 {
723 x = (byte)i,
724 z = (byte)j,
725 objVal = data[num3],
726 _blockMat = data2[num3],
727 _block = data3[num3],
728 _floorMat = data4[num3],
729 _floor = data5[num3],
730 obj = data6[num3],
731 objMat = data7[num3],
732 decal = data8[num3],
733 _deco = data9[num3],
734 _decoMat = data10[num3],
735 _dirs = data11[num3],
736 height = data14[num3],
737 _bridge = data15[num3],
738 _bridgeMat = data16[num3],
739 bridgeHeight = data17[num3],
740 bridgePillar = data18[num3],
741 _roofBlock = data19[num3],
742 _roofBlockMat = data20[num3],
743 _roofBlockDir = data21[num3],
744 isSeen = data12[num3].GetBit(1),
745 isHarvested = data12[num3].GetBit(2),
746 impassable = data12[num3].GetBit(3),
747 isModified = data12[num3].GetBit(4),
748 isClearSnow = data12[num3].GetBit(5),
749 isForceFloat = data12[num3].GetBit(6),
750 isToggleWallPillar = data12[num3].GetBit(7),
751 isWatered = data13[num3].GetBit(0),
752 isObjDyed = data13[num3].GetBit(1),
753 crossWall = data13[num3].GetBit(2),
754 hidePillar = data13[num3].GetBit(3),
755 toggleOcclusion = data13[num3].GetBit(4)
756 });
757 if (version.IsBelow(0, 23, 344) && cell.bridgePillar == 255)
758 {
759 cell.bridgePillar = 0;
760 cell.hidePillar = true;
761 }
762 if (!EClass.sources.floors.map.ContainsKey(cell._bridge))
763 {
764 cell._bridge = 0;
765 }
766 if (!EClass.sources.materials.map.ContainsKey(cell._bridgeMat))
767 {
768 cell._bridgeMat = 1;
769 }
771 num3++;
772 }
773 }
774 things.ForeachReverse(delegate(Thing t)
775 {
776 if (t.Num <= 0 || t.isDestroyed)
777 {
778 Debug.Log("[bug] Removing bugged thing:" + t.Num + "/" + t.isDestroyed + "/" + t);
779 things.Remove(t);
780 }
781 });
782 foreach (KeyValuePair<int, CellEffect> cellEffect in cellEffects)
783 {
784 int key = cellEffect.Key;
785 int num4 = key % Size;
786 int num5 = key / Size;
787 cells[num4, num5].effect = cellEffect.Value;
788 if (cellEffect.Value.IsFire)
789 {
790 effectManager.GetOrCreate(new Point(num4, num5));
791 }
792 }
793 cellEffects.Clear();
795 byte[] TryLoad(string s)
796 {
797 return TryLoadFile(path, s, size);
798 }
799 int[] TryLoadIds(string s)
800 {
801 int value;
802 int width = ((cellWidths == null || !cellWidths.TryGetValue(s, out value)) ? 1 : value);
803 return ReadCellIds(CellIdPath(path + s, width), s, size, width) ?? new int[size];
804 }
805 void Validate<T>(ref T[] reference, string id)
806 {
807 if (reference.Length < size)
808 {
809 Debug.LogError("exception: size invalid:" + id + " " + reference.Length + "/" + size);
810 reference = new T[size];
811 }
812 }
813 }
bool isDestroyed
Definition: Card.cs:78
int Num
Definition: Card.cs:161
int _bridgeMat
Definition: Cell.cs:56
CellEffect effect
Definition: Cell.cs:114
static void RebuildCritter(Cell cell)
Definition: Critter.cs:93
LogicalPoint GetOrCreate(Point point)
void SetBounds(int _x, int _z, int _maxX, int _maxZ)
Definition: MapBounds.cs:30
int[] ReadCellIds(string file, string s, int size, int width)
Definition: Map.cs:618
Dictionary< string, int > cellWidths
Definition: Map.cs:28
Dictionary< int, CellEffect > cellEffects
Definition: Map.cs:67
byte[] TryLoadFile(string path, string s, int size)
Definition: Map.cs:564
CellEffectManager effectManager
Definition: Map.cs:92
void ValidateVersion()
Definition: Map.cs:815
IO.Compression compression
Definition: Map.cs:25
static string CellIdPath(string path, int width)
Definition: Map.cs:575
SourceMaterial materials
SourceFloor floors
bool IsBelow(int _major, int _minor, int _batch)
Definition: Version.cs:49

References Cell._bridge, Cell._bridgeMat, bounds, cellEffects, CellIdPath(), cells, cellWidths, compression, Debug, Cell.effect, effectManager, SourceManager.floors, LogicalPointManager.GetOrCreate(), Version.IsBelow(), Card.isDestroyed, SourceManager.materials, MapBounds.maxX, Card.Num, ReadCellIds(), Critter.RebuildCritter(), MapBounds.SetBounds(), SetBounds(), MapBounds.Size, EClass.sources, things, TryLoadFile(), ValidateVersion(), version, MapBounds.x, and MapBounds.z.

Referenced by PartialMap._Load(), and Zone.Activate().

◆ MineBlock()

void Map.MineBlock ( Point  point,
bool  recoverBlock = false,
Chara  c = null,
bool  mineObj = true 
)
inline

Definition at line 1829 of file Map.cs.

1830 {
1831 bool flag = ActionMode.Mine.IsRoofEditMode() && point.cell._roofBlock != 0;
1832 if (!point.IsValid || (!flag && !point.cell.HasBlock))
1833 {
1834 return;
1835 }
1836 SourceMaterial.Row row = (flag ? point.matRoofBlock : point.matBlock);
1837 int num = (flag ? point.cell._roofBlock : point.cell._block);
1839 Effect.Get("smoke").Play(point);
1840 Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
1841 .Emit(10 + EClass.rnd(10));
1842 point.PlaySound(row.GetSoundDead(row2));
1843 row.AddBlood(point, 8);
1844 bool flag2 = c == null || c.IsAgent || c.IsPCFactionOrMinion;
1846 {
1847 flag2 = false;
1848 }
1849 if (flag)
1850 {
1851 point.cell._roofBlock = 0;
1852 RefreshSingleTile(point.x, point.z);
1853 }
1854 else
1855 {
1856 if (point.cell.HasFullBlock)
1857 {
1858 RemoveLonelyRamps(point.cell);
1859 }
1860 point.SetBlock();
1861 if (flag2 && point.sourceObj.tileType.IsBlockMount && mineObj)
1862 {
1863 MineObj(point, null, c);
1864 }
1865 }
1866 if (flag2)
1867 {
1868 DropBlockComponent(point, row2, row, recoverBlock, isPlatform: false, c);
1869 }
1870 RefreshShadow(point.x, point.z);
1871 RefreshShadow(point.x, point.z - 1);
1872 ValidateInstalled(point);
1873 RefreshFOV(point.x, point.z);
1874 if (flag2 && !point.cell.isModified && !flag)
1875 {
1876 if (num == 17 || EClass.rnd(100) == 0)
1877 {
1878 zone.AddCard(ThingGen.Create("money2"), point);
1879 }
1880 if (EClass._zone.DangerLv >= 10 && EClass.rnd(200) == 0)
1881 {
1882 zone.AddCard(ThingGen.Create("crystal_earth"), point);
1883 }
1884 if (EClass._zone.DangerLv >= 25 && EClass.rnd(200) == 0)
1885 {
1886 zone.AddCard(ThingGen.Create("crystal_sun"), point);
1887 }
1888 if (EClass._zone.DangerLv >= 40 && EClass.rnd(200) == 0)
1889 {
1890 zone.AddCard(ThingGen.Create("crystal_mana"), point);
1891 }
1892 point.cell.isModified = true;
1893 }
1894 }
override bool IsRoofEditMode(Card c=null)
Definition: AM_Mine.cs:19
static AM_Mine Mine
Definition: ActionMode.cs:33
bool IsPCFactionOrMinion
Definition: Card.cs:2342
bool isModified
Definition: Cell.cs:450
void RefreshSingleTile(int x, int z)
Definition: Map.cs:2264
void RefreshFOV(int x, int z, int radius=6, bool recalculate=false)
Definition: Map.cs:1042
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:2001
void RemoveLonelyRamps(Cell cell)
Definition: Map.cs:2171
void ValidateInstalled(Point p)
Definition: Map.cs:2128
void DropBlockComponent(Point point, TileRow r, SourceMaterial.Row mat, bool recoverBlock, bool isPlatform=false, Chara c=null)
Definition: Map.cs:1788
void RefreshShadow(int x, int z)
Definition: Map.cs:1961
SourceMaterial.Row matBlock
Definition: Point.cs:51
SourceObj.Row sourceObj
Definition: Point.cs:65
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:920
SourceBlock blocks
override int DangerLv
Definition: Zone.cs:115

References Cell._block, EClass._zone, SourceMaterial.Row.AddBlood(), Zone.AddCard(), SourceManager.blocks, Point.cell, ThingGen.Create(), Zone.DangerLv, GamePrincipal.disableUsermapBenefit, EClass.game, Effect.Get(), SourceMaterial.Row.GetColor(), SourceMaterial.Row.GetSoundDead(), Cell.HasBlock, Cell.HasFullBlock, Cell.isModified, AM_Mine.IsRoofEditMode(), Zone.IsUserZone, Point.IsValid, Point.matBlock, ActionMode.Mine, Effect.Play(), Point.PlaySound(), Game.principal, EClass.rnd(), Point.SetBlock(), Point.sourceObj, EClass.sources, Point.x, and Point.z.

Referenced by ActEffect.DamageEle(), and TaskMine.OnProgressComplete().

◆ MineFloor()

void Map.MineFloor ( Point  point,
Chara  c = null,
bool  recoverBlock = false,
bool  removePlatform = true 
)
inline

Definition at line 1913 of file Map.cs.

1914 {
1915 if (!point.IsValid || (!point.HasFloor && !point.HasBridge))
1916 {
1917 return;
1918 }
1919 SourceMaterial.Row row = (point.cell.HasBridge ? point.matBridge : point.matFloor);
1920 SourceFloor.Row c2 = (point.cell.HasBridge ? point.sourceBridge : point.sourceFloor);
1921 Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
1922 .Emit(10 + EClass.rnd(10));
1923 point.PlaySound(row.GetSoundDead(c2));
1924 MineObj(point, null, c);
1925 if (point.cell.HasBridge && removePlatform)
1926 {
1927 DropBlockComponent(EClass.pc.pos, point.sourceBridge, point.matBridge, recoverBlock, isPlatform: true, c);
1928 EClass._map.SetBridge(point.x, point.z);
1929 if (point.IsSky)
1930 {
1931 EClass.pc.Kick(point, ignoreSelf: true);
1932 }
1933 return;
1934 }
1936 {
1937 DropBlockComponent(EClass.pc.pos, point.sourceFloor, row, recoverBlock, isPlatform: false, c);
1938 SetFloor(point.x, point.z, 0, 90);
1939 if (point.IsSky)
1940 {
1941 EClass.pc.Kick(point, ignoreSelf: true);
1942 }
1943 return;
1944 }
1945 if (zone.IsRegion || point.cell._floor == 40)
1946 {
1947 Thing thing = ThingGen.CreateRawMaterial(row);
1948 thing.ChangeMaterial(row.alias);
1949 TrySmoothPick(point, thing, c);
1950 }
1951 else
1952 {
1953 DropBlockComponent(point, point.sourceFloor, row, recoverBlock, isPlatform: false, c);
1954 }
1955 if (!EClass._zone.IsRegion && !point.sourceFloor.components[0].Contains("chunk@soil"))
1956 {
1957 point.SetFloor(EClass.sources.floors[1].DefaultMaterial.id, 40);
1958 }
1959 }
void Kick(Point p, bool ignoreSelf=false, bool checkWall=true)
Definition: Card.cs:6315
int _floor
Definition: Cell.cs:46
bool HasBridge
Definition: Cell.cs:707
static Chara pc
Definition: EClass.cs:15
void SetBridge(int x, int z, int height=0, int idMat=0, int idBridge=0, int dir=0, int idPillar=0, bool hidePillar=false)
Definition: Map.cs:1108
void SetFloor(int x, int z, int idMat=0, int idFloor=0)
Definition: Map.cs:1084
SourceMaterial.Row matFloor
Definition: Point.cs:53
bool HasBridge
Definition: Point.cs:217
bool IsSky
Definition: Point.cs:220
SourceMaterial.Row matBridge
Definition: Point.cs:55
void SetFloor(int idMat=0, int idFloor=0)
Definition: Point.cs:925
SourceFloor.Row sourceFloor
Definition: Point.cs:61
bool HasFloor
Definition: Point.cs:215
SourceFloor.Row sourceBridge
Definition: Point.cs:63
static Thing CreateRawMaterial(SourceMaterial.Row m)
Definition: ThingGen.cs:68
virtual bool IsSkyLevel
Definition: Zone.cs:274

References Cell._floor, EClass._map, EClass._zone, SourceMaterial.Row.alias, Point.cell, Card.ChangeMaterial(), ThingGen.CreateRawMaterial(), SourceManager.floors, Effect.Get(), SourceMaterial.Row.GetColor(), SourceMaterial.Row.GetSoundDead(), Cell.HasBridge, Point.HasBridge, Point.HasFloor, Spatial.IsRegion, Point.IsSky, Zone.IsSkyLevel, Point.IsValid, Card.Kick(), Point.matBridge, Point.matFloor, EClass.pc, Effect.Play(), Point.PlaySound(), Card.pos, EClass.rnd(), SetBridge(), Point.SetFloor(), Point.sourceBridge, Point.sourceFloor, EClass.sources, Point.x, and Point.z.

Referenced by TaskDig.OnProgressComplete().

◆ MineObj()

void Map.MineObj ( Point  point,
Task  task = null,
Chara  c = null 
)
inline

Definition at line 2001 of file Map.cs.

2002 {
2003 if (!point.IsValid || !point.HasObj)
2004 {
2005 return;
2006 }
2007 Cell cell = point.cell;
2008 SourceObj.Row sourceObj = cell.sourceObj;
2009 if (c == null && task != null)
2010 {
2011 c = task.owner;
2012 }
2013 bool num = c == null || c.IsAgent || c.IsPCFactionOrMinion;
2014 DestroyObj(point);
2015 if (num)
2016 {
2017 SourceMaterial.Row matObj_fixed = cell.matObj_fixed;
2018 if (task is TaskHarvest { IsReapSeed: not false })
2019 {
2020 int num2 = 1 + EClass.rnd(2) + ((EClass.rnd(3) == 0) ? 1 : 0);
2021 int soilCost = EClass._zone.GetSoilCost();
2022 int maxSoil = EClass._zone.MaxSoil;
2023 if (soilCost > maxSoil)
2024 {
2025 num2 -= EClass.rnd(2 + (soilCost - maxSoil) / 10);
2026 }
2027 if (num2 <= 0)
2028 {
2029 Msg.Say("seedSpoiled", cell.GetObjName());
2030 }
2031 else if (!EClass._zone.IsUserZone)
2032 {
2033 Thing t = TraitSeed.MakeSeed(cell).SetNum(num2);
2034 EClass.pc.PickOrDrop(point, t);
2035 }
2036 if (cell.growth.IsTree)
2037 {
2038 cell.isHarvested = true;
2039 return;
2040 }
2041 }
2042 else if (sourceObj.HasGrowth)
2043 {
2044 cell.growth.PopMineObj(c);
2045 }
2046 else
2047 {
2048 if (cell.HasBlock && (sourceObj.id == 18 || sourceObj.id == 19))
2049 {
2050 MineBlock(point, recoverBlock: false, c, mineObj: false);
2051 }
2053 {
2054 if (EClass.game.survival.OnMineWreck(point))
2055 {
2056 Rand.SetSeed();
2057 return;
2058 }
2059 Rand.SetSeed();
2060 }
2061 switch (sourceObj.alias)
2062 {
2063 case "nest_bird":
2064 if (EClass.rnd(5) <= 1)
2065 {
2066 Pop(ThingGen.Create((EClass.rnd(10) == 0) ? "egg_fertilized" : "_egg").TryMakeRandomItem());
2067 }
2068 break;
2069 }
2070 int num3 = EClass.rnd(EClass.rnd(sourceObj.components.Length) + 1);
2071 string[] array = sourceObj.components[num3].Split('/');
2072 Thing thing = ThingGen.Create(array[0].Split('|')[0], matObj_fixed.alias);
2073 if (array.Length > 1)
2074 {
2075 thing.SetNum(EClass.rnd(array[1].ToInt()) + 1);
2076 }
2077 Pop(thing);
2078 }
2079 }
2080 SetObj(point.x, point.z);
2081 cell.gatherCount = 0;
2082 void Pop(Thing thing2)
2083 {
2085 {
2087 {
2088 EClass._map.PutAway(thing2);
2089 }
2090 else
2091 {
2092 TrySmoothPick(point, thing2, c);
2093 }
2094 }
2095 }
2096 }
static bool not(DramaManager dm, Dictionary< string, string > line, params string[] parameters)
new Chara owner
Definition: AIAct.cs:14
Thing TryMakeRandomItem(int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
Definition: Card.cs:5758
Thing SetNum(int a)
Definition: Card.cs:3676
string GetObjName()
Definition: Cell.cs:1676
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4616
SurvivalManager survival
Definition: Game.cs:228
bool IsSurvival
Definition: Game.cs:276
void PopMineObj(Chara c=null)
Definition: GrowSystem.cs:552
void DestroyObj(Point point)
Definition: Map.cs:1986
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1829
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:44
bool HasGrowth
Definition: SourceObj.cs:29
bool OnMineWreck(Point point)
string alias
Definition: TileRow.cs:13
static Thing MakeSeed(string idSource)
Definition: TraitSeed.cs:105
virtual int MaxSoil
Definition: Zone.cs:523
int GetSoilCost()
Definition: Zone.cs:4051

References EClass._map, EClass._zone, Scene.actionMode, SourceMaterial.Row.alias, TileRow.alias, Point.cell, RenderRow.components, ThingGen.Create(), EClass.debug, GamePrincipal.disableUsermapBenefit, EClass.game, Cell.GetObjName(), Zone.GetSoilCost(), CoreDebug.godBuild, Cell.growth, Cell.HasBlock, SourceObj.Row.HasGrowth, Point.HasObj, TileRow.id, ActionMode.IsBuildMode, Game.IsSurvival, GrowSystem.IsTree, Zone.IsUserZone, Point.IsValid, TraitSeed.MakeSeed(), Cell.matObj_fixed, Zone.MaxSoil, not(), SurvivalManager.OnMineWreck(), EClass.pc, Chara.PickOrDrop(), GrowSystem.PopMineObj(), Game.principal, PutAway(), EClass.rnd(), Msg.Say(), EClass.scene, Card.SetNum(), Rand.SetSeed(), Cell.sourceObj, Game.survival, Card.TryMakeRandomItem(), Point.x, and Point.z.

Referenced by ActEffect.DamageEle(), TaskHarvest.OnCreateProgress(), TaskCut.OnProgressComplete(), and GrowSystem.OnProgressComplete().

◆ MineObjSound()

void Map.MineObjSound ( Point  point)
inline

Definition at line 2098 of file Map.cs.

2099 {
2100 point.PlaySound(point.cell.matObj.GetSoundDead(point.cell.sourceObj));
2101 }

References Point.cell, Cell.matObj, Point.PlaySound(), and Cell.sourceObj.

Referenced by Recipe.Build().

◆ MineRamp()

void Map.MineRamp ( Point  point,
int  ramp,
bool  recoverBlock = false 
)
inline

Definition at line 1896 of file Map.cs.

1897 {
1898 if (point.IsValid && point.cell.HasFullBlock)
1899 {
1900 SourceMaterial.Row matBlock = point.matBlock;
1901 int block = point.cell._block;
1902 Effect.Get("smoke").Play(point);
1903 Effect.Get("mine").Play(point).SetParticleColor(point.matBlock.GetColor())
1904 .Emit(10 + EClass.rnd(10));
1905 MineObj(point);
1906 int rampDir = EClass._map.GetRampDir(point.x, point.z, EClass.sources.blocks[ramp].tileType);
1907 RemoveLonelyRamps(point.cell);
1908 SetBlock(point.x, point.z, point.cell._blockMat, ramp, rampDir);
1909 DropBlockComponent(point, EClass.sources.blocks[block], matBlock, recoverBlock);
1910 }
1911 }
int _blockMat
Definition: Cell.cs:44
int GetRampDir(int x, int z, TileType blockType=null)
Definition: Map.cs:2314

References Cell._block, Cell._blockMat, EClass._map, block, SourceManager.blocks, Point.cell, Effect.Get(), GetRampDir(), Cell.HasFullBlock, Point.IsValid, Point.matBlock, Effect.Play(), EClass.rnd(), EClass.sources, Point.x, and Point.z.

Referenced by TaskMine.OnProgressComplete().

◆ ModFire()

void Map.ModFire ( int  x,
int  z,
int  amount 
)
inline

Definition at line 1309 of file Map.cs.

1310 {
1311 Cell cell = cells[x, z];
1312 if (amount <= 0 || (!cell.IsTopWaterAndNoSnow && !cell.IsSnowTile && !EClass._zone.IsUnderwater))
1313 {
1314 if (cell.effect == null && amount > 0)
1315 {
1316 SE.Play("fire");
1317 }
1318 int num = amount + (cell.effect?.FireAmount ?? 0);
1319 if (num > 20)
1320 {
1321 num = 20;
1322 }
1323 if (num <= 0)
1324 {
1325 cell.effect = null;
1326 return;
1327 }
1328 cell.effect = new CellEffect
1329 {
1330 id = 3,
1331 amount = num
1332 };
1334 }
1335 }
int FireAmount
Definition: CellEffect.cs:162
bool IsSnowTile
Definition: Cell.cs:818
bool IsTopWaterAndNoSnow
Definition: Cell.cs:748

References EClass._zone, Cell.effect, CellEffect.FireAmount, LogicalPointManager.GetOrCreate(), Cell.IsSnowTile, Cell.IsTopWaterAndNoSnow, and Zone.IsUnderwater.

Referenced by RecipeCard.Craft(), and Point.ModFire().

◆ ModLiquid()

void Map.ModLiquid ( int  x,
int  z,
int  amount 
)
inline

Definition at line 1674 of file Map.cs.

1675 {
1676 Cell cell = cells[x, z];
1677 if (!cell.IsTopWaterAndNoSnow && cell.effect != null)
1678 {
1679 cell.effect.amount += amount;
1680 if (cell.effect.amount <= 0)
1681 {
1682 cell.effect = null;
1683 }
1684 }
1685 }
int amount
Definition: CellEffect.cs:26

References CellEffect.amount, Cell.effect, and Cell.IsTopWaterAndNoSnow.

Referenced by GameUpdater.SurfaceUpdater.FixedUpdate().

◆ MoveCard()

void Map.MoveCard ( Point  p,
Card  t 
)
inline

Definition at line 953 of file Map.cs.

954 {
955 _AddCard(p.x, p.z, t, onAddToZone: false);
956 }

References _AddCard(), Point.x, and Point.z.

Referenced by Chara._Move(), Card._Move(), Card.MoveImmediate(), ResetEditorPos(), Resize(), AI_Trolley.Run(), and Chara.SyncRide().

◆ OnCardAddedToZone()

void Map.OnCardAddedToZone ( Card  t,
int  x,
int  z 
)
inline

Definition at line 918 of file Map.cs.

919 {
920 if (t.isChara)
921 {
922 charas.Add(t.Chara);
923 }
924 else
925 {
926 things.Add(t.Thing);
927 }
929 if (t.isChara && new Point(x, z).cell.HasFullBlock)
930 {
931 DestroyBlock(x, z);
932 }
933 _AddCard(x, z, t, onAddToZone: true);
935 }
virtual Thing Thing
Definition: Card.cs:2110
void DestroyBlock(int x, int z)
Definition: Map.cs:2185
virtual void OnAddedToZone()
Definition: Trait.cs:722

References _AddCard(), ActPlan.List.Add(), Card.Chara, charas, DestroyBlock(), Card.isChara, Trait.OnAddedToZone(), PropsManager.OnCardAddedToZone(), props, Card.Thing, things, Card.trait, MapBounds.x, and MapBounds.z.

Referenced by Zone.AddCard().

◆ OnCardRemovedFromZone()

void Map.OnCardRemovedFromZone ( Card  t)
inline

Definition at line 937 of file Map.cs.

938 {
941 _RemoveCard(t);
942 t.parent = null;
943 if (t.isChara)
944 {
945 charas.RemoveFromEnd(t.Chara);
946 }
947 else
948 {
949 things.RemoveFromEnd(t.Thing);
950 }
951 }
void SetPlaceState(PlaceState newState, bool byPlayer=false)
Definition: Card.cs:3928
virtual void OnRemovedFromZone()
Definition: Trait.cs:726

References _RemoveCard(), Card.Chara, charas, Card.isChara, Trait.OnRemovedFromZone(), Card.SetPlaceState(), Card.Thing, things, and Card.trait.

Referenced by Zone.RemoveCard().

◆ OnDeactivate()

void Map.OnDeactivate ( )
inline

Definition at line 210 of file Map.cs.

211 {
212 charas.ForeachReverse(delegate(Chara c)
213 {
214 c.ai = new NoGoal();
215 if (c.IsGlobal)
216 {
217 zone.RemoveCard(c);
218 c.currentZone = zone;
219 }
220 });
221 foreach (Thing thing in things)
222 {
223 if (thing.renderer.hasActor)
224 {
225 thing.renderer.KillActor();
226 }
227 }
229 }
void KillActor()
CardRenderer renderer
Definition: Card.cs:64
override bool IsGlobal
Definition: Chara.cs:630
Definition: NoGoal.cs:4
void ClearMapHighlights()
Definition: Player.cs:2553
void RemoveCard(Card t)
Definition: Zone.cs:2200

References charas, Player.ClearMapHighlights(), CardRenderer.hasActor, Chara.IsGlobal, CardRenderer.KillActor(), EClass.player, Zone.RemoveCard(), Card.renderer, things, and zone.

Referenced by Zone.Deactivate().

◆ OnDeserialized()

void Map.OnDeserialized ( StreamingContext  context)
inlineprivate

Definition at line 153 of file Map.cs.

154 {
155 bits.Bits = (uint)_bits;
156 }
int _bits
Definition: Map.cs:22

References _bits.

◆ OnImport()

void Map.OnImport ( ZoneExportData  data)
inline

Definition at line 826 of file Map.cs.

827 {
828 tasks = new TaskManager();
829 data.serializedCards.Restore(this, data.orgMap, addToZone: false);
830 }
TaskManager tasks
Definition: Map.cs:37
void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial=null)
SerializedCards serializedCards

References ZoneExportData.orgMap, SerializedCards.Restore(), ZoneExportData.serializedCards, and tasks.

Referenced by Zone.Activate().

◆ OnLoad()

void Map.OnLoad ( )
inline

Definition at line 820 of file Map.cs.

821 {
822 rooms.OnLoad();
823 tasks.OnLoad();
824 }
void OnLoad()
Definition: RoomManager.cs:26
void OnLoad()
Definition: TaskManager.cs:66

References RoomManager.OnLoad(), TaskManager.OnLoad(), rooms, and tasks.

◆ OnSerializing() [1/2]

virtual void Map.OnSerializing ( )
inlineprotectedvirtual

Definition at line 148 of file Map.cs.

149 {
150 }

◆ OnSerializing() [2/2]

void Map.OnSerializing ( StreamingContext  context)
inlineprivate

Definition at line 143 of file Map.cs.

144 {
145 _bits = (int)bits.Bits;
146 }
BitArray32 bits
Definition: Map.cs:78
uint Bits
Definition: BitArray32.cs:6

References _bits, bits, and BitArray32.Bits.

◆ OnSetBlockOrDoor()

void Map.OnSetBlockOrDoor ( int  x,
int  z 
)
inline

Definition at line 1161 of file Map.cs.

1162 {
1163 new Point(x, z);
1164 TryRemoveRoom(x, z);
1165 if (x > 0)
1166 {
1167 TryRemoveRoom(x - 1, z);
1168 }
1169 if (x < Size - 1)
1170 {
1171 TryRemoveRoom(x + 1, z);
1172 }
1173 if (z > 0)
1174 {
1175 TryRemoveRoom(x, z - 1);
1176 }
1177 if (z < Size - 1)
1178 {
1179 TryRemoveRoom(x, z + 1);
1180 }
1181 if (x > 0 && z < Size - 1)
1182 {
1183 TryRemoveRoom(x - 1, z + 1);
1184 }
1185 roomHash.Clear();
1186 TryAddRoom(x, z);
1187 if (x > 0)
1188 {
1189 TryAddRoom(x - 1, z);
1190 }
1191 if (x < Size - 1)
1192 {
1193 TryAddRoom(x + 1, z);
1194 }
1195 if (z > 0)
1196 {
1197 TryAddRoom(x, z - 1);
1198 }
1199 if (z < Size - 1)
1200 {
1201 TryAddRoom(x, z + 1);
1202 }
1203 if (x > 0 && z < Size - 1)
1204 {
1205 TryAddRoom(x - 1, z + 1);
1206 }
1207 }
HashSet< int > roomHash
Definition: Map.cs:110
void TryRemoveRoom(int x, int z)
Definition: Map.cs:1209
void TryAddRoom(int x, int z)
Definition: Map.cs:1221

Referenced by SerializedCards.Restore(), and Card.SetPlaceState().

◆ PutAway()

bool Map.PutAway ( Card  c)
inline

Definition at line 2739 of file Map.cs.

2740 {
2742 {
2743 return false;
2744 }
2745 if (c.isChara)
2746 {
2748 {
2749 return false;
2750 }
2751 c.Destroy();
2752 return true;
2753 }
2754 Thing thing = c.Thing;
2755 if (thing.parent != null)
2756 {
2757 thing.parent.RemoveCard(thing);
2758 }
2759 thing.isMasked = false;
2760 thing.isRoofItem = false;
2761 if (EClass._zone.IsPCFaction && EClass._map.props.installed.traits.GetRandomThing<TraitSpotStockpile>() != null)
2762 {
2763 EClass._zone.TryAddThingInSpot<TraitSpotStockpile>(thing);
2764 return true;
2765 }
2766 if (EClass.debug.enable)
2767 {
2769 return true;
2770 }
2771 EClass.pc.Pick(thing, msg: false);
2772 return true;
2773 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3280
ICardParent parent
Definition: Card.cs:56
void Destroy()
Definition: Card.cs:5314
virtual bool IsPC
Definition: Card.cs:2197
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4636
bool enable
Definition: CoreDebug.cs:302
Thing GetOrCreateDebugContainer()
Definition: CoreDebug.cs:794
bool ignoreBuildRule
Definition: CoreDebug.cs:201
TraitManager traits
Definition: Props.cs:18
virtual bool CanOnlyCarry
Definition: Trait.cs:305
void RemoveCard(Card c)

References EClass._map, EClass._zone, Card.AddThing(), Trait.CanOnlyCarry, EClass.debug, Card.Destroy(), CoreDebug.enable, CoreDebug.GetOrCreateDebugContainer(), CoreDebug.ignoreBuildRule, PropsManager.installed, Card.isChara, Card.IsPC, Zone.IsPCFaction, Card.parent, EClass.pc, Chara.Pick(), props, ICardParent.RemoveCard(), Card.Thing, Card.trait, and Props.traits.

Referenced by MineObj(), AM_Deconstruct.Perform(), and AM_MoveInstalled.TryPutAway().

◆ Quake()

void Map.Quake ( )
inline

Definition at line 2630 of file Map.cs.

2631 {
2632 Point point = new Point();
2633 int num;
2634 for (num = 0; num < Size; num++)
2635 {
2636 int num2;
2637 for (num2 = 0; num2 < Size; num2++)
2638 {
2639 point.x = num;
2640 point.z = num2;
2641 point.Copy().Animate(AnimeID.Quake, animeBlock: true);
2642 num2 += EClass.rnd(2);
2643 }
2644 num += EClass.rnd(2);
2645 }
2646 }
AnimeID
Definition: AnimeID.cs:2
Point Copy()
Definition: Point.cs:487
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1304

References Point.Animate(), Point.Copy(), and EClass.rnd().

◆ QuickRefreshTile()

void Map.QuickRefreshTile ( int  x,
int  z 
)
inline

Definition at line 2299 of file Map.cs.

2300 {
2301 Cell cell = cells[x, z];
2302 Cell cell2 = ((x > 0) ? cells[x - 1, z] : Cell.Void);
2303 Cell cell3 = ((x + 1 < Size) ? cells[x + 1, z] : Cell.Void);
2304 Cell cell4 = ((z > 0) ? cells[x, z - 1] : Cell.Void);
2305 Cell cell5 = ((z + 1 < Size) ? cells[x, z + 1] : Cell.Void);
2306 Cell cell6 = ((x > 0 && z > 0) ? cells[x - 1, z - 1] : Cell.Void);
2307 Cell cell7 = ((x + 1 < Size && z > 0) ? cells[x + 1, z - 1] : Cell.Void);
2308 Cell cell8 = ((x > 0 && z + 1 < Size) ? cells[x - 1, z + 1] : Cell.Void);
2309 Cell cell9 = ((x + 1 < Size && z + 1 < Size) ? cells[x + 1, z + 1] : Cell.Void);
2310 cell.isSurrounded4d = cell2.HasFullBlock && cell3.HasFullBlock && cell4.HasFullBlock && cell5.HasFullBlock;
2311 cell.isSurrounded = cell.isSurrounded4d && cell6.HasFullBlock && cell7.HasFullBlock && cell8.HasFullBlock && cell9.HasFullBlock;
2312 }
static Cell Void
Definition: Cell.cs:10

References Cell.HasFullBlock, and Cell.Void.

Referenced by MapGen.GenerateTerrain().

◆ ReadCellIds()

int[] Map.ReadCellIds ( string  file,
string  s,
int  size,
int  width 
)
inlineprivate

Definition at line 618 of file Map.cs.

619 {
620 byte[] array = IO.ReadLZ4(file, size * width, compression);
621 if (array == null)
622 {
623 return null;
624 }
625 if ((width != 1 && width != 2 && width != 4) || array.Length != (long)size * (long)width)
626 {
627 Debug.Log("Couldn't load:" + s);
628 return null;
629 }
630 int[] array2 = new int[size];
631 for (int i = 0; i < size; i++)
632 {
633 for (int j = 0; j < width; j++)
634 {
635 array2[i] |= array[i * width + j] << 8 * j;
636 }
637 }
638 return array2;
639 }
static byte[] ReadLZ4(string _path, int size, Compression compression)
Definition: IO.cs:158

References compression, and Debug.

Referenced by Load().

◆ RefreshAllTiles()

void Map.RefreshAllTiles ( )
inline

Definition at line 2269 of file Map.cs.

2270 {
2271 for (int i = 0; i < Size; i++)
2272 {
2273 for (int j = 0; j < Size; j++)
2274 {
2275 cells[i, j].Refresh();
2276 }
2277 }
2278 }
void Refresh()
Definition: Cell.cs:1192

References Cell.Refresh().

Referenced by GameDate.AdvanceMonth(), PartialMap.Apply(), ZoneInspector.FillUtil.FlattenHeight(), MapGenDungen.OnGenerateTerrain(), MapGenRegion.OnGenerateTerrain(), Zone.OnSimulateMonth(), MapGen.Populate(), ZoneInspector.RefreshAll(), and HotItemContext.Show().

◆ RefreshFOV()

void Map.RefreshFOV ( int  x,
int  z,
int  radius = 6,
bool  recalculate = false 
)
inline

Definition at line 1042 of file Map.cs.

1043 {
1044 ForeachSphere(x, z, radius, delegate(Point p)
1045 {
1046 CellDetail detail = p.detail;
1047 if (detail == null)
1048 {
1049 return;
1050 }
1051 foreach (Thing thing in detail.things)
1052 {
1053 if (recalculate)
1054 {
1055 thing.RecalculateFOV();
1056 }
1057 else
1058 {
1059 thing.CalculateFOV();
1060 }
1061 }
1062 foreach (Chara chara in detail.charas)
1063 {
1064 if (recalculate)
1065 {
1066 chara.RecalculateFOV();
1067 }
1068 else
1069 {
1070 chara.CalculateFOV();
1071 }
1072 }
1073 });
1074 }
CellDetail detail
Definition: Point.cs:67

References Point.detail, ForeachSphere(), Card.things, MapBounds.x, and MapBounds.z.

Referenced by GrowSystem.Grow(), WidgetArtTool.OnActivate(), TaskMoveInstalled.OnProgressComplete(), TraitDoor.ToggleDoor(), and TraitDoorSwing.ToggleDoor().

◆ RefreshFOVAll()

void Map.RefreshFOVAll ( )
inline

Definition at line 1076 of file Map.cs.

1077 {
1078 foreach (Card item in ((IEnumerable<Card>)EClass._map.things).Concat((IEnumerable<Card>)EClass._map.charas))
1079 {
1080 item.RecalculateFOV();
1081 }
1082 }

References EClass._map, charas, item, and things.

Referenced by ColorProfile.OnValidate().

◆ RefreshNeighborTiles()

void Map.RefreshNeighborTiles ( int  x,
int  z 
)
inline

Definition at line 2280 of file Map.cs.

2281 {
2282 cells[x, z].Refresh();
2283 for (int i = x - 2; i < x + 3; i++)
2284 {
2285 if (i < 0 || i >= Size)
2286 {
2287 continue;
2288 }
2289 for (int j = z - 2; j < z + 3; j++)
2290 {
2291 if (j >= 0 && j < Size && (x != i || z != j))
2292 {
2293 cells[i, j].Refresh();
2294 }
2295 }
2296 }
2297 }

References Cell.Refresh().

Referenced by SetSeen().

◆ RefreshShadow()

void Map.RefreshShadow ( int  x,
int  z 
)
inline

Definition at line 1961 of file Map.cs.

1962 {
1963 }

◆ RefreshSingleTile()

void Map.RefreshSingleTile ( int  x,
int  z 
)
inline

Definition at line 2264 of file Map.cs.

2265 {
2266 cells[x, z].Refresh();
2267 }

References Cell.Refresh().

Referenced by GameUpdater.LogicUpdater.FixedUpdate(), TraitDoor.ToggleDoor(), and TraitDoorSwing.ToggleDoor().

◆ RefreshSunMap()

void Map.RefreshSunMap ( )
inline

Definition at line 2933 of file Map.cs.

2934 {
2935 if (!isDirtySunMap)
2936 {
2937 return;
2938 }
2939 sunMap.Clear();
2940 foreach (Card sun in EClass._map.props.installed.traits.suns)
2941 {
2942 foreach (Point item in sun.trait.ListPoints(null, onlyPassable: false))
2943 {
2944 sunMap.Add(item.index);
2945 }
2946 }
2947 isDirtySunMap = false;
2948 }
static bool isDirtySunMap
Definition: Map.cs:16
static HashSet< int > sunMap
Definition: Map.cs:14
TraitMap suns
Definition: TraitManager.cs:14
virtual List< Point > ListPoints(Point center=null, bool onlyPassable=true, bool allowChara=true)
Definition: Trait.cs:870

References EClass._map, PropsManager.installed, item, Trait.ListPoints(), props, TraitManager.suns, Card.trait, and Props.traits.

Referenced by GameUpdater.Update().

◆ Reload()

void Map.Reload ( )
inline

Definition at line 315 of file Map.cs.

316 {
317 rooms = new RoomManager();
318 SetReference();
319 string id = Game.id;
320 EClass.game.Save();
321 EClass.scene.Init(Scene.Mode.None);
322 Game.Load(id, cloud: false);
323 RevealAll();
324 TweenUtil.Tween(0.1f, null, delegate
325 {
326 ReloadRoom();
327 });
328 }
Definition: Game.cs:9
static void Load(string id, bool cloud)
Definition: Game.cs:322
static string id
Definition: Game.cs:148
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1090
void ReloadRoom()
Definition: Map.cs:330
void RevealAll(bool reveal=true)
Definition: Map.cs:1018
Definition: Scene.cs:8
void Init(Mode newMode)
Definition: Scene.cs:178
Mode
Definition: Scene.cs:10

References EClass.game, Game.id, Scene.Init(), Game.Load(), ReloadRoom(), RevealAll(), rooms, Game.Save(), EClass.scene, and SetReference().

Referenced by Resize(), and Shift().

◆ ReloadRoom()

void Map.ReloadRoom ( )
inline

Definition at line 330 of file Map.cs.

331 {
332 List<Thing> list = new List<Thing>();
333 foreach (Thing thing in things)
334 {
335 if (thing.trait.IsDoor)
336 {
337 list.Add(thing);
338 }
339 }
340 foreach (Thing item in list)
341 {
342 Point pos = item.pos;
344 EClass._zone.AddCard(item, pos);
345 item.Install();
346 }
348 }
void RefreshAll()
Definition: RoomManager.cs:43
virtual bool IsDoor
Definition: Trait.cs:58

References EClass._zone, Zone.AddCard(), Trait.IsDoor, item, RoomManager.RefreshAll(), Zone.RemoveCard(), rooms, things, and Card.trait.

Referenced by MapGenDungen.OnGenerateTerrain(), and Reload().

◆ RemoveLonelyRamps()

void Map.RemoveLonelyRamps ( Cell  cell)
inline

Definition at line 2171 of file Map.cs.

2172 {
2173 for (int i = 0; i < 4; i++)
2174 {
2175 Cell dependedRamp = GetDependedRamp(cell);
2176 if (dependedRamp != null)
2177 {
2178 MineBlock(dependedRamp.GetPoint());
2179 continue;
2180 }
2181 break;
2182 }
2183 }
Point GetPoint()
Definition: Cell.cs:1141
Cell GetDependedRamp(Cell cell)
Definition: Map.cs:2351

References Cell.GetPoint().

◆ RemovePlant()

void Map.RemovePlant ( Point  pos)
inline

Definition at line 2123 of file Map.cs.

2124 {
2125 plants.Remove(pos.index);
2126 }

References Point.index.

◆ Reset()

void Map.Reset ( )
inline

Definition at line 350 of file Map.cs.

351 {
352 for (int i = 0; i < Size; i++)
353 {
354 for (int j = 0; j < Size; j++)
355 {
356 cells[i, j].Reset();
357 }
358 }
359 SetReference();
360 }
void Reset()
Definition: Cell.cs:1597

References cells, Cell.Reset(), SetReference(), and MapBounds.Size.

Referenced by MapGen.OnGenerateTerrain().

◆ ResetEditorPos()

void Map.ResetEditorPos ( )
inline

Definition at line 362 of file Map.cs.

363 {
365 foreach (Chara chara in charas)
366 {
367 if (chara.isPlayerCreation && chara.orgPos != null)
368 {
369 MoveCard(chara.orgPos, chara);
370 }
371 }
372 foreach (Thing thing in things)
373 {
374 if (thing.trait is TraitDoor)
375 {
376 (thing.trait as TraitDoor).ForceClose();
377 }
378 }
379 }
bool isPlayerCreation
Definition: Card.cs:497
Point orgPos
Definition: Chara.cs:23
void MoveCard(Point p, Card t)
Definition: Map.cs:953
void Revive()
Definition: Zone.cs:1220

References EClass._zone, charas, Card.isPlayerCreation, MoveCard(), Chara.orgPos, Zone.Revive(), things, and Card.trait.

Referenced by Zone.Export(), and BuildMenu.OnActivate().

◆ Resize()

void Map.Resize ( int  newSize)
inline

Definition at line 231 of file Map.cs.

232 {
233 Point p = new Point(0, 0);
234 foreach (Thing thing in EClass._map.things)
235 {
236 if (thing.pos.x >= newSize || thing.pos.z >= newSize)
237 {
238 MoveCard(p, thing);
239 }
240 }
241 foreach (Chara chara in EClass._map.charas)
242 {
243 if (chara.pos.x >= newSize || chara.pos.z >= newSize)
244 {
245 MoveCard(p, chara);
246 }
247 }
248 Size = (bounds.Size = newSize);
249 maxX = (maxZ = Size);
250 cells = Util.ResizeArray(EClass._map.cells, newSize, newSize, (int x, int y) => new Cell
251 {
252 x = (byte)x,
253 z = (byte)y,
254 isSeen = true
255 });
256 Reload();
257 }
void Reload()
Definition: Map.cs:315
Definition: Util.cs:10

References EClass._map, cells, charas, MapBounds.maxX, MapBounds.maxZ, MoveCard(), Card.pos, Reload(), MapBounds.Size, things, Util, MapBounds.x, Point.x, MapBounds.z, and Point.z.

Referenced by ZoneInspector.ResizeUtil.Apply(), and MapGen.OnGenerateTerrain().

◆ Reveal()

void Map.Reveal ( Point  center,
int  power = 100 
)
inline

Definition at line 1031 of file Map.cs.

1032 {
1033 ForeachSphere(center.x, center.z, 10 + power / 5, delegate(Point p)
1034 {
1035 if (EClass.rnd(power) >= Mathf.Min(p.Distance(center) * 10, power - 10))
1036 {
1037 EClass._map.SetSeen(p.x, p.z);
1038 }
1039 });
1040 }

References Point.Distance(), ForeachSphere(), EClass.rnd(), Point.x, and Point.z.

Referenced by ActEffect.Proc().

◆ RevealAll()

void Map.RevealAll ( bool  reveal = true)
inline

Definition at line 1018 of file Map.cs.

1019 {
1020 for (int i = 0; i < Size; i++)
1021 {
1022 for (int j = 0; j < Size; j++)
1023 {
1024 EClass._map.SetSeen(i, j, reveal, refresh: false);
1025 }
1026 }
1027 revealed = !revealed;
1029 }
bool revealed
Definition: Map.cs:108
void SetSeen(int x, int z, bool seen=true, bool refresh=true)
Definition: Map.cs:1005
static void UpdateMap(List< Cell > newPoints)

References EClass._map, revealed, SetSeen(), MapBounds.Size, and WidgetMinimap.UpdateMap().

Referenced by BuildMenu.Activate(), Zone.ClaimZone(), ZoneProfile.Generate(), ActEffect.Proc(), Reload(), and CoreDebug.ToggleRevealMap().

◆ Save()

void Map.Save ( string  path,
ZoneExportData  export = null,
PartialMap  partial = null 
)
inline

Definition at line 381 of file Map.cs.

382 {
384 Debug.Log("#io saving map:" + path);
385 IO.CreateDirectory(path);
386 int num = 0;
387 int num2 = 0;
388 int num3 = Size;
389 int num4 = Size;
390 if (partial != null)
391 {
392 num = partial.offsetX;
393 num2 = partial.offsetZ;
394 num3 = partial.w;
395 num4 = partial.h;
396 }
397 int num5 = num3 * num4;
398 byte[] array = new byte[num5];
399 int[] array2 = new int[num5];
400 int[] array3 = new int[num5];
401 int[] array4 = new int[num5];
402 int[] array5 = new int[num5];
403 int[] array6 = new int[num5];
404 int[] array7 = new int[num5];
405 byte[] array8 = new byte[num5];
406 byte[] array9 = new byte[num5];
407 byte[] array10 = new byte[num5];
408 byte[] array11 = new byte[num5];
409 byte[] array12 = new byte[num5];
410 int[] array13 = new int[num5];
411 int[] array14 = new int[num5];
412 byte[] array15 = new byte[num5];
413 int[] array16 = new int[num5];
414 byte[] array17 = new byte[num5];
415 int[] array18 = new int[num5];
416 int[] array19 = new int[num5];
417 int[] array20 = new int[num5];
418 int[] array21 = new int[num5];
419 cellEffects.Clear();
420 int num6 = 0;
421 for (int i = num; i < num + num3; i++)
422 {
423 for (int j = num2; j < num2 + num4; j++)
424 {
425 Cell cell = cells[i, j];
426 array[num6] = cell.objVal;
427 array3[num6] = cell._blockMat;
428 array2[num6] = cell._block;
429 array5[num6] = cell._floorMat;
430 array4[num6] = cell._floor;
431 array6[num6] = cell.obj;
432 array20[num6] = cell._deco;
433 array21[num6] = cell._decoMat;
434 array7[num6] = cell.objMat;
435 array8[num6] = cell.decal;
436 array9[num6] = cell._dirs;
437 array12[num6] = cell.height;
438 array13[num6] = cell._bridge;
439 array14[num6] = cell._bridgeMat;
440 array15[num6] = cell.bridgeHeight;
441 array17[num6] = cell._roofBlockDir;
442 array18[num6] = cell._roofBlock;
443 array19[num6] = cell._roofBlockMat;
444 array16[num6] = cell.bridgePillar;
445 array10[num6] = array10[num6].SetBit(1, cell.isSeen);
446 array10[num6] = array10[num6].SetBit(2, cell.isHarvested);
447 array10[num6] = array10[num6].SetBit(3, cell.impassable);
448 array10[num6] = array10[num6].SetBit(4, cell.isModified);
449 array10[num6] = array10[num6].SetBit(5, cell.isClearSnow);
450 array10[num6] = array10[num6].SetBit(6, cell.isForceFloat);
451 array10[num6] = array10[num6].SetBit(7, cell.isToggleWallPillar);
452 array11[num6] = array11[num6].SetBit(0, cell.isWatered);
453 array11[num6] = array11[num6].SetBit(1, cell.isObjDyed);
454 array11[num6] = array11[num6].SetBit(2, cell.crossWall);
455 array11[num6] = array11[num6].SetBit(3, cell.hidePillar);
456 array11[num6] = array11[num6].SetBit(4, cell.toggleOcclusion);
457 if (cell.effect != null)
458 {
459 cellEffects[j * num4 + i] = cell.effect;
460 }
461 num6++;
462 }
463 }
465 cellWidths.Clear();
466 Write("objVals", array);
467 WriteIds("blocks", array2);
468 WriteIds("blockMats", array3);
469 WriteIds("floors", array4);
470 WriteIds("floorMats", array5);
471 WriteIds("objs", array6);
472 WriteIds("objMats", array7);
473 Write("decal", array8);
474 Write("flags", array10);
475 Write("flags2", array11);
476 Write("dirs", array9);
477 Write("heights", array12);
478 WriteIds("bridges", array13);
479 WriteIds("bridgeMats", array14);
480 Write("bridgeHeights", array15);
481 WriteIds("bridgePillars", array16);
482 WriteIds("roofBlocks", array18);
483 WriteIds("roofBlockMats", array19);
484 Write("roofBlockDirs", array17);
485 WriteIds("decos", array20);
486 WriteIds("decoMats", array21);
487 things.Sort((Thing a, Thing b) => a.stackOrder - b.stackOrder);
488 if (export == null)
489 {
490 foreach (Chara chara in charas)
491 {
492 if (!chara.IsGlobal)
493 {
494 serializedCharas.Add(chara);
495 }
496 }
497 try
498 {
499 GameIO.SaveFile(path + "map", this);
500 }
501 finally
502 {
503 serializedCharas.Clear();
504 }
505 }
506 else
507 {
508 export.serializedCards.cards.Clear();
509 if (partial == null)
510 {
511 MapExportSetting mapExportSetting = exportSetting ?? new MapExportSetting();
512 foreach (Chara chara2 in charas)
513 {
514 if (export.usermap)
515 {
516 if ((!mapExportSetting.clearLocalCharas || chara2.IsPCFactionOrMinion) && !chara2.trait.IsUnique && !chara2.IsPC)
517 {
518 export.serializedCards.Add(chara2);
519 }
520 }
521 else if (!chara2.IsGlobal && chara2.isPlayerCreation)
522 {
523 export.serializedCards.Add(chara2);
524 }
525 }
526 foreach (Thing thing in things)
527 {
528 if (thing.isPlayerCreation && thing.c_altName != "DebugContainer")
529 {
530 export.serializedCards.Add(thing);
531 }
532 }
533 }
534 else
535 {
536 foreach (Thing thing2 in things)
537 {
538 if ((ActionMode.Copy.IsActive || thing2.trait.CanCopyInBlueprint) && thing2.pos.x >= num && thing2.pos.z >= num2 && thing2.pos.x < num + num3 && thing2.pos.z < num2 + num4)
539 {
540 export.serializedCards.Add(thing2);
541 }
542 }
543 }
544 List<Thing> list = things;
545 things = new List<Thing>();
546 GameIO.SaveFile(path + "map", this);
547 things = list;
548 }
549 serializedCharas.Clear();
550 void Write(string name, byte[] bytes)
551 {
552 IO.WriteLZ4(path + name, bytes, compression);
553 }
554 void WriteIds(string name, int[] ids)
555 {
556 int num7 = WriteCellIds(path + name, ids, compression);
557 if (num7 > 1)
558 {
559 cellWidths[name] = num7;
560 }
561 }
562 }
static AM_Copy Copy
Definition: ActionMode.cs:45
bool IsActive
Definition: ActionMode.cs:121
string c_altName
Definition: Card.cs:1633
bool toggleOcclusion
Definition: Cell.cs:666
int obj
Definition: Cell.cs:50
int objMat
Definition: Cell.cs:52
bool isHarvested
Definition: Cell.cs:342
bool isClearSnow
Definition: Cell.cs:462
int _roofBlock
Definition: Cell.cs:58
byte objVal
Definition: Cell.cs:68
int bridgePillar
Definition: Cell.cs:74
int _floorMat
Definition: Cell.cs:48
byte height
Definition: Cell.cs:94
bool isWatered
Definition: Cell.cs:354
int _roofBlockMat
Definition: Cell.cs:60
byte _roofBlockDir
Definition: Cell.cs:72
bool isToggleWallPillar
Definition: Cell.cs:570
bool isSeen
Definition: Cell.cs:294
bool hidePillar
Definition: Cell.cs:654
int _decoMat
Definition: Cell.cs:64
bool isForceFloat
Definition: Cell.cs:318
bool impassable
Definition: Cell.cs:414
bool crossWall
Definition: Cell.cs:642
bool isObjDyed
Definition: Cell.cs:630
byte bridgeHeight
Definition: Cell.cs:96
byte _dirs
Definition: Cell.cs:66
int _deco
Definition: Cell.cs:62
new TraitChara trait
Definition: Chara.cs:511
override bool IsPC
Definition: Chara.cs:632
Definition: GameIO.cs:11
static void SaveFile(string path, object obj)
Definition: GameIO.cs:278
Compression
Definition: IO.cs:12
static void CreateDirectory(string path)
Definition: IO.cs:384
static void WriteLZ4(string _path, byte[] _bytes, Compression compression=Compression.None)
Definition: IO.cs:140
List< Chara > serializedCharas
Definition: Map.cs:46
static int WriteCellIds(string path, int[] ids, IO.Compression compression)
Definition: Map.cs:584
int offsetX
Definition: PartialMap.cs:31
int offsetZ
Definition: PartialMap.cs:34
void Add(Card c)
List< Data > cards
int stackOrder
Definition: Thing.cs:13
virtual bool IsUnique
Definition: TraitChara.cs:34
virtual bool CanCopyInBlueprint
Definition: Trait.cs:166

References Cell._block, Cell._blockMat, Cell._bridge, Cell._bridgeMat, Cell._deco, Cell._decoMat, Cell._dirs, Cell._floor, Cell._floorMat, Cell._roofBlock, Cell._roofBlockDir, Cell._roofBlockMat, Cell.bridgeHeight, Cell.bridgePillar, Card.c_altName, Trait.CanCopyInBlueprint, cellEffects, cells, cellWidths, charas, compression, CoreConfig.Test.compressSave, Core.config, ActionMode.Copy, EClass.core, Cell.crossWall, Debug, Cell.decal, Cell.effect, exportSetting, Cell.height, Cell.hidePillar, Cell.impassable, ActionMode.IsActive, Cell.isClearSnow, Cell.isForceFloat, Chara.IsGlobal, Cell.isHarvested, Cell.isModified, Cell.isObjDyed, Chara.IsPC, Card.IsPCFactionOrMinion, Card.isPlayerCreation, Cell.isSeen, Cell.isToggleWallPillar, TraitChara.IsUnique, Cell.isWatered, Cell.obj, Cell.objMat, Cell.objVal, Card.pos, GameIO.SaveFile(), serializedCharas, MapBounds.Size, Thing.stackOrder, CoreConfig.test, things, Cell.toggleOcclusion, Card.trait, Chara.trait, version, BaseCore.version, WriteCellIds(), Point.x, and Point.z.

Referenced by Zone._OnBeforeSave(), Zone.Export(), and GameIO.SaveGameCopy().

◆ SetBlock() [1/2]

void Map.SetBlock ( int  x,
int  z,
int  idMat,
int  idBlock,
int  dir 
)
inline

Definition at line 1138 of file Map.cs.

1139 {
1140 Cell cell = cells[x, z];
1141 bool hasFloodBlock = cell.HasFloodBlock;
1142 cell._blockMat = idMat;
1143 cell._block = idBlock;
1144 cell.blockDir = dir;
1145 if (cell.effect == null || !cell.effect.IsFire)
1146 {
1147 cell.effect = null;
1148 }
1149 cell.isToggleWallPillar = false;
1150 if (cell.room != null)
1151 {
1152 cell.room.SetDirty();
1153 }
1154 if (hasFloodBlock || cell.HasFloodBlock)
1155 {
1157 }
1159 }
bool IsFire
Definition: CellEffect.cs:147
bool HasFloodBlock
Definition: Cell.cs:1053
void OnSetBlockOrDoor(int x, int z)
Definition: Map.cs:1161

References Cell.effect, Cell.HasFloodBlock, CellEffect.IsFire, Cell.room, and Room.SetDirty().

◆ SetBlock() [2/2]

void Map.SetBlock ( int  x,
int  z,
int  idMat = 0,
int  idBlock = 0 
)
inline

Definition at line 1133 of file Map.cs.

1134 {
1135 SetBlock(x, z, idMat, idBlock, 0);
1136 }

Referenced by Recipe.Build(), ZoneInspector.FillUtil.ClearBlock(), ZoneInspector.FillUtil.FillBlock(), and Point.SetBlock().

◆ SetBlockDir()

void Map.SetBlockDir ( int  x,
int  z,
int  dir 
)
inline

Definition at line 1302 of file Map.cs.

1303 {
1304 Cell cell = cells[x, z];
1305 cell._block = cell.sourceBlock.id;
1306 cell.blockDir = dir;
1307 }

References Cell.sourceBlock.

Referenced by Recipe.Build().

◆ SetBounds() [1/2]

void Map.SetBounds ( int  size)
inline

Definition at line 2518 of file Map.cs.

2519 {
2520 if (size > Size / 2 + 1)
2521 {
2522 size = Size / 2 - 1;
2523 }
2524 bounds.SetBounds(Size / 2 - size, Size / 2 - size, Size / 2 + size, Size / 2 + size);
2525 }

References MapBounds.SetBounds().

Referenced by CreateNew(), Load(), and MapGen.OnGenerateTerrain().

◆ SetBounds() [2/2]

void Map.SetBounds ( MapBounds  b)
inline

Definition at line 2527 of file Map.cs.

2528 {
2529 bounds.SetBounds(b.x, b.z, b.maxX, b.maxZ);
2530 bounds.Size = b.Size;
2531 }

References MapBounds.maxX, MapBounds.maxZ, MapBounds.SetBounds(), MapBounds.Size, MapBounds.x, and MapBounds.z.

◆ SetBridge()

void Map.SetBridge ( int  x,
int  z,
int  height = 0,
int  idMat = 0,
int  idBridge = 0,
int  dir = 0,
int  idPillar = 0,
bool  hidePillar = false 
)
inline

Definition at line 1108 of file Map.cs.

1109 {
1110 Cell cell = cells[x, z];
1111 cell.bridgeHeight = (byte)height;
1112 cell._bridgeMat = idMat;
1113 cell._bridge = idBridge;
1114 cell.bridgePillar = idPillar;
1115 cell.hidePillar = hidePillar;
1116 cell.floorDir = dir;
1117 if (cell.room != null)
1118 {
1119 cell.room.SetDirty();
1120 }
1122 }

References Cell.room, and Room.SetDirty().

Referenced by Recipe.Build(), MineFloor(), and GoalCombat.TryUseAbility().

◆ SetDecal()

void Map.SetDecal ( int  x,
int  z,
int  id = 0,
int  amount = 1,
bool  refresh = true 
)
inline

Definition at line 2212 of file Map.cs.

2213 {
2214 cells[x, z].decal = (byte)((id != 0 && amount != 0) ? ((uint)(id * 8 + amount)) : 0u);
2215 if (refresh)
2216 {
2218 }
2219 }

References Cell.decal.

Referenced by FactionBranch.DailyOutcome(), AM_MoveInstalled.HitTest(), AIWork_Clean.OnPerformWork(), TaskCut.OnProgressComplete(), AI_Clean.Run(), and TaskClean.Run().

◆ SetDeco()

void Map.SetDeco ( int  x,
int  z,
int  idMat,
int  idDeco 
)
inline

Definition at line 1100 of file Map.cs.

1101 {
1102 Cell cell = cells[x, z];
1103 cell._decoMat = idMat;
1104 cell._deco = idDeco;
1106 }

Referenced by Recipe.Build().

◆ SetEffect()

void Map.SetEffect ( int  x,
int  z,
CellEffect  effect = null 
)
inline

Definition at line 1669 of file Map.cs.

1670 {
1671 cells[x, z].effect = effect;
1672 }

References Cell.effect.

Referenced by Chara._Move(), GameUpdater.FastSurfaceUpdater.FixedUpdate(), and ActEffect.ProcAt().

◆ SetFloor() [1/2]

void Map.SetFloor ( int  x,
int  z,
int  idMat,
int  idFloor,
int  dir 
)
inline

Definition at line 1089 of file Map.cs.

1090 {
1091 Cell cell = cells[x, z];
1092 cell._floorMat = idMat;
1093 cell._floor = idFloor;
1094 cell.floorDir = dir;
1095 cell.isWatered = false;
1096 Critter.RebuildCritter(cell);
1098 }

References Critter.RebuildCritter().

◆ SetFloor() [2/2]

void Map.SetFloor ( int  x,
int  z,
int  idMat = 0,
int  idFloor = 0 
)
inline

Definition at line 1084 of file Map.cs.

1085 {
1086 SetFloor(x, z, idMat, idFloor, 0);
1087 }

Referenced by Recipe.Build(), ZonePreEnterDigStairs.Execute(), ZoneInspector.FillUtil.FillFloor(), Zone.Generate(), and Point.SetFloor().

◆ SetFoormark()

void Map.SetFoormark ( Point  pos,
int  id,
int  angle,
int  offset = 0 
)
inline

Definition at line 2221 of file Map.cs.

2222 {
2223 Cell cell = pos.cell;
2224 int tile = AngleToIndex(angle) + offset;
2225 Footmark footmark = new Footmark
2226 {
2227 tile = tile,
2228 remaining = 10
2229 };
2230 footmark.pos.Set(pos);
2231 footmarks.Add(footmark);
2232 cell.GetOrCreateDetail().footmark = footmark;
2233 }
Footmark footmark
Definition: CellDetail.cs:17
CellDetail GetOrCreateDetail()
Definition: Cell.cs:1605
Point pos
Definition: Footmark.cs:3
int AngleToIndex(int a)
Definition: Map.cs:2235
List< Footmark > footmarks
Definition: Map.cs:102

References Point.cell, CellDetail.footmark, Cell.GetOrCreateDetail(), Footmark.pos, and Point.Set().

Referenced by Chara._Move().

◆ SetLiquid() [1/2]

void Map.SetLiquid ( int  x,
int  z,
CellEffect  effect = null 
)
inline

◆ SetLiquid() [2/2]

void Map.SetLiquid ( int  x,
int  z,
int  id,
int  value = 1 
)
inline

Definition at line 1647 of file Map.cs.

1648 {
1649 Cell cell = cells[x, z];
1650 if (!cell.IsTopWaterAndNoSnow || value == 0)
1651 {
1652 if (value > 3)
1653 {
1654 value = 3;
1655 }
1656 if (value <= 0)
1657 {
1658 cell.effect = null;
1659 return;
1660 }
1661 cell.effect = new CellEffect
1662 {
1663 id = id,
1664 amount = value
1665 };
1666 }
1667 }

References Cell.IsTopWaterAndNoSnow.

◆ SetObj() [1/2]

void Map.SetObj ( int  x,
int  z,
int  id = 0,
int  value = 1,
int  dir = 0 
)
inline

◆ SetObj() [2/2]

void Map.SetObj ( int  x,
int  z,
int  idMat,
int  idObj,
int  value,
int  dir,
bool  ignoreRandomMat = false 
)
inline

Definition at line 1701 of file Map.cs.

1702 {
1703 Cell cell = cells[x, z];
1704 if (cell.sourceObj.id == 118 || idObj == 118)
1705 {
1706 EClass._zone.dirtyElectricity = true;
1707 }
1708 cell.obj = idObj;
1709 cell.objVal = (byte)value;
1710 cell.objMat = idMat;
1711 cell.objDir = dir;
1712 cell.isHarvested = false;
1713 cell.isObjDyed = false;
1714 SourceObj.Row sourceObj = cell.sourceObj;
1715 if (!ignoreRandomMat && !sourceObj.matCategory.IsEmpty())
1716 {
1717 int num = EClass._zone.DangerLv;
1718 if (sourceObj.tag.Contains("spot"))
1719 {
1720 num += EClass.pc.Evalue(1656) * 5;
1721 }
1722 cell.objMat = MATERIAL.GetRandomMaterialFromCategory(num, sourceObj.matCategory.Split(','), cell.matObj).id;
1723 }
1724 if (backerObjs.ContainsKey(cell.index))
1725 {
1726 backerObjs.Remove(cell.index);
1727 }
1728 if (plants.ContainsKey(cell.index))
1729 {
1730 plants.Remove(cell.index);
1731 }
1732 cell.growth?.OnSetObj();
1733 Critter.RebuildCritter(cell);
1735 }
int Evalue(int ele)
Definition: Card.cs:2704
virtual void OnSetObj()
Definition: GrowSystem.cs:288
static SourceMaterial.Row GetRandomMaterialFromCategory(int lv, string cat, SourceMaterial.Row fallback)
Definition: MATERIAL.cs:93
string[] tag
Definition: RenderRow.cs:58
string matCategory
Definition: SourceObj.cs:24

References EClass._zone, Zone.DangerLv, Card.Evalue(), MATERIAL.GetRandomMaterialFromCategory(), Cell.growth, Cell.index, SourceObj.Row.matCategory, Cell.matObj, GrowSystem.OnSetObj(), EClass.pc, Critter.RebuildCritter(), Cell.sourceObj, and RenderRow.tag.

◆ SetReference()

void Map.SetReference ( )
inline

Definition at line 200 of file Map.cs.

201 {
202 Fov.map = (Cell.map = (Wall.map = (Point.map = (CellDetail.map = this))));
203 Cell.Size = Size;
204 Cell.cells = cells;
206 WeightCell[,] weightMap = cells;
207 pathfinder.Init(this, weightMap, Size);
208 }
IPathfinder pathfinder
Definition: PathManager.cs:24
static PathManager Instance
Definition: PathManager.cs:16
void Init(IPathfindGrid _grid, WeightCell[,] _weightMap, int size)

References cells, IPathfinder.Init(), PathManager.Instance, PathManager.pathfinder, and MapBounds.Size.

Referenced by PartialMap._Load(), Zone.Activate(), PartialMap.Apply(), CreateNew(), Reload(), Reset(), and SetZone().

◆ SetRoofBlock()

void Map.SetRoofBlock ( int  x,
int  z,
int  idMat,
int  idBlock,
int  dir,
int  height 
)
inline

Definition at line 1124 of file Map.cs.

1125 {
1126 Cell cell = cells[x, z];
1127 cell._roofBlockMat = idMat;
1128 cell._roofBlock = idBlock;
1129 cell._roofBlockDir = (byte)(dir + height * 4);
1131 }

Referenced by Recipe.Build().

◆ SetSeen()

void Map.SetSeen ( int  x,
int  z,
bool  seen = true,
bool  refresh = true 
)
inline

Definition at line 1005 of file Map.cs.

1006 {
1007 if (cells[x, z].isSeen != seen)
1008 {
1009 cells[x, z].isSeen = seen;
1010 if (refresh)
1011 {
1013 }
1015 }
1016 }

References EClass._map, cells, Cell.isSeen, RefreshNeighborTiles(), WidgetMinimap.UpdateMap(), MapBounds.x, and MapBounds.z.

Referenced by Fov.Perform(), and RevealAll().

◆ SetZone()

void Map.SetZone ( Zone  _zone)
inline

Definition at line 186 of file Map.cs.

187 {
188 zone = _zone;
189 zone.bounds = bounds;
190 bounds.Size = Size;
191 SetReference();
192 props.Init();
193 EClass.scene.profile = SceneProfile.Load(config.idSceneProfile.IsEmpty("default"));
194 if (!config.idFowProfile.IsEmpty())
195 {
197 }
198 }
static FowProfile Load(string id)
Definition: FowProfile.cs:9
string idSceneProfile
Definition: MapConfig.cs:8
string idFowProfile
Definition: MapConfig.cs:11
FowProfile fowProfile
Definition: Map.cs:104
MapConfig config
Definition: Map.cs:40
static SceneProfile Load(string id)
Definition: SceneProfile.cs:18

References EClass._zone, bounds, config, fowProfile, MapConfig.idFowProfile, MapConfig.idSceneProfile, PropsManager.Init(), FowProfile.Load(), SceneProfile.Load(), props, SetReference(), MapBounds.Size, and zone.

Referenced by Zone.Activate(), Zone.Generate(), ZoneBlueprint.GenerateMap(), MapGen.GenerateTerrain(), MapGenDungen.OnGenerateTerrain(), and MapGenRegion.OnGenerateTerrain().

◆ Shift()

void Map.Shift ( Vector2Int  offset)
inline

Definition at line 259 of file Map.cs.

260 {
261 TweenUtil.Tween(0.1f, null, delegate
262 {
263 foreach (Card item in ((IEnumerable<Card>)EClass._map.things).Concat((IEnumerable<Card>)EClass._map.charas))
264 {
265 item.pos.x += offset.x;
266 item.pos.z += offset.y;
267 item.pos.Clamp();
268 }
269 Cell[,] array = new Cell[Size, Size];
270 for (int i = 0; i < Size; i++)
271 {
272 int num = i - offset.y;
273 for (int j = 0; j < Size; j++)
274 {
275 int num2 = j - offset.x;
276 if (num2 >= 0 && num2 < Size && num >= 0 && num < Size)
277 {
278 array[j, i] = cells[num2, num];
279 }
280 else
281 {
282 array[j, i] = new Cell
283 {
284 x = (byte)j,
285 z = (byte)i
286 };
287 }
288 }
289 }
290 cells = array;
291 bounds.x += offset.x;
292 bounds.z += offset.y;
293 bounds.maxX += offset.x;
294 bounds.maxZ += offset.y;
295 if (bounds.x < 0)
296 {
297 bounds.x = 0;
298 }
299 if (bounds.z < 0)
300 {
301 bounds.z = 0;
302 }
303 if (bounds.maxX > Size)
304 {
305 bounds.maxX = Size;
306 }
307 if (bounds.maxZ > Size)
308 {
309 bounds.maxZ = Size;
310 }
311 Reload();
312 });
313 }

References EClass._map, bounds, cells, charas, item, MapBounds.maxX, MapBounds.maxZ, Reload(), MapBounds.Size, things, Cell.x, MapBounds.x, and MapBounds.z.

Referenced by ZoneInspector.ResizeUtil.Apply().

◆ TryAddRoom()

void Map.TryAddRoom ( int  x,
int  z 
)
inline

Definition at line 1221 of file Map.cs.

1222 {
1223 if (EClass._zone.DisableRooms || roomHash.Contains(x + z * Size) || cells[x, z].HasFloodBlock)
1224 {
1225 return;
1226 }
1227 FloodSpiller floodSpiller = flood;
1228 IFloodCell[,] array = cells;
1229 FloodSpiller.Result result = floodSpiller.SpillFlood(array, x, z);
1230 if (!result.IsValid)
1231 {
1232 return;
1233 }
1234 bool flag = false;
1235 foreach (IFloodCell item in result.visited)
1236 {
1237 if (item.hasDoor)
1238 {
1239 flag = true;
1240 break;
1241 }
1242 Cell cell = item as Cell;
1243 if (cell.sourceBlock.tileType.IsFloodDoor || cell.Front.hasDoor || cell.Right.hasDoor || cell.FrontRight.hasDoor || cell.Back.hasDoor || cell.Left.hasDoor || cell.BackLeft.hasDoor)
1244 {
1245 flag = true;
1246 break;
1247 }
1248 }
1249 if (!flag && IsIndoor)
1250 {
1251 foreach (IFloodCell item2 in result.visited)
1252 {
1253 Cell cell2 = item2 as Cell;
1254 if (cell2.detail == null || cell2.detail.things.Count == 0)
1255 {
1256 continue;
1257 }
1258 foreach (Thing thing in cell2.detail.things)
1259 {
1260 if (thing.trait is TraitRoomPlate || thing.trait is TraitHouseBoard)
1261 {
1262 flag = true;
1263 break;
1264 }
1265 }
1266 if (flag)
1267 {
1268 break;
1269 }
1270 }
1271 }
1272 if (!flag)
1273 {
1274 return;
1275 }
1276 Room room = rooms.AddRoom(new Room());
1277 foreach (IFloodCell item3 in result.visited)
1278 {
1279 Cell cell3 = item3 as Cell;
1280 byte b = cell3.x;
1281 byte b2 = cell3.z;
1282 room.AddPoint(new Point(b, b2));
1283 roomHash.Add(b + b2 * Size);
1284 if (b2 > 0 && cell3.Front.HasFloodBlock && cell3.Front.room == null)
1285 {
1286 room.AddPoint(new Point(b, b2 - 1));
1287 roomHash.Add(b + (b2 - 1) * Size);
1288 }
1289 if (b < Size - 1 && cell3.Right.HasFloodBlock && cell3.Right.room == null)
1290 {
1291 room.AddPoint(new Point(b + 1, b2));
1292 roomHash.Add(b + 1 + b2 * Size);
1293 }
1294 if (b2 > 0 && b < Size - 1 && cell3.FrontRight.HasFloodBlock && cell3.FrontRight.room == null)
1295 {
1296 room.AddPoint(new Point(b + 1, b2 - 1));
1297 roomHash.Add(b + 1 + (b2 - 1) * Size);
1298 }
1299 }
1300 }
Cell BackLeft
Definition: Cell.cs:235
bool hasDoor
Definition: Cell.cs:279
Cell FrontRight
Definition: Cell.cs:199
bool IsIndoor
Definition: Map.cs:136
FloodSpiller flood
Definition: Map.cs:96
Room AddRoom(Room r)
Definition: RoomManager.cs:110
Definition: Room.cs:4
void AddPoint(Point p)
Definition: Room.cs:46
virtual bool DisableRooms
Definition: Zone.cs:126

References EClass._zone, RoomManager.AddRoom(), Cell.Back, Cell.BackLeft, Cell.detail, Zone.DisableRooms, Cell.Front, Cell.FrontRight, Cell.hasDoor, Cell.HasFloodBlock, item, Cell.Left, Cell.Right, Cell.room, Cell.sourceBlock, Card.things, CellDetail.things, Card.trait, Cell.x, and Cell.z.

◆ TryGetPlant() [1/2]

PlantData Map.TryGetPlant ( Cell  c)
inline

Definition at line 2108 of file Map.cs.

2109 {
2110 return plants.TryGetValue(c.index);
2111 }

References Cell.index.

◆ TryGetPlant() [2/2]

◆ TryLoadFile()

byte[] Map.TryLoadFile ( string  path,
string  s,
int  size 
)
inline

Definition at line 564 of file Map.cs.

565 {
566 byte[] array = IO.ReadLZ4(path + s, size, compression);
567 if (array == null)
568 {
569 Debug.Log("Couldn't load:" + s);
570 return new byte[size];
571 }
572 return array;
573 }

References compression, and Debug.

Referenced by Zone.Activate(), and Load().

◆ TryRemoveRoom()

void Map.TryRemoveRoom ( int  x,
int  z 
)
inline

Definition at line 1209 of file Map.cs.

1210 {
1211 if (!cells[x, z].HasFloodBlock)
1212 {
1213 Room room = cells[x, z].room;
1214 if (room != null)
1215 {
1216 rooms.RemoveRoom(room);
1217 }
1218 }
1219 }
void RemoveRoom(Room r)
Definition: RoomManager.cs:119

References RoomManager.RemoveRoom(), and Cell.room.

◆ TryShatter()

void Map.TryShatter ( Point  pos,
int  ele,
int  power,
Card  CC = null 
)
inline

Definition at line 1337 of file Map.cs.

1338 {
1339 bool flag = false;
1340 if (CC != null && CC.IsPCFactionOrMinion && (CC.HasElement(1651) || EClass.pc.Evalue(1651) >= 2))
1341 {
1342 flag = true;
1343 }
1344 Element element = Element.Create(ele);
1345 List<Card> list = new List<Card>();
1346 bool fire = ele == 910;
1347 bool cold = ele == 911;
1348 _ = fire;
1349 List<Card> list2 = pos.ListCards();
1350 if (fire && (pos.cell.IsSnowTile || pos.cell.IsTopWater))
1351 {
1352 return;
1353 }
1354 foreach (Card item in list2)
1355 {
1356 if (item.ResistLvFrom(ele) >= 3 || item.trait is TraitBlanket || (EClass.rnd(3) == 0 && !CanCook(item)) || (item.IsPCFaction && EClass.rnd(3) == 0) || (fire && item.HasCondition<ConWet>()) || (cold && item.HasCondition<ConBurning>()))
1357 {
1358 continue;
1359 }
1360 if (flag)
1361 {
1362 if (item.isChara)
1363 {
1364 if (item.IsPCFactionOrMinion)
1365 {
1366 continue;
1367 }
1368 }
1369 else if (!CanCook(item))
1370 {
1371 continue;
1372 }
1373 }
1375 {
1376 Card rootCard = item.GetRootCard();
1377 if (!rootCard.isChara || rootCard.Chara.IsPCFaction)
1378 {
1379 if (pos.IsSync)
1380 {
1381 Msg.Say("damage_protectCore", item);
1382 }
1383 continue;
1384 }
1385 }
1386 if (item.isThing && item.things.Count == 0)
1387 {
1388 list.Add(item);
1389 }
1390 else
1391 {
1392 if (ele == 911 && item.HasElement(1236))
1393 {
1394 continue;
1395 }
1396 Thing thing = ((ele == 910) ? item.things.FindBest<TraitBlanketFireproof>((Thing t) => -t.c_charges) : item.things.FindBest<TraitBlanketColdproof>((Thing t) => -t.c_charges));
1397 if (thing != null)
1398 {
1399 thing.ModCharge(-1);
1400 Card rootCard2 = item.GetRootCard();
1401 if (pos.IsSync)
1402 {
1403 Msg.Say((item.isChara ? "blanketInv_" : "blanketGround_") + element.source.alias, thing, item);
1404 }
1405 if (thing.c_charges <= 0)
1406 {
1407 thing.Die(element);
1408 if (rootCard2.IsPCParty)
1409 {
1411 }
1412 }
1413 continue;
1414 }
1415 foreach (Thing item2 in item.things.List((Thing a) => a.things.Count == 0))
1416 {
1417 Card parentCard = item2.parentCard;
1418 if (parentCard == null || (!(parentCard.trait is TraitChestMerchant) && !parentCard.HasEditorTag(EditorTag.PreciousContainer)))
1419 {
1420 list.Add(item2);
1421 }
1422 }
1423 }
1424 }
1425 list.Shuffle();
1426 int num = 0;
1427 bool flag2 = false;
1428 foreach (Card item3 in list)
1429 {
1430 if (!item3.trait.CanBeDestroyed || item3.category.IsChildOf("currency") || item3.trait is TraitDoor || item3.trait is TraitFigure || item3.trait is TraitTrainingDummy || item3.rarity >= Rarity.Legendary)
1431 {
1432 continue;
1433 }
1434 Card rootCard3 = item3.GetRootCard();
1435 if (item3.IsEquipmentOrRangedOrAmmo && (EClass.rnd(4) != 0 || ((item3.IsRangedWeapon || item3.Thing.isEquipped) && rootCard3.IsPCFaction && EClass.rnd(4) != 0)))
1436 {
1437 continue;
1438 }
1439 switch (ele)
1440 {
1441 case 910:
1442 if (item3.isFireproof || (!item3.category.IsChildOf("book") && EClass.rnd(2) == 0))
1443 {
1444 continue;
1445 }
1446 break;
1447 case 911:
1448 if (!item3.category.IsChildOf("drink") && EClass.rnd(5) == 0)
1449 {
1450 continue;
1451 }
1452 break;
1453 }
1454 if (EClass.rnd(num * num) != 0)
1455 {
1456 continue;
1457 }
1458 bool flag3 = CanCook(item3);
1459 string text = "";
1460 if (flag3)
1461 {
1462 if (fire)
1463 {
1464 List<SourceThing.Row> list3 = new List<SourceThing.Row>();
1465 foreach (RecipeSource item4 in RecipeManager.list)
1466 {
1467 if (!(item4.row is SourceThing.Row { isOrigin: false, chance: not 0 } row) || row.components.IsEmpty() || (row.components.Length >= 3 && !row.components[2].StartsWith('+')) || !row.Category.IsChildOf("meal") || (row.HasTag(CTAG.dish_fail) && power > EClass.rnd(500)))
1468 {
1469 continue;
1470 }
1471 if (!row.factory.IsEmpty())
1472 {
1473 switch (row.factory[0])
1474 {
1475 case "chopper":
1476 case "mixer":
1477 case "camppot":
1478 case "cauldron":
1479 continue;
1480 }
1481 }
1482 if (row.components[0].Split('|').Contains(item3.id) || row.components[0].Split('|').Contains(item3.sourceCard._origin))
1483 {
1484 list3.Add(row);
1485 }
1486 }
1487 if (list3.Count > 0)
1488 {
1489 text = list3.RandomItemWeighted((SourceThing.Row r) => r.chance)?.id;
1490 }
1491 }
1492 else
1493 {
1494 text = "711";
1495 }
1496 }
1497 if (flag3 && !text.IsEmpty())
1498 {
1499 Thing thing2 = item3.Split(1);
1500 List<Thing> list4 = new List<Thing>();
1501 list4.Add(thing2);
1502 Thing thing3 = ThingGen.Create(text);
1503 CraftUtil.MakeDish(thing3, list4, 999);
1504 thing3.elements.ModBase(2, EClass.curve(power / 10, 50, 10));
1505 if (pos.IsSync)
1506 {
1507 Msg.Say(((rootCard3 == item3) ? "cook_groundItem" : "cook_invItem") + (fire ? "" : "_cold"), thing2, rootCard3, thing3.Name);
1508 }
1509 if (rootCard3 == item3)
1510 {
1511 EClass._zone.AddCard(thing3, item3.pos);
1512 }
1513 else if (rootCard3.isChara)
1514 {
1515 rootCard3.Chara.Pick(thing3, msg: false);
1516 }
1517 else
1518 {
1519 rootCard3.AddThing(thing3);
1520 }
1521 thing2.Destroy();
1522 }
1523 else
1524 {
1525 int num2 = EClass.rnd(item3.Num) / 2 + 1;
1526 if (item3.Num > num2)
1527 {
1528 Thing thing4 = item3.Split(num2);
1529 if (pos.IsSync)
1530 {
1531 Msg.Say((rootCard3 == item3) ? "damage_groundItem" : "damage_invItem", thing4, rootCard3);
1532 }
1533 thing4.Destroy();
1534 if (rootCard3.IsPCFaction)
1535 {
1536 WidgetPopText.Say("popDestroy".lang(thing4.Name, rootCard3.Name));
1537 }
1538 }
1539 else
1540 {
1541 item3.Die(element);
1542 if (rootCard3.IsPCFaction)
1543 {
1544 WidgetPopText.Say("popDestroy".lang(item3.Name, rootCard3.Name));
1545 }
1546 }
1547 }
1548 if (rootCard3.IsPCParty)
1549 {
1551 }
1552 if (!flag2)
1553 {
1554 pos.PlayEffect(fire ? "Element/eleFire" : "Element/eleCold");
1555 flag2 = true;
1556 }
1557 num++;
1558 }
1559 _ValidateInstalled(pos.x, pos.z);
1560 bool CanCook(Card c)
1561 {
1562 if ((fire || cold) && c.IsFood)
1563 {
1564 return c.category.IsChildOf("foodstuff");
1565 }
1566 return false;
1567 }
1568 }
CTAG
Definition: CTAG.cs:2
EditorTag
Definition: EditorTag.cs:2
int itemLost
Definition: AM_Adv.cs:110
static AM_Adv Adv
Definition: ActionMode.cs:15
string _origin
Definition: CardRow.cs:15
Thing Split(int a)
Definition: Card.cs:3665
ElementContainerCard elements
Definition: Card.cs:42
virtual void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Card.cs:5245
virtual bool IsPCParty
Definition: Card.cs:2203
bool IsEquipmentOrRangedOrAmmo
Definition: Card.cs:2284
string Name
Definition: Card.cs:2191
bool IsFood
Definition: Card.cs:2229
void ModCharge(int a, bool destroy=false)
Definition: Card.cs:4131
bool HasEditorTag(EditorTag tag)
Definition: Card.cs:2733
bool isFireproof
Definition: Card.cs:677
Card GetRootCard()
Definition: Card.cs:3607
virtual bool IsPCFaction
Definition: Card.cs:2339
Card parentCard
Definition: Card.cs:106
virtual CardRow sourceCard
Definition: Card.cs:2183
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:3257
SourceCategory.Row category
Definition: Card.cs:2101
int c_charges
Definition: Card.cs:1309
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6383
bool IsTopWater
Definition: Cell.cs:736
Definition: ConWet.cs:2
static void MakeDish(Thing food, int lv, Chara crafter=null, int seed=-1)
Definition: CraftUtil.cs:62
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
static FactionBranch Branch
Definition: EClass.cs:23
Element ModBase(int ele, int v)
SourceElement.Row source
Definition: ELEMENT.cs:282
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1163
bool HasItemProtection
void _ValidateInstalled(int x, int y)
Definition: Map.cs:2137
bool IsSync
Definition: Point.cs:340
Effect PlayEffect(string id)
Definition: Point.cs:1250
static List< RecipeSource > list
RenderRow row
Definition: RecipeSource.cs:5
bool isEquipped
Definition: Thing.cs:17
virtual bool CanBeDestroyed
Definition: Trait.cs:307
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)

References EClass._zone, Card.Add(), Zone.AddCard(), Card.AddThing(), ActionMode.Adv, EClass.Branch, Card.c_charges, Card.category, Point.cell, Card.Chara, Element.Create(), ThingGen.Create(), EClass.curve(), Card.Destroy(), Card.Die(), Card.elements, Card.Evalue(), Card.GetRootCard(), Card.HasEditorTag(), FactionBranch.HasItemProtection, Card.isChara, Card.IsFood, Card.IsPCFaction, Chara.IsPCFaction, Zone.IsPCFaction, Card.IsPCParty, Cell.IsSnowTile, Cell.IsTopWater, item, AM_Adv.itemLost, RecipeManager.list, Point.ListCards(), CraftUtil.MakeDish(), ElementContainer.ModBase(), Card.ModCharge(), Card.Name, Card.parentCard, EClass.pc, Chara.Pick(), Card.pos, EClass.rnd(), RecipeSource.row, Msg.Say(), WidgetPopText.Say(), Card.Split(), and Card.trait.

Referenced by ActEffect.DamageEle(), and GameUpdater.FastSurfaceUpdater.FixedUpdate().

◆ TrySmoothPick() [1/2]

◆ TrySmoothPick() [2/2]

void Map.TrySmoothPick ( Point  p,
Thing  t,
Chara  c 
)
inline

Definition at line 1970 of file Map.cs.

1971 {
1972 if (c != null && c.IsAgent)
1973 {
1974 EClass.pc.PickOrDrop(p, t);
1975 }
1976 else if (c != null && c.IsPC && (c.pos.Equals(p) || EClass.core.config.game.smoothPick || EClass._zone.IsRegion))
1977 {
1978 c.PickOrDrop(p, t);
1979 }
1980 else
1981 {
1982 EClass._zone.AddCard(t, p);
1983 }
1984 }
bool IsAgent
Definition: Card.cs:2303
new GameConfig game
Definition: CoreConfig.cs:629
bool Equals(int _x, int _z)
Definition: Point.cs:962

References EClass._zone, Zone.AddCard(), Core.config, EClass.core, Point.Equals(), CoreConfig.game, Card.IsAgent, Chara.IsPC, Spatial.IsRegion, EClass.pc, Chara.PickOrDrop(), Card.pos, and CoreConfig.GameConfig.smoothPick.

◆ UpdateMetaData()

static void Map.UpdateMetaData ( string  pathZip,
PartialMap  partial = null 
)
inlinestatic

Definition at line 877 of file Map.cs.

878 {
880 ZipFile zipFile = ZipFile.Read(pathZip);
881 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
882 zipFile.ExtractAll(IO.TempPath);
883 zipFile.Dispose();
884 EClass._map.ExportMetaData(IO.TempPath + "/", Path.GetFileNameWithoutExtension(pathZip), partial);
885 using (zipFile = new ZipFile())
886 {
887 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
888 zipFile.AddDirectory(IO.TempPath);
889 zipFile.Save(pathZip);
890 zipFile.Dispose();
891 }
893 }
static void CreateTempDirectory(string path=null)
Definition: IO.cs:419
static string TempPath
Definition: IO.cs:63
static void DeleteTempDirectory(string path=null)
Definition: IO.cs:424
void ExportMetaData(string _path, string id, PartialMap partial=null)
Definition: Map.cs:832

References EClass._map, and ExportMetaData().

Referenced by PartialMap.Update().

◆ ValidateInstalled()

void Map.ValidateInstalled ( Point  p)
inline

Definition at line 2128 of file Map.cs.

2129 {
2130 _ValidateInstalled(p.x, p.z);
2131 _ValidateInstalled(p.x + 1, p.z);
2132 _ValidateInstalled(p.x - 1, p.z);
2133 _ValidateInstalled(p.x, p.z + 1);
2134 _ValidateInstalled(p.x, p.z - 1);
2135 }

References Point.x, and Point.z.

◆ ValidateVersion()

void Map.ValidateVersion ( )
inline

Definition at line 815 of file Map.cs.

816 {
818 }

References EClass.core, version, and BaseCore.version.

Referenced by Load().

◆ WriteCellIds()

static int Map.WriteCellIds ( string  path,
int[]  ids,
IO::Compression  compression 
)
inlinestaticprivate

Definition at line 584 of file Map.cs.

585 {
586 int num = 0;
587 int[] array = ids;
588 foreach (int b in array)
589 {
590 num = Mathf.Max(num, b);
591 }
592 int num2 = ((num <= 255) ? 1 : ((num <= 65535) ? 2 : 4));
593 byte[] array2 = new byte[ids.Length * num2];
594 for (int j = 0; j < ids.Length; j++)
595 {
596 for (int k = 0; k < num2; k++)
597 {
598 array2[j * num2 + k] = (byte)(ids[j] >> 8 * k);
599 }
600 }
601 IO.WriteLZ4(CellIdPath(path, num2), array2, compression);
602 array = CellIdWidths;
603 foreach (int num3 in array)
604 {
605 if (num3 != num2)
606 {
607 string text = CellIdPath(path, num3);
608 IO.DeleteFile(text);
609 for (int l = 1; l < 5; l++)
610 {
611 IO.DeleteFile(text + ".b" + l);
612 }
613 }
614 }
615 return num2;
616 }
static void DeleteFile(string path)
Definition: IO.cs:356
static readonly int[] CellIdWidths
Definition: Map.cs:106

References CellIdPath(), CellIdWidths, and compression.

Referenced by Save().

Member Data Documentation

◆ _bits

int Map._bits

Definition at line 22 of file Map.cs.

Referenced by OnDeserialized(), and OnSerializing().

◆ _plDay

List<int> Map._plDay = new List<int>()

◆ _plNight

List<int> Map._plNight = new List<int>()

Definition at line 61 of file Map.cs.

Referenced by LayerEditPlaylist.Activate(), and LayerEditPlaylist.OnKill().

◆ _things

List<Thing> Map._things = new List<Thing>()
private

Definition at line 112 of file Map.cs.

◆ backerObjs

Dictionary<int, int> Map.backerObjs = new Dictionary<int, int>()

◆ biomes

BiomeProfile [,] Map.biomes

Definition at line 98 of file Map.cs.

◆ bits

BitArray32 Map.bits

Definition at line 78 of file Map.cs.

Referenced by OnSerializing().

◆ bounds

◆ cellEffects

Dictionary<int, CellEffect> Map.cellEffects = new Dictionary<int, CellEffect>()

Definition at line 67 of file Map.cs.

Referenced by Load(), and Save().

◆ CellIdWidths

readonly int [] Map.CellIdWidths = new int[3] { 1, 2, 4 }
staticprivate

Definition at line 106 of file Map.cs.

Referenced by WriteCellIds().

◆ cells

◆ cellWidths

Dictionary<string, int> Map.cellWidths = new Dictionary<string, int>()

Definition at line 28 of file Map.cs.

Referenced by Load(), and Save().

◆ charas

List<Chara> Map.charas = new List<Chara>()

Definition at line 84 of file Map.cs.

Referenced by ReligionManager.ジュアさまの薄い本をください(), ActPlan._Update(), Zone.Activate(), ActionMode.Activate(), SerializedCards.Add(), Zone.AddGlobalCharasOnActivate(), LayerSleep.Advance(), ZoneEventQuest.AggroEnemy(), Chara.BanishAllMinions(), Point.CallGuard(), Chara.CallHelp(), TraitTrolley.CanActivate(), QuestDefense.CanUpdateOnTalk(), ElementContainerFaction.CheckDirty(), AM_MoveInstalled.CheckEnemyNearBy(), FactionBranch.CountGuests(), Zone.CountMinions(), FactionBranch.CountWealthyGuests(), AI_Torture.CreateProgress(), LayerPeople.CreateSelectEmbarkMembers(), Card.DamageHP(), Chara.Die(), Zone.FindChara(), Chara.FindNearestNewEnemy(), Chara.FindNewEnemy(), GameUpdater.SensorUpdater.FixedUpdate(), GameUpdater.CharaUpdater.FixedUpdate(), GameUpdater.ConditionUpdater.FixedUpdate(), RefChara.GetAndCache(), GoalSiege.GetDestCard(), DramaCustomSequence.GetListGuide(), AI_Mofu.GetMofu(), Zone.GetRandomVisitPos(), TaskCullLife.GetTarget(), QuestManager.HasFarAwayEscort(), Chara.HasMinion(), TraitShackle.IsRestraining(), Point.ListCharasInRadius(), Zone.ListMinions(), Region.ListMobs(), CraftUtil.MakeDarkSoup(), DramaOutcome.marry(), Chara.MoveZone(), Zone.OnActivate(), Zone_Casino.OnActivate(), Zone_LittleGarden.OnActivate(), TraitTrap.OnActivateTrap(), FactionBranch.OnAfterSimulate(), Zone_WindRest.OnAfterSimulate(), AI_Torture.OnCancelOrSuccess(), OnCardAddedToZone(), OnCardRemovedFromZone(), NotificationBattle.OnClick(), NotificationGuest.OnClick(), AM_EditMarker.OnDeactivate(), OnDeactivate(), QuestDeliver.OnEnterZone(), Zone.OnGenerateMap(), Zone_CursedManor.OnGenerateMap(), Zone_RandomDungeon.OnGenerateMap(), Zone_Void.OnGenerateMap(), Zone_SubTown.OnGenerateRooms(), ZoneInstanceRandomQuest.OnLeaveZone(), BaseListPeople.OnList(), ListPeopleBed.OnList(), WidgetNotice.OnRefresh(), AM_Adv.OnRenderTile(), Zone.OnSimulateHour(), ConInvisibility.OnStart(), Zone.OnVisit(), ZoneEventSiege.OnVisit(), DramaManager.ParseLine(), ActCryRage.Perform(), ActCrySad.Perform(), ActSummonGuard.Perform(), ActTimeStop.Perform(), ActEffect.Proc(), ActEffect.ProcAt(), Card.PurgeDuplicateArtifact(), Card.PurgeEythArtifact(), Zone.RefreshCriminal(), Zone.RefreshDeathSentense(), RefreshFOVAll(), Zone.RefreshListCitizen(), WidgetMinimap.RefreshMarkers(), LayerQuestBoard.RefreshQuest(), ActionMode.RefreshTexts(), CoreDebug.RegenerateNames(), Chara.RequestProtection(), ResetEditorPos(), Zone.ResetHostility(), Resize(), AI_Fuck.Run(), AI_Idle.Run(), AI_Offer.Run(), GoalCombat.Run(), Save(), WidgetSearch.Search(), Zone.SetAlarm(), ZoneInspector.SetAllPlayerCreation(), Shift(), Zone.Simulate(), Card.SpawnLoot(), ConSleep.SuccubusSleep(), ConSleep.SuccubusVisit(), ContentRanking.SwitchRanking(), Msg.TalkMaid(), Player.TargetRanged(), Card.Teleport(), CoreDebug.TestSpawn(), Chara.Tick(), ConChampagne.Tick(), ConSleep.Tick(), Chara.TryClearInventory(), ThingGen.TryLickChest(), GoalCombat.TryUseAbility(), Chara.UnmakeMinion(), GameUpdater.Update(), CoreDebug.UpdateInput(), Player.UpdateNyan(), Zone.UpdateQuests(), Chara.UseAbility(), and ElementContainerCard.ValueBonus().

◆ compression

IO.Compression Map.compression

Definition at line 25 of file Map.cs.

Referenced by Load(), ReadCellIds(), Save(), TryLoadFile(), and WriteCellIds().

◆ config

◆ custom

CustomData Map.custom

Definition at line 43 of file Map.cs.

Referenced by ExportMetaData(), LayerUploader.OnInit(), and LayerUploader.SaveID().

◆ deadCharas

◆ effectManager

CellEffectManager Map.effectManager = new CellEffectManager()

Definition at line 92 of file Map.cs.

Referenced by Load().

◆ exportSetting

MapExportSetting Map.exportSetting

◆ flood

FloodSpiller Map.flood = new FloodSpiller()

Definition at line 96 of file Map.cs.

◆ footmarks

List<Footmark> Map.footmarks = new List<Footmark>()

Definition at line 102 of file Map.cs.

Referenced by GameDate.AdvanceMin().

◆ fowProfile

FowProfile Map.fowProfile

Definition at line 104 of file Map.cs.

Referenced by SetZone(), and BaseGameScreen.UpdateShaders().

◆ gatherCounts

Dictionary<int, int> Map.gatherCounts = new Dictionary<int, int>()

Definition at line 64 of file Map.cs.

◆ isDirtySunMap

bool Map.isDirtySunMap
static

Definition at line 16 of file Map.cs.

◆ plants

Dictionary<int, PlantData> Map.plants = new Dictionary<int, PlantData>()

Definition at line 73 of file Map.cs.

◆ plDay

◆ plNight

Playlist Map.plNight

Definition at line 82 of file Map.cs.

◆ poiMap

◆ pointAnimes

List<TransAnime> Map.pointAnimes = new List<TransAnime>()

Definition at line 86 of file Map.cs.

Referenced by Point.Animate(), BaseGameScreen.Draw(), and WidgetDebug.UpdateText().

◆ props

◆ revealed

bool Map.revealed

Definition at line 108 of file Map.cs.

Referenced by RevealAll().

◆ roomHash

HashSet<int> Map.roomHash = new HashSet<int>()
private

Definition at line 110 of file Map.cs.

◆ rooms

◆ seed

int Map.seed

Definition at line 19 of file Map.cs.

Referenced by MapGen.Output(), and WidgetDebug.UpdateText().

◆ serializedCharas

List<Chara> Map.serializedCharas = new List<Chara>()

Definition at line 46 of file Map.cs.

Referenced by Zone.Activate(), SerializedCards.Restore(), and Save().

◆ sunMap

HashSet<int> Map.sunMap = new HashSet<int>()
static

Definition at line 14 of file Map.cs.

Referenced by BaseTileMap.DrawTile().

◆ tasks

◆ things

List<Thing> Map.things = new List<Thing>()

Definition at line 52 of file Map.cs.

Referenced by Zone.Activate(), ActionMode.Activate(), GameDate.AdvanceMonth(), PartialMap.Apply(), FactionBranch.CalcInnIncome(), QuestSharedContainer.CanUpdateOnTalk(), QuestShippingChest.CanUpdateOnTalk(), Zone.ClaimZone(), Zone.Deactivate(), CoreDebug.Fix_Awning(), CoreDebug.Fix_LostCore(), GameUpdater.ThingUpdater.FixedUpdate(), CoreDebug.GetDebugContainer(), Zone.GetElectricity(), DramaCustomSequence.GetListGuide(), CoreDebug.GetOrCreateDebugContainer(), Zone.GetSpawnPos(), Zone.GrowPlants(), Scene.Init(), Point.IsInSpot< T >(), HomeResourceWorth.ListHeirloom(), AI_Haul.ListThingsToClean(), Load(), Zone_Tent.OnBeforeDeactivate(), OnCardAddedToZone(), OnCardRemovedFromZone(), AM_EditMarker.OnDeactivate(), OnDeactivate(), Zone_CursedManorDungeon.OnGenerateMap(), Zone_WindRest.OnGenerateMap(), ContentConfigGame.OnInstantiate(), Zone.OnKillGame(), Zone.OnSimulateHour(), ZoneEventHarvest.OnVisit(), ZoneEventMusic.OnVisit(), ZoneEventWedding.OnVisit(), Scene.RebuildActorEx(), BranchMap.Refresh(), Zone.RefreshElectricity(), RefreshFOVAll(), ActionMode.RefreshTexts(), ReloadRoom(), TraitDaggerGrave.RemainingSword(), ResetEditorPos(), Resize(), SerializedCards.Restore(), TaskDump.Run(), PartialMap.Save(), Save(), TraitDetector.Search(), WidgetSearch.Search(), Zone_CurryRuinDungeon.SetAlarm(), Zone_OldKeepDungeon.SetAlarm(), ZoneInspector.SetAllPlayerCreation(), Shift(), Zone.Simulate(), CoreDebug.Test_Grow(), Zone.TryGetRestock< T >(), Zone.TryListThingsInSpot< T >(), AI_Shopping.TryRestock(), TraitFactionBoard.TrySetAct(), and TraitTeleporter.TryTeleport().

◆ version

Version Map.version

◆ zone

Zone Map.zone

Definition at line 90 of file Map.cs.

Referenced by AddCardOnActivate(), OnDeactivate(), SetZone(), and WidgetMinimap.UpdateMap().

Property Documentation

◆ Cards

IEnumerable<Card> Map.Cards
get

Definition at line 140 of file Map.cs.

Referenced by MapSubset.OnSave(), ActSwarm.Perform(), and ActionMode.RefreshTexts().

◆ Installed

◆ isBreakerDown

bool Map.isBreakerDown
getset

Definition at line 114 of file Map.cs.

115 {
116 get
117 {
118 return bits[0];
119 }
120 set
121 {
122 bits[0] = value;
123 }
124 }

Referenced by TraitLeverBreaker.OnToggle().

◆ isGenerated

bool Map.isGenerated
get

Definition at line 134 of file Map.cs.

Referenced by MapGen.OnGenerateTerrain().

◆ IsIndoor

◆ Roaming

◆ sizeModifier

float Map.sizeModifier
get

Definition at line 132 of file Map.cs.

Referenced by Crawler.Crawl().

◆ SizeXZ

int Map.SizeXZ
get

◆ Stocked


The documentation for this class was generated from the following file: