-
Notifications
You must be signed in to change notification settings - Fork 3
/
21813_mossytree_GHOLAU.cos
224 lines (186 loc) · 2.98 KB
/
21813_mossytree_GHOLAU.cos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
** Code by Laura and Ghosthande
*initial seed script
* new: simp 2 3 21813 "gp_mossytree_JESS" 1 rand 9 10 1000
** Mossy seed
scrp 2 3 21813 1000
attr 195
bhvr 48
elas 0.5
aero 2
accg 0.2
perm 100
** delay growth
tick rand 200 800
mvsf _p1_ _p2_
endm
** Eternal Mossy tree
scrp 2 4 21813 1000
setv ov55 0
setv ov56 1
bhvr 3
attr 0
perm 40
emit 7 1
accg 3
elas 25
fric 90
aero 2
setv ov10 rand 200 1000
mvto _p1_ _p2_
tick 1200
endm
* Population control script
scrp 1 1 21813 9
rnge 1000
tick rand 900 1200
setv va00 0
esee 2 4 21813
addv va00 1
next
doif va00 lt 1
setv va10 posx
setv va11 posy
new: simp 2 3 21813 "gp_mossytree_JESS" 1 rand 9 10 1000
mesg wrt+ targ 1000 va10 va11 1
endi
endm
*tree timer script
scrp 2 4 21813 9
tick 0
doif ov55 eq 0
gsub grow
elif ov55 ge 1
gsub seed
else
gsub die
endi
** grow
subr grow
tick rand 250 600
setv va00 pose
doif va00 lt 7
addv va00 1
pose va00
else
setv ov55 1
endi
retn
** produce seeds
subr seed
tick rand 1000 2400
addv ov55 1
doif ov55 gt 20 and ov56 ne 1
setv ov55 -1
endi
** produce 1 seed at a time
setv va10 posx
setv va11 post
addv va10 rand -50 50
addv va11 rand 50 100
** seeds spawned by the tree
new: simp 2 3 21813 "gp_mossytree_JESS" 1 rand 9 10 1000
mesg wrt+ targ 1000 va10 va11 0
retn
** die
subr die
pose 8
wait rand 40 80
kill ownr
retn
endm
*seed pick up script
scrp 2 3 21813 4
** "I have gotten"
stim writ from 18 1
endm
*seed drop script
scrp 2 3 21813 5
** "I have dropped"
stim writ from 19 1
endm
*seed collision script
scrp 2 3 21813 6
sndc "smit"
endm
*seed eat script
scrp 2 3 21813 12
sndc "chwp"
** "I have eaten plant"
stim writ from 77 1
kill ownr
endm
*seed timer script
scrp 2 3 21813 9
doif carr eq null and fall ne 1
** set room types
doif rtyp room ownr >= 5 and rtyp room ownr <= 7
wait rand 10 40
setv va00 posx
setv va01 posy
** make sure the population isn't too dense already
rnge 1000
setv ov00 0
esee 2 4 21813
addv ov00 1
next
rnge 300
setv va30 0
esee 2 4 21813
addv va30 1
next
doif ov00 lt 2 and va30 lt 1
new: simp 2 4 21813 "gp_mossytree_JESS" 9 0 rand 200 6000
setv ov55 0
bhvr 3
attr 0
perm 40
emit 7 1
accg 3
elas 25
fric 90
aero 2
setv ov10 rand 200 1000
subv va00 170
subv va01 400
mvto va00 va01
tick 1200
kill ownr
stop
** give seeds multiple chances to grow
endi
endi
addv ov11 1
doif ov11 > 3
kill ownr
endi
endi
endm
*tree push script
scrp 2 4 21813 1
** "I have pushed friendly plant"
stim writ from 84 1
endm
*tree pull script
scrp 2 4 21813 2
** "I have pulled friendly plant"
stim writ from 84 1
endm
*remove script
rscr
enum 1 1 21813
kill targ
next
enum 2 4 21813
kill targ
next
enum 2 3 21813
kill targ
next
scrx 2 4 21813 9
scrx 2 3 21813 4
scrx 2 3 21813 5
scrx 2 3 21813 6
scrx 2 3 21813 12
scrx 2 3 21813 9
scrx 2 4 21813 1
scrx 2 4 21813 2