Elin Decompiled Documentation EA 23.319 Nightly Patch 1
Loading...
Searching...
No Matches
Point.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using Newtonsoft.Json;
5using UnityEngine;
6
7[Serializable]
8public class Point : EClass
9{
10 public static readonly XY[] Surrounds = new XY[4]
11 {
12 new XY(0, -1),
13 new XY(1, 0),
14 new XY(0, 1),
15 new XY(-1, 0)
16 };
17
18 public static Vector3 fixedPos;
19
20 public static Point shared = new Point();
21
22 public static Point shared2 = new Point();
23
24 public static Point shared3 = new Point();
25
26 public static Map map;
27
28 public static Point Invalid = new Point
29 {
30 IsValid = false
31 };
32
33 public static Point Zero = new Point();
34
35 [JsonProperty]
36 public int x;
37
38 [JsonProperty]
39 public int z;
40
41 private Vector3 vCache;
42
43 public static BaseGameScreen _screen;
44
45 private static List<Card> listCard = new List<Card>();
46
47 private static List<Chara> listChara = new List<Chara>();
48
49 public int index => x + z * map.Size;
50
51 public Cell cell => map.cells[x, z];
52
54
56
58
60
62
64
66
68
70
72
73 public Area area => detail?.area;
74
75 public Point Front => new Point(x + 1, z - 1);
76
78
79 public int eloX => EClass.scene.elomap.minX + x;
80
81 public int eloY => EClass.scene.elomap.minY + z;
82
83 public bool HasDesignation => cell.detail?.designation != null;
84
85 public bool HasDirt => cell.decal != 0;
86
87 public bool IsValid
88 {
89 get
90 {
91 if (x >= 0 && z >= 0 && x < map.Size)
92 {
93 return z < map.Size;
94 }
95 return false;
96 }
97 set
98 {
99 x = ((!value) ? (-999) : 0);
100 }
101 }
102
103 public bool IsInBounds
104 {
105 get
106 {
107 if (x >= map.bounds.x && z >= map.bounds.z && x <= map.bounds.maxX)
108 {
109 return z <= map.bounds.maxZ;
110 }
111 return false;
112 }
113 }
114
115 public bool IsInBoundsPlus
116 {
117 get
118 {
119 if (x >= 0 && z >= 0 && x <= map.Size - 1)
120 {
121 return z <= map.Size - 1;
122 }
123 return false;
124 }
125 }
126
127 public bool IsFarmField => (HasBridge ? sourceBridge : sourceFloor).Category.id == "floor_field";
128
129 public bool IsWater => cell.IsTopWater;
130
131 public bool HasRamp => cell.HasRamp;
132
133 public bool HasRail => sourceObj.tag.Contains("rail");
134
136
137 public bool HasObj => cell.obj != 0;
138
139 public bool HasDecal => cell.decal != 0;
140
141 public bool HasBlock => cell._block != 0;
142
143 public bool HasMinableBlock
144 {
145 get
146 {
147 if (HasObj)
148 {
149 return sourceBlock.tileType.IsFullBlock;
150 }
151 return false;
152 }
153 }
154
156
157 public bool HasWall
158 {
159 get
160 {
161 if (cell._block != 0)
162 {
163 return cell.sourceBlock.tileType.IsWall;
164 }
165 return false;
166 }
167 }
168
169 public bool HasFence
170 {
171 get
172 {
173 if (cell._block != 0)
174 {
175 return cell.sourceBlock.tileType.IsFence;
176 }
177 return false;
178 }
179 }
180
181 public bool IsSunLit
182 {
183 get
184 {
186 {
187 return Map.sunMap.Contains(index);
188 }
189 return true;
190 }
191 }
192
193 public bool HasNonWallBlock
194 {
195 get
196 {
197 if (HasBlock)
198 {
199 return !cell.sourceBlock.tileType.IsWallOrFence;
200 }
201 return false;
202 }
203 }
204
205 public bool HasTaskBuild
206 {
207 get
208 {
209 if (cell.detail != null)
210 {
211 return cell.detail.designation is TaskBuild;
212 }
213 return false;
214 }
215 }
216
217 public bool HasBlockRecipe => (cell.detail?.designation as TaskBuild)?.isBlock ?? false;
218
219 public bool HasFloor => cell._floor != 0;
220
221 public bool HasBridge => cell._bridge != 0;
222
223 public bool IsSky
224 {
225 get
226 {
227 if (sourceFloor.tileType == TileType.Sky)
228 {
229 return !HasBridge;
230 }
231 return false;
232 }
233 }
234
235 public bool HasArea => detail?.area != null;
236
237 public bool HasChara
238 {
239 get
240 {
241 CellDetail cellDetail = detail;
242 if (cellDetail == null)
243 {
244 return false;
245 }
246 return cellDetail.charas.Count > 0;
247 }
248 }
249
250 public bool HasThing
251 {
252 get
253 {
254 CellDetail cellDetail = detail;
255 if (cellDetail == null)
256 {
257 return false;
258 }
259 return cellDetail.things.Count > 0;
260 }
261 }
262
264 {
265 get
266 {
267 if (detail != null)
268 {
269 return detail.charas.Count > 1;
270 }
271 return false;
272 }
273 }
274
275 public bool IsDeepWater
276 {
277 get
278 {
280 {
281 return sourceFloor.tileType.IsDeepWater;
282 }
283 return false;
284 }
285 }
286
288 {
289 get
290 {
291 CellDetail cellDetail = detail;
292 if (cellDetail == null || cellDetail.charas.Count <= 0)
293 {
294 return null;
295 }
296 return detail.charas[0];
297 }
298 }
299
301 {
302 get
303 {
304 CellDetail cellDetail = detail;
305 if (cellDetail == null || cellDetail.things.Count <= 0)
306 {
307 return null;
308 }
309 return detail.things[0];
310 }
311 }
312
314 {
315 get
316 {
317 CellDetail cellDetail = detail;
318 if (cellDetail == null || cellDetail.things.Count <= 0)
319 {
320 return null;
321 }
322 return detail.things.LastItem();
323 }
324 }
325
327 {
328 get
329 {
330 if (detail == null || detail.things.Count <= 0 || !detail.things[0].IsInstalled)
331 {
332 return null;
333 }
334 return detail.things[0];
335 }
336 }
337
338 public List<Thing> Things => cell.Things;
339
340 public List<Chara> Charas => cell.Charas;
341
342 public bool IsSeen => cell.isSeen;
343
344 public bool IsSync => cell.pcSync;
345
346 public bool IsHidden
347 {
348 get
349 {
350 if (cell.isSeen)
351 {
352 if (cell.room != null && !EClass.screen.tileMap.hideRoomFog && !cell.hasDoor)
353 {
354 return cell.HasRoof;
355 }
356 return false;
357 }
358 return true;
359 }
360 }
361
362 public bool IsBlocked
363 {
364 get
365 {
366 if (IsValid)
367 {
368 return cell.blocked;
369 }
370 return true;
371 }
372 }
373
374 public bool IsHotSpring
375 {
376 get
377 {
379 {
380 if (!EClass.debug.enable && !EClass._zone.elements.Has(3701))
381 {
382 return IsInSpot<TraitGeyser>();
383 }
384 return true;
385 }
386 return false;
387 }
388 }
389
390 public static Point GetShared(int x, int z)
391 {
392 shared.x = x;
393 shared.z = z;
394 return shared;
395 }
396
397 public bool Within(int _x, int _z, int _w, int _h)
398 {
399 if (x >= _x && z >= _z && x < _x + _w)
400 {
401 return z < _z + _h;
402 }
403 return false;
404 }
405
407 {
408 if (detail != null)
409 {
410 foreach (Chara chara in detail.charas)
411 {
412 if (EClass.pc.CanSee(chara))
413 {
414 return chara;
415 }
416 }
417 }
418 return null;
419 }
420
421 public bool HasRoomOrArea(BaseArea a)
422 {
423 if (area != a)
424 {
425 return cell.room == a;
426 }
427 return true;
428 }
429
430 public bool IsInSpot<T>() where T : Trait
431 {
432 foreach (Thing thing in EClass._map.things)
433 {
434 if (!(thing.trait is T) || thing.trait.radius == 0)
435 {
436 continue;
437 }
438 foreach (Point item in thing.trait.ListPoints())
439 {
440 if (Equals(item))
441 {
442 return true;
443 }
444 }
445 }
446 return false;
447 }
448
449 public bool IsPublicSpace()
450 {
451 if (area != null)
452 {
454 {
455 return true;
456 }
457 return false;
458 }
459 if (cell.room != null)
460 {
462 {
463 return true;
464 }
465 return false;
466 }
467 return true;
468 }
469
470 public Point()
471 {
472 }
473
474 public Point(Point p)
475 {
476 x = p.x;
477 z = p.z;
478 }
479
480 public Point(int _x, int _z)
481 {
482 x = _x;
483 z = _z;
484 }
485
486 public Point(int _index)
487 {
488 Set(_index);
489 }
490
491 public Point Copy()
492 {
493 return new Point(x, z);
494 }
495
496 public T Copy<T>() where T : Point
497 {
498 T val = Activator.CreateInstance<T>();
499 val.Set(this);
500 return val;
501 }
502
503 public Point Set(int _x, int _z)
504 {
505 x = _x;
506 z = _z;
507 return this;
508 }
509
510 public Point Set(int index)
511 {
512 x = index % map.Size;
513 z = index % map.SizeXZ / map.Size;
514 return this;
515 }
516
517 public Point Set(Point point)
518 {
519 x = point.x;
520 z = point.z;
521 return this;
522 }
523
524 public override string ToString()
525 {
526 return "(" + x + " / " + z + ")";
527 }
528
529 public static Point operator +(Point lhs, Point rhs)
530 {
531 return new Point(lhs.x + rhs.x, lhs.z + rhs.z);
532 }
533
534 public void Set(Vector3 v)
535 {
536 v.x -= 0.64f;
537 v.y -= 0.64f;
538 int num = Mathf.RoundToInt(v.x / _screen.tileAlign.x);
539 int num2 = Mathf.RoundToInt(v.y / _screen.tileAlign.y);
540 x = (num2 - num) / 2 * -1;
541 z = num - x;
542 }
543
544 public ref Vector3 PositionAuto()
545 {
547 {
548 return ref PositionTopdown();
549 }
550 return ref Position();
551 }
552
553 public ref Vector3 Position(int height)
554 {
555 if (height == -1)
556 {
557 return ref Position();
558 }
559 vCache.x = (float)(x + z) * _screen.tileAlign.x;
560 vCache.y = (float)(z - x) * _screen.tileAlign.y + (float)height * _screen.tileMap._heightMod.y;
561 vCache.z = 1000f + vCache.x * _screen.tileWeight.x + vCache.y * _screen.tileWeight.z + (float)height * _screen.tileMap._heightMod.z;
562 return ref vCache;
563 }
564
565 public ref Vector3 Position()
566 {
567 byte b = ((cell.bridgeHeight == 0) ? cell.height : cell.bridgeHeight);
568 vCache.x = (float)(x + z) * _screen.tileAlign.x;
569 vCache.y = (float)(z - x) * _screen.tileAlign.y + (float)(int)b * _screen.tileMap._heightMod.y;
570 vCache.z = 1000f + vCache.x * _screen.tileWeight.x + vCache.y * _screen.tileWeight.z + (float)(int)b * _screen.tileMap._heightMod.z;
571 return ref vCache;
572 }
573
574 public ref Vector3 PositionTopdown()
575 {
576 byte b = ((cell.bridgeHeight == 0) ? cell.height : cell.bridgeHeight);
577 vCache.x = (float)x * _screen.tileAlign.x;
578 vCache.y = (float)z * _screen.tileAlign.y + (float)(int)b * _screen.tileMap._heightMod.y;
579 vCache.z = 1000f + vCache.x * _screen.tileWeight.x + vCache.y * _screen.tileWeight.z + (float)(int)b * _screen.tileMap._heightMod.z;
580 return ref vCache;
581 }
582
583 public ref Vector3 PositionTopdownTreasure()
584 {
586 vCache.x = (float)(x - EClass.scene.elomap.minX) * screenElona.tileAlign.x;
587 vCache.y = (float)(z - EClass.scene.elomap.minY) * screenElona.tileAlign.y;
588 vCache.z = 1400f;
589 return ref vCache;
590 }
591
592 public ref Vector3 PositionCenter()
593 {
595 {
596 _ = ref PositionTopdown();
597 }
598 else
599 {
600 _ = ref Position();
601 }
602 vCache.x += EClass.screen.tileWorldSize.x * 0.5f;
603 vCache.y += EClass.screen.tileWorldSize.y * 0.75f;
604 return ref vCache;
605 }
606
607 public Quaternion GetRotation(Point to)
608 {
609 return Quaternion.Euler(0f, 0f, GetAngle(to));
610 }
611
612 public float GetAngle(Point to)
613 {
614 Vector3 vector = to.Position() - Position();
615 return Mathf.Atan2(vector.y, vector.x) * 57.29578f;
616 }
617
618 public float GetAngle2(Point to)
619 {
620 int num = to.x - x;
621 return Mathf.Atan2(to.z - z, num) * 57.29578f;
622 }
623
624 public Point GetNearestPoint(bool allowBlock = false, bool allowChara = true, bool allowInstalled = true, bool ignoreCenter = false, int minRadius = 0)
625 {
626 Point p = new Point();
627 int r = 1;
628 int num = x;
629 int num2 = z;
630 if (IsValid(num, num2))
631 {
632 return p;
633 }
634 if (IsValid(num, num2 + 1))
635 {
636 return p;
637 }
638 for (int i = 0; i < 30; i++)
639 {
640 for (int j = 0; j < r; j++)
641 {
642 num++;
643 if (IsValid(num, num2))
644 {
645 return p;
646 }
647 }
648 for (int k = 0; k < r; k++)
649 {
650 num2++;
651 if (IsValid(num, num2))
652 {
653 return p;
654 }
655 }
656 r++;
657 for (int l = 0; l < r; l++)
658 {
659 num--;
660 if (IsValid(num, num2))
661 {
662 return p;
663 }
664 }
665 for (int m = 0; m < r; m++)
666 {
667 num2--;
668 if (IsValid(num, num2))
669 {
670 return p;
671 }
672 }
673 r++;
674 }
675 p.Set(this);
676 return p;
677 bool IsValid(int dx, int dz)
678 {
679 p.Set(dx, dz);
680 if (minRadius > r / 2)
681 {
682 return false;
683 }
684 if (!p.IsInBounds || !map.Contains(dx, dz) || (ignoreCenter && dx == x && dz == z))
685 {
686 return false;
687 }
688 if ((!allowBlock && (p.cell.blocked || p.cell.hasDoor || (p.cell.growth != null && p.cell.growth.IsTree))) || (!allowChara && p.HasChara) || (!allowInstalled && p.Installed != null))
689 {
690 return false;
691 }
692 return true;
693 }
694 }
695
696 public bool ForeachNearestPoint(Func<Point, bool> endFunc, bool allowBlock = false, bool allowChara = true, bool allowInstalled = true, bool ignoreCenter = false, int maxRange = 30)
697 {
698 Point p = new Point();
699 int num = 1;
700 int num2 = x;
701 int num3 = z;
702 if (IsValid(num2, num3) && endFunc(p))
703 {
704 return true;
705 }
706 if (IsValid(num2, num3 + 1) && endFunc(p))
707 {
708 return true;
709 }
710 for (int i = 0; i < maxRange; i++)
711 {
712 for (int j = 0; j < num; j++)
713 {
714 num2++;
715 if (IsValid(num2, num3) && endFunc(p))
716 {
717 return true;
718 }
719 }
720 for (int k = 0; k < num; k++)
721 {
722 num3++;
723 if (IsValid(num2, num3) && endFunc(p))
724 {
725 return true;
726 }
727 }
728 num++;
729 for (int l = 0; l < num; l++)
730 {
731 num2--;
732 if (IsValid(num2, num3) && endFunc(p))
733 {
734 return true;
735 }
736 }
737 for (int m = 0; m < num; m++)
738 {
739 num3--;
740 if (IsValid(num2, num3) && endFunc(p))
741 {
742 return true;
743 }
744 }
745 num++;
746 }
747 Debug.Log("ForeachNearestPoint Fail:" + this);
748 return false;
749 bool IsValid(int dx, int dz)
750 {
751 p.Set(dx, dz);
752 if (!p.IsInBounds || !map.Contains(dx, dz) || (ignoreCenter && dx == x && dz == z))
753 {
754 return false;
755 }
756 if ((!allowBlock && (p.cell.blocked || p.cell.hasDoor || (p.cell.growth != null && p.cell.growth.IsTree))) || (!allowChara && p.HasChara) || (!allowInstalled && p.Installed != null))
757 {
758 return false;
759 }
760 return true;
761 }
762 }
763
765 {
766 int num = ((EClass.rnd(2) == 0) ? 1 : (-1));
767 if (EClass.rnd(2) == 0)
768 {
769 return new Point(Mathf.Clamp(x + num, 0, map.Size - 1), z);
770 }
771 return new Point(x, Mathf.Clamp(z + num, 0, map.Size - 1));
772 }
773
774 public Point GetRandomPoint(int radius, bool requireLos = true, bool allowChara = true, bool allowBlocked = false, int tries = 100)
775 {
776 Point point = new Point();
777 for (int i = 0; i < tries; i++)
778 {
779 point.Set(x - radius + EClass.rnd(radius * 2 + 1), z - radius + EClass.rnd(radius * 2 + 1));
780 if (point.IsValid && (allowBlocked || !point.IsBlocked) && (!requireLos || Los.IsVisible(this, point)) && (allowChara || !point.HasChara))
781 {
782 return point;
783 }
784 }
785 return null;
786 }
787
788 public Point GetRandomPointInRadius(int minRadius, int maxRadius, bool requireLos = true, bool allowChara = true, bool allowBlocked = false, int tries = 2000)
789 {
790 Point point = new Point();
791 for (int i = 0; i < tries; i++)
792 {
793 point.Set(x - maxRadius + EClass.rnd(maxRadius * 2 + 1), z - maxRadius + EClass.rnd(maxRadius * 2 + 1));
794 if (point.IsValid && (allowBlocked || !point.IsBlocked) && (allowChara || !point.HasChara))
795 {
796 int num = point.Distance(this);
797 if (num >= minRadius && num <= maxRadius && (!requireLos || Los.IsVisible(this, point)))
798 {
799 return point;
800 }
801 }
802 }
803 return null;
804 }
805
807 {
808 Point point = new Point(this);
809 int num = dest.x - point.x;
810 int num2 = dest.z - point.z;
811 if (Mathf.Abs(num) > 1 || Mathf.Abs(num2) > 1)
812 {
813 int num3 = Mathf.Max(Mathf.Abs(num), Mathf.Abs(num2));
814 point.x += num / num3;
815 point.z += num2 / num3;
816 }
817 return point;
818 }
819
820 public void TalkWitnesses(Chara criminal, string idTalk, int radius = 4, WitnessType type = WitnessType.everyone, Func<Chara, bool> talkIf = null, int chance = 3)
821 {
822 if (talkIf == null)
823 {
824 talkIf = (Chara c) => EClass.rnd(chance) == 0;
825 }
826 foreach (Chara item in ListWitnesses(criminal, radius, type))
827 {
828 if (talkIf(item) && !item.renderer.IsTalking())
829 {
830 item.Talk(idTalk);
831 }
832 }
833 }
834
835 public List<Chara> ListWitnesses(Chara criminal, int radius = 4, WitnessType type = WitnessType.crime, Chara target = null)
836 {
837 List<Chara> list = new List<Chara>();
838 foreach (Point item in map.ListPointsInCircle(this, radius, mustBeWalkable: false))
839 {
840 List<Chara> list2 = item.detail?.charas;
841 if (list2 == null || list2.Count == 0)
842 {
843 continue;
844 }
845 foreach (Chara item2 in list2)
846 {
847 if (item2 == criminal || item2.IsPC || (item2.HasCondition<ConDim>() && EClass.rnd(2) == 0) || item2.conSuspend != null || item2.isParalyzed || item2.IsDisabled || (type != 0 && type != WitnessType.ally && item2 != target && !item2.CanWitness))
848 {
849 continue;
850 }
851 switch (type)
852 {
853 case WitnessType.ally:
854 if (!criminal.IsPCFaction || item2.hostility <= Hostility.Neutral)
855 {
856 continue;
857 }
858 break;
859 case WitnessType.crime:
860 if (criminal == null || item2.isBlind || item2.isConfused || (criminal.IsPCParty && (item2.IsPCFaction || item2.IsPCFactionMinion)) || (target == null && item2.OriginalHostility < Hostility.Neutral))
861 {
862 continue;
863 }
864 break;
865 case WitnessType.music:
866 if (item2.hostility <= Hostility.Enemy)
867 {
868 continue;
869 }
870 break;
871 }
872 list.Add(item2);
873 }
874 }
875 return list;
876 }
877
878 public bool TryWitnessCrime(Chara criminal, Chara target = null, int radius = 4, Func<Chara, bool> funcWitness = null)
879 {
880 List<Chara> list = ListWitnesses(criminal, radius, WitnessType.crime, target);
881 bool result = false;
882 if (funcWitness == null)
883 {
884 funcWitness = (Chara c) => EClass.rnd(10) == 0;
885 }
886 foreach (Chara item in list)
887 {
888 if (funcWitness(item))
889 {
890 CallGuard(criminal, item);
891 result = true;
892 target?.DoHostileAction(criminal);
893 if (item != target)
894 {
895 item.DoHostileAction(criminal);
896 }
897 break;
898 }
899 }
900 return result;
901 }
902
903 public void CallGuard(Chara criminal, Chara caller)
904 {
905 if (caller.HasCondition<ConSleep>())
906 {
907 caller.RemoveCondition<ConSleep>();
908 }
909 caller.Talk("callGuards");
910 List<Chara> list = EClass._map.charas.Where((Chara c) => c.trait is TraitGuard && !c.IsInCombat).ToList();
911 if (list.Count > 0)
912 {
913 list.Sort((Chara a, Chara b) => a.Dist(criminal) - b.Dist(criminal));
914 Chara chara = list.First();
915 caller.Say("calledGuard", caller);
916 chara.DoHostileAction(criminal);
917 }
919 {
920 EClass._zone.SetAlarm(enable: true);
921 }
922 }
923
924 public void SetBlock(int idMat = 0, int idBlock = 0)
925 {
926 map.SetBlock(x, z, idMat, idBlock);
927 }
928
929 public void SetFloor(int idMat = 0, int idFloor = 0)
930 {
931 map.SetFloor(x, z, idMat, idFloor);
932 }
933
934 public void SetObj(int id = 0, int value = 1, int dir = 0)
935 {
936 map.SetObj(x, z, id, value, dir);
937 }
938
939 public void ModFire(int value, bool extinguish = false)
940 {
941 if (extinguish && cell.HasFire)
942 {
943 PlaySound("extinguish");
944 PlayEffect("smoke");
945 PlayEffect("vanish");
946 }
947 map.ModFire(x, z, value);
948 }
949
950 public void Plow()
951 {
952 if (IsFarmField)
953 {
955 {
957 }
958 else if (cell.Front.HasWallOrFence)
959 {
961 }
962 }
963 SetFloor(4, 4);
964 }
965
966 public bool Equals(int _x, int _z)
967 {
968 if (x == _x)
969 {
970 return z == _z;
971 }
972 return false;
973 }
974
975 public override bool Equals(object obj)
976 {
977 Point point = obj as Point;
978 if (point == null)
979 {
980 Debug.Log(point?.ToString() + ":" + point.GetType()?.ToString() + "is not Point");
981 return false;
982 }
983 if (x == point.x)
984 {
985 return z == point.z;
986 }
987 return false;
988 }
989
990 public override int GetHashCode()
991 {
992 return x + z * map.Size;
993 }
994
995 public int Distance(Point p)
996 {
997 return Fov.Distance(p.x, p.z, x, z);
998 }
999
1000 public int Distance(int tx, int tz)
1001 {
1002 return Fov.Distance(tx, tz, x, z);
1003 }
1004
1005 public bool IsBlockByHeight(Point p)
1006 {
1007 if (Mathf.Abs(p.cell.minHeight - cell.topHeight) > 8)
1008 {
1009 return Mathf.Abs(p.cell.topHeight - cell.minHeight) > 8;
1010 }
1011 return false;
1012 }
1013
1014 public Point Clamp(bool useBounds = false)
1015 {
1016 if (useBounds)
1017 {
1018 if (x < map.bounds.x)
1019 {
1020 x = map.bounds.x;
1021 }
1022 else if (x >= map.bounds.maxX)
1023 {
1024 x = map.bounds.maxX;
1025 }
1026 if (z < map.bounds.z)
1027 {
1028 z = map.bounds.z;
1029 }
1030 else if (z >= map.bounds.maxZ)
1031 {
1032 z = map.bounds.maxZ;
1033 }
1034 }
1035 else
1036 {
1037 if (x < 0)
1038 {
1039 x = 0;
1040 }
1041 else if (x >= map.Size)
1042 {
1043 x = map.Size - 1;
1044 }
1045 if (z < 0)
1046 {
1047 z = 0;
1048 }
1049 else if (z >= map.Size)
1050 {
1051 z = map.Size - 1;
1052 }
1053 }
1054 return this;
1055 }
1056
1057 public List<Card> ListCards(bool includeMasked = false)
1058 {
1059 listCard.Clear();
1060 bool flag = EClass.scene.actionMode != null && EClass.scene.actionMode.IsRoofEditMode();
1061 if (detail != null)
1062 {
1063 foreach (Thing thing in detail.things)
1064 {
1065 if (!thing.isHidden && (includeMasked || !thing.isMasked) && thing.isRoofItem == flag)
1066 {
1067 listCard.Add(thing);
1068 }
1069 }
1070 if (!flag)
1071 {
1072 foreach (Chara chara in detail.charas)
1073 {
1074 listCard.Add(chara);
1075 }
1076 }
1077 }
1078 return listCard;
1079 }
1080
1081 public List<Card> ListVisibleCards()
1082 {
1083 listCard.Clear();
1084 if (detail != null)
1085 {
1086 foreach (Thing thing in detail.things)
1087 {
1088 if (!thing.isHidden && !thing.isMasked && !thing.isRoofItem)
1089 {
1090 listCard.Add(thing);
1091 }
1092 }
1093 foreach (Chara chara in detail.charas)
1094 {
1095 if (EClass.pc.CanSee(chara))
1096 {
1097 listCard.Add(chara);
1098 }
1099 }
1100 }
1101 return listCard;
1102 }
1103
1105 {
1106 foreach (Card item in ListCards())
1107 {
1108 if (item.isChara || item.trait.CanBeAttacked)
1109 {
1110 return item;
1111 }
1112 }
1113 return null;
1114 }
1115
1116 public Chara FindChara(Func<Chara, bool> func)
1117 {
1118 if (detail != null)
1119 {
1120 foreach (Chara chara in detail.charas)
1121 {
1122 if (func(chara))
1123 {
1124 return chara;
1125 }
1126 }
1127 }
1128 return null;
1129 }
1130
1131 public T FindThing<T>() where T : Trait
1132 {
1133 if (IsValid && detail != null)
1134 {
1135 foreach (Thing thing in detail.things)
1136 {
1137 if (thing.trait is T)
1138 {
1139 return thing.trait as T;
1140 }
1141 }
1142 }
1143 return null;
1144 }
1145
1146 public Thing FindThing(Func<Thing, bool> func)
1147 {
1148 if (detail != null)
1149 {
1150 foreach (Thing thing in detail.things)
1151 {
1152 if (func(thing))
1153 {
1154 return thing;
1155 }
1156 }
1157 }
1158 return null;
1159 }
1160
1161 public List<Card> ListThings<T>(bool onlyInstalled = true) where T : Trait
1162 {
1163 listCard.Clear();
1164 if (detail != null)
1165 {
1166 foreach (Thing thing in detail.things)
1167 {
1168 if (!thing.isHidden && !thing.isRoofItem && !thing.isMasked && (!onlyInstalled || thing.IsInstalled) && thing.trait is T)
1169 {
1170 listCard.Add(thing);
1171 }
1172 }
1173 }
1174 return listCard;
1175 }
1176
1177 public List<Chara> ListCharas()
1178 {
1179 listChara.Clear();
1180 if (detail != null)
1181 {
1182 foreach (Chara chara in detail.charas)
1183 {
1184 listChara.Add(chara);
1185 }
1186 }
1187 return listChara;
1188 }
1189
1190 public List<Chara> ListVisibleCharas()
1191 {
1192 listChara.Clear();
1193 if (detail != null)
1194 {
1195 foreach (Chara chara in detail.charas)
1196 {
1197 if (EClass.pc.CanSee(chara))
1198 {
1199 listChara.Add(chara);
1200 }
1201 }
1202 }
1203 return listChara;
1204 }
1205
1206 public List<Chara> ListCharasInNeighbor(Func<Chara, bool> func)
1207 {
1208 listChara.Clear();
1209 ForeachNeighbor(delegate(Point p)
1210 {
1211 if (p.detail == null)
1212 {
1213 return;
1214 }
1215 foreach (Chara chara in p.detail.charas)
1216 {
1217 if (func(chara))
1218 {
1219 listChara.Add(chara);
1220 }
1221 }
1222 });
1223 return listChara;
1224 }
1225
1226 public List<Chara> ListCharasInRadius(Chara cc, int dist, Func<Chara, bool> func, bool onlyVisible = true)
1227 {
1228 listChara.Clear();
1229 foreach (Chara chara in EClass._map.charas)
1230 {
1231 if (func(chara) && chara.Dist(cc) < dist && (!onlyVisible || Los.IsVisible(chara, cc)))
1232 {
1233 listChara.Add(chara);
1234 }
1235 }
1236 return listChara;
1237 }
1238
1239 public T GetInstalled<T>() where T : Trait
1240 {
1241 if (detail != null)
1242 {
1243 foreach (Thing thing in detail.things)
1244 {
1245 if (thing.IsInstalled && thing.trait is T)
1246 {
1247 return thing.trait as T;
1248 }
1249 }
1250 }
1251 return null;
1252 }
1253
1254 public Effect PlayEffect(string id)
1255 {
1256 return Effect.Get(id).Play(this);
1257 }
1258
1259 public SoundSource PlaySound(string id, bool synced = true, float v = 1f, bool spatial = true)
1260 {
1261 Vector3 vector = default(Vector3);
1262 if (spatial)
1263 {
1264 if (!IsValid)
1265 {
1266 return null;
1267 }
1268 vector = (EClass._zone.IsRegion ? PositionTopdown() : Position());
1269 vector.z = 0f;
1270 if (Vector3.Distance(vector, EClass.scene.transAudio.position) > EClass.core.gameSetting.audio.maxRange)
1271 {
1272 return null;
1273 }
1274 if (!synced)
1275 {
1276 v -= 0.4f;
1277 }
1278 }
1279 return EClass.Sound.Play(id, vector, (!spatial) ? 1f : (v * ((EClass.screen.Zoom >= 1f) ? 1f : EClass.screen.Zoom)));
1280 }
1281
1283 {
1284 map.RefreshNeighborTiles(x, z);
1285 }
1286
1287 public void RefreshTile()
1288 {
1289 map.RefreshSingleTile(x, z);
1290 }
1291
1292 public bool HasNonHomeProperty(Thing exclude = null)
1293 {
1294 if (FirstThing == null)
1295 {
1296 return false;
1297 }
1298 foreach (Thing thing in detail.things)
1299 {
1300 if (thing != exclude && thing.isNPCProperty)
1301 {
1302 return true;
1303 }
1304 }
1305 return false;
1306 }
1307
1308 public void Animate(AnimeID id, bool animeBlock = false)
1309 {
1310 if (!IsValid)
1311 {
1312 return;
1313 }
1314 CellDetail orCreateDetail = cell.GetOrCreateDetail();
1315 if (orCreateDetail.anime == null)
1316 {
1317 TransAnime transAnime = (orCreateDetail.anime = new TransAnime
1318 {
1319 data = ResourceCache.Load<TransAnimeData>("Scene/Render/Anime/" + id),
1320 point = this,
1321 animeBlock = animeBlock
1322 }.Init());
1323 EClass._map.pointAnimes.Add(transAnime);
1324 if (id == AnimeID.Quake)
1325 {
1326 transAnime.drawBlock = true;
1327 }
1328 }
1329 }
1330
1332 {
1333 if (detail == null || detail.anime == null)
1334 {
1335 return p;
1336 }
1337 p.x += detail.anime.v.x;
1338 p.y += detail.anime.v.y;
1339 p.z += detail.anime.v.z;
1340 p.v.x += detail.anime.v.x;
1341 p.v.y += detail.anime.v.y;
1342 p.v.z += detail.anime.v.z;
1343 return p;
1344 }
1345
1346 public Vector3 ApplyAnime(ref Vector3 p)
1347 {
1348 if (detail == null || detail.anime == null)
1349 {
1350 return p;
1351 }
1352 p.x += detail.anime.v.x;
1353 p.y += detail.anime.v.y;
1354 p.z += detail.anime.v.z;
1355 return p;
1356 }
1357
1358 public List<IInspect> ListInspectorTargets()
1359 {
1360 List<IInspect> list = new List<IInspect>();
1361 CellDetail cellDetail = detail;
1362 if (cellDetail != null)
1363 {
1364 foreach (Chara chara in cellDetail.charas)
1365 {
1366 if (chara.isSynced)
1367 {
1368 list.Add(chara);
1369 }
1370 }
1371 foreach (Thing thing in cellDetail.things)
1372 {
1373 list.Add(thing);
1374 }
1375 if (cellDetail.designation != null && !(cellDetail.designation is TaskCut) && !(cellDetail.designation is TaskMine))
1376 {
1377 list.Add(cellDetail.designation);
1378 }
1379 }
1380 if (ObjInfo._CanInspect(this))
1381 {
1382 list.Add(ObjInfo.GetTempList(this));
1383 }
1384 if (BlockInfo._CanInspect(this))
1385 {
1386 list.Add(BlockInfo.GetTempList(this));
1387 }
1388 return list;
1389 }
1390
1391 public void ForeachMultiSize(int w, int h, Action<Point, bool> action)
1392 {
1393 for (int i = 0; i < h; i++)
1394 {
1395 for (int j = 0; j < w; j++)
1396 {
1397 shared3.Set(x - j, z + i);
1398 action(shared3, j == 0 && i == 0);
1399 }
1400 }
1401 }
1402
1403 public void ForeachNeighbor(Action<Point> action, bool diagonal = true)
1404 {
1405 Point point = new Point();
1406 for (int i = x - 1; i <= x + 1; i++)
1407 {
1408 for (int j = z - 1; j <= z + 1; j++)
1409 {
1410 if (diagonal || i == x || j == z)
1411 {
1412 point.Set(i, j);
1413 if (point.IsValid)
1414 {
1415 action(point);
1416 }
1417 }
1418 }
1419 }
1420 }
1421
1423 {
1424 Point point = new Point(x, z);
1425 point.x += EClass.scene.elomap.minX;
1426 point.z += EClass.scene.elomap.minY;
1427 return point;
1428 }
1429
1430 public void SetHighlight(int id)
1431 {
1432 cell.highlight = (byte)id;
1434 }
1435}
AnimeID
Definition: AnimeID.cs:2
Hostility
Definition: Hostility.cs:2
WitnessType
Definition: WitnessType.cs:2
virtual bool IsRoofEditMode(Card c=null)
Definition: ActionMode.cs:311
virtual bool IsPublicArea
Definition: AreaType.cs:20
Definition: Area.cs:4
AreaType type
Definition: BaseArea.cs:32
Vector3 tileWeight
BaseTileMap tileMap
bool hideRoomFog
Definition: BaseTileMap.cs:281
Vector3 _heightMod
Definition: BaseTileMap.cs:335
static bool _CanInspect(Point pos)
Definition: BlockInfo.cs:31
static BlockInfo GetTempList(Point _pos)
Definition: BlockInfo.cs:21
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2326
bool isMasked
Definition: Card.cs:593
bool isNPCProperty
Definition: Card.cs:557
bool isRoofItem
Definition: Card.cs:581
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:7122
Trait trait
Definition: Card.cs:54
ThingContainer things
Definition: Card.cs:39
bool IsInstalled
Definition: Card.cs:2435
int Dist(Card c)
Definition: Card.cs:8115
bool isHidden
Definition: Card.cs:533
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7240
TaskDesignation designation
Definition: CellDetail.cs:19
List< Thing > things
Definition: CellDetail.cs:11
TransAnime anime
Definition: CellDetail.cs:21
List< Chara > charas
Definition: CellDetail.cs:13
Area area
Definition: CellDetail.cs:15
Definition: Cell.cs:7
byte _block
Definition: Cell.cs:32
Room room
Definition: Cell.cs:110
bool HasWallOrFence
Definition: Cell.cs:839
SourceBlock.Row sourceBlock
Definition: Cell.cs:1062
SourceMaterial.Row matBlock
Definition: Cell.cs:1038
SourceFloor.Row sourceFloor
Definition: Cell.cs:1064
SourceMaterial.Row matRoofBlock
Definition: Cell.cs:1036
bool IsTopWaterAndNoSnow
Definition: Cell.cs:720
Cell Front
Definition: Cell.cs:137
List< Thing > Things
Definition: Cell.cs:994
SourceMaterial.Row matBridge
Definition: Cell.cs:1044
bool pcSync
Definition: Cell.cs:112
byte topHeight
Definition: Cell.cs:86
byte minHeight
Definition: Cell.cs:88
bool IsTopWater
Definition: Cell.cs:708
List< Chara > Charas
Definition: Cell.cs:996
byte height
Definition: Cell.cs:80
GrowSystem growth
Definition: Cell.cs:233
SourceFloor.Row sourceBridge
Definition: Cell.cs:1066
CellDetail detail
Definition: Cell.cs:100
bool HasRoof
Definition: Cell.cs:656
SourceMaterial.Row matFloor
Definition: Cell.cs:1040
bool isSeen
Definition: Cell.cs:290
SourceObj.Row sourceObj
Definition: Cell.cs:1084
bool HasFire
Definition: Cell.cs:684
SourceBlock.Row sourceRoofBlock
Definition: Cell.cs:1060
Point GetPoint()
Definition: Cell.cs:1113
Cell Right
Definition: Cell.cs:149
bool HasRamp
Definition: Cell.cs:845
byte bridgeHeight
Definition: Cell.cs:82
bool hasDoor
Definition: Cell.cs:266
bool HasRampOrLadder
Definition: Cell.cs:850
Definition: Chara.cs:10
Hostility OriginalHostility
Definition: Chara.cs:475
ConSuspend conSuspend
Definition: Chara.cs:104
override bool IsPC
Definition: Chara.cs:630
bool isParalyzed
Definition: Chara.cs:134
bool IsInCombat
Definition: Chara.cs:887
bool HasCondition(string alias)
Definition: Chara.cs:9811
override bool IsDisabled
Definition: Chara.cs:591
override bool isSynced
Definition: Chara.cs:709
override bool IsPCFaction
Definition: Chara.cs:689
bool CanSee(Card c)
Definition: Chara.cs:1253
override bool IsPCFactionMinion
Definition: Chara.cs:673
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6576
bool isBlind
Definition: Chara.cs:132
Hostility hostility
Definition: Chara.cs:295
bool CanWitness
Definition: Chara.cs:1026
bool isConfused
Definition: Chara.cs:128
Definition: ConDim.cs:2
bool enable
Definition: CoreDebug.cs:301
GameSetting gameSetting
Definition: Core.cs:47
bool IsNight
Definition: Date.cs:112
Definition: EClass.cs:6
static Scene scene
Definition: EClass.cs:31
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static BaseGameScreen screen
Definition: EClass.cs:33
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
static SoundManager Sound
Definition: EClass.cs:47
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
bool Has(int ele)
int minX
Definition: EloMap.cs:112
int minY
Definition: EloMap.cs:114
Definition: Fov.cs:6
static int Distance(int x1, int y1, int x2, int y2)
Definition: Fov.cs:134
AudioSetting audio
Definition: GameSetting.cs:299
virtual bool IsTree
Definition: GrowSystem.cs:101
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167
int Size
Definition: MapBounds.cs:20
int maxZ
Definition: MapBounds.cs:17
int maxX
Definition: MapBounds.cs:14
int x
Definition: MapBounds.cs:8
bool Contains(int dx, int dz)
Definition: MapBounds.cs:38
Definition: Map.cs:13
bool IsIndoor
Definition: Map.cs:131
List< Thing > things
Definition: Map.cs:49
void ModFire(int x, int z, int amount)
Definition: Map.cs:1193
void SetFloor(int x, int z, int idMat=0, int idFloor=0)
Definition: Map.cs:970
void SetBlock(int x, int z, int idMat=0, int idBlock=0)
Definition: Map.cs:1017
Cell[,] cells
Definition: Map.cs:85
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2323
List< Chara > charas
Definition: Map.cs:81
List< TransAnime > pointAnimes
Definition: Map.cs:83
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
Definition: Map.cs:1580
static HashSet< int > sunMap
Definition: Map.cs:14
MapBounds bounds
Definition: Map.cs:52
static bool _CanInspect(Point pos)
Definition: ObjInfo.cs:67
static ObjInfo GetTempList(Point _pos)
Definition: ObjInfo.cs:57
List< Cell > lastMarkedHighlights
Definition: Player.cs:1215
Definition: Point.cs:9
Thing Installed
Definition: Point.cs:327
int eloY
Definition: Point.cs:81
static Point shared
Definition: Point.cs:20
SourceMaterial.Row matBlock
Definition: Point.cs:55
SourceMaterial.Row matFloor
Definition: Point.cs:57
static Point GetShared(int x, int z)
Definition: Point.cs:390
int Distance(int tx, int tz)
Definition: Point.cs:1000
SourceMaterial.Row matRoofBlock
Definition: Point.cs:53
int index
Definition: Point.cs:49
static Point Invalid
Definition: Point.cs:28
bool HasDirt
Definition: Point.cs:85
Vector3 vCache
Definition: Point.cs:41
bool IsBlockByHeight(Point p)
Definition: Point.cs:1005
List< Chara > ListWitnesses(Chara criminal, int radius=4, WitnessType type=WitnessType.crime, Chara target=null)
Definition: Point.cs:835
bool IsSeen
Definition: Point.cs:342
SourceBlock.Row sourceBlock
Definition: Point.cs:63
bool HasFence
Definition: Point.cs:170
bool HasDecal
Definition: Point.cs:139
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1391
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:934
Point Set(Point point)
Definition: Point.cs:517
List< Card > ListThings< T >(bool onlyInstalled=true)
Definition: Point.cs:1161
void Plow()
Definition: Point.cs:950
List< Card > ListVisibleCards()
Definition: Point.cs:1081
ref Vector3 Position(int height)
Definition: Point.cs:553
bool HasBridge
Definition: Point.cs:221
void SetHighlight(int id)
Definition: Point.cs:1430
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1057
float GetAngle(Point to)
Definition: Point.cs:612
static Point shared2
Definition: Point.cs:22
Vector3 ApplyAnime(ref Vector3 p)
Definition: Point.cs:1346
RenderParam ApplyAnime(RenderParam p)
Definition: Point.cs:1331
bool HasWall
Definition: Point.cs:158
Point Copy()
Definition: Point.cs:491
bool IsSky
Definition: Point.cs:224
Point(Point p)
Definition: Point.cs:474
ref Vector3 PositionTopdownTreasure()
Definition: Point.cs:583
bool HasDesignation
Definition: Point.cs:83
override string ToString()
Definition: Point.cs:524
Point Set(int _x, int _z)
Definition: Point.cs:503
List< IInspect > ListInspectorTargets()
Definition: Point.cs:1358
ref Vector3 PositionTopdown()
Definition: Point.cs:574
ref Vector3 PositionAuto()
Definition: Point.cs:544
T FindThing< T >()
Definition: Point.cs:1131
static Point Zero
Definition: Point.cs:33
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1403
CellDetail detail
Definition: Point.cs:71
Thing LastThing
Definition: Point.cs:314
bool HasTaskBuild
Definition: Point.cs:206
bool HasRail
Definition: Point.cs:133
Point(int _x, int _z)
Definition: Point.cs:480
bool IsBlocked
Definition: Point.cs:363
bool HasMultipleChara
Definition: Point.cs:264
bool IsWater
Definition: Point.cs:129
Quaternion GetRotation(Point to)
Definition: Point.cs:607
List< Thing > Things
Definition: Point.cs:338
int x
Definition: Point.cs:36
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:624
bool HasWallOrFence
Definition: Point.cs:155
void RefreshTile()
Definition: Point.cs:1287
bool HasNonHomeProperty(Thing exclude=null)
Definition: Point.cs:1292
bool IsInBoundsPlus
Definition: Point.cs:116
void ModFire(int value, bool extinguish=false)
Definition: Point.cs:939
int z
Definition: Point.cs:39
bool IsFarmField
Definition: Point.cs:127
bool IsSync
Definition: Point.cs:344
SourceMaterial.Row matBridge
Definition: Point.cs:59
List< Chara > Charas
Definition: Point.cs:340
void SetFloor(int idMat=0, int idFloor=0)
Definition: Point.cs:929
void CallGuard(Chara criminal, Chara caller)
Definition: Point.cs:903
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1259
override bool Equals(object obj)
Definition: Point.cs:975
int eloX
Definition: Point.cs:79
List< Chara > ListCharasInNeighbor(Func< Chara, bool > func)
Definition: Point.cs:1206
ref Vector3 PositionCenter()
Definition: Point.cs:592
Point GetPointTowards(Point dest)
Definition: Point.cs:806
bool HasBlockRecipe
Definition: Point.cs:217
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1226
bool HasThing
Definition: Point.cs:251
SourceObj.Row sourceObj
Definition: Point.cs:69
Chara FindChara(Func< Chara, bool > func)
Definition: Point.cs:1116
bool Equals(int _x, int _z)
Definition: Point.cs:966
bool HasMinableBlock
Definition: Point.cs:144
static BaseGameScreen _screen
Definition: Point.cs:43
List< Chara > ListCharas()
Definition: Point.cs:1177
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:878
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool IsSunLit
Definition: Point.cs:182
Card FindAttackTarget()
Definition: Point.cs:1104
static List< Chara > listChara
Definition: Point.cs:47
T Copy< T >()
Definition: Point.cs:496
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:820
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:924
bool HasArea
Definition: Point.cs:235
Chara FirstVisibleChara()
Definition: Point.cs:406
bool Within(int _x, int _z, int _w, int _h)
Definition: Point.cs:397
bool IsValid
Definition: Point.cs:88
override int GetHashCode()
Definition: Point.cs:990
static Point operator+(Point lhs, Point rhs)
Definition: Point.cs:529
Effect PlayEffect(string id)
Definition: Point.cs:1254
bool HasObj
Definition: Point.cs:137
void RefreshNeighborTiles()
Definition: Point.cs:1282
ref Vector3 Position()
Definition: Point.cs:565
bool HasRoomOrArea(BaseArea a)
Definition: Point.cs:421
bool HasRamp
Definition: Point.cs:131
static readonly XY[] Surrounds
Definition: Point.cs:10
Point Front
Definition: Point.cs:75
bool HasRampOrLadder
Definition: Point.cs:135
Area area
Definition: Point.cs:73
Point ToRegionPos()
Definition: Point.cs:1422
bool HasFloor
Definition: Point.cs:219
Point(int _index)
Definition: Point.cs:486
Point()
Definition: Point.cs:470
bool ForeachNearestPoint(Func< Point, bool > endFunc, bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int maxRange=30)
Definition: Point.cs:696
Point GetRandomPointInRadius(int minRadius, int maxRadius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=2000)
Definition: Point.cs:788
int Distance(Point p)
Definition: Point.cs:995
bool IsHidden
Definition: Point.cs:347
static Point shared3
Definition: Point.cs:24
Chara FirstChara
Definition: Point.cs:288
Thing FirstThing
Definition: Point.cs:301
Point Clamp(bool useBounds=false)
Definition: Point.cs:1014
bool HasBlock
Definition: Point.cs:141
static List< Card > listCard
Definition: Point.cs:45
bool IsInBounds
Definition: Point.cs:104
void Set(Vector3 v)
Definition: Point.cs:534
Cell cell
Definition: Point.cs:51
float GetAngle2(Point to)
Definition: Point.cs:618
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1146
Point GetRandomNeighbor()
Definition: Point.cs:764
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1308
static Vector3 fixedPos
Definition: Point.cs:18
SourceFloor.Row sourceBridge
Definition: Point.cs:67
bool IsPublicSpace()
Definition: Point.cs:449
GrowSystem growth
Definition: Point.cs:77
List< Chara > ListVisibleCharas()
Definition: Point.cs:1190
bool HasChara
Definition: Point.cs:238
bool HasNonWallBlock
Definition: Point.cs:194
bool IsHotSpring
Definition: Point.cs:375
bool IsInSpot< T >()
Definition: Point.cs:430
SourceBlock.Row sourceRoofBlock
Definition: Point.cs:61
Point Set(int index)
Definition: Point.cs:510
bool IsDeepWater
Definition: Point.cs:276
static Map map
Definition: Point.cs:26
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:774
Vector3 v
Definition: RenderParam.cs:19
Transform transAudio
Definition: Scene.cs:31
ActionMode actionMode
Definition: Scene.cs:79
EloMap elomap
Definition: Scene.cs:149
GameScreenElona screenElona
Definition: Scene.cs:95
bool isAlarmSet
Definition: Spatial.cs:430
virtual bool IsRegion
Definition: Spatial.cs:515
Definition: Thing.cs:8
static TileTypeSky Sky
Definition: TileType.cs:75
Definition: Trait.cs:7
virtual int radius
Definition: Trait.cs:94
virtual List< Point > ListPoints(Point center=null, bool onlyPassable=true)
Definition: Trait.cs:864
GameDate date
Definition: World.cs:6
virtual bool SetAlarmOnBreakLaw
Definition: Zone.cs:235
ElementContainerZone elements
Definition: Zone.cs:43
virtual bool IsUnderwater
Definition: Zone.cs:273
virtual void SetAlarm(bool enable)
Definition: Zone.cs:3756
Definition: XY.cs:2