-
Notifications
You must be signed in to change notification settings - Fork 3
/
21833_hairhydraplanter_gb.cos
394 lines (343 loc) · 5.79 KB
/
21833_hairhydraplanter_gb.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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
**
** hair hydrangea planter script
**
** Sprites by Jesseth, coding by Pilla.
**
**
** Feel free to use this code however you want.
**
**
**
** Caos2pray chunk
**
** Compiles the agent.
**
* CAOS2PRAY CHUNK
*# Pray-File "gb_hairhydra_planter_JESS.agents"
*# DSGB-Name "GP - Planter (hairhydra) GB"
*# attach gp_hairhydra_planter_JESS.c16 GrenP_Hairhydraplanter.catalogue
*# desc = "A planter with hair algae and a cute hydrangea that bounces around.by Jesseth"
*# Agent Animation File = "gp_hairhydra_planter_JESS.c16"
*# Agent Sprite First Image = 0
*# Agent Animation Gallery = "gp_hairhydra_planter_JESS"
*# GB_Category = 7
*# GB_Category Name = "Planters"
*# Agent Author = "Jesseth & Pilla"
*# link 21833_hairhydraplanter.cos
*
*
*
** Injection script
**
**
** The planter
**
new: comp 2 23 21833 "gp_hairhydra_planter_JESS" 1 0 rand 700 900
mesg wrt+ targ 1000 Game "ch_x" Game "ch_y" 0
**
** SCRIPTS
**
**
** Planter creator script
**
scrp 2 23 21833 1000
new: comp 2 23 21833 "gp_hairhydra_planter_JESS" 1 0 rand 700 900
** Attributes: mouseable 2 + activateable 4 + invisible 16 + collide 64 + physics 128 = 214
attr 214
perm 100
accg 0
elas 0
fric 100
aero 100
perm 100
bhvr 0
** The hydrangea spawning spot
pat: dull 3 "gp_hairhydra_planter_JESS" 1 16 25 1
** The hair spawning spots
pat: dull 6 "gp_hairhydra_planter_JESS" 6 21 4 1
pat: dull 7 "gp_hairhydra_planter_JESS" 6 25 11 1
pat: dull 8 "gp_hairhydra_planter_JESS" 6 40 13 1
tick 20
mvsf _p1_ _p2_
slow
targ ownr
kill targ
endm
**
** PLANTER PUSH SCRIPT
**
scrp 2 23 21833 1
mesg writ pntr 101
setv va05 posl
setv va06 post
addv va05 16
addv va06 25
part 3
frat 4
lock
anim [1 2 3]
over
inst
** Vend a hydrangea
new: simp 2 21 21833 "gp_hairhydra_planter_JESS" 7 11 rand 1800 1900
** attr: mouseable 2 + activateable 4 + collide 64 + physics 128 = 198
attr 198
** Will go through some walls
perm 80
** Physics
accg 0.1
aero 1
fric 60
elas 40
** bhvr: act1 1 + act2 2 + hit 3 + pickup 32 = 43
bhvr 43
tick 1800
velo rand -1 1 0
mvsf va05 va06
targ ownr
part 3
pose 0
slow
endm
**
** PLANTER TIMER SCRIPT
**
scrp 2 23 21833 9
doif carr eq null
tick rand 160 260
lock
** Check whether there's a hydrangea growing
part 3
setv va00 0
doif pose ne 0
addv va00 1
endi
** If there is no hydrangea, there may grow one.
doif va00 eq 0 and rand 0 10 eq 0
** hydrangea subroutine
part 3
pose 1
else
** If there are hydrangeas, grow them
doif pose ge 1 and pose lt 3
setv va10 pose
addv va10 1
pose va10
elif pose eq 3
inst
gsub dropedible
slow
targ ownr
part 3
pose 0
endi
endi
** Grow the flowers and spawn the hair
setv va01 6
part va01
reps 3
** hair subroutine
doif pose ge 1 and pose lt 3
setv va10 pose
addv va10 1
pose va10
elif pose eq 3
gsub dropedible
** reset seed lobe
targ ownr
part va01
pose 0
endi
addv va01 1
targ ownr
repe
** Check how many hairs there are currently growing
setv va02 0
setv va03 6
reps 3
part va03
doif pose ne 0
addv va02 1
endi
addv va03 1
repe
** If there are less than 3 hairs growing, there may grow another one.
doif va00 lt 3 and rand 0 2 eq 0
setv va13 0
** Make the first checking point random.
setv va01 6
addv va01 rand 0 2
** If the first spot isn't free, try the next one.
reps 3
part va01
doif pose eq 0 and va13 eq 0
pose 1
addv va13 1
endi
addv va01 1
doif va01 gt 8
setv va01 6
endi
repe
endi
endi
subr dropedible
inst
doif va01 ge 6
setv va05 posl
setv va06 post
** hairs 6 7 8
doif va01 eq 6
addv va05 21
addv va06 4
elif va01 eq 7
addv va05 25
addv va06 11
elif va01 eq 8
addv va05 40
addv va06 13
endi
doif sorq 2 3 21802 9 eq 0
new: simp 2 3 21833 "gp_hairhydra_planter_JESS" 1 10 rand 1200 1900
else
new: simp 2 3 21802 "gp_hair_algae_JESS" 1 0 rand 1000 2000
endi
** bhvr: eat 16 + pickup 32 = 48
bhvr 48
** attr: mouseable 2 + collide 64 + physics 128 = 194
attr 194
elas 40
accg 0.1
tick rand 1200 1600
else
targ ownr
setv va05 posl
setv va06 post
addv va05 14
addv va06 24
new: simp 2 21 21833 "gp_hairhydra_planter_JESS" 7 11 rand 1200 1900
** bhvr: act1 1 + act2 2 + hit 8 + pickup 32 = 43
bhvr 43
** attr: mouseable 2 + activateable 4 + collide 64 + physics 128 = 198
attr 198
elas 90
accg 0.1
** timer variable
setv ov99 0
tick 600
endi
** Will go through some walls
perm 80
** Physics
aero 1
fric 60
velo 0 0
mvsf va05 va06
slow
retn
endm
**
** hydrangea PUSH
**
scrp 2 21 21833 1
lock
stim writ from 97 0.7
wait 5
targ from
drop
targ ownr
velo rand -3 3 rand -3 -1
frat 2
anim [ 1 2 3 4 5 6 0]
over
unlk
endm
**
** hydrangea PULL
**
scrp 2 21 21833 2
lock
stim writ from 97 0.7
wait 5
targ from
drop
targ ownr
velo rand -3 3 rand -3 -1
frat 2
anim [ 1 2 3 4 5 6 0]
over
unlk
endm
**
** hydrangea HIT
**
scrp 2 21 21833 3
lock
stim writ from 97 0.7
stim writ from 92 1
wait 5
targ from
drop
targ ownr
velo rand -3 3 rand -3 -1
frat 1
anim [ 1 2 3 4 5 6 0 1 2 3 4 5 6 0]
over
unlk
endm
**
** hair EAT
**
scrp 2 3 21833 12
lock
wait 10
** stim eat food
stim writ from 79 1
wait 10
kill ownr
unlk
endm
**
** hydrangea TIMER
**
scrp 2 21 21833 9
doif carr eq null
doif ov99 lt 5
addv ov99 1
velo rand -3 3 -2
frat 2
anim [ 1 2 3 4 5 6 0]
else
kill ownr
endi
endi
endm
**
** hair TIMER
**
scrp 2 3 21833 9
doif carr eq null
kill ownr
endi
endm
*
** Removal script
*
rscr
enum 2 23 21833
kill targ
next
enum 2 21 21833
kill targ
next
enum 2 3 21833
kill targ
next
scrx 2 23 21833 1
scrx 2 23 21833 9
scrx 2 21 21833 9
scrx 2 21 21833 1
scrx 2 21 21833 2
scrx 2 21 21833 3
scrx 2 3 21833 9
scrx 2 3 21833 12