-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path21814_gerana_LIAM.cos
309 lines (273 loc) · 3.78 KB
/
21814_gerana_LIAM.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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
*Gerana
*ov00 life stage
*ov01 life force
*ov02 life length
*ov10 direction
*ov11 direction of wall (if applic.)
*ov40 (random) how many 'walks' a critter does
* Baby gerana: base 2, adult gerana: base 18
* reps 3
* new: simp 2 15 21814 "gp_gerana" 42 0 2000
* mesg wrt+ targ 1000 25820 1519 0
* repe
* Gerana creation script
scrp 2 15 21814 1000
doif base eq 0
doif rand 0 1 eq 1
base 18
else
base 2
endi
endi
pose 0
attr 194
elas .1
accg 1
perm 100
*Set basic variables
setv ov40 0
setv ov10 0
setv ov11 0
setv ov02 rand 70 120
frat 2
tick 20
mvsf _p1_ _p2_
endm
*Gerana
scrp 2 15 21814 9
lock
doif base eq 2
gsub babywalk
doif ov02 lt 1
gsub grow
endi
elif base eq 18
gsub adultwalk
doif ov02 lt 1
gsub die
endi
endi
subv ov02 1
subr grow
inst
base 18
pose 1
mvsf posl post
slow
setv ov02 rand 70 120
retn
subr die
lock
doif base eq 18
cato 10
targ ownr
frat 50
doif ov10 eq 1
anim [20 21 22 23]
else
anim [16 17 18 19]
endi
over
kill targ
elif base eq 2
cato 10
targ ownr
frat 50
doif ov10 eq 1
anim [14 15]
else
anim [12 13]
endi
over
kill targ
endi
unlk
retn
subr babywalk
setv ov40 rand 1 6
setv ov10 rand 1 -1
wait rand 1 10
doif obst rght lt 5
setv ov11 1
elif obst left lt 5
setv ov11 2
else
setv ov11 0
endi
doif carr eq null and fall = 0
*Checks for walls
doif ov11 = 1
gsub babyleft
endi
doif ov11 = 2
gsub babyright
endi
*Checks if it is going right
doif ov10 = 1
gsub babyright
endi
*Checks if it is going left
doif ov10 = -1
gsub babyleft
endi
else
stop
endi
retn
*The going right subroutine
subr babyright
reps ov40
anim [6 7]
velo 1.2 -1
over
anim [8 9]
velo 1.2 -1
over
anim [10 11]
velo 1.2 -1
over
repe
retn
*The going left subroutine
subr babyleft
reps ov40
anim [0 1]
velo -1 -1
over
anim [2 3]
velo -1 -1
over
anim [4 5]
velo -1 -1
over
repe
retn
subr adultwalk
inst
setv va20 0
rnge 250
esee 2 15 21814
addv va20 1
next
esee 2 18 21814
addv va20 1
next
doif va20 lt 8 and rand 0 10 eq 10
setv va00 posx
setv va01 posy
new: simp 2 18 21814 "gp_gerana" 2 0 rand 1500 2500
mesg wrt+ targ 1000 va00 va01 0
endi
targ ownr
setv ov40 rand 1 6
setv ov10 rand 1 -1
wait rand 1 10
doif obst rght lt 5
setv ov11 1
elif obst left lt 5
setv ov11 2
else
setv ov11 0
endi
doif carr eq null and fall = 0
*Checks for walls
doif ov11 = 1
gsub left
endi
doif ov11 = 2
gsub right
endi
*Checks if it is going right
doif ov10 = 1
gsub right
endi
*Checks if it is going left
doif ov10 = -1
gsub left
endi
else
stop
endi
retn
*The going right subroutine
subr left
reps ov40
anim [0 1]
velo -2 -1.5
over
anim [2 3]
velo -2 -1.5
over
anim [4 5]
velo -2 -1.5
over
anim [6 7]
velo -2 -1.5
over
repe
retn
*The going left subroutine
subr right
reps ov40
anim [8 9]
velo 2.2 -1.5
over
anim [10 11]
velo 2.2 -1.5
over
anim [12 13]
velo 2.2 -1.5
over
anim [14 15]
velo 2.2 -1.5
over
repe
retn
endm
scrp 2 18 21814 1000
inst
attr 194
elas .1
accg 1
perm 100
rnge 250
setv ov00 10
tick 150
mvsf _p1_ _p2_
endm
scrp 2 18 21814 9
inst
rnge 1600
setv va00 0
esee 2 15 21814
addv va00 1
next
doif va00 lt 4
inst
setv va00 posx
setv va01 post
new: simp 2 15 21814 "gp_gerana" 42 0 2000
base 2
pose 0
mesg wrt+ targ 1000 va00 va01 1
targ ownr
frat 60
anim [1 1 1]
over
kill ownr
slow
else
subv ov00 1
doif ov00 lt 1
kill ownr
endi
endi
endm
rscr
*Gerana
enum 2 15 21814
kill targ
next
enum 2 18 21814
kill targ
next