-
Notifications
You must be signed in to change notification settings - Fork 1
/
36463_bug_gb.cos
169 lines (152 loc) · 2.69 KB
/
36463_bug_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
** CAOS2PRAY
*# Pray-File "gb_betabug.agent"
*# DSGB-Name "Betaship bug GB"
*# Depend blnk.c16
*# Attach betaship_agents.c16 betaship.catalogue
*# Attach betaship_dead.c16
*# desc = "A bug from the Betaship"
*# Agent Animation File = "betaship_agents.c16"
*# Agent Animation Gallery = "betaship_agents"
*# Agent Sprite First Image = 6
*# GB_Category = 3
*# Agent Author = "Pilla"
*# link 36463_dead.cos 36463_deadremover.cos
**
** Bug script
**
new: simp 2 13 36463 "betaship_agents" 2 6 rand 1000 4000
mesg wrt+ targ 1009 game "ch_x" game "ch_y" 0
**
** Creation script
**
** Bug creation
scrp 2 13 36463 1009
* Attr: mouseable 2 + collide 64 + physics 128 = 194
attr 194
* Bhvr: act1 1 + hit 8 + eat 16 + pick up 32 = 57
bhvr 57
* Set physics attributes
accg 2
aero 3
* Set collision attributes
perm 60
fric 60
elas 30
* Move to the spot if possible
mvsf _p1_ _p2_
tick 8
endm
**
** Activate 1 (push) script
**
** Bug play
scrp 2 13 36463 1
* stim played with good bug
stim writ from 85 1
* move the bug around a bit
setv va00 velx
mulv va00 3
velo va00 -3
endm
**
** Hit script
**
** Bug hit
scrp 2 13 36463 3
* stim hit animal
stim writ from 87 1
* move the bug around a little
velo rand -3 3 rand -6 -3
endm
**
** Eat script
**
** Bug eat
scrp 2 13 36463 12
* stim eaten animal
stim writ from 80 2
kill ownr
endm
**
** Timer script
**
* Bug
scrp 2 13 36463 9
* if not being carried
doif carr eq null
* Pick direction
setv va00 rand 1 8
doif va00 le 4
setv va00 rand -8 -5
pose 1
elif va00 gt 4
setv va00 rand 5 8
pose 0
endi
* walk
reps rand 4 12
* if not busy falling
doif fall ne 1
setv va20 grap posx posy
* if in water, set accg
doif rtyp va20 eq 8 or rtyp va20 eq 9
accg 0.8
* if in invalid spot, kill
elif rtyp va20 eq -1
kill targ
stop
* if on land, set accg
else
accg 2
endi
* move!
velo va00 -8
endi
wait 15
repe
* randomly make kids
doif rand 0 5 eq 0
rnge 1000
* set random variable to get dynamic population
setv va00 rand 0 3
* check if not too many around
esee 2 13 36463
addv va00 1
next
doif va00 lt 4
* Create new bugs
targ ownr
setv va01 posx
setv va02 post
subv va02 5
reps 2
new: simp 2 13 36463 "betaship_agents" 2 6 rand 1200 4000
mesg wrt+ targ 1009 va01 va02 0
repe
* if too many bugs around, die
elif va00 gt 7
gsub detritus
endi
endi
endi
* set tick
tick rand 50 85
subr detritus
slow
targ ownr
setv va00 posl
setv va01 post
subv va01 10
new: simp 2 10 36463 "betaship_dead" 1 1 rand 1000 3000
mesg wrt+ targ 1000 va00 va01 0
targ ownr
attr 16
show 0
wait 20
kill ownr
retn
endm
rscr
enum 2 13 36463
kill targ
next