Elin Modding Docs Doc
Loading...
Searching...
No Matches
AreaTypeFarm.cs
1
using
System;
2
using
System.Collections.Generic;
3
using
Newtonsoft.Json;
4
5
// Token: 0x02000225 RID: 549
6
public
class
AreaTypeFarm
:
AreaType
7
{
8
// Token: 0x17000403 RID: 1027
9
// (get) Token: 0x06000F80 RID: 3968 RVA: 0x0006FC32 File Offset: 0x0006DE32
10
public
override
bool
IsWork
11
{
12
get
13
{
14
return
true
;
15
}
16
}
17
18
// Token: 0x06000F81 RID: 3969 RVA: 0x0006FC38 File Offset: 0x0006DE38
19
public
override
AIAct
GetAI()
20
{
21
Point
plowPos = this.GetPlowPos();
22
if
(plowPos !=
null
)
23
{
24
if
(plowPos.HasObj)
25
{
26
return
new
TaskCut
27
{
28
pos = plowPos.Copy()
29
};
30
}
31
return
new
AI_Farm
32
{
33
pos = plowPos.Copy()
34
};
35
}
36
else
37
{
38
if
(
EClass
.rnd(3) == 0)
39
{
40
return
new
AI_Farm
41
{
42
pos = this.owner.GetRandomFreePos()
43
};
44
}
45
if
(
EClass
.rnd(3) == 0)
46
{
47
return
new
AI_Water
48
{
49
pos = this.owner.GetRandomFreePos()
50
};
51
}
52
return
base.GetAI();
53
}
54
}
55
56
// Token: 0x06000F82 RID: 3970 RVA: 0x0006FCC0 File Offset: 0x0006DEC0
57
public
Point
GetPlowPos()
58
{
59
List<Point> list =
new
List<Point>();
60
foreach
(
Point
point
in
this.owner.points)
61
{
62
if
((point.sourceFloor.ContainsTag(
"grass"
) || point.sourceFloor.tag.Contains(
"soil"
)) && (!point.IsFarmField || point.HasObj))
63
{
64
list.Add(point);
65
}
66
}
67
if
(list.Count > 0)
68
{
69
return
list.RandomItem<
Point
>();
70
}
71
return
null
;
72
}
73
74
// Token: 0x04000D82 RID: 3458
75
[JsonProperty]
76
public
int
refSeed;
77
}
AI_Farm
Definition
AI_Farm.cs:5
AI_Water
Definition
AI_Water.cs:5
AIAct
Definition
AIAct.cs:7
AreaTypeFarm
Definition
AreaTypeFarm.cs:7
AreaType
Definition
AreaType.cs:7
EClass
Definition
EClass.cs:7
Point
Definition
Point.cs:11
TaskCut
Definition
TaskCut.cs:5
Elin
AreaTypeFarm.cs
Generated by
1.12.0