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