Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ZonePreEnterDigStairs.cs
Go to the documentation of this file.
1using Newtonsoft.Json;
2
4{
5 [JsonProperty]
6 public Point pos;
7
8 [JsonProperty]
9 public bool fromAbove;
10
11 [JsonProperty]
12 public int uidZone;
13
14 public override void Execute()
15 {
16 if (pos.HasBlock)
17 {
18 pos.SetBlock();
19 }
20 if (pos.HasObj)
21 {
22 pos.SetObj();
23 }
24 Trait trait = null;
25 foreach (Thing thing2 in pos.Things)
26 {
27 if (thing2.trait is TraitStairsLocked)
28 {
29 trait = thing2.trait;
30 break;
31 }
32 if (thing2.trait is TraitNewZone traitNewZone && ((fromAbove && traitNewZone.IsUpstairs) || (!fromAbove && traitNewZone.IsDownstairs)))
33 {
34 trait = traitNewZone;
35 break;
36 }
37 }
38 if (trait != null)
39 {
40 return;
41 }
43 {
44 for (int i = pos.z - 1; i < pos.z + 2; i++)
45 {
46 for (int j = pos.x - 1; j < pos.x + 2; j++)
47 {
48 Point point = new Point(j, i);
49 if (point.IsValid && point.sourceFloor.tileType == TileType.Sky)
50 {
52 }
53 }
54 }
55 }
57 EClass._zone.AddCard(thing, pos.x, pos.z);
58 thing.c_uidZone = uidZone;
59 thing.SetPlaceState(PlaceState.installed);
60 thing.isPlayerCreation = true;
61 }
62}
PlaceState
Definition: PlaceState.cs:2
string GetIdStairs(bool upstairs)
TileGroup interior
void SetPlaceState(PlaceState newState, bool byPlayer=false)
Definition: Card.cs:3454
Trait trait
Definition: Card.cs:49
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
void SetFloor(int x, int z, int idMat=0, int idFloor=0)
Definition: Map.cs:951
Definition: Point.cs:9
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:892
List< Thing > Things
Definition: Point.cs:314
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
SourceFloor.Row sourceFloor
Definition: Point.cs:65
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:882
bool IsValid
Definition: Point.cs:88
bool HasObj
Definition: Point.cs:137
bool HasBlock
Definition: Point.cs:141
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
static TileTypeSky Sky
Definition: TileType.cs:67
Definition: Trait.cs:7
BiomeProfile biome
Definition: Zone.cs:126
virtual bool IsSkyLevel
Definition: Zone.cs:262
Card AddCard(Card t, Point point)
Definition: Zone.cs:1893