Elin Decompiled Documentation EA 23.362.1 Stable
Loading...
Searching...
No Matches
Map.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Linq;
5using System.Runtime.Serialization;
6using Algorithms;
7using FloodSpill;
8using Ionic.Zip;
9using Newtonsoft.Json;
10using UnityEngine;
11
13{
14 public static HashSet<int> sunMap = new HashSet<int>();
15
16 public static bool isDirtySunMap;
17
18 [JsonProperty]
19 public int seed;
20
21 [JsonProperty]
22 public int _bits;
23
24 [JsonProperty]
26
27 [JsonProperty]
28 public Dictionary<string, int> cellWidths = new Dictionary<string, int>();
29
30 [JsonProperty]
32
33 [JsonProperty]
35
36 [JsonProperty]
38
39 [JsonProperty]
40 public MapConfig config = new MapConfig();
41
42 [JsonProperty]
44
45 [JsonProperty]
46 public List<Chara> serializedCharas = new List<Chara>();
47
48 [JsonProperty]
49 public List<Chara> deadCharas = new List<Chara>();
50
51 [JsonProperty]
52 public List<Chara> deadCharasShort = new List<Chara>();
53
54 [JsonProperty]
55 public List<Thing> things = new List<Thing>();
56
57 [JsonProperty]
58 public MapBounds bounds = new MapBounds();
59
60 [JsonProperty]
61 public List<int> _plDay = new List<int>();
62
63 [JsonProperty]
64 public List<int> _plNight = new List<int>();
65
66 [JsonProperty]
67 public Dictionary<int, int> gatherCounts = new Dictionary<int, int>();
68
69 [JsonProperty]
70 public Dictionary<int, CellEffect> cellEffects = new Dictionary<int, CellEffect>();
71
72 [JsonProperty]
73 public Dictionary<int, int> backerObjs = new Dictionary<int, int>();
74
75 [JsonProperty]
76 public Dictionary<int, PlantData> plants = new Dictionary<int, PlantData>();
77
78 [JsonProperty]
80
82
83 public Playlist plDay;
84
85 public Playlist plNight;
86
87 public List<Chara> charas = new List<Chara>();
88
89 public List<TransAnime> pointAnimes = new List<TransAnime>();
90
91 public Cell[,] cells;
92
93 public Zone zone;
94
96
98
99 public FloodSpiller flood = new FloodSpiller();
100
102
104
105 public List<Footmark> footmarks = new List<Footmark>();
106
108
109 private static readonly int[] CellIdWidths = new int[3] { 1, 2, 4 };
110
111 public bool revealed;
112
113 private HashSet<int> roomHash = new HashSet<int>();
114
115 private List<Thing> _things = new List<Thing>();
116
117 public bool isBreakerDown
118 {
119 get
120 {
121 return bits[0];
122 }
123 set
124 {
125 bits[0] = value;
126 }
127 }
128
130
132
134
135 public float sizeModifier => 1f / (16384f / (float)SizeXZ);
136
137 public bool isGenerated => Size != 0;
138
139 public bool IsIndoor => config.indoor;
140
141 public int SizeXZ => Size * Size;
142
143 public IEnumerable<Card> Cards => ((IEnumerable<Card>)things).Concat((IEnumerable<Card>)charas);
144
146 private void OnSerializing(StreamingContext context)
147 {
148 _bits = (int)bits.Bits;
149 }
150
151 protected virtual void OnSerializing()
152 {
153 }
154
156 private void OnDeserialized(StreamingContext context)
157 {
158 bits.Bits = (uint)_bits;
159 }
160
161 public void CreateNew(int size, bool setReference = true)
162 {
163 Debug.Log("Map CreateNew:");
164 Size = size;
165 cells = new Cell[Size, Size];
166 bounds = new MapBounds
167 {
168 x = 0,
169 z = 0,
170 maxX = Size - 1,
171 maxZ = Size - 1,
172 Size = Size
173 };
174 SetBounds(0, 0, Size - 1, Size - 1);
175 ForeachXYZ(delegate(int x, int z)
176 {
177 cells[x, z] = new Cell
178 {
179 x = (byte)x,
180 z = (byte)z
181 };
182 });
183 if (setReference)
184 {
185 SetReference();
186 }
187 }
188
189 public void SetZone(Zone _zone)
190 {
191 zone = _zone;
192 zone.bounds = bounds;
193 bounds.Size = Size;
194 SetReference();
195 props.Init();
196 EClass.scene.profile = SceneProfile.Load(config.idSceneProfile.IsEmpty("default"));
197 if (!config.idFowProfile.IsEmpty())
198 {
200 }
201 }
202
203 public void SetReference()
204 {
205 Fov.map = (Cell.map = (Wall.map = (Point.map = (CellDetail.map = this))));
206 Cell.Size = Size;
207 Cell.cells = cells;
209 WeightCell[,] weightMap = cells;
210 pathfinder.Init(this, weightMap, Size);
211 }
212
213 public void OnDeactivate()
214 {
215 charas.ForeachReverse(delegate(Chara c)
216 {
217 c.ai = new NoGoal();
218 if (c.IsGlobal)
219 {
220 zone.RemoveCard(c);
221 c.currentZone = zone;
222 }
223 });
224 foreach (Thing thing in things)
225 {
226 if (thing.renderer.hasActor)
227 {
228 thing.renderer.KillActor();
229 }
230 }
232 }
233
234 public void Resize(int newSize)
235 {
236 Point p = new Point(0, 0);
237 foreach (Thing thing in EClass._map.things)
238 {
239 if (thing.pos.x >= newSize || thing.pos.z >= newSize)
240 {
241 MoveCard(p, thing);
242 }
243 }
244 foreach (Chara chara in EClass._map.charas)
245 {
246 if (chara.pos.x >= newSize || chara.pos.z >= newSize)
247 {
248 MoveCard(p, chara);
249 }
250 }
251 Size = (bounds.Size = newSize);
252 maxX = (maxZ = Size);
253 cells = Util.ResizeArray(EClass._map.cells, newSize, newSize, (int x, int y) => new Cell
254 {
255 x = (byte)x,
256 z = (byte)y,
257 isSeen = true
258 });
259 Reload();
260 }
261
262 public void Shift(Vector2Int offset)
263 {
264 TweenUtil.Tween(0.1f, null, delegate
265 {
266 foreach (Card item in ((IEnumerable<Card>)EClass._map.things).Concat((IEnumerable<Card>)EClass._map.charas))
267 {
268 item.pos.x += offset.x;
269 item.pos.z += offset.y;
270 item.pos.Clamp();
271 }
272 Cell[,] array = new Cell[Size, Size];
273 for (int i = 0; i < Size; i++)
274 {
275 int num = i - offset.y;
276 for (int j = 0; j < Size; j++)
277 {
278 int num2 = j - offset.x;
279 if (num2 >= 0 && num2 < Size && num >= 0 && num < Size)
280 {
281 array[j, i] = cells[num2, num];
282 }
283 else
284 {
285 array[j, i] = new Cell
286 {
287 x = (byte)j,
288 z = (byte)i
289 };
290 }
291 }
292 }
293 cells = array;
294 bounds.x += offset.x;
295 bounds.z += offset.y;
296 bounds.maxX += offset.x;
297 bounds.maxZ += offset.y;
298 if (bounds.x < 0)
299 {
300 bounds.x = 0;
301 }
302 if (bounds.z < 0)
303 {
304 bounds.z = 0;
305 }
306 if (bounds.maxX > Size)
307 {
308 bounds.maxX = Size;
309 }
310 if (bounds.maxZ > Size)
311 {
312 bounds.maxZ = Size;
313 }
314 Reload();
315 });
316 }
317
318 public void Reload()
319 {
320 rooms = new RoomManager();
321 SetReference();
322 string id = Game.id;
323 EClass.game.Save();
324 EClass.scene.Init(Scene.Mode.None);
325 Game.Load(id, cloud: false);
326 RevealAll();
327 TweenUtil.Tween(0.1f, null, delegate
328 {
329 ReloadRoom();
330 });
331 }
332
333 public void ReloadRoom()
334 {
335 List<Thing> list = new List<Thing>();
336 foreach (Thing thing in things)
337 {
338 if (thing.trait.IsDoor)
339 {
340 list.Add(thing);
341 }
342 }
343 foreach (Thing item in list)
344 {
345 Point pos = item.pos;
347 EClass._zone.AddCard(item, pos);
348 item.Install();
349 }
351 }
352
353 public void Reset()
354 {
355 for (int i = 0; i < Size; i++)
356 {
357 for (int j = 0; j < Size; j++)
358 {
359 cells[i, j].Reset();
360 }
361 }
362 SetReference();
363 }
364
365 public void ResetEditorPos()
366 {
368 foreach (Chara chara in charas)
369 {
370 if (chara.isPlayerCreation && chara.orgPos != null)
371 {
372 MoveCard(chara.orgPos, chara);
373 }
374 }
375 foreach (Thing thing in things)
376 {
377 if (thing.trait is TraitDoor)
378 {
379 (thing.trait as TraitDoor).ForceClose();
380 }
381 }
382 }
383
384 public void Save(string path, ZoneExportData export = null, PartialMap partial = null)
385 {
387 Debug.Log("#io saving map:" + path);
388 IO.CreateDirectory(path);
389 int num = 0;
390 int num2 = 0;
391 int num3 = Size;
392 int num4 = Size;
393 if (partial != null)
394 {
395 num = partial.offsetX;
396 num2 = partial.offsetZ;
397 num3 = partial.w;
398 num4 = partial.h;
399 }
400 int num5 = num3 * num4;
401 byte[] array = new byte[num5];
402 int[] array2 = new int[num5];
403 int[] array3 = new int[num5];
404 int[] array4 = new int[num5];
405 int[] array5 = new int[num5];
406 int[] array6 = new int[num5];
407 int[] array7 = new int[num5];
408 byte[] array8 = new byte[num5];
409 byte[] array9 = new byte[num5];
410 byte[] array10 = new byte[num5];
411 byte[] array11 = new byte[num5];
412 byte[] array12 = new byte[num5];
413 int[] array13 = new int[num5];
414 int[] array14 = new int[num5];
415 byte[] array15 = new byte[num5];
416 int[] array16 = new int[num5];
417 byte[] array17 = new byte[num5];
418 int[] array18 = new int[num5];
419 int[] array19 = new int[num5];
420 int[] array20 = new int[num5];
421 int[] array21 = new int[num5];
422 cellEffects.Clear();
423 int num6 = 0;
424 for (int i = num; i < num + num3; i++)
425 {
426 for (int j = num2; j < num2 + num4; j++)
427 {
428 Cell cell = cells[i, j];
429 array[num6] = cell.objVal;
430 array3[num6] = cell._blockMat;
431 array2[num6] = cell._block;
432 array5[num6] = cell._floorMat;
433 array4[num6] = cell._floor;
434 array6[num6] = cell.obj;
435 array20[num6] = cell._deco;
436 array21[num6] = cell._decoMat;
437 array7[num6] = cell.objMat;
438 array8[num6] = cell.decal;
439 array9[num6] = cell._dirs;
440 array12[num6] = cell.height;
441 array13[num6] = cell._bridge;
442 array14[num6] = cell._bridgeMat;
443 array15[num6] = cell.bridgeHeight;
444 array17[num6] = cell._roofBlockDir;
445 array18[num6] = cell._roofBlock;
446 array19[num6] = cell._roofBlockMat;
447 array16[num6] = cell.bridgePillar;
448 array10[num6] = array10[num6].SetBit(1, cell.isSeen);
449 array10[num6] = array10[num6].SetBit(2, cell.isHarvested);
450 array10[num6] = array10[num6].SetBit(3, cell.impassable);
451 array10[num6] = array10[num6].SetBit(4, cell.isModified);
452 array10[num6] = array10[num6].SetBit(5, cell.isClearSnow);
453 array10[num6] = array10[num6].SetBit(6, cell.isForceFloat);
454 array10[num6] = array10[num6].SetBit(7, cell.isToggleWallPillar);
455 array11[num6] = array11[num6].SetBit(0, cell.isWatered);
456 array11[num6] = array11[num6].SetBit(1, cell.isObjDyed);
457 array11[num6] = array11[num6].SetBit(2, cell.crossWall);
458 array11[num6] = array11[num6].SetBit(3, cell.hidePillar);
459 array11[num6] = array11[num6].SetBit(4, cell.toggleOcclusion);
460 if (cell.effect != null)
461 {
462 cellEffects[j * num4 + i] = cell.effect;
463 }
464 num6++;
465 }
466 }
467 compression = ((!EClass.core.config.test.compressSave) ? IO.Compression.None : IO.Compression.LZ4);
468 cellWidths.Clear();
469 Write("objVals", array);
470 WriteIds("blocks", array2);
471 WriteIds("blockMats", array3);
472 WriteIds("floors", array4);
473 WriteIds("floorMats", array5);
474 WriteIds("objs", array6);
475 WriteIds("objMats", array7);
476 Write("decal", array8);
477 Write("flags", array10);
478 Write("flags2", array11);
479 Write("dirs", array9);
480 Write("heights", array12);
481 WriteIds("bridges", array13);
482 WriteIds("bridgeMats", array14);
483 Write("bridgeHeights", array15);
484 WriteIds("bridgePillars", array16);
485 WriteIds("roofBlocks", array18);
486 WriteIds("roofBlockMats", array19);
487 Write("roofBlockDirs", array17);
488 WriteIds("decos", array20);
489 WriteIds("decoMats", array21);
490 things.Sort((Thing a, Thing b) => a.stackOrder - b.stackOrder);
491 if (export == null)
492 {
493 foreach (Chara chara in charas)
494 {
495 if (!chara.IsGlobal)
496 {
497 serializedCharas.Add(chara);
498 }
499 }
500 try
501 {
502 GameIO.SaveFile(path + "map", this);
503 }
504 finally
505 {
506 serializedCharas.Clear();
507 }
508 }
509 else
510 {
511 export.serializedCards.cards.Clear();
512 if (partial == null)
513 {
514 MapExportSetting mapExportSetting = exportSetting ?? new MapExportSetting();
515 foreach (Chara chara2 in charas)
516 {
517 if (export.usermap)
518 {
519 if ((!mapExportSetting.clearLocalCharas || chara2.IsPCFactionOrMinion) && !chara2.trait.IsUnique && !chara2.IsPC)
520 {
521 export.serializedCards.Add(chara2);
522 }
523 }
524 else if (!chara2.IsGlobal && chara2.isPlayerCreation)
525 {
526 export.serializedCards.Add(chara2);
527 }
528 }
529 foreach (Thing thing in things)
530 {
531 if (thing.isPlayerCreation && thing.c_altName != "DebugContainer")
532 {
533 export.serializedCards.Add(thing);
534 }
535 }
536 }
537 else
538 {
539 foreach (Thing thing2 in things)
540 {
541 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)
542 {
543 export.serializedCards.Add(thing2);
544 }
545 }
546 }
547 List<Thing> list = things;
548 things = new List<Thing>();
549 GameIO.SaveFile(path + "map", this);
550 things = list;
551 }
552 serializedCharas.Clear();
553 void Write(string name, byte[] bytes)
554 {
555 IO.WriteLZ4(path + name, bytes, compression);
556 }
557 void WriteIds(string name, int[] ids)
558 {
559 int num7 = WriteCellIds(path + name, ids, compression);
560 if (num7 > 1)
561 {
562 cellWidths[name] = num7;
563 }
564 }
565 }
566
567 public byte[] TryLoadFile(string path, string s, int size)
568 {
569 byte[] array = IO.ReadLZ4(path + s, size, compression);
570 if (array == null)
571 {
572 Debug.Log("Couldn't load:" + s);
573 return new byte[size];
574 }
575 return array;
576 }
577
578 private static string CellIdPath(string path, int width)
579 {
580 if (width != 1)
581 {
582 return path + ".w" + width;
583 }
584 return path;
585 }
586
587 private static int WriteCellIds(string path, int[] ids, IO.Compression compression)
588 {
589 int num = 0;
590 int[] array = ids;
591 foreach (int b in array)
592 {
593 num = Mathf.Max(num, b);
594 }
595 int num2 = ((num <= 255) ? 1 : ((num <= 65535) ? 2 : 4));
596 byte[] array2 = new byte[ids.Length * num2];
597 for (int j = 0; j < ids.Length; j++)
598 {
599 for (int k = 0; k < num2; k++)
600 {
601 array2[j * num2 + k] = (byte)(ids[j] >> 8 * k);
602 }
603 }
604 IO.WriteLZ4(CellIdPath(path, num2), array2, compression);
605 array = CellIdWidths;
606 foreach (int num3 in array)
607 {
608 if (num3 != num2)
609 {
610 string text = CellIdPath(path, num3);
611 IO.DeleteFile(text);
612 for (int l = 1; l < 5; l++)
613 {
614 IO.DeleteFile(text + ".b" + l);
615 }
616 }
617 }
618 return num2;
619 }
620
621 private int[] ReadCellIds(string file, string s, int size, int width)
622 {
623 byte[] array = IO.ReadLZ4(file, size * width, compression);
624 if (array == null)
625 {
626 return null;
627 }
628 if ((width != 1 && width != 2 && width != 4) || array.Length != (long)size * (long)width)
629 {
630 Debug.Log("Couldn't load:" + s);
631 return null;
632 }
633 int[] array2 = new int[size];
634 for (int i = 0; i < size; i++)
635 {
636 for (int j = 0; j < width; j++)
637 {
638 array2[i] |= array[i * width + j] << 8 * j;
639 }
640 }
641 return array2;
642 }
643
644 public void Load(string path, bool import = false, PartialMap partial = null)
645 {
646 if (partial == null)
647 {
648 Debug.Log("Map Load:" + compression.ToString() + ": " + path);
649 }
650 int num = Size;
651 int num2 = Size;
652 if (partial != null)
653 {
654 num = partial.w;
655 num2 = partial.h;
656 Debug.Log(compression.ToString() + ": " + num + "/" + num2);
657 }
658 int size = num * num2;
659 cells = new Cell[num, num2];
660 if (bounds.maxX == 0)
661 {
662 bounds.SetBounds(0, 0, num - 1, num2 - 1);
663 }
664 SetBounds(0, 0, num - 1, num2 - 1);
665 byte[] data = TryLoad("objVals");
666 int[] data2 = TryLoadIds("blockMats");
667 int[] data3 = TryLoadIds("blocks");
668 int[] data4 = TryLoadIds("floorMats");
669 int[] data5 = TryLoadIds("floors");
670 int[] data6 = TryLoadIds("objs");
671 int[] data7 = TryLoadIds("objMats");
672 byte[] data8 = TryLoad("decal");
673 int[] data9 = TryLoadIds("decos");
674 int[] data10 = TryLoadIds("decoMats");
675 byte[] data11 = TryLoad("dirs");
676 byte[] data12 = TryLoad("flags");
677 byte[] data13 = TryLoad("flags2");
678 byte[] data14 = TryLoad("heights");
679 int[] data15 = TryLoadIds("bridges");
680 int[] data16 = TryLoadIds("bridgeMats");
681 byte[] data17 = TryLoad("bridgeHeights");
682 int[] data18 = TryLoadIds("bridgePillars");
683 int[] data19 = TryLoadIds("roofBlocks");
684 int[] data20 = TryLoadIds("roofBlockMats");
685 byte[] data21 = TryLoad("roofBlockDirs");
686 if (data18.Length < size)
687 {
688 data18 = new int[size];
689 }
690 if (data.Length < size)
691 {
692 data = new byte[size];
693 }
694 if (data13.Length < size)
695 {
696 data13 = new byte[size];
697 }
698 Validate<byte>(ref data, "objVals");
699 Validate<int>(ref data2, "blockMats");
700 Validate<int>(ref data3, "blocks");
701 Validate<int>(ref data4, "floorMats");
702 Validate<int>(ref data5, "floors");
703 Validate<int>(ref data6, "objs");
704 Validate<int>(ref data7, "objMats");
705 Validate<byte>(ref data8, "decal");
706 Validate<int>(ref data9, "decos");
707 Validate<int>(ref data10, "decoMats");
708 Validate<byte>(ref data11, "dirs");
709 Validate<byte>(ref data12, "flags");
710 Validate<byte>(ref data13, "flags2");
711 Validate<byte>(ref data14, "heights");
712 Validate<int>(ref data15, "bridges");
713 Validate<int>(ref data16, "bridgeMats");
714 Validate<byte>(ref data17, "bridgeHeights");
715 Validate<int>(ref data18, "bridgePillars");
716 Validate<int>(ref data19, "roofBlocks");
717 Validate<int>(ref data20, "roofBlockMats");
718 Validate<byte>(ref data21, "roofBlockDirs");
719 int num3 = 0;
720 for (int i = 0; i < num; i++)
721 {
722 for (int j = 0; j < num2; j++)
723 {
724 Cell cell = (cells[i, j] = new Cell
725 {
726 x = (byte)i,
727 z = (byte)j,
728 objVal = data[num3],
729 _blockMat = data2[num3],
730 _block = data3[num3],
731 _floorMat = data4[num3],
732 _floor = data5[num3],
733 obj = data6[num3],
734 objMat = data7[num3],
735 decal = data8[num3],
736 _deco = data9[num3],
737 _decoMat = data10[num3],
738 _dirs = data11[num3],
739 height = data14[num3],
740 _bridge = data15[num3],
741 _bridgeMat = data16[num3],
742 bridgeHeight = data17[num3],
743 bridgePillar = data18[num3],
744 _roofBlock = data19[num3],
745 _roofBlockMat = data20[num3],
746 _roofBlockDir = data21[num3],
747 isSeen = data12[num3].GetBit(1),
748 isHarvested = data12[num3].GetBit(2),
749 impassable = data12[num3].GetBit(3),
750 isModified = data12[num3].GetBit(4),
751 isClearSnow = data12[num3].GetBit(5),
752 isForceFloat = data12[num3].GetBit(6),
753 isToggleWallPillar = data12[num3].GetBit(7),
754 isWatered = data13[num3].GetBit(0),
755 isObjDyed = data13[num3].GetBit(1),
756 crossWall = data13[num3].GetBit(2),
757 hidePillar = data13[num3].GetBit(3),
758 toggleOcclusion = data13[num3].GetBit(4)
759 });
760 if (version.IsBelow(0, 23, 344) && cell.bridgePillar == 255)
761 {
762 cell.bridgePillar = 0;
763 cell.hidePillar = true;
764 }
765 if (!EClass.sources.floors.map.ContainsKey(cell._bridge))
766 {
767 cell._bridge = 0;
768 }
769 if (!EClass.sources.materials.map.ContainsKey(cell._bridgeMat))
770 {
771 cell._bridgeMat = 1;
772 }
774 num3++;
775 }
776 }
777 things.ForeachReverse(delegate(Thing t)
778 {
779 if (t.Num <= 0 || t.isDestroyed)
780 {
781 Debug.Log("[bug] Removing bugged thing:" + t.Num + "/" + t.isDestroyed + "/" + t);
782 things.Remove(t);
783 }
784 });
785 foreach (KeyValuePair<int, CellEffect> cellEffect in cellEffects)
786 {
787 int key = cellEffect.Key;
788 int num4 = key % Size;
789 int num5 = key / Size;
790 cells[num4, num5].effect = cellEffect.Value;
791 if (cellEffect.Value.IsFire)
792 {
793 effectManager.GetOrCreate(new Point(num4, num5));
794 }
795 }
796 cellEffects.Clear();
798 byte[] TryLoad(string s)
799 {
800 return TryLoadFile(path, s, size);
801 }
802 int[] TryLoadIds(string s)
803 {
804 int value;
805 int width = ((cellWidths == null || !cellWidths.TryGetValue(s, out value)) ? 1 : value);
806 return ReadCellIds(CellIdPath(path + s, width), s, size, width) ?? new int[size];
807 }
808 void Validate<T>(ref T[] reference, string id)
809 {
810 if (reference.Length < size)
811 {
812 Debug.LogError("exception: size invalid:" + id + " " + reference.Length + "/" + size);
813 reference = new T[size];
814 }
815 }
816 }
817
818 public void ValidateVersion()
819 {
821 }
822
823 public void OnLoad()
824 {
825 rooms.OnLoad();
826 tasks.OnLoad();
827 }
828
829 public void OnImport(ZoneExportData data)
830 {
831 tasks = new TaskManager();
832 data.serializedCards.Restore(this, data.orgMap, addToZone: false);
833 }
834
835 public void ExportMetaData(string _path, string id, PartialMap partial = null)
836 {
837 if (custom == null)
838 {
839 custom = new CustomData();
840 }
841 MapMetaData mapMetaData = new MapMetaData
842 {
843 name = EClass._zone.Name,
845 tag = (EClass._map.exportSetting?.tag ?? ""),
846 partial = partial,
847 underwater = EClass._zone.IsUnderwater
848 };
849 custom.id = (mapMetaData.id = id);
850 IO.SaveFile(_path + "meta", mapMetaData);
851 }
852
853 public static MapMetaData GetMetaData(string pathZip)
854 {
855 try
856 {
857 using ZipFile zipFile = ZipFile.Read(pathZip);
858 ZipEntry zipEntry = zipFile["meta"];
859 if (zipEntry != null)
860 {
861 using (MemoryStream stream = new MemoryStream())
862 {
863 zipEntry.Extract(stream);
864 MapMetaData mapMetaData = IO.LoadStreamJson<MapMetaData>(stream);
865 mapMetaData.path = pathZip;
866 return mapMetaData;
867 }
868 }
869 }
870 catch (Exception message)
871 {
872 if (Application.isEditor)
873 {
874 Debug.Log(message);
875 }
876 }
877 return null;
878 }
879
880 public static void UpdateMetaData(string pathZip, PartialMap partial = null)
881 {
882 IO.CreateTempDirectory();
883 ZipFile zipFile = ZipFile.Read(pathZip);
884 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
885 zipFile.ExtractAll(IO.TempPath);
886 zipFile.Dispose();
887 EClass._map.ExportMetaData(IO.TempPath + "/", Path.GetFileNameWithoutExtension(pathZip), partial);
888 using (zipFile = new ZipFile())
889 {
890 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
891 zipFile.AddDirectory(IO.TempPath);
892 zipFile.Save(pathZip);
893 zipFile.Dispose();
894 }
895 IO.DeleteTempDirectory();
896 }
897
898 public void AddCardOnActivate(Card c)
899 {
900 c.parent = zone;
902 Chara chara = c.Chara;
903 if (chara != null)
904 {
905 chara.currentZone = EClass._zone;
906 }
907 if (c.isChara)
908 {
909 if (!c.pos.IsInBounds)
910 {
912 }
913 }
914 else if (!c.pos.IsValid)
915 {
917 }
918 _AddCard(c.pos.x, c.pos.z, c, onAddToZone: true);
919 }
920
921 public void OnCardAddedToZone(Card t, int x, int z)
922 {
923 if (t.isChara)
924 {
925 charas.Add(t.Chara);
926 }
927 else
928 {
929 things.Add(t.Thing);
930 }
932 if (t.isChara && new Point(x, z).cell.HasFullBlock)
933 {
934 DestroyBlock(x, z);
935 }
936 _AddCard(x, z, t, onAddToZone: true);
938 }
939
941 {
944 _RemoveCard(t);
945 t.parent = null;
946 if (t.isChara)
947 {
948 charas.RemoveFromEnd(t.Chara);
949 }
950 else
951 {
952 things.RemoveFromEnd(t.Thing);
953 }
954 }
955
956 public void MoveCard(Point p, Card t)
957 {
958 _AddCard(p.x, p.z, t, onAddToZone: false);
959 }
960
961 public void _AddCard(int x, int z, Card t, bool onAddToZone)
962 {
963 if (!onAddToZone)
964 {
965 _RemoveCard(t);
966 }
967 t.lastPos.Set(t.pos);
968 t.pos.Set(x, z);
969 if (t.IsMultisize)
970 {
971 t.ForeachPoint(delegate(Point p, bool main)
972 {
973 p.cell.AddCard(t);
974 });
975 }
976 else
977 {
978 t.Cell.AddCard(t);
979 }
980 t.CalculateFOV();
981 if (t.isThing && !t.trait.IDActorEx.IsEmpty())
982 {
984 }
985 }
986
987 public void _RemoveCard(Card t)
988 {
989 if (t.IsMultisize)
990 {
991 t.ForeachPoint(delegate(Point p, bool main)
992 {
993 p.cell.RemoveCard(t);
994 });
995 }
996 else
997 {
998 t.Cell.RemoveCard(t);
999 }
1000 t.ClearFOV();
1001 }
1002
1003 public Cell GetCell(int index)
1004 {
1005 return cells[index % Size, index % SizeXZ / Size];
1006 }
1007
1008 public void SetSeen(int x, int z, bool seen = true, bool refresh = true)
1009 {
1010 if (cells[x, z].isSeen != seen)
1011 {
1012 cells[x, z].isSeen = seen;
1013 if (refresh)
1014 {
1016 }
1018 }
1019 }
1020
1021 public void RevealAll(bool reveal = true)
1022 {
1023 for (int i = 0; i < Size; i++)
1024 {
1025 for (int j = 0; j < Size; j++)
1026 {
1027 EClass._map.SetSeen(i, j, reveal, refresh: false);
1028 }
1029 }
1030 revealed = !revealed;
1032 }
1033
1034 public void Reveal(Point center, int power = 100)
1035 {
1036 ForeachSphere(center.x, center.z, 10 + power / 5, delegate(Point p)
1037 {
1038 if (EClass.rnd(power) >= Mathf.Min(p.Distance(center) * 10, power - 10))
1039 {
1040 EClass._map.SetSeen(p.x, p.z);
1041 }
1042 });
1043 }
1044
1045 public void RefreshFOV(int x, int z, int radius = 6, bool recalculate = false)
1046 {
1047 ForeachSphere(x, z, radius, delegate(Point p)
1048 {
1049 CellDetail detail = p.detail;
1050 if (detail == null)
1051 {
1052 return;
1053 }
1054 foreach (Thing thing in detail.things)
1055 {
1056 if (recalculate)
1057 {
1058 thing.RecalculateFOV();
1059 }
1060 else
1061 {
1062 thing.CalculateFOV();
1063 }
1064 }
1065 foreach (Chara chara in detail.charas)
1066 {
1067 if (recalculate)
1068 {
1069 chara.RecalculateFOV();
1070 }
1071 else
1072 {
1073 chara.CalculateFOV();
1074 }
1075 }
1076 });
1077 }
1078
1079 public void RefreshFOVAll()
1080 {
1081 foreach (Card item in ((IEnumerable<Card>)EClass._map.things).Concat((IEnumerable<Card>)EClass._map.charas))
1082 {
1083 item.RecalculateFOV();
1084 }
1085 }
1086
1087 public void SetFloor(int x, int z, int idMat = 0, int idFloor = 0)
1088 {
1089 SetFloor(x, z, idMat, idFloor, 0);
1090 }
1091
1092 public void SetFloor(int x, int z, int idMat, int idFloor, int dir)
1093 {
1094 Cell cell = cells[x, z];
1095 cell._floorMat = idMat;
1096 cell._floor = idFloor;
1097 cell.floorDir = dir;
1098 cell.isWatered = false;
1099 Critter.RebuildCritter(cell);
1100 RefreshNeighborTiles(x, z);
1101 }
1102
1103 public void SetDeco(int x, int z, int idMat, int idDeco)
1104 {
1105 Cell cell = cells[x, z];
1106 cell._decoMat = idMat;
1107 cell._deco = idDeco;
1108 RefreshNeighborTiles(x, z);
1109 }
1110
1111 public void SetBridge(int x, int z, int height = 0, int idMat = 0, int idBridge = 0, int dir = 0, int idPillar = 0, bool hidePillar = false)
1112 {
1113 Cell cell = cells[x, z];
1114 cell.bridgeHeight = (byte)height;
1115 cell._bridgeMat = idMat;
1116 cell._bridge = idBridge;
1117 cell.bridgePillar = idPillar;
1118 cell.hidePillar = hidePillar;
1119 cell.floorDir = dir;
1120 if (cell.room != null)
1121 {
1122 cell.room.SetDirty();
1123 }
1124 RefreshNeighborTiles(x, z);
1125 }
1126
1127 public void SetRoofBlock(int x, int z, int idMat, int idBlock, int dir, int height)
1128 {
1129 Cell cell = cells[x, z];
1130 cell._roofBlockMat = idMat;
1131 cell._roofBlock = idBlock;
1132 cell._roofBlockDir = (byte)(dir + height * 4);
1133 RefreshSingleTile(x, z);
1134 }
1135
1136 public void SetBlock(int x, int z, int idMat = 0, int idBlock = 0)
1137 {
1138 SetBlock(x, z, idMat, idBlock, 0);
1139 }
1140
1141 public void SetBlock(int x, int z, int idMat, int idBlock, int dir)
1142 {
1143 Cell cell = cells[x, z];
1144 bool hasFloodBlock = cell.HasFloodBlock;
1145 cell._blockMat = idMat;
1146 cell._block = idBlock;
1147 cell.blockDir = dir;
1148 if (cell.effect == null || !cell.effect.IsFire)
1149 {
1150 cell.effect = null;
1151 }
1152 cell.isToggleWallPillar = false;
1153 if (cell.room != null)
1154 {
1155 cell.room.SetDirty();
1156 }
1157 if (hasFloodBlock || cell.HasFloodBlock)
1158 {
1159 OnSetBlockOrDoor(x, z);
1160 }
1161 RefreshNeighborTiles(x, z);
1162 }
1163
1164 public void OnSetBlockOrDoor(int x, int z)
1165 {
1166 new Point(x, z);
1167 TryRemoveRoom(x, z);
1168 if (x > 0)
1169 {
1170 TryRemoveRoom(x - 1, z);
1171 }
1172 if (x < Size - 1)
1173 {
1174 TryRemoveRoom(x + 1, z);
1175 }
1176 if (z > 0)
1177 {
1178 TryRemoveRoom(x, z - 1);
1179 }
1180 if (z < Size - 1)
1181 {
1182 TryRemoveRoom(x, z + 1);
1183 }
1184 if (x > 0 && z < Size - 1)
1185 {
1186 TryRemoveRoom(x - 1, z + 1);
1187 }
1188 roomHash.Clear();
1189 TryAddRoom(x, z);
1190 if (x > 0)
1191 {
1192 TryAddRoom(x - 1, z);
1193 }
1194 if (x < Size - 1)
1195 {
1196 TryAddRoom(x + 1, z);
1197 }
1198 if (z > 0)
1199 {
1200 TryAddRoom(x, z - 1);
1201 }
1202 if (z < Size - 1)
1203 {
1204 TryAddRoom(x, z + 1);
1205 }
1206 if (x > 0 && z < Size - 1)
1207 {
1208 TryAddRoom(x - 1, z + 1);
1209 }
1210 }
1211
1212 public void TryRemoveRoom(int x, int z)
1213 {
1214 if (!cells[x, z].HasFloodBlock)
1215 {
1216 Room room = cells[x, z].room;
1217 if (room != null)
1218 {
1219 rooms.RemoveRoom(room);
1220 }
1221 }
1222 }
1223
1224 public void TryAddRoom(int x, int z)
1225 {
1226 if (EClass._zone.DisableRooms || roomHash.Contains(x + z * Size) || cells[x, z].HasFloodBlock)
1227 {
1228 return;
1229 }
1230 FloodSpiller floodSpiller = flood;
1231 IFloodCell[,] array = cells;
1232 FloodSpiller.Result result = floodSpiller.SpillFlood(array, x, z);
1233 if (!result.IsValid)
1234 {
1235 return;
1236 }
1237 bool flag = false;
1238 foreach (IFloodCell item in result.visited)
1239 {
1240 if (item.hasDoor)
1241 {
1242 flag = true;
1243 break;
1244 }
1245 Cell cell = item as Cell;
1246 if (cell.sourceBlock.tileType.IsFloodDoor || cell.Front.hasDoor || cell.Right.hasDoor || cell.FrontRight.hasDoor || cell.Back.hasDoor || cell.Left.hasDoor || cell.BackLeft.hasDoor)
1247 {
1248 flag = true;
1249 break;
1250 }
1251 }
1252 if (!flag && IsIndoor)
1253 {
1254 foreach (IFloodCell item2 in result.visited)
1255 {
1256 Cell cell2 = item2 as Cell;
1257 if (cell2.detail == null || cell2.detail.things.Count == 0)
1258 {
1259 continue;
1260 }
1261 foreach (Thing thing in cell2.detail.things)
1262 {
1263 if (thing.trait is TraitRoomPlate || thing.trait is TraitHouseBoard)
1264 {
1265 flag = true;
1266 break;
1267 }
1268 }
1269 if (flag)
1270 {
1271 break;
1272 }
1273 }
1274 }
1275 if (!flag)
1276 {
1277 return;
1278 }
1279 Room room = rooms.AddRoom(new Room());
1280 foreach (IFloodCell item3 in result.visited)
1281 {
1282 Cell cell3 = item3 as Cell;
1283 byte b = cell3.x;
1284 byte b2 = cell3.z;
1285 room.AddPoint(new Point(b, b2));
1286 roomHash.Add(b + b2 * Size);
1287 if (b2 > 0 && cell3.Front.HasFloodBlock && cell3.Front.room == null)
1288 {
1289 room.AddPoint(new Point(b, b2 - 1));
1290 roomHash.Add(b + (b2 - 1) * Size);
1291 }
1292 if (b < Size - 1 && cell3.Right.HasFloodBlock && cell3.Right.room == null)
1293 {
1294 room.AddPoint(new Point(b + 1, b2));
1295 roomHash.Add(b + 1 + b2 * Size);
1296 }
1297 if (b2 > 0 && b < Size - 1 && cell3.FrontRight.HasFloodBlock && cell3.FrontRight.room == null)
1298 {
1299 room.AddPoint(new Point(b + 1, b2 - 1));
1300 roomHash.Add(b + 1 + (b2 - 1) * Size);
1301 }
1302 }
1303 }
1304
1305 public void SetBlockDir(int x, int z, int dir)
1306 {
1307 Cell cell = cells[x, z];
1308 cell._block = cell.sourceBlock.id;
1309 cell.blockDir = dir;
1310 }
1311
1312 public void ModFire(int x, int z, int amount)
1313 {
1314 Cell cell = cells[x, z];
1315 if (amount <= 0 || (!cell.IsTopWaterAndNoSnow && !cell.IsSnowTile && !EClass._zone.IsUnderwater))
1316 {
1317 if (cell.effect == null && amount > 0)
1318 {
1319 SE.Play("fire");
1320 }
1321 int num = amount + (cell.effect?.FireAmount ?? 0);
1322 if (num > 20)
1323 {
1324 num = 20;
1325 }
1326 if (num <= 0)
1327 {
1328 cell.effect = null;
1329 return;
1330 }
1331 cell.effect = new CellEffect
1332 {
1333 id = 3,
1334 amount = num
1335 };
1336 effectManager.GetOrCreate(new Point(x, z));
1337 }
1338 }
1339
1340 public void TryShatter(Point pos, int ele, int power, Card CC = null)
1341 {
1342 bool flag = false;
1343 if (CC != null && CC.IsPCFactionOrMinion && (CC.HasElement(1651) || EClass.pc.Evalue(1651) >= 2))
1344 {
1345 flag = true;
1346 }
1347 Element element = Element.Create(ele);
1348 List<Card> list = new List<Card>();
1349 bool fire = ele == 910;
1350 bool cold = ele == 911;
1351 _ = fire;
1352 List<Card> list2 = pos.ListCards();
1353 if (fire && (pos.cell.IsSnowTile || pos.cell.IsTopWater))
1354 {
1355 return;
1356 }
1357 foreach (Card item in list2)
1358 {
1359 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>()))
1360 {
1361 continue;
1362 }
1363 if (flag)
1364 {
1365 if (item.isChara)
1366 {
1367 if (item.IsPCFactionOrMinion)
1368 {
1369 continue;
1370 }
1371 }
1372 else if (!CanCook(item))
1373 {
1374 continue;
1375 }
1376 }
1378 {
1379 Card rootCard = item.GetRootCard();
1380 if (!rootCard.isChara || rootCard.Chara.IsPCFaction)
1381 {
1382 if (pos.IsSync)
1383 {
1384 Msg.Say("damage_protectCore", item);
1385 }
1386 continue;
1387 }
1388 }
1389 if (item.isThing && item.things.Count == 0)
1390 {
1391 list.Add(item);
1392 }
1393 else
1394 {
1395 if (ele == 911 && item.HasElement(1236))
1396 {
1397 continue;
1398 }
1399 Thing thing = ((ele == 910) ? item.things.FindBest<TraitBlanketFireproof>((Thing t) => -t.c_charges) : item.things.FindBest<TraitBlanketColdproof>((Thing t) => -t.c_charges));
1400 if (thing != null)
1401 {
1402 thing.ModCharge(-1);
1403 Card rootCard2 = item.GetRootCard();
1404 if (pos.IsSync)
1405 {
1406 Msg.Say((item.isChara ? "blanketInv_" : "blanketGround_") + element.source.alias, thing, item);
1407 }
1408 if (thing.c_charges <= 0)
1409 {
1410 thing.Die(element);
1411 if (rootCard2.IsPCParty)
1412 {
1414 }
1415 }
1416 continue;
1417 }
1418 foreach (Thing item2 in item.things.List((Thing a) => a.things.Count == 0))
1419 {
1420 Card parentCard = item2.parentCard;
1421 if (parentCard == null || (!(parentCard.trait is TraitChestMerchant) && !parentCard.HasEditorTag(EditorTag.PreciousContainer)))
1422 {
1423 list.Add(item2);
1424 }
1425 }
1426 }
1427 }
1428 list.Shuffle();
1429 int num = 0;
1430 bool flag2 = false;
1431 foreach (Card item3 in list)
1432 {
1433 if (!item3.trait.CanBeDestroyed || item3.category.IsChildOf("currency") || item3.trait is TraitDoor || item3.trait is TraitFigure || item3.trait is TraitTrainingDummy || item3.rarity >= Rarity.Legendary)
1434 {
1435 continue;
1436 }
1437 Card rootCard3 = item3.GetRootCard();
1438 if (item3.IsEquipmentOrRangedOrAmmo && (EClass.rnd(4) != 0 || ((item3.IsRangedWeapon || item3.Thing.isEquipped) && rootCard3.IsPCFaction && EClass.rnd(4) != 0)))
1439 {
1440 continue;
1441 }
1442 switch (ele)
1443 {
1444 case 910:
1445 if (item3.isFireproof || (!item3.category.IsChildOf("book") && EClass.rnd(2) == 0))
1446 {
1447 continue;
1448 }
1449 break;
1450 case 911:
1451 if (!item3.category.IsChildOf("drink") && EClass.rnd(5) == 0)
1452 {
1453 continue;
1454 }
1455 break;
1456 }
1457 if (EClass.rnd(num * num) != 0)
1458 {
1459 continue;
1460 }
1461 bool flag3 = CanCook(item3);
1462 string text = "";
1463 if (flag3)
1464 {
1465 if (fire)
1466 {
1467 List<SourceThing.Row> list3 = new List<SourceThing.Row>();
1468 foreach (RecipeSource item4 in RecipeManager.list)
1469 {
1470 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)))
1471 {
1472 continue;
1473 }
1474 if (!row.factory.IsEmpty())
1475 {
1476 switch (row.factory[0])
1477 {
1478 case "chopper":
1479 case "mixer":
1480 case "camppot":
1481 case "cauldron":
1482 continue;
1483 }
1484 }
1485 if (row.components[0].Split('|').Contains(item3.id) || row.components[0].Split('|').Contains(item3.sourceCard._origin))
1486 {
1487 list3.Add(row);
1488 }
1489 }
1490 if (list3.Count > 0)
1491 {
1492 text = list3.RandomItemWeighted((SourceThing.Row r) => r.chance)?.id;
1493 }
1494 }
1495 else
1496 {
1497 text = "711";
1498 }
1499 }
1500 if (flag3 && !text.IsEmpty())
1501 {
1502 Thing thing2 = item3.Split(1);
1503 List<Thing> list4 = new List<Thing>();
1504 list4.Add(thing2);
1505 Thing thing3 = ThingGen.Create(text);
1506 CraftUtil.MakeDish(thing3, list4, 999);
1507 thing3.elements.ModBase(2, EClass.curve(power / 10, 50, 10));
1508 if (pos.IsSync)
1509 {
1510 Msg.Say(((rootCard3 == item3) ? "cook_groundItem" : "cook_invItem") + (fire ? "" : "_cold"), thing2, rootCard3, thing3.Name);
1511 }
1512 if (rootCard3 == item3)
1513 {
1514 EClass._zone.AddCard(thing3, item3.pos);
1515 }
1516 else if (rootCard3.isChara)
1517 {
1518 rootCard3.Chara.Pick(thing3, msg: false);
1519 }
1520 else
1521 {
1522 rootCard3.AddThing(thing3);
1523 }
1524 thing2.Destroy();
1525 }
1526 else
1527 {
1528 int num2 = EClass.rnd(item3.Num) / 2 + 1;
1529 if (item3.Num > num2)
1530 {
1531 Thing thing4 = item3.Split(num2);
1532 if (pos.IsSync)
1533 {
1534 Msg.Say((rootCard3 == item3) ? "damage_groundItem" : "damage_invItem", thing4, rootCard3);
1535 }
1536 thing4.Destroy();
1537 if (rootCard3.IsPCFaction)
1538 {
1539 WidgetPopText.Say("popDestroy".lang(thing4.Name, rootCard3.Name));
1540 }
1541 }
1542 else
1543 {
1544 item3.Die(element);
1545 if (rootCard3.IsPCFaction)
1546 {
1547 WidgetPopText.Say("popDestroy".lang(item3.Name, rootCard3.Name));
1548 }
1549 }
1550 }
1551 if (rootCard3.IsPCParty)
1552 {
1554 }
1555 if (!flag2)
1556 {
1557 pos.PlayEffect(fire ? "Element/eleFire" : "Element/eleCold");
1558 flag2 = true;
1559 }
1560 num++;
1561 }
1562 _ValidateInstalled(pos.x, pos.z);
1563 bool CanCook(Card c)
1564 {
1565 if ((fire || cold) && c.IsFood)
1566 {
1567 return c.category.IsChildOf("foodstuff");
1568 }
1569 return false;
1570 }
1571 }
1572
1573 public void Burn(int x, int z, bool instant = false)
1574 {
1575 Cell cell = cells[x, z];
1576 Point sharedPoint = cell.GetSharedPoint();
1577 if ((instant || EClass.rnd(10) == 0) && cell.HasObj)
1578 {
1579 if (cell.sourceObj.tileType is TileTypeTree)
1580 {
1581 SetObj(x, z, cell.matObj_fixed.id, 59, 0, EClass.rnd(4));
1582 }
1583 else
1584 {
1585 SetObj(x, z);
1586 if (EClass.rnd(2) == 0)
1587 {
1588 EClass._zone.AddCard(ThingGen.Create((EClass.rnd(2) == 0) ? "ash" : "ash2"), sharedPoint);
1589 }
1590 }
1591 }
1592 if ((instant || EClass.rnd(5) == 0) && cell._block != 0 && cell._block != 96)
1593 {
1594 if (EClass.rnd(10) == 0 || !cell.sourceBlock.tileType.IsWall)
1595 {
1596 cell._block = 0;
1597 }
1598 else
1599 {
1600 cell._block = 96;
1601 }
1602 SetObj(x, z);
1603 if (cell.room != null)
1604 {
1605 cell.room.SetDirty();
1606 }
1607 RefreshNeighborTiles(x, z);
1608 }
1609 if (instant || EClass.rnd(10) == 0)
1610 {
1611 if (EClass.rnd(4) != 0)
1612 {
1613 cell._floor = 49;
1614 }
1615 if (cell._bridge != 0 && EClass.rnd(5) != 0)
1616 {
1617 cell._bridge = 49;
1618 }
1619 }
1620 foreach (Card item in sharedPoint.ListCards())
1621 {
1622 if (item.trait.CanBeDestroyed && !item.trait.IsDoor && !item.isFireproof && !item.category.IsChildOf("currency") && item.rarity < Rarity.Legendary && !(item.trait is TraitFigure) && item.isThing)
1623 {
1624 if (instant)
1625 {
1626 item.Destroy();
1627 EClass._zone.AddCard(ThingGen.Create((EClass.rnd(2) == 0) ? "ash" : "ash2"), sharedPoint);
1628 }
1629 else
1630 {
1631 item.DamageHP(30L, 910);
1632 }
1633 }
1634 }
1635 if (instant)
1636 {
1637 cell.effect = null;
1638 }
1639 }
1640
1641 public void SetLiquid(int x, int z, CellEffect effect = null)
1642 {
1643 Cell cell = cells[x, z];
1644 if (!cell.IsTopWaterAndNoSnow || effect == null)
1645 {
1646 cell.effect = effect;
1647 }
1648 }
1649
1650 public void SetLiquid(int x, int z, int id, int value = 1)
1651 {
1652 Cell cell = cells[x, z];
1653 if (!cell.IsTopWaterAndNoSnow || value == 0)
1654 {
1655 if (value > 3)
1656 {
1657 value = 3;
1658 }
1659 if (value <= 0)
1660 {
1661 cell.effect = null;
1662 return;
1663 }
1664 cell.effect = new CellEffect
1665 {
1666 id = id,
1667 amount = value
1668 };
1669 }
1670 }
1671
1672 public void SetEffect(int x, int z, CellEffect effect = null)
1673 {
1674 cells[x, z].effect = effect;
1675 }
1676
1677 public void ModLiquid(int x, int z, int amount)
1678 {
1679 Cell cell = cells[x, z];
1680 if (!cell.IsTopWaterAndNoSnow && cell.effect != null)
1681 {
1682 cell.effect.amount += amount;
1683 if (cell.effect.amount <= 0)
1684 {
1685 cell.effect = null;
1686 }
1687 }
1688 }
1689
1690 public void ClearRainAndDecal()
1691 {
1692 ForeachCell(delegate(Cell c)
1693 {
1694 c.effect = null;
1695 c.decal = 0;
1696 });
1697 }
1698
1699 public void SetObj(int x, int z, int id = 0, int value = 1, int dir = 0)
1700 {
1701 SetObj(x, z, EClass.sources.objs[id].DefaultMaterial.id, id, value, dir);
1702 }
1703
1704 public void SetObj(int x, int z, int idMat, int idObj, int value, int dir, bool ignoreRandomMat = false)
1705 {
1706 Cell cell = cells[x, z];
1707 if (cell.sourceObj.id == 118 || idObj == 118)
1708 {
1709 EClass._zone.dirtyElectricity = true;
1710 }
1711 cell.obj = idObj;
1712 cell.objVal = (byte)value;
1713 cell.objMat = idMat;
1714 cell.objDir = dir;
1715 cell.isHarvested = false;
1716 cell.isObjDyed = false;
1717 SourceObj.Row sourceObj = cell.sourceObj;
1718 if (!ignoreRandomMat && !sourceObj.matCategory.IsEmpty())
1719 {
1720 int num = EClass._zone.DangerLv;
1721 if (sourceObj.tag.Contains("spot"))
1722 {
1723 num += EClass.pc.Evalue(1656) * 5;
1724 }
1725 cell.objMat = MATERIAL.GetRandomMaterialFromCategory(num, sourceObj.matCategory.Split(','), cell.matObj).id;
1726 }
1727 if (backerObjs.ContainsKey(cell.index))
1728 {
1729 backerObjs.Remove(cell.index);
1730 }
1731 if (plants.ContainsKey(cell.index))
1732 {
1733 plants.Remove(cell.index);
1734 }
1735 cell.growth?.OnSetObj();
1736 Critter.RebuildCritter(cell);
1737 RefreshNeighborTiles(x, z);
1738 }
1739
1740 public void AddBackerTree(bool draw)
1741 {
1743 int num = ((!draw) ? 1 : 2);
1744 EClass._map.bounds.ForeachCell(delegate(Cell c)
1745 {
1746 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"))
1747 {
1748 backerObjs[c.index] = item.id;
1749 Debug.Log(c.index + "/" + c.x + "/" + c.z + "/" + item.id + "/" + item.Name + "/" + item.tree);
1750 num--;
1752 }
1753 });
1754 }
1755
1757 {
1758 if (!backerObjs.ContainsKey(p.index))
1759 {
1760 return null;
1761 }
1762 return EClass.sources.backers.map.TryGetValue(backerObjs[p.index]);
1763 }
1764
1765 public void ApplyBackerObj(Point p, int id = -1)
1766 {
1767 if (!p.HasObj)
1768 {
1769 return;
1770 }
1771 bool flag = p.sourceObj.id == 82;
1772 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)));
1773 if (row == null)
1774 {
1775 return;
1776 }
1778 {
1779 backerObjs[p.index] = row.id;
1780 if (flag)
1781 {
1782 p.cell.objDir = row.skin;
1783 }
1784 }
1785 else
1786 {
1787 backerObjs.Remove(p.index);
1788 }
1789 }
1790
1791 public void DropBlockComponent(Point point, TileRow r, SourceMaterial.Row mat, bool recoverBlock, bool isPlatform = false, Chara c = null)
1792 {
1794 {
1795 return;
1796 }
1797 Thing thing = null;
1798 if (r.components.Length == 0)
1799 {
1800 return;
1801 }
1803 if (recoverBlock)
1804 {
1805 thing = ((!(r is SourceFloor.Row)) ? ThingGen.CreateBlock(r.id, mat.id) : ThingGen.CreateFloor(r.id, mat.id, isPlatform));
1806 }
1807 else
1808 {
1809 RecipeSource recipeSource = RecipeManager.Get(r.RecipeID + (isPlatform ? "-b" : ""));
1810 if (recipeSource == null)
1811 {
1812 return;
1813 }
1814 string iDIngredient = recipeSource.GetIDIngredient();
1815 if (iDIngredient == null)
1816 {
1817 return;
1818 }
1819 thing = ThingGen.Create(iDIngredient);
1820 thing.ChangeMaterial(mat.alias);
1821 }
1823 {
1824 PutAway(thing);
1825 }
1826 else
1827 {
1828 TrySmoothPick(point, thing, c);
1829 }
1830 }
1831
1832 public void MineBlock(Point point, bool recoverBlock = false, Chara c = null, bool mineObj = true)
1833 {
1834 bool flag = ActionMode.Mine.IsRoofEditMode() && point.cell._roofBlock != 0;
1835 if (!point.IsValid || (!flag && !point.cell.HasBlock))
1836 {
1837 return;
1838 }
1839 SourceMaterial.Row row = (flag ? point.matRoofBlock : point.matBlock);
1840 int num = (flag ? point.cell._roofBlock : point.cell._block);
1842 Effect.Get("smoke").Play(point);
1843 Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
1844 .Emit(10 + EClass.rnd(10));
1845 point.PlaySound(row.GetSoundDead(row2));
1846 row.AddBlood(point, 8);
1847 bool flag2 = c == null || c.IsAgent || c.IsPCFactionOrMinion;
1849 {
1850 flag2 = false;
1851 }
1852 if (flag)
1853 {
1854 point.cell._roofBlock = 0;
1855 RefreshSingleTile(point.x, point.z);
1856 }
1857 else
1858 {
1859 if (point.cell.HasFullBlock)
1860 {
1861 RemoveLonelyRamps(point.cell);
1862 }
1863 point.SetBlock();
1864 if (flag2 && point.sourceObj.tileType.IsBlockMount && mineObj)
1865 {
1866 MineObj(point, null, c);
1867 }
1868 }
1869 if (flag2)
1870 {
1871 DropBlockComponent(point, row2, row, recoverBlock, isPlatform: false, c);
1872 }
1873 RefreshShadow(point.x, point.z);
1874 RefreshShadow(point.x, point.z - 1);
1875 ValidateInstalled(point);
1876 RefreshFOV(point.x, point.z);
1877 if (flag2 && !point.cell.isModified && !flag)
1878 {
1879 if (num == 17 || EClass.rnd(100) == 0)
1880 {
1881 zone.AddCard(ThingGen.Create("money2"), point);
1882 }
1883 if (EClass._zone.DangerLv >= 10 && EClass.rnd(200) == 0)
1884 {
1885 zone.AddCard(ThingGen.Create("crystal_earth"), point);
1886 }
1887 if (EClass._zone.DangerLv >= 25 && EClass.rnd(200) == 0)
1888 {
1889 zone.AddCard(ThingGen.Create("crystal_sun"), point);
1890 }
1891 if (EClass._zone.DangerLv >= 40 && EClass.rnd(200) == 0)
1892 {
1893 zone.AddCard(ThingGen.Create("crystal_mana"), point);
1894 }
1895 point.cell.isModified = true;
1896 }
1897 }
1898
1899 public void MineRamp(Point point, int ramp, bool recoverBlock = false)
1900 {
1901 if (point.IsValid && point.cell.HasFullBlock)
1902 {
1903 SourceMaterial.Row matBlock = point.matBlock;
1904 int block = point.cell._block;
1905 Effect.Get("smoke").Play(point);
1906 Effect.Get("mine").Play(point).SetParticleColor(point.matBlock.GetColor())
1907 .Emit(10 + EClass.rnd(10));
1908 MineObj(point);
1909 int rampDir = EClass._map.GetRampDir(point.x, point.z, EClass.sources.blocks[ramp].tileType);
1910 RemoveLonelyRamps(point.cell);
1911 SetBlock(point.x, point.z, point.cell._blockMat, ramp, rampDir);
1912 DropBlockComponent(point, EClass.sources.blocks[block], matBlock, recoverBlock);
1913 }
1914 }
1915
1916 public void MineFloor(Point point, Chara c = null, bool recoverBlock = false, bool removePlatform = true)
1917 {
1918 if (!point.IsValid || (!point.HasFloor && !point.HasBridge))
1919 {
1920 return;
1921 }
1922 SourceMaterial.Row row = (point.cell.HasBridge ? point.matBridge : point.matFloor);
1923 SourceFloor.Row c2 = (point.cell.HasBridge ? point.sourceBridge : point.sourceFloor);
1924 Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
1925 .Emit(10 + EClass.rnd(10));
1926 point.PlaySound(row.GetSoundDead(c2));
1927 MineObj(point, null, c);
1928 if (point.cell.HasBridge && removePlatform)
1929 {
1930 DropBlockComponent(EClass.pc.pos, point.sourceBridge, point.matBridge, recoverBlock, isPlatform: true, c);
1931 EClass._map.SetBridge(point.x, point.z);
1932 if (point.IsSky)
1933 {
1934 EClass.pc.Kick(point, ignoreSelf: true);
1935 }
1936 return;
1937 }
1939 {
1940 DropBlockComponent(EClass.pc.pos, point.sourceFloor, row, recoverBlock, isPlatform: false, c);
1941 SetFloor(point.x, point.z, 0, 90);
1942 if (point.IsSky)
1943 {
1944 EClass.pc.Kick(point, ignoreSelf: true);
1945 }
1946 return;
1947 }
1948 if (zone.IsRegion || point.cell._floor == 40)
1949 {
1950 Thing thing = ThingGen.CreateRawMaterial(row);
1951 thing.ChangeMaterial(row.alias);
1952 TrySmoothPick(point, thing, c);
1953 }
1954 else
1955 {
1956 DropBlockComponent(point, point.sourceFloor, row, recoverBlock, isPlatform: false, c);
1957 }
1958 if (!EClass._zone.IsRegion && !point.sourceFloor.components[0].Contains("chunk@soil"))
1959 {
1960 point.SetFloor(EClass.sources.floors[1].DefaultMaterial.id, 40);
1961 }
1962 }
1963
1964 public void RefreshShadow(int x, int z)
1965 {
1966 }
1967
1968 public void TrySmoothPick(Cell cell, Thing t, Chara c)
1969 {
1970 TrySmoothPick(cell.GetPoint(), t, c);
1971 }
1972
1973 public void TrySmoothPick(Point p, Thing t, Chara c)
1974 {
1975 if (c != null && c.IsAgent)
1976 {
1977 EClass.pc.PickOrDrop(p, t);
1978 }
1979 else if (c != null && c.IsPC && (c.pos.Equals(p) || EClass.core.config.game.smoothPick || EClass._zone.IsRegion))
1980 {
1981 c.PickOrDrop(p, t);
1982 }
1983 else
1984 {
1985 EClass._zone.AddCard(t, p);
1986 }
1987 }
1988
1989 public void DestroyObj(Point point)
1990 {
1991 Cell cell = point.cell;
1992 SourceObj.Row sourceObj = cell.sourceObj;
1993 SourceMaterial.Row row = (cell.isObjDyed ? sourceObj.DefaultMaterial : cell.matObj);
1994 if (sourceObj.tileType.IsBlockPass)
1995 {
1996 Effect.Get("smoke").Play(point);
1997 }
1998 Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
1999 .Emit(10 + EClass.rnd(10));
2000 point.PlaySound(row.GetSoundDead());
2001 row.AddBlood(point, 3);
2002 }
2003
2004 public void MineObj(Point point, Task task = null, Chara c = null)
2005 {
2006 if (!point.IsValid || !point.HasObj)
2007 {
2008 return;
2009 }
2010 Cell cell = point.cell;
2011 SourceObj.Row sourceObj = cell.sourceObj;
2012 if (c == null && task != null)
2013 {
2014 c = task.owner;
2015 }
2016 bool num = c == null || c.IsAgent || c.IsPCFactionOrMinion;
2017 DestroyObj(point);
2018 if (num)
2019 {
2020 SourceMaterial.Row matObj_fixed = cell.matObj_fixed;
2021 if (task is TaskHarvest { IsReapSeed: not false })
2022 {
2023 int num2 = 1 + EClass.rnd(2) + ((EClass.rnd(3) == 0) ? 1 : 0);
2024 int soilCost = EClass._zone.GetSoilCost();
2025 int maxSoil = EClass._zone.MaxSoil;
2026 if (soilCost > maxSoil)
2027 {
2028 num2 -= EClass.rnd(2 + (soilCost - maxSoil) / 10);
2029 }
2030 if (num2 <= 0)
2031 {
2032 Msg.Say("seedSpoiled", cell.GetObjName());
2033 }
2034 else if (!EClass._zone.IsUserZone)
2035 {
2036 Thing t = TraitSeed.MakeSeed(cell).SetNum(num2);
2037 EClass.pc.PickOrDrop(point, t);
2038 }
2039 if (cell.growth.IsTree)
2040 {
2041 cell.isHarvested = true;
2042 return;
2043 }
2044 }
2045 else if (sourceObj.HasGrowth)
2046 {
2047 cell.growth.PopMineObj(c);
2048 }
2049 else
2050 {
2051 if (cell.HasBlock && (sourceObj.id == 18 || sourceObj.id == 19))
2052 {
2053 MineBlock(point, recoverBlock: false, c, mineObj: false);
2054 }
2056 {
2057 if (EClass.game.survival.OnMineWreck(point))
2058 {
2059 Rand.SetSeed();
2060 return;
2061 }
2062 Rand.SetSeed();
2063 }
2064 switch (sourceObj.alias)
2065 {
2066 case "nest_bird":
2067 if (EClass.rnd(5) <= 1)
2068 {
2069 Pop(ThingGen.Create((EClass.rnd(10) == 0) ? "egg_fertilized" : "_egg").TryMakeRandomItem());
2070 }
2071 break;
2072 }
2073 int num3 = EClass.rnd(EClass.rnd(sourceObj.components.Length) + 1);
2074 string[] array = sourceObj.components[num3].Split('/');
2075 Thing thing = ThingGen.Create(array[0].Split('|')[0], matObj_fixed.alias);
2076 if (array.Length > 1)
2077 {
2078 thing.SetNum(EClass.rnd(array[1].ToInt()) + 1);
2079 }
2080 Pop(thing);
2081 }
2082 }
2083 SetObj(point.x, point.z);
2084 cell.gatherCount = 0;
2085 void Pop(Thing thing2)
2086 {
2088 {
2090 {
2091 EClass._map.PutAway(thing2);
2092 }
2093 else
2094 {
2095 TrySmoothPick(point, thing2, c);
2096 }
2097 }
2098 }
2099 }
2100
2101 public void MineObjSound(Point point)
2102 {
2103 point.PlaySound(point.cell.matObj.GetSoundDead(point.cell.sourceObj));
2104 }
2105
2107 {
2108 return plants.TryGetValue(p.index);
2109 }
2110
2112 {
2113 return plants.TryGetValue(c.index);
2114 }
2115
2117 {
2118 PlantData plantData = new PlantData
2119 {
2120 seed = seed
2121 };
2122 plants[pos.index] = plantData;
2123 return plantData;
2124 }
2125
2126 public void RemovePlant(Point pos)
2127 {
2128 plants.Remove(pos.index);
2129 }
2130
2132 {
2133 _ValidateInstalled(p.x, p.z);
2134 _ValidateInstalled(p.x + 1, p.z);
2135 _ValidateInstalled(p.x - 1, p.z);
2136 _ValidateInstalled(p.x, p.z + 1);
2137 _ValidateInstalled(p.x, p.z - 1);
2138 }
2139
2140 public void _ValidateInstalled(int x, int y)
2141 {
2142 Point point = Point.shared.Set(x, y);
2143 if (!point.IsValid)
2144 {
2145 return;
2146 }
2147 List<Card> list = point.ListCards();
2148 CellDetail detail = point.cell.detail;
2149 if (detail == null)
2150 {
2151 return;
2152 }
2153 foreach (Card item in list)
2154 {
2155 if (!item.isThing || !item.trait.CanBeDestroyed || !item.IsInstalled)
2156 {
2157 continue;
2158 }
2159 HitResult hitResult = item.TileType._HitTest(point, item.Thing, canIgnore: false);
2160 if (item.Thing.stackOrder != detail.things.IndexOf(item.Thing) || (hitResult != HitResult.Valid && hitResult != HitResult.Warning))
2161 {
2162 if (EClass._zone.IsPCFaction || (!item.isNPCProperty && !(item.trait is TraitHarvest)))
2163 {
2164 item.SetPlaceState(PlaceState.roaming);
2165 }
2166 else if (item.rarity < Rarity.Legendary)
2167 {
2168 item.Die();
2169 }
2170 }
2171 }
2172 }
2173
2174 public void RemoveLonelyRamps(Cell cell)
2175 {
2176 for (int i = 0; i < 4; i++)
2177 {
2178 Cell dependedRamp = GetDependedRamp(cell);
2179 if (dependedRamp != null)
2180 {
2181 MineBlock(dependedRamp.GetPoint());
2182 continue;
2183 }
2184 break;
2185 }
2186 }
2187
2188 public void DestroyBlock(int x, int z)
2189 {
2190 SetBlock(x, z);
2191 }
2192
2193 public void AddDecal(int x, int z, int id, int amount = 1, bool refresh = true)
2194 {
2195 if (x < 0 || z < 0 || x >= Size || z >= Size)
2196 {
2197 return;
2198 }
2199 Cell cell = cells[x, z];
2200 if (cell.sourceFloor.tileType.AllowBlood && (cell.decal / 8 == id || cell.decal % 8 <= amount))
2201 {
2202 if (cell.decal / 8 != id && cell.decal % 8 == 0)
2203 {
2204 amount--;
2205 }
2206 int num = Mathf.Clamp(((cell.decal / 8 == id) ? (cell.decal % 8) : 0) + amount, 0, 7);
2207 cell.decal = (byte)(id * 8 + num);
2208 if (refresh)
2209 {
2210 RefreshNeighborTiles(x, z);
2211 }
2212 }
2213 }
2214
2215 public void SetDecal(int x, int z, int id = 0, int amount = 1, bool refresh = true)
2216 {
2217 cells[x, z].decal = (byte)((id != 0 && amount != 0) ? ((uint)(id * 8 + amount)) : 0u);
2218 if (refresh)
2219 {
2220 RefreshNeighborTiles(x, z);
2221 }
2222 }
2223
2224 public void SetFoormark(Point pos, int id, int angle, int offset = 0)
2225 {
2226 Cell cell = pos.cell;
2227 int tile = AngleToIndex(angle) + offset;
2228 Footmark footmark = new Footmark
2229 {
2230 tile = tile,
2231 remaining = 10
2232 };
2233 footmark.pos.Set(pos);
2234 footmarks.Add(footmark);
2235 cell.GetOrCreateDetail().footmark = footmark;
2236 }
2237
2238 public int AngleToIndex(int a)
2239 {
2240 if (EClass._zone.IsRegion)
2241 {
2242 return a switch
2243 {
2244 135 => 7,
2245 180 => 0,
2246 225 => 1,
2247 -90 => 2,
2248 -45 => 3,
2249 0 => 4,
2250 45 => 5,
2251 _ => 6,
2252 };
2253 }
2254 return a switch
2255 {
2256 135 => 0,
2257 180 => 1,
2258 225 => 2,
2259 -90 => 3,
2260 -45 => 4,
2261 0 => 5,
2262 45 => 6,
2263 _ => 7,
2264 };
2265 }
2266
2267 public void RefreshSingleTile(int x, int z)
2268 {
2269 cells[x, z].Refresh();
2270 }
2271
2272 public void RefreshAllTiles()
2273 {
2274 for (int i = 0; i < Size; i++)
2275 {
2276 for (int j = 0; j < Size; j++)
2277 {
2278 cells[i, j].Refresh();
2279 }
2280 }
2281 }
2282
2283 public void RefreshNeighborTiles(int x, int z)
2284 {
2285 cells[x, z].Refresh();
2286 for (int i = x - 2; i < x + 3; i++)
2287 {
2288 if (i < 0 || i >= Size)
2289 {
2290 continue;
2291 }
2292 for (int j = z - 2; j < z + 3; j++)
2293 {
2294 if (j >= 0 && j < Size && (x != i || z != j))
2295 {
2296 cells[i, j].Refresh();
2297 }
2298 }
2299 }
2300 }
2301
2302 public void QuickRefreshTile(int x, int z)
2303 {
2304 Cell cell = cells[x, z];
2305 Cell cell2 = ((x > 0) ? cells[x - 1, z] : Cell.Void);
2306 Cell cell3 = ((x + 1 < Size) ? cells[x + 1, z] : Cell.Void);
2307 Cell cell4 = ((z > 0) ? cells[x, z - 1] : Cell.Void);
2308 Cell cell5 = ((z + 1 < Size) ? cells[x, z + 1] : Cell.Void);
2309 Cell cell6 = ((x > 0 && z > 0) ? cells[x - 1, z - 1] : Cell.Void);
2310 Cell cell7 = ((x + 1 < Size && z > 0) ? cells[x + 1, z - 1] : Cell.Void);
2311 Cell cell8 = ((x > 0 && z + 1 < Size) ? cells[x - 1, z + 1] : Cell.Void);
2312 Cell cell9 = ((x + 1 < Size && z + 1 < Size) ? cells[x + 1, z + 1] : Cell.Void);
2313 cell.isSurrounded4d = cell2.HasFullBlock && cell3.HasFullBlock && cell4.HasFullBlock && cell5.HasFullBlock;
2314 cell.isSurrounded = cell.isSurrounded4d && cell6.HasFullBlock && cell7.HasFullBlock && cell8.HasFullBlock && cell9.HasFullBlock;
2315 }
2316
2317 public int GetRampDir(int x, int z, TileType blockType = null)
2318 {
2319 Cell cell = cells[x, z];
2320 if (cell.HasFullBlock)
2321 {
2322 if (blockType == null)
2323 {
2324 blockType = cell.sourceBlock.tileType;
2325 }
2326 Cell right = cell.Right;
2327 Cell front = cell.Front;
2328 Cell left = cell.Left;
2329 Cell back = cell.Back;
2330 if (!right.HasBlock && !right.IsVoid && left.HasFullBlock && front.CanBuildRamp(1) && back.CanBuildRamp(1))
2331 {
2332 return 1;
2333 }
2334 if (!front.HasBlock && !front.IsVoid && back.HasFullBlock && left.CanBuildRamp(0) && right.CanBuildRamp(0))
2335 {
2336 return 0;
2337 }
2338 if (!left.HasBlock && !left.IsVoid && right.HasFullBlock && front.CanBuildRamp(3) && back.CanBuildRamp(3))
2339 {
2340 return 3;
2341 }
2342 if (!back.HasBlock && !back.IsVoid && front.HasFullBlock && left.CanBuildRamp(2) && right.CanBuildRamp(2))
2343 {
2344 return 2;
2345 }
2346 if (!blockType.IsRamp)
2347 {
2348 return 0;
2349 }
2350 }
2351 return -1;
2352 }
2353
2355 {
2356 Cell right = cell.Right;
2357 if (right.HasRamp && !right.HasStairs && right.blockDir == 1)
2358 {
2359 return right;
2360 }
2361 Cell front = cell.Front;
2362 if (front.HasRamp && !front.HasStairs && front.blockDir == 0)
2363 {
2364 return front;
2365 }
2366 Cell left = cell.Left;
2367 if (left.HasRamp && !left.HasStairs && left.blockDir == 3)
2368 {
2369 return left;
2370 }
2371 Cell back = cell.Back;
2372 if (back.HasRamp && !back.HasStairs && back.blockDir == 2)
2373 {
2374 return back;
2375 }
2376 return null;
2377 }
2378
2379 public Point GetRandomPoint(Point center, int radius, int tries = 100, bool mustBeWalkable = true, bool requireLos = true)
2380 {
2381 Point point = new Point();
2382 for (int i = 0; i < tries; i++)
2383 {
2384 point.x = center.x + EClass.rnd(radius * 2 + 1) - radius;
2385 point.z = center.z + EClass.rnd(radius * 2 + 1) - radius;
2386 point.Clamp();
2387 if ((!mustBeWalkable || !point.cell.blocked) && (!requireLos || Los.IsVisible(center, point)))
2388 {
2389 return point;
2390 }
2391 }
2392 Debug.Log("GetRandomPoint failed center:" + center?.ToString() + " rad:" + radius);
2393 point.IsValid = false;
2394 return point;
2395 }
2396
2397 public new Point GetRandomEdge(int r = 3)
2398 {
2399 int num = 0;
2400 int num2 = 0;
2401 for (int i = 0; i < 10000; i++)
2402 {
2403 if (EClass.rnd(2) == 0)
2404 {
2405 num = ((EClass.rnd(2) == 0) ? EClass.rnd(r) : (Size - 1 - EClass.rnd(r)));
2406 num2 = EClass.rnd(Size);
2407 }
2408 else
2409 {
2410 num2 = ((EClass.rnd(2) == 0) ? EClass.rnd(r) : (Size - 1 - EClass.rnd(r)));
2411 num = EClass.rnd(Size);
2412 }
2413 Point surface = GetSurface(num, num2, walkable: false);
2414 if (surface.IsValid)
2415 {
2416 return surface;
2417 }
2418 }
2419 return GetSurface(Size / 2, Size / 2, walkable: false);
2420 }
2421
2423 {
2424 Point point = new Point();
2425 int num = ((EClass.rnd(2) == 0) ? 1 : (-1));
2426 int num2 = ((EClass.rnd(2) == 0) ? 1 : (-1));
2427 for (int i = 0; i < 3; i++)
2428 {
2429 point.x = center.x - num + i * num;
2430 for (int j = 0; j < 3; j++)
2431 {
2432 point.z = center.z - num2 + j * num2;
2433 if (point.IsValid && point.area == null && point.cell.CanHarvest())
2434 {
2435 return point;
2436 }
2437 }
2438 }
2439 return Point.Invalid;
2440 }
2441
2442 public List<Point> ListPointsInCircle(Point center, float radius, bool mustBeWalkable = true, bool los = true)
2443 {
2444 List<Point> list = new List<Point>();
2445 ForeachSphere(center.x, center.z, radius, delegate(Point p)
2446 {
2447 if ((!mustBeWalkable || !p.cell.blocked) && (!los || Los.IsVisible(center, p)))
2448 {
2449 list.Add(p.Copy());
2450 }
2451 });
2452 return list;
2453 }
2454
2455 public List<Point> ListPointsInSquare(Point center, int radius, bool mustBeWalkable = true, bool los = true)
2456 {
2457 List<Point> list = new List<Point>();
2458 ForeachSquare(center.x, center.z, radius, delegate(Point p)
2459 {
2460 if ((!mustBeWalkable || !p.cell.blocked) && (!los || Los.IsVisible(center, p)))
2461 {
2462 list.Add(p.Copy());
2463 }
2464 });
2465 return list;
2466 }
2467
2468 public List<Point> ListPointsOnEdge(Point center, int destDist, bool mustBeWalkable = true, bool los = true)
2469 {
2470 List<Point> list = new List<Point>();
2471 ForeachSphere(center.x, center.z, destDist, delegate(Point p)
2472 {
2473 if (center.Distance(p) == destDist && (!mustBeWalkable || !p.cell.blocked) && (!los || Los.IsVisible(center, p)))
2474 {
2475 list.Add(p.Copy());
2476 }
2477 });
2478 return list;
2479 }
2480
2481 public List<Chara> ListCharasInCircle(Point center, float radius, bool los = true)
2482 {
2483 List<Chara> list = new List<Chara>();
2484 foreach (Point item in ListPointsInCircle(center, radius, mustBeWalkable: false, los))
2485 {
2486 CellDetail detail = item.detail;
2487 if (detail == null || detail.charas.Count <= 0)
2488 {
2489 continue;
2490 }
2491 foreach (Chara chara in item.detail.charas)
2492 {
2493 list.Add(chara);
2494 }
2495 }
2496 return list;
2497 }
2498
2499 public List<Point> ListPointsInArc(Point center, Point to, int radius, float angle)
2500 {
2501 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));
2502 Point point = new Point(0, 0);
2503 List<Point> list = new List<Point>();
2504 float diff = point.GetAngle2(to2);
2505 ForeachSphere(center.x, center.z, radius, delegate(Point p)
2506 {
2507 float angle2 = center.GetAngle2(p);
2508 if ((Mathf.Abs(diff - angle2) < angle || Mathf.Abs(diff - angle2 + 360f) < angle || Mathf.Abs(360f - diff + angle2) < angle) && Los.IsVisible(center, p) && !p.IsBlocked)
2509 {
2510 list.Add(p.Copy());
2511 }
2512 });
2513 return list;
2514 }
2515
2516 public List<Point> ListPointsInLine(Point center, Point to, int radius, bool returnOnBlocked = true)
2517 {
2518 return Los.ListVisible(center, to, radius, null, returnOnBlocked);
2519 }
2520
2521 public void SetBounds(int size)
2522 {
2523 if (size > Size / 2 + 1)
2524 {
2525 size = Size / 2 - 1;
2526 }
2527 bounds.SetBounds(Size / 2 - size, Size / 2 - size, Size / 2 + size, Size / 2 + size);
2528 }
2529
2530 public void SetBounds(MapBounds b)
2531 {
2532 bounds.SetBounds(b.x, b.z, b.maxX, b.maxZ);
2533 bounds.Size = b.Size;
2534 }
2535
2536 public new void ForeachCell(Action<Cell> action)
2537 {
2538 for (int i = 0; i < Size; i++)
2539 {
2540 for (int j = 0; j < Size; j++)
2541 {
2542 action(cells[i, j]);
2543 }
2544 }
2545 }
2546
2547 public new void ForeachPoint(Action<Point> action)
2548 {
2549 Point point = new Point();
2550 for (int i = 0; i < Size; i++)
2551 {
2552 for (int j = 0; j < Size; j++)
2553 {
2554 action(point.Set(i, j));
2555 }
2556 }
2557 }
2558
2559 public new void ForeachXYZ(Action<int, int> action)
2560 {
2561 for (int i = 0; i < Size; i++)
2562 {
2563 for (int j = 0; j < Size; j++)
2564 {
2565 action(i, j);
2566 }
2567 }
2568 }
2569
2570 public void ForeachSphere(int _x, int _z, float r, Action<Point> action)
2571 {
2572 Point point = new Point();
2573 int num = (int)Mathf.Ceil(r);
2574 for (int i = _x - num; i < _x + num + 1; i++)
2575 {
2576 if (i < 0 || i >= Size)
2577 {
2578 continue;
2579 }
2580 for (int j = _z - num; j < _z + num + 1; j++)
2581 {
2582 if (j >= 0 && j < Size && (float)((i - _x) * (i - _x) + (j - _z) * (j - _z)) < r * r)
2583 {
2584 point.Set(i, j);
2585 action(point);
2586 }
2587 }
2588 }
2589 }
2590
2591 public void ForeachSquare(int _x, int _z, int r, Action<Point> action)
2592 {
2593 Point point = new Point();
2594 for (int i = _x - r; i < _x + r + 1; i++)
2595 {
2596 if (i < 0 || i >= Size)
2597 {
2598 continue;
2599 }
2600 for (int j = _z - r; j < _z + r + 1; j++)
2601 {
2602 if (j >= 0 && j < Size)
2603 {
2604 point.Set(i, j);
2605 action(point);
2606 }
2607 }
2608 }
2609 }
2610
2611 public void ForeachNeighbor(Point center, Action<Point> action)
2612 {
2613 int num = center.x;
2614 int num2 = center.z;
2615 Point point = new Point();
2616 for (int i = num - 1; i < num + 2; i++)
2617 {
2618 if (i < 0 || i >= Size)
2619 {
2620 continue;
2621 }
2622 for (int j = num2 - 1; j < num2 + 2; j++)
2623 {
2624 if (j >= 0 && j < Size)
2625 {
2626 point.Set(i, j);
2627 action(point);
2628 }
2629 }
2630 }
2631 }
2632
2633 public void Quake()
2634 {
2635 Point point = new Point();
2636 int num;
2637 for (num = 0; num < Size; num++)
2638 {
2639 int num2;
2640 for (num2 = 0; num2 < Size; num2++)
2641 {
2642 point.x = num;
2643 point.z = num2;
2644 point.Copy().Animate(AnimeID.Quake, animeBlock: true);
2645 num2 += EClass.rnd(2);
2646 }
2647 num += EClass.rnd(2);
2648 }
2649 }
2650
2651 public int CountChara(Faction faction)
2652 {
2653 int num = 0;
2654 foreach (Chara chara in charas)
2655 {
2656 if (chara.faction == faction)
2657 {
2658 num++;
2659 }
2660 }
2661 return num;
2662 }
2663
2664 public int CountGuest()
2665 {
2666 int num = 0;
2667 foreach (Chara chara in charas)
2668 {
2669 if (chara.IsGuest())
2670 {
2671 num++;
2672 }
2673 }
2674 return num;
2675 }
2676
2677 public int CountHostile()
2678 {
2679 int num = 0;
2680 foreach (Chara chara in charas)
2681 {
2682 if (!chara.IsPCFaction && chara.IsHostile())
2683 {
2684 num++;
2685 }
2686 }
2687 return num;
2688 }
2689
2690 public int CountWildAnimal()
2691 {
2692 int num = 0;
2693 foreach (Chara chara in charas)
2694 {
2695 if (!chara.IsPCFaction && chara.IsAnimal)
2696 {
2697 num++;
2698 }
2699 }
2700 return num;
2701 }
2702
2703 public int CountNonHostile()
2704 {
2705 int num = 0;
2706 foreach (Chara chara in charas)
2707 {
2708 if (!chara.IsPCFaction && !chara.IsHostile())
2709 {
2710 num++;
2711 }
2712 }
2713 return num;
2714 }
2715
2716 public List<Chara> ListChara(Faction faction)
2717 {
2718 List<Chara> list = new List<Chara>();
2719 foreach (Chara chara in charas)
2720 {
2721 if (chara.faction == faction)
2722 {
2723 list.Add(chara);
2724 }
2725 }
2726 return list;
2727 }
2728
2729 public List<Thing> ListThing<T>() where T : Trait
2730 {
2731 List<Thing> list = new List<Thing>();
2732 foreach (Thing thing in things)
2733 {
2734 if (thing.IsInstalled && thing.trait is T)
2735 {
2736 list.Add(thing);
2737 }
2738 }
2739 return list;
2740 }
2741
2742 public bool PutAway(Card c)
2743 {
2745 {
2746 return false;
2747 }
2748 if (c.isChara)
2749 {
2751 {
2752 return false;
2753 }
2754 c.Destroy();
2755 return true;
2756 }
2757 Thing thing = c.Thing;
2758 if (thing.parent != null)
2759 {
2760 thing.parent.RemoveCard(thing);
2761 }
2762 thing.isMasked = false;
2763 thing.isRoofItem = false;
2764 if (EClass._zone.IsPCFaction && EClass._map.props.installed.traits.GetRandomThing<TraitSpotStockpile>() != null)
2765 {
2766 EClass._zone.TryAddThingInSpot<TraitSpotStockpile>(thing);
2767 return true;
2768 }
2769 if (EClass.debug.enable)
2770 {
2772 return true;
2773 }
2774 EClass.pc.Pick(thing, msg: false);
2775 return true;
2776 }
2777
2778 public Chara FindChara(string id)
2779 {
2780 foreach (Chara chara in charas)
2781 {
2782 if (chara.id == id)
2783 {
2784 return chara;
2785 }
2786 }
2787 return null;
2788 }
2789
2790 public Chara FindChara(int uid)
2791 {
2792 foreach (Chara chara in charas)
2793 {
2794 if (chara.uid == uid)
2795 {
2796 return chara;
2797 }
2798 }
2799 return null;
2800 }
2801
2802 public Thing FindThing(Func<Thing, bool> func)
2803 {
2804 foreach (Thing thing in things)
2805 {
2806 if (func(thing))
2807 {
2808 return thing;
2809 }
2810 }
2811 return null;
2812 }
2813
2814 public Thing FindThing(int uid)
2815 {
2816 foreach (Thing thing in things)
2817 {
2818 if (thing.uid == uid)
2819 {
2820 return thing;
2821 }
2822 }
2823 return null;
2824 }
2825
2826 public T FindThing<T>() where T : Trait
2827 {
2828 foreach (Thing thing in things)
2829 {
2830 if (thing.trait is T)
2831 {
2832 return thing.trait as T;
2833 }
2834 }
2835 return null;
2836 }
2837
2838 public Thing FindThing(Type type, Chara c = null)
2839 {
2840 if (type == null)
2841 {
2842 return null;
2843 }
2844 _things.Clear();
2845 foreach (Thing thing in EClass._map.props.installed.things)
2846 {
2847 if (type.IsAssignableFrom(thing.trait.GetType()) && thing.pos.IsPublicSpace())
2848 {
2849 _things.Add(thing);
2850 }
2851 }
2852 if (_things.Count <= 0)
2853 {
2854 return null;
2855 }
2856 return _things.RandomItem();
2857 }
2858
2859 public Thing FindThing(Type type, BaseArea area1, BaseArea area2 = null)
2860 {
2861 if (type == null || (area1 == null && area2 == null))
2862 {
2863 return null;
2864 }
2865 Thing thing = Find(area1);
2866 if (thing == null && area2 != null)
2867 {
2868 thing = Find(area2);
2869 }
2870 return thing;
2871 Thing Find(BaseArea a)
2872 {
2873 _things.Clear();
2874 foreach (Thing thing2 in EClass._map.props.installed.things)
2875 {
2876 if (type.IsAssignableFrom(thing2.trait.GetType()) && thing2.pos.HasRoomOrArea(a))
2877 {
2878 _things.Add(thing2);
2879 }
2880 }
2881 if (_things.Count <= 0)
2882 {
2883 return null;
2884 }
2885 return _things.RandomItem();
2886 }
2887 }
2888
2889 public Thing FindThing(string workTag, BaseArea area1 = null, BaseArea area2 = null)
2890 {
2891 if (area1 == null && area2 == null)
2892 {
2893 return null;
2894 }
2895 Thing thing = null;
2896 PropSet orCreate = EClass._map.Installed.workMap.GetOrCreate(workTag);
2897 if (area1 != null)
2898 {
2899 IEnumerable<Card> enumerable = orCreate.Where((Card a) => a.pos.HasRoomOrArea(area1));
2900 if (enumerable.Count() > 0)
2901 {
2902 thing = enumerable.RandomItem() as Thing;
2903 }
2904 }
2905 if (thing == null && area2 != null)
2906 {
2907 IEnumerable<Card> enumerable2 = orCreate.Where((Card a) => a.pos.HasRoomOrArea(area2));
2908 if (enumerable2.Count() > 0)
2909 {
2910 thing = enumerable2.RandomItem() as Thing;
2911 }
2912 }
2913 return thing;
2914 }
2915
2916 public Thing FindThing(string workTag, Chara c)
2917 {
2918 Thing result = null;
2919 IEnumerable<Card> enumerable = from a in EClass._map.Installed.workMap.GetOrCreate(workTag)
2920 where a.pos.IsPublicSpace()
2921 select a;
2922 if (enumerable.Count() > 0)
2923 {
2924 result = enumerable.RandomItem() as Thing;
2925 }
2926 return result;
2927 }
2928
2930 {
2931 return (from a in ((IEnumerable<BaseArea>)rooms.listArea).Concat((IEnumerable<BaseArea>)rooms.listRoom)
2932 where a.type.IsPublicArea
2933 select a).RandomItem();
2934 }
2935
2936 public void RefreshSunMap()
2937 {
2938 if (!isDirtySunMap)
2939 {
2940 return;
2941 }
2942 sunMap.Clear();
2943 foreach (Card sun in EClass._map.props.installed.traits.suns)
2944 {
2945 foreach (Point item in sun.trait.ListPoints(null, onlyPassable: false))
2946 {
2947 sunMap.Add(item.index);
2948 }
2949 }
2950 isDirtySunMap = false;
2951 }
2952}
AnimeID
Definition: AnimeID.cs:2
CTAG
Definition: CTAG.cs:2
@ seed
static bool not(DramaManager dm, Dictionary< string, string > line, params string[] parameters)
EditorTag
Definition: EditorTag.cs:2
HitResult
Definition: HitResult.cs:2
PlaceState
Definition: PlaceState.cs:2
Rarity
Definition: Rarity.cs:2
int itemLost
Definition: AM_Adv.cs:110
override bool IsRoofEditMode(Card c=null)
Definition: AM_Mine.cs:19
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static AM_Copy Copy
Definition: ActionMode.cs:45
bool IsActive
Definition: ActionMode.cs:121
virtual bool IsBuildMode
Definition: ActionMode.cs:181
static AM_Mine Mine
Definition: ActionMode.cs:33
static AM_Adv Adv
Definition: ActionMode.cs:15
static int indexTree
Definition: BackerContent.cs:3
static int indexRemain
Definition: BackerContent.cs:5
Version version
Definition: BaseCore.cs:17
static BaseCore Instance
Definition: BaseCore.cs:11
void KillActor()
Definition: Card.cs:11
bool isDestroyed
Definition: Card.cs:78
Thing TryMakeRandomItem(int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
Definition: Card.cs:5774
bool IsPCFactionOrMinion
Definition: Card.cs:2354
virtual bool IsMultisize
Definition: Card.cs:2224
virtual bool isThing
Definition: Card.cs:2145
virtual Chara Chara
Definition: Card.cs:2134
Thing Split(int a)
Definition: Card.cs:3677
bool IsAgent
Definition: Card.cs:2315
void SetPlaceState(PlaceState newState, bool byPlayer=false)
Definition: Card.cs:3940
ElementContainerCard elements
Definition: Card.cs:42
string id
Definition: Card.cs:36
virtual void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Card.cs:5261
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3229
string c_altName
Definition: Card.cs:1645
virtual bool IsPCParty
Definition: Card.cs:2215
void CalculateFOV()
Definition: Card.cs:7000
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3292
string Name
Definition: Card.cs:2203
ICardParent parent
Definition: Card.cs:56
void Kick(Point p, bool ignoreSelf=false, bool checkWall=true)
Definition: Card.cs:6331
Thing SetNum(int a)
Definition: Card.cs:3688
void ForeachPoint(Action< Point, bool > action)
Definition: Card.cs:8433
bool IsFood
Definition: Card.cs:2241
Point pos
Definition: Card.cs:60
void ClearFOV()
Definition: Card.cs:7090
int uid
Definition: Card.cs:125
Trait trait
Definition: Card.cs:54
void ModCharge(int a, bool destroy=false)
Definition: Card.cs:4143
void Destroy()
Definition: Card.cs:5330
bool HasEditorTag(EditorTag tag)
Definition: Card.cs:2745
ThingContainer things
Definition: Card.cs:39
bool IsInstalled
Definition: Card.cs:2463
virtual bool IsPC
Definition: Card.cs:2209
virtual bool isChara
Definition: Card.cs:2147
virtual Thing Thing
Definition: Card.cs:2122
Card GetRootCard()
Definition: Card.cs:3619
int Evalue(int ele)
Definition: Card.cs:2716
virtual bool IsPCFaction
Definition: Card.cs:2351
Cell Cell
Definition: Card.cs:2119
bool isPlayerCreation
Definition: Card.cs:497
Card parentCard
Definition: Card.cs:106
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:3269
int Num
Definition: Card.cs:161
SourceCategory.Row category
Definition: Card.cs:2113
Point lastPos
Definition: Card.cs:62
int c_charges
Definition: Card.cs:1321
CardRenderer renderer
Definition: Card.cs:64
List< Thing > things
Definition: CellDetail.cs:11
List< Chara > charas
Definition: CellDetail.cs:13
Footmark footmark
Definition: CellDetail.cs:17
int amount
Definition: CellEffect.cs:26
int FireAmount
Definition: CellEffect.cs:162
bool IsFire
Definition: CellEffect.cs:147
Definition: Cell.cs:7
int _bridgeMat
Definition: Cell.cs:56
bool CanHarvest()
Definition: Cell.cs:1736
Room room
Definition: Cell.cs:122
void RemoveCard(Card c)
Definition: Cell.cs:1638
SourceBlock.Row sourceBlock
Definition: Cell.cs:1090
bool IsSnowTile
Definition: Cell.cs:818
int _floor
Definition: Cell.cs:46
bool HasBlock
Definition: Cell.cs:679
bool CanBuildRamp(int dir)
Definition: Cell.cs:1183
SourceFloor.Row sourceFloor
Definition: Cell.cs:1092
CellEffect effect
Definition: Cell.cs:114
Cell Back
Definition: Cell.cs:175
bool HasStairs
Definition: Cell.cs:891
bool toggleOcclusion
Definition: Cell.cs:666
byte decal
Definition: Cell.cs:70
int obj
Definition: Cell.cs:50
int objMat
Definition: Cell.cs:52
bool HasBridge
Definition: Cell.cs:707
Point GetSharedPoint()
Definition: Cell.cs:1146
bool isHarvested
Definition: Cell.cs:342
bool IsTopWaterAndNoSnow
Definition: Cell.cs:748
bool isClearSnow
Definition: Cell.cs:462
Cell Front
Definition: Cell.cs:151
SourceMaterial.Row matObj
Definition: Cell.cs:1074
CellDetail GetOrCreateDetail()
Definition: Cell.cs:1605
int _roofBlock
Definition: Cell.cs:58
byte objVal
Definition: Cell.cs:68
void Refresh()
Definition: Cell.cs:1192
void Reset()
Definition: Cell.cs:1597
int bridgePillar
Definition: Cell.cs:74
bool isModified
Definition: Cell.cs:450
int _floorMat
Definition: Cell.cs:48
bool IsTopWater
Definition: Cell.cs:736
byte height
Definition: Cell.cs:94
GrowSystem growth
Definition: Cell.cs:247
bool isWatered
Definition: Cell.cs:354
CellDetail detail
Definition: Cell.cs:112
int _roofBlockMat
Definition: Cell.cs:60
byte _roofBlockDir
Definition: Cell.cs:72
bool HasFloodBlock
Definition: Cell.cs:1053
bool isToggleWallPillar
Definition: Cell.cs:570
byte z
Definition: Cell.cs:78
Cell Left
Definition: Cell.cs:187
bool isSeen
Definition: Cell.cs:294
void AddCard(Card c)
Definition: Cell.cs:1622
bool hidePillar
Definition: Cell.cs:654
SourceObj.Row sourceObj
Definition: Cell.cs:1112
int _decoMat
Definition: Cell.cs:64
Cell BackLeft
Definition: Cell.cs:235
string GetObjName()
Definition: Cell.cs:1676
bool isForceFloat
Definition: Cell.cs:318
int _blockMat
Definition: Cell.cs:44
byte x
Definition: Cell.cs:76
Point GetPoint()
Definition: Cell.cs:1141
bool impassable
Definition: Cell.cs:414
static Cell Void
Definition: Cell.cs:10
bool HasObj
Definition: Cell.cs:677
Cell Right
Definition: Cell.cs:163
bool crossWall
Definition: Cell.cs:642
bool isObjDyed
Definition: Cell.cs:630
bool HasRamp
Definition: Cell.cs:873
byte bridgeHeight
Definition: Cell.cs:96
int index
Definition: Cell.cs:136
bool hasDoor
Definition: Cell.cs:279
int blockDir
Definition: Cell.cs:934
byte _dirs
Definition: Cell.cs:66
int _bridge
Definition: Cell.cs:54
bool HasFullBlock
Definition: Cell.cs:853
bool IsVoid
Definition: Cell.cs:995
SourceMaterial.Row matObj_fixed
Definition: Cell.cs:1077
Cell FrontRight
Definition: Cell.cs:199
int _deco
Definition: Cell.cs:62
int _block
Definition: Cell.cs:42
Definition: Chara.cs:10
new TraitChara trait
Definition: Chara.cs:511
Faction faction
Definition: Chara.cs:433
override bool IsPC
Definition: Chara.cs:632
override bool IsGlobal
Definition: Chara.cs:630
Point orgPos
Definition: Chara.cs:23
bool IsAnimal
Definition: Chara.cs:923
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4632
override bool IsPCFaction
Definition: Chara.cs:691
bool IsGuest()
Definition: Chara.cs:7093
bool IsHostile()
Definition: Chara.cs:7002
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4652
Definition: ConWet.cs:2
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:578
new GameConfig game
Definition: CoreConfig.cs:629
bool enable
Definition: CoreDebug.cs:302
bool godBuild
Definition: CoreDebug.cs:320
Thing GetOrCreateDebugContainer()
Definition: CoreDebug.cs:794
bool ignoreBuildRule
Definition: CoreDebug.cs:201
CoreConfig config
Definition: Core.cs:70
static void MakeDish(Thing food, int lv, Chara crafter=null, int seed=-1)
Definition: CraftUtil.cs:62
static void RebuildCritter(Cell cell)
Definition: Critter.cs:93
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
static Scene scene
Definition: EClass.cs:31
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static SourceManager sources
Definition: EClass.cs:43
static FactionBranch Branch
Definition: EClass.cs:23
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
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
Element ModBase(int ele, int v)
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1163
bool HasItemProtection
Point pos
Definition: Footmark.cs:3
static FowProfile Load(string id)
Definition: FowProfile.cs:9
Definition: GameIO.cs:11
static void SaveFile(string path, object obj)
Definition: GameIO.cs:278
bool disableUsermapBenefit
Definition: Game.cs:9
SurvivalManager survival
Definition: Game.cs:228
static void Load(string id, bool cloud)
Definition: Game.cs:322
GamePrincipal principal
Definition: Game.cs:225
static string id
Definition: Game.cs:148
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1116
bool IsSurvival
Definition: Game.cs:276
void PopMineObj(Chara c=null)
Definition: GrowSystem.cs:552
virtual bool IsMature
Definition: GrowSystem.cs:117
virtual void OnSetObj()
Definition: GrowSystem.cs:288
virtual bool IsTree
Definition: GrowSystem.cs:101
Compression
Definition: IO.cs:12
LogicalPoint GetOrCreate(Point point)
Definition: Los.cs:5
static List< Point > ListVisible(Point p1, Point p2, int radius, Action< Point, bool > _onVisit=null, bool returnOnBlocked=true)
Definition: Los.cs:90
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167
static SourceMaterial.Row GetRandomMaterialFromCategory(int lv, string cat, SourceMaterial.Row fallback)
Definition: MATERIAL.cs:93
int Size
Definition: MapBounds.cs:20
int maxZ
Definition: MapBounds.cs:17
void SetBounds(int _x, int _z, int _maxX, int _maxZ)
Definition: MapBounds.cs:30
int maxX
Definition: MapBounds.cs:14
void ForeachCell(Action< Cell > action)
Definition: MapBounds.cs:279
int x
Definition: MapBounds.cs:8
Point GetCenterPos()
Definition: MapBounds.cs:52
string idSceneProfile
Definition: MapConfig.cs:8
bool indoor
Definition: MapConfig.cs:29
string idFowProfile
Definition: MapConfig.cs:11
Definition: Map.cs:13
bool IsIndoor
Definition: Map.cs:139
new void ForeachXYZ(Action< int, int > action)
Definition: Map.cs:2559
List< int > _plNight
Definition: Map.cs:64
new void ForeachCell(Action< Cell > action)
Definition: Map.cs:2536
void TrySmoothPick(Point p, Thing t, Chara c)
Definition: Map.cs:1973
Thing FindThing(Type type, BaseArea area1, BaseArea area2=null)
Definition: Map.cs:2859
void ResetEditorPos()
Definition: Map.cs:365
void RefreshNeighborTiles(int x, int z)
Definition: Map.cs:2283
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2802
bool isGenerated
Definition: Map.cs:137
Cell GetCell(int index)
Definition: Map.cs:1003
PlantData TryGetPlant(Point p)
Definition: Map.cs:2106
void ForeachSphere(int _x, int _z, float r, Action< Point > action)
Definition: Map.cs:2570
Dictionary< int, int > gatherCounts
Definition: Map.cs:67
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:1111
BitArray32 bits
Definition: Map.cs:81
static readonly int[] CellIdWidths
Definition: Map.cs:109
void Shift(Vector2Int offset)
Definition: Map.cs:262
Thing FindThing(Type type, Chara c=null)
Definition: Map.cs:2838
void ExportMetaData(string _path, string id, PartialMap partial=null)
Definition: Map.cs:835
Chara FindChara(string id)
Definition: Map.cs:2778
IEnumerable< Card > Cards
Definition: Map.cs:143
void RefreshSunMap()
Definition: Map.cs:2936
int[] ReadCellIds(string file, string s, int size, int width)
Definition: Map.cs:621
void RefreshSingleTile(int x, int z)
Definition: Map.cs:2267
Point GetRandomPoint(Point center, int radius, int tries=100, bool mustBeWalkable=true, bool requireLos=true)
Definition: Map.cs:2379
void RemovePlant(Point pos)
Definition: Map.cs:2126
BaseArea FindPublicArea()
Definition: Map.cs:2929
static void UpdateMetaData(string pathZip, PartialMap partial=null)
Definition: Map.cs:880
void DestroyObj(Point point)
Definition: Map.cs:1989
void Save(string path, ZoneExportData export=null, PartialMap partial=null)
Definition: Map.cs:384
void Reset()
Definition: Map.cs:353
int SizeXZ
Definition: Map.cs:141
PropsInstalled Installed
Definition: Map.cs:131
void TrySmoothPick(Cell cell, Thing t, Chara c)
Definition: Map.cs:1968
Dictionary< string, int > cellWidths
Definition: Map.cs:28
void AddCardOnActivate(Card c)
Definition: Map.cs:898
Thing FindThing(int uid)
Definition: Map.cs:2814
Dictionary< int, CellEffect > cellEffects
Definition: Map.cs:70
void RefreshFOV(int x, int z, int radius=6, bool recalculate=false)
Definition: Map.cs:1045
List< Point > ListPointsInArc(Point center, Point to, int radius, float angle)
Definition: Map.cs:2499
HashSet< int > roomHash
Definition: Map.cs:113
int CountNonHostile()
Definition: Map.cs:2703
void MoveCard(Point p, Card t)
Definition: Map.cs:956
Thing FindThing(string workTag, Chara c)
Definition: Map.cs:2916
void AddBackerTree(bool draw)
Definition: Map.cs:1740
void Reveal(Point center, int power=100)
Definition: Map.cs:1034
FloodSpiller flood
Definition: Map.cs:99
void SetBlockDir(int x, int z, int dir)
Definition: Map.cs:1305
void SetBounds(int size)
Definition: Map.cs:2521
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:2004
void OnDeactivate()
Definition: Map.cs:213
void SetLiquid(int x, int z, CellEffect effect=null)
Definition: Map.cs:1641
void OnCardRemovedFromZone(Card t)
Definition: Map.cs:940
void SetZone(Zone _zone)
Definition: Map.cs:189
Point GetNearbyResourcePoint(Point center)
Definition: Map.cs:2422
void SetDecal(int x, int z, int id=0, int amount=1, bool refresh=true)
Definition: Map.cs:2215
PropsRoaming Roaming
Definition: Map.cs:133
PlantData TryGetPlant(Cell c)
Definition: Map.cs:2111
int CountChara(Faction faction)
Definition: Map.cs:2651
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1832
bool revealed
Definition: Map.cs:111
List< Chara > ListCharasInCircle(Point center, float radius, bool los=true)
Definition: Map.cs:2481
int CountHostile()
Definition: Map.cs:2677
void SetFloor(int x, int z, int idMat, int idFloor, int dir)
Definition: Map.cs:1092
List< Thing > things
Definition: Map.cs:55
void OnDeserialized(StreamingContext context)
Definition: Map.cs:156
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2224
void RefreshFOVAll()
Definition: Map.cs:1079
byte[] TryLoadFile(string path, string s, int size)
Definition: Map.cs:567
void _ValidateInstalled(int x, int y)
Definition: Map.cs:2140
int GetRampDir(int x, int z, TileType blockType=null)
Definition: Map.cs:2317
Dictionary< int, int > backerObjs
Definition: Map.cs:73
int CountGuest()
Definition: Map.cs:2664
List< int > _plDay
Definition: Map.cs:61
Playlist plDay
Definition: Map.cs:83
int AngleToIndex(int a)
Definition: Map.cs:2238
CustomData custom
Definition: Map.cs:43
List< Chara > deadCharas
Definition: Map.cs:49
void ModFire(int x, int z, int amount)
Definition: Map.cs:1312
void SetDeco(int x, int z, int idMat, int idDeco)
Definition: Map.cs:1103
void _AddCard(int x, int z, Card t, bool onAddToZone)
Definition: Map.cs:961
List< Chara > deadCharasShort
Definition: Map.cs:52
void Burn(int x, int z, bool instant=false)
Definition: Map.cs:1573
void MineObjSound(Point point)
Definition: Map.cs:2101
void OnSerializing(StreamingContext context)
Definition: Map.cs:146
void SetSeen(int x, int z, bool seen=true, bool refresh=true)
Definition: Map.cs:1008
PropsManager props
Definition: Map.cs:97
void ModLiquid(int x, int z, int amount)
Definition: Map.cs:1677
void MineFloor(Point point, Chara c=null, bool recoverBlock=false, bool removePlatform=true)
Definition: Map.cs:1916
void SetFloor(int x, int z, int idMat=0, int idFloor=0)
Definition: Map.cs:1087
void SetBounds(MapBounds b)
Definition: Map.cs:2530
void TryShatter(Point pos, int ele, int power, Card CC=null)
Definition: Map.cs:1340
int seed
Definition: Map.cs:19
void SetBlock(int x, int z, int idMat=0, int idBlock=0)
Definition: Map.cs:1136
PlantData AddPlant(Point pos, Thing seed)
Definition: Map.cs:2116
RoomManager rooms
Definition: Map.cs:34
bool PutAway(Card c)
Definition: Map.cs:2742
void ForeachSquare(int _x, int _z, int r, Action< Point > action)
Definition: Map.cs:2591
void TryRemoveRoom(int x, int z)
Definition: Map.cs:1212
void SetReference()
Definition: Map.cs:203
BiomeProfile[,] biomes
Definition: Map.cs:101
List< Footmark > footmarks
Definition: Map.cs:105
POIMap poiMap
Definition: Map.cs:103
void SetRoofBlock(int x, int z, int idMat, int idBlock, int dir, int height)
Definition: Map.cs:1127
void ClearRainAndDecal()
Definition: Map.cs:1690
void Reload()
Definition: Map.cs:318
new Point GetRandomEdge(int r=3)
Definition: Map.cs:2397
void OnLoad()
Definition: Map.cs:823
void OnImport(ZoneExportData data)
Definition: Map.cs:829
List< Point > ListPointsInSquare(Point center, int radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2455
int CountWildAnimal()
Definition: Map.cs:2690
new void ForeachPoint(Action< Point > action)
Definition: Map.cs:2547
void TryAddRoom(int x, int z)
Definition: Map.cs:1224
void DestroyBlock(int x, int z)
Definition: Map.cs:2188
void QuickRefreshTile(int x, int z)
Definition: Map.cs:2302
List< Chara > serializedCharas
Definition: Map.cs:46
float sizeModifier
Definition: Map.cs:135
Cell[,] cells
Definition: Map.cs:91
static bool isDirtySunMap
Definition: Map.cs:16
static MapMetaData GetMetaData(string pathZip)
Definition: Map.cs:853
virtual void OnSerializing()
Definition: Map.cs:151
List< Thing > _things
Definition: Map.cs:115
void _RemoveCard(Card t)
Definition: Map.cs:987
Zone zone
Definition: Map.cs:93
static int WriteCellIds(string path, int[] ids, IO.Compression compression)
Definition: Map.cs:587
void RemoveLonelyRamps(Cell cell)
Definition: Map.cs:2174
void SetBlock(int x, int z, int idMat, int idBlock, int dir)
Definition: Map.cs:1141
int _bits
Definition: Map.cs:22
void SetLiquid(int x, int z, int id, int value=1)
Definition: Map.cs:1650
TaskManager tasks
Definition: Map.cs:37
void ValidateInstalled(Point p)
Definition: Map.cs:2131
void DropBlockComponent(Point point, TileRow r, SourceMaterial.Row mat, bool recoverBlock, bool isPlatform=false, Chara c=null)
Definition: Map.cs:1791
MapExportSetting exportSetting
Definition: Map.cs:79
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1672
void OnCardAddedToZone(Card t, int x, int z)
Definition: Map.cs:921
Version version
Definition: Map.cs:31
Thing FindThing(string workTag, BaseArea area1=null, BaseArea area2=null)
Definition: Map.cs:2889
FowProfile fowProfile
Definition: Map.cs:107
void ForeachNeighbor(Point center, Action< Point > action)
Definition: Map.cs:2611
bool isBreakerDown
Definition: Map.cs:118
MapConfig config
Definition: Map.cs:40
void OnSetBlockOrDoor(int x, int z)
Definition: Map.cs:1164
void Load(string path, bool import=false, PartialMap partial=null)
Definition: Map.cs:644
Chara FindChara(int uid)
Definition: Map.cs:2790
Playlist plNight
Definition: Map.cs:85
CellEffectManager effectManager
Definition: Map.cs:95
void ReloadRoom()
Definition: Map.cs:333
List< Point > ListPointsOnEdge(Point center, int destDist, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2468
List< Point > ListPointsInLine(Point center, Point to, int radius, bool returnOnBlocked=true)
Definition: Map.cs:2516
Cell GetDependedRamp(Cell cell)
Definition: Map.cs:2354
PropsStocked Stocked
Definition: Map.cs:129
void MineRamp(Point point, int ramp, bool recoverBlock=false)
Definition: Map.cs:1899
void ValidateVersion()
Definition: Map.cs:818
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2442
void CreateNew(int size, bool setReference=true)
Definition: Map.cs:161
List< Chara > charas
Definition: Map.cs:87
void AddDecal(int x, int z, int id, int amount=1, bool refresh=true)
Definition: Map.cs:2193
void RevealAll(bool reveal=true)
Definition: Map.cs:1021
IO.Compression compression
Definition: Map.cs:25
void SetObj(int x, int z, int idMat, int idObj, int value, int dir, bool ignoreRandomMat=false)
Definition: Map.cs:1704
void Resize(int newSize)
Definition: Map.cs:234
Dictionary< int, PlantData > plants
Definition: Map.cs:76
void RefreshAllTiles()
Definition: Map.cs:2272
void Quake()
Definition: Map.cs:2633
List< Chara > ListChara(Faction faction)
Definition: Map.cs:2716
List< TransAnime > pointAnimes
Definition: Map.cs:89
void RefreshShadow(int x, int z)
Definition: Map.cs:1964
void ApplyBackerObj(Point p, int id=-1)
Definition: Map.cs:1765
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
Definition: Map.cs:1699
SourceBacker.Row GetBackerObj(Point p)
Definition: Map.cs:1756
static string CellIdPath(string path, int width)
Definition: Map.cs:578
static HashSet< int > sunMap
Definition: Map.cs:14
MapBounds bounds
Definition: Map.cs:58
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: NoGoal.cs:4
Definition: POIMap.cs:4
IPathfinder pathfinder
Definition: PathManager.cs:24
static PathManager Instance
Definition: PathManager.cs:16
HashSet< int > doneBackers
Definition: Player.cs:1152
void ClearMapHighlights()
Definition: Player.cs:2553
Definition: Point.cs:9
static Point shared
Definition: Point.cs:20
SourceMaterial.Row matBlock
Definition: Point.cs:51
SourceMaterial.Row matFloor
Definition: Point.cs:53
int index
Definition: Point.cs:45
static Point Invalid
Definition: Point.cs:28
bool HasBridge
Definition: Point.cs:217
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1053
Point Copy()
Definition: Point.cs:487
bool IsSky
Definition: Point.cs:220
Point Set(int _x, int _z)
Definition: Point.cs:499
CellDetail detail
Definition: Point.cs:67
bool IsBlocked
Definition: Point.cs:359
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
SourceMaterial.Row matBridge
Definition: Point.cs:55
void SetFloor(int idMat=0, int idFloor=0)
Definition: Point.cs:925
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1255
SourceObj.Row sourceObj
Definition: Point.cs:65
bool Equals(int _x, int _z)
Definition: Point.cs:962
SourceFloor.Row sourceFloor
Definition: Point.cs:61
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:920
bool IsValid
Definition: Point.cs:84
bool HasObj
Definition: Point.cs:133
bool HasRoomOrArea(BaseArea a)
Definition: Point.cs:417
Area area
Definition: Point.cs:69
bool HasFloor
Definition: Point.cs:215
int Distance(Point p)
Definition: Point.cs:991
Point Clamp(bool useBounds=false)
Definition: Point.cs:1010
bool IsInBounds
Definition: Point.cs:100
Cell cell
Definition: Point.cs:47
float GetAngle2(Point to)
Definition: Point.cs:614
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1304
SourceFloor.Row sourceBridge
Definition: Point.cs:63
bool IsPublicSpace()
Definition: Point.cs:445
PropsInstalled installed
Definition: PropsManager.cs:8
PropsRoaming roaming
Definition: PropsManager.cs:10
void OnCardAddedToZone(Card c)
Definition: PropsManager.cs:25
PropsStocked stocked
Definition: PropsManager.cs:6
TraitManager traits
Definition: Props.cs:18
List< Thing > things
Definition: Props.cs:20
Dictionary< string, PropSet > workMap
Definition: Props.cs:16
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:44
static void BuildList()
static List< RecipeSource > list
static RecipeSource Get(string id)
RenderRow row
Definition: RecipeSource.cs:5
string GetIDIngredient()
string[] tag
Definition: RenderRow.cs:58
virtual string RecipeID
Definition: RenderRow.cs:108
TileType tileType
Definition: RenderRow.cs:77
string[] components
Definition: RenderRow.cs:52
Room AddRoom(Room r)
Definition: RoomManager.cs:110
void RefreshAll()
Definition: RoomManager.cs:43
void RemoveRoom(Room r)
Definition: RoomManager.cs:119
List< Room > listRoom
Definition: RoomManager.cs:13
List< Area > listArea
Definition: RoomManager.cs:10
void OnLoad()
Definition: RoomManager.cs:26
Definition: Room.cs:4
void SetDirty()
Definition: Room.cs:210
static SceneProfile Load(string id)
Definition: SceneProfile.cs:18
Definition: Scene.cs:8
ActionMode actionMode
Definition: Scene.cs:79
void AddActorEx(Card c, Action< ActorEx > onBeforeSetOwner=null)
Definition: Scene.cs:1021
void Init(Mode newMode)
Definition: Scene.cs:178
Mode
Definition: Scene.cs:10
void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial=null)
List< Row > listRemain
List< Row > listTree
SourceMaterial materials
SourceObj objs
SourceBlock blocks
SourceBacker backers
SourceFloor floors
void AddBlood(Point p, int a=1)
string GetSoundDead(RenderRow c=null)
bool HasGrowth
Definition: SourceObj.cs:29
string matCategory
Definition: SourceObj.cs:24
virtual bool IsRegion
Definition: Spatial.cs:515
virtual string Name
Definition: Spatial.cs:509
bool OnMineWreck(Point point)
void OnLoad()
Definition: TaskManager.cs:66
Definition: Task.cs:4
static Thing CreateRawMaterial(SourceMaterial.Row m)
Definition: ThingGen.cs:68
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
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
int stackOrder
Definition: Thing.cs:13
string alias
Definition: TileRow.cs:13
int id
Definition: TileRow.cs:9
virtual bool IsBlockPass
Definition: TileType.cs:161
virtual bool IsUnique
Definition: TraitChara.cs:34
TraitMap suns
Definition: TraitManager.cs:14
static Thing MakeSeed(string idSource)
Definition: TraitSeed.cs:105
Definition: Trait.cs:7
virtual string IDActorEx
Definition: Trait.cs:187
virtual bool IsDoor
Definition: Trait.cs:58
virtual void OnAddedToZone()
Definition: Trait.cs:722
virtual bool CanCopyInBlueprint
Definition: Trait.cs:166
virtual void OnRemovedFromZone()
Definition: Trait.cs:726
virtual List< Point > ListPoints(Point center=null, bool onlyPassable=true, bool allowChara=true)
Definition: Trait.cs:870
virtual bool CanOnlyCarry
Definition: Trait.cs:305
static void UpdateMap(List< Cell > newPoints)
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
SerializedCards serializedCards
Definition: Zone.cs:12
void Revive()
Definition: Zone.cs:1221
virtual bool IsSkyLevel
Definition: Zone.cs:274
virtual bool DisableRooms
Definition: Zone.cs:126
virtual int MaxSoil
Definition: Zone.cs:523
virtual bool IsUserZone
Definition: Zone.cs:278
void RemoveCard(Card t)
Definition: Zone.cs:2202
override int DangerLv
Definition: Zone.cs:115
bool IsPCFaction
Definition: Zone.cs:480
virtual bool IsUnderwater
Definition: Zone.cs:276
int GetSoilCost()
Definition: Zone.cs:4053
Card AddCard(Card t, Point point)
Definition: Zone.cs:2162
void RemoveCard(Card c)
void Init(IPathfindGrid _grid, WeightCell[,] _weightMap, int size)
uint Bits
Definition: BitArray32.cs:6
bool IsBelow(int _major, int _minor, int _batch)
Definition: Version.cs:49
int GetInt()
Definition: Version.cs:39