Elin Modding Docs Doc
Loading...
Searching...
No Matches
LogicalFire.cs
1using System;
2
3// Token: 0x02000685 RID: 1669
5{
6 // Token: 0x17000D5D RID: 3421
7 // (get) Token: 0x06002EEA RID: 12010 RVA: 0x00106EE4 File Offset: 0x001050E4
8 public int fireAmount
9 {
10 get
11 {
12 CellEffect effect = base.cell.effect;
13 if (effect == null)
14 {
15 return 0;
16 }
17 return effect.FireAmount;
18 }
19 }
20
21 // Token: 0x17000D5E RID: 3422
22 // (get) Token: 0x06002EEB RID: 12011 RVA: 0x00106EFC File Offset: 0x001050FC
23 public override LogicalPointManager manager
24 {
25 get
26 {
27 return Point.map.effectManager;
28 }
29 }
30
31 // Token: 0x06002EEC RID: 12012 RVA: 0x00106F08 File Offset: 0x00105108
32 public override void Update()
33 {
34 this.manager.refreshList.Add(this);
35 bool flag = false;
36 foreach (XY xy in Point.Surrounds)
37 {
38 Point.shared.Set(this.x + xy.x, this.z + xy.y);
39 if (Point.shared.IsValid)
40 {
41 Cell cell = Point.shared.cell;
42 if (cell.fireAmount != this.fireAmount)
43 {
44 if (cell.fireAmount > this.fireAmount)
45 {
46 this.manager.GetOrCreate(Point.shared);
47 }
48 else if (this.fireAmount <= 0)
49 {
50 base.cell.effect = null;
51 }
52 else
53 {
54 byte b = (byte)(this.fireAmount - cell.fireAmount);
55 if (cell.fireAmount == 0)
56 {
57 if (this.fireAmount >= 2 && b >= 2)
58 {
59 if (EClass.rnd(2) == 0)
60 {
61 this.Transfer(Point.shared, 1);
62 }
63 base.ModFire(-1);
64 flag = true;
65 }
66 }
67 else if (b == 1)
68 {
69 if (this.life < 2)
70 {
71 base.ModFire(-1);
72 }
73 else if (EClass.rnd(3) == 0)
74 {
75 this.Transfer(Point.shared, 1);
76 base.ModFire(1);
77 flag = true;
78 }
79 }
80 else
81 {
82 if (b > 6)
83 {
84 b = 6;
85 }
86 this.Transfer(Point.shared, b - 1);
87 flag = true;
88 }
89 }
90 }
91 }
92 }
93 if (this.fireAmount == 0)
94 {
95 base.cell.effect = null;
96 }
97 else
98 {
99 EClass._map.Burn(this.x, this.z, false);
100 }
101 if (!flag)
102 {
103 this.life--;
104 }
105 if (this.life < 0)
106 {
107 this.Kill();
108 }
109 }
110
111 // Token: 0x06002EED RID: 12013 RVA: 0x001070C0 File Offset: 0x001052C0
112 public void Transfer(Point p, byte amount = 1)
113 {
114 base.ModFire((int)(-(int)amount));
115 if (!p.cell.HasFire)
116 {
117 SE.Play("fire");
118 }
119 p.ModFire((int)amount);
120 }
121}
Definition Cell.cs:10
Definition Point.cs:11
Definition XY.cs:5