-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path21823_grendelmother.cos
361 lines (323 loc) · 6.92 KB
/
21823_grendelmother.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
**
** Caos2pray chunk
**
** Compiles the agent.
**
* CAOS2PRAY CHUNK
*# Pray-File "gp_grendel_mother_UZAG.agents"
*# DS-Name "Grendel Mother thing"
*# attach gp_grendelmother_UZAG.c16
*# depend blnk.c16
*# desc = "Grendel egg layer."
*# Agent Animation File = "gp_grendelmother_UZAG.c16"
*# Agent Sprite First Image = 0
*# Agent Animation Gallery = "gp_grendelmother_UZAG"
*
*
**
** GRENDEL MOTHER
**
**
** Grendel egg maker script.
** This goes through the grendel egg agents you have installed.
** Functions: left/right buttons, male/female switch, breed name, go button
**
**grendel egg maker
scrp 3 3 21823 1000
attr 208
fric 90
elas 10
accg 4
aero 5
perm 100
emit 16 0.5
** text box, GO button, left button, right button, gender button
pat: fixd 1 "gp_grendelmother_UZAG" 17 -12 -23 5 "whiteontransparentchars"
pat: butt 2 "gp_grendelmother_UZAG" 9 2 78 76 1 [0] 1001 0
pat: butt 3 "gp_grendelmother_UZAG" 11 2 1 19 1 [0] 1001 0
pat: butt 4 "gp_grendelmother_UZAG" 13 2 1 30 1 [0] 1001 0
pat: butt 5 "gp_grendelmother_UZAG" 15 2 26 72 1 [] 1001 0
** The scary image. What's this I don't even.
pat: dull 6 "blnk" 0 30 12 5
part 3
anim [1]
part 4
anim [1]
part 2
anim [1]
** Females default. Because I can.
setv ov00 2
mvsf _p1_ _p2_
tick 1
endm
** The initialize script: search for a grendel breed in your agents folder to show initially.
scrp 3 3 21823 9
* va99: grendel genetics found
* va98: more than 100 breeds searched
setv va99 0
setv va98 0
* va97: last breed displayed
sets va97 ""
inst
* get the next grendel egg agent
loop
sets ov90 pray next "EGGS" va97
sets va97 ov90
sets va01 pray agts ov90 "Genetics File" ""
sets va02 subs va01 1 4
doif va02 eq "gren"
setv va99 1
endi
addv va98 1
untl va99 eq 1 or va98 gt 100
* if more than 100 agents searched, there are no grendel egg agents. This shouldn't happen since we include one.
doif va98 gt 100
sets ov90 ""
targ ownr
part 1
ptxt "Nothing found"
else
* Display the grendel breed name!
gsub display_name
endi
slow
* Disable ticks
tick 0
** Name display function: Displays the breed name and image on the screen.
subr display_name
sets va01 ov90
targ ownr
part 1
ptxt va01
doif pray test ov90 > 0
doif ov00 eq 1
part 6
setv va23 pray file pray agts ov90 "Egg Glyph File" "blnk.s16" 2 1
doif pray file pray agts ov90 "Egg Glyph File" "blnk.s16" 2 1 eq 1
gall "blnk" 0
else
anim [0]
gall pray agts ov90 "Egg Gallery male" "blnk" 0
endi
elif ov00 eq 2
part 6
setv va23 pray file pray agts ov90 "Egg Glyph File 2" "blnk.s16" 2 1
doif pray file pray agts ov90 "Egg Glyph File 2" "blnk.s16" 2 1 eq 1
gall "blnk" 0
else
anim [0]
gall pray agts ov90 "Egg Gallery female" "blnk" 0
endi
endi
endi
retn
endm
** Button click script
scrp 3 3 21823 1001
* refresh the pray agents file folder
pray refr
* GO button
doif _p1_ eq 2
* If there is a grendel genome loaded, pick that genome and lay an egg
doif ov90 ne ""
gsub lay_egg
else
* If not, do nothing and display nothing found text on the info bar.
targ ownr
part 1
ptxt "Nothing found"
endi
* LEFT button
elif _p1_ eq 3
gsub prev_genome
* RIGHT button
elif _p1_ eq 4
gsub next_genome
* GENDER button
elif _p1_ eq 5
gsub set_gender
endi
*
** Subroutines
*
** Lay the egg
subr lay_egg
inst
* Check some... stuff.
setv va00 pray test ov90
setv va23 pray deps ov90 1
sets va99 ov90
rtar 1 1 161
doif targ ne null
lock
wait 1
endi
targ ownr
* If va23 != 0 then we have problems
doif va23 ne 0 or va00 eq 0
targ ownr
part 1
ptxt "Error"
stop
endi
* set some variables
sets va01 pray agts ov90 "Genetics File" "gren*"
setv va02 ov00
setv va50 posl
addv va50 130
setv va51 post
addv va51 5
lock
part 0
frat 2
anim [1 2 3 4 5 6 7 8]
over
pose 0
* create the new egg
inst
new: simp 3 4 2 "greneggmask" 7 1 10
elas 30
fric 70
attr 195
bhvr 32
aero 0
accg 2
perm 60
gene load targ 1 va01
setv ov01 va02
mvsf va50 va51
velo rand 10 14 -3
tick 600
slow
targ ownr
unlk
retn
** Goto next egg agent with grendel genome
subr next_genome
* set some variables
setv va99 0
setv va98 0
sets va97 ov90
inst
* find the next agent with a genetics file that starts with gren
loop
sets ov90 pray next "EGGS" va97
sets va97 ov90
sets va01 pray agts ov90 "Genetics File" ""
sets va02 subs va01 1 4
doif va02 eq "gren"
setv va99 1
endi
addv va98 1
untl va99 eq 1 or va98 gt 100
slow
* If more than 100 egg agents searched without result, throw error
doif va98 gt 100
targ ownr
sets ov90 ""
part 1
ptxt "No genomes"
stop
else
gsub display_name
endi
retn
** Goto previous egg agent with grendel genome
subr prev_genome
setv va99 0
setv va98 0
sets va97 ov90
inst
* find the previous egg agent with a genome that starts with gren
loop
sets ov90 pray prev "EGGS" va97
sets va97 ov90
sets va01 pray agts ov90 "Genetics File" ""
sets va02 subs va01 1 4
doif va02 eq "gren"
setv va99 1
endi
addv va98 1
untl va99 eq 1 or va98 gt 100
slow
* If more than 100 egg agents searched without result, throw error
doif va98 gt 100
targ ownr
sets ov90 ""
part 1
ptxt "No genomes"
stop
else
gsub display_name
endi
retn
** Gender switch: checks for current gender status and changes it and image accordingly.
subr set_gender
doif ov00 eq 2
setv ov00 1
part 5
pose 1
else
setv ov00 2
part 5
pose 0
endi
doif pray test ov90 > 0
doif ov00 eq 1
part 6
setv va23 pray file pray agts ov90 "Egg Glyph File" "blnk.s16" 2 1
doif pray file pray agts ov90 "Egg Glyph File" "blnk.s16" 2 1 eq 1
gall "blnk" 0
else
anim [0]
gall pray agts ov90 "Egg Gallery male" "blnk" 0
endi
elif ov00 eq 2
part 6
setv va23 pray file pray agts ov90 "Egg Glyph File 2" "blnk.s16" 2 1
doif pray file pray agts ov90 "Egg Glyph File 2" "blnk.s16" 2 1 eq 1
gall "blnk" 0
else
part 6
anim [0]
gall pray agts ov90 "Egg Gallery female" "blnk" 0
endi
endi
endi
retn
** Name display function: Displays the breed name and image on the screen.
subr display_name
sets va01 ov90
targ ownr
part 1
ptxt va01
doif pray test ov90 > 0
doif ov00 eq 1
part 6
setv va23 pray file pray agts ov90 "Egg Glyph File" "blnk.s16" 2 1
doif pray file pray agts ov90 "Egg Glyph File" "blnk.s16" 2 1 eq 1
gall "blnk" 0
else
anim [0]
gall pray agts ov90 "Egg Gallery male" "blnk" 0
endi
elif ov00 eq 2
part 6
setv va23 pray file pray agts ov90 "Egg Glyph File 2" "blnk.s16" 2 1
doif pray file pray agts ov90 "Egg Glyph File 2" "blnk.s16" 2 1 eq 1
gall "blnk" 0
else
part 6
anim [0]
gall pray agts ov90 "Egg Gallery female" "blnk" 0
endi
endi
endi
retn
endm
****REMOVAL
rscr
enum 3 3 21823
kill targ
next
scrx 3 3 21823 1001