-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path36464_fish_gb.cos
165 lines (142 loc) · 2.43 KB
/
36464_fish_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
** CAOS2PRAY
*# Pray-File "gb_betafish.agent"
*# DSGB-Name "Betaship fish GB"
*# Depend blnk.c16
*# Attach betaship_fish.c16 betaship.catalogue
*# Attach betaship_dead.c16
*# desc = "A fish from the Betaship"
*# Agent Animation File = "betaship_fish.c16"
*# Agent Animation Gallery = "betaship_fish"
*# Agent Sprite First Image = 0
*# GB_Category = 5
*# Agent Author = "Pilla"
*# link 36463_dead.cos 36463_deadremover.cos
**
** Fish script
**
new: simp 2 15 36464 "betaship_fish" 2 0 rand 1000 4000
mesg wrt+ targ 1009 game "ch_x" game "ch_y" 0
**
** Creation script
**
** Fish creation
scrp 2 15 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 8
endm
**
** Timer script
**
** Fish timer
scrp 2 15 36464 9
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 eq 8 or va02 eq 9
velo va00 va01
else
velo rand -2 2 10
endi
wait 15
repe
doif rand 0 5 eq 0
setv va02 rtyp grap posx posy
doif va02 eq 8 or va02 eq 9
elif va02 eq -1
kill ownr
else
gsub detritus
endi
rnge 700
setv va00 rand 0 3
esee 2 15 36464
addv va00 1
next
doif va00 lt 4
* Create new fish
setv va01 posx
setv va02 post
subv va02 5
reps 2
new: simp 2 15 36464 "betaship_fish" 2 0 rand 1200 4000
mesg wrt+ targ 1009 va01 va02 0
repe
elif va00 gt 8
gsub detritus
targ ownr
kill ownr
endi
endi
endi
tick rand 50 85
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
**
** Fish play
scrp 2 15 36464 1
stim writ from 86 1
setv va00 velx
mulv va00 3
velo va00 -3
endm
**
** Hit script
**
** Fish hit
scrp 2 15 36464 3
stim writ from 87 1
velo rand -3 3 rand -6 -3
endm
**
** Eat script
**
** Fish eat
scrp 2 15 36464 12
stim writ from 80 2
kill ownr
endm
**
** Removal script
**
rscr
** Remove all fishies
enum 2 15 36464
kill targ
next