-
Notifications
You must be signed in to change notification settings - Fork 1
/
36464_fly_gb.cos
157 lines (140 loc) · 2.35 KB
/
36464_fly_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
** CAOS2PRAY
*# Pray-File "gb_betafly.agent"
*# DSGB-Name "Betaship fly GB"
*# Depend blnk.c16
*# Attach betaship_fly.c16 betaship.catalogue
*# Attach betaship_dead.c16
*# desc = "A fly from the Betaship"
*# Agent Animation File = "betaship_fly.c16"
*# Agent Animation Gallery = "betaship_fly"
*# Agent Sprite First Image = 0
*# GB_Category = 3
*# Agent Author = "Pilla"
*# link 36463_dead.cos 36463_deadremover.cos
**
** fly script
**
new: simp 2 13 36464 "betaship_fly" 2 0 rand 1000 4000
mesg wrt+ targ 1009 game "ch_x" game "ch_y" 0
**
** Creation script
**
** Fly creation
scrp 2 13 36464 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 0
aero 3
* Set collision attributes
perm 5
fric 60
elas 30
* Move to the spot if possible
mvsf _p1_ _p2_
tick 10
endm
**
** Timer script
**
** Fly timer
scrp 2 13 36464 9
tick rand 50 85
doif carr eq null
setv va00 rand -9 9
doif va00 lt 0
setv va00 rand -3 -2
setv va01 rand -1 1
pose 1
elif va00 gt 0
setv va00 rand 2 3
setv va01 rand -1 1
pose 0
endi
reps rand 4 12
setv va02 rtyp grap posx posy
doif va02 ne 8 and va02 ne 9
velo va00 va01
setv ov70 0
else
velo rand -2 2 -10
addv ov70 1
doif ov70 gt 20
targ ownr
gsub detritus
kill ownr
stop
endi
endi
wait 15
repe
doif rand 0 5 eq 0
rnge 700
setv va00 rand 0 3
esee 2 13 36464
addv va00 1
next
doif va00 lt 4
* Create new fly
setv va01 posx
setv va02 post
subv va02 5
reps 2
new: simp 2 13 36464 "betaship_fly" 2 0 rand 1200 4000
mesg wrt+ targ 1009 va01 va02 0
repe
elif va00 gt 8
gsub detritus
endi
endi
endi
subr detritus
slow
targ ownr
setv va00 posl
setv va01 post
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
stop
retn
endm
**
** Activate 1 (push) script
**
** Fly play
scrp 2 13 36464 1
stim writ from 86 1
setv va00 velx
mulv va00 3
velo va00 -3
endm
**
** Hit script
**
** Fly hit
scrp 2 13 36464 3
stim writ from 87 1
velo rand -3 3 rand -6 -3
endm
**
** Eat script
**
** Fly eat
scrp 2 13 36464 12
stim writ from 80 2
kill ownr
endm
**
** Removal script
**
rscr
enum 2 13 36464
kill targ
next