-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path36468_leaf.cos
161 lines (145 loc) · 2.52 KB
/
36468_leaf.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
**
** Leaf script
**
**
** Install script
**
** Leaves
** Big ocean
reps 8
new: simp 2 6 36468 "betaship_tools" 1 1 rand 1500 4000
mesg wrt+ targ 1000 54919 26115 1
velo rand -200 200 0
repe
* main controller
new: simp 2 5 36468 "blnk" 1 0 1
tick 50
**
** Event scripts
**
** Creation script
scrp 2 6 36468 1000
* Attr: mouseable 2 + collide 64 + physics 128 = 194
attr 194
* Bhvr: eat 16 + pick up 32 = 48
bhvr 56
* Set physics attributes
accg 0
aero 3
* Set collision attributes
perm 5
fric 70
elas 0
* Move to the spot if possible
doif tmvt _p1_ _p2_ ne 0
mvto _p1_ _p2_
else
kill targ
endi
tick 1
endm
** Main controller timer
scrp 2 5 36468 9
doif sean eq 2
doif rand 1 4 eq 4
new: simp 2 6 36468 "betaship_tools" 1 1 rand 1500 4000
mesg wrt+ targ 1000 rand 53959 54504 rand 26836 26919 1
endi
doif rand 1 4 eq 4
new: simp 2 6 36468 "betaship_tools" 1 1 rand 1500 4000
mesg wrt+ targ 1000 rand 55163 55637 rand 26816 26903 1
endi
doif rand 1 8 eq 8
new: simp 2 6 36468 "betaship_tools" 1 1 rand 1500 4000
mesg wrt+ targ 1000 rand 54368 54599 rand 27160 27248 1
endi
endi
endm
** Leaf timer
scrp 2 6 36468 9
addv ov50 1
doif carr eq null
setv va00 rand -9 9
doif va00 lt 0
setv va00 rand -2 -1
setv va01 rand -2 2
elif va00 gt 0
setv va00 rand 1 2
setv va01 rand -2 2
endi
reps rand 4 12
setv va02 rtyp grap posx posy
doif va02 eq 8 or va02 eq 9
aero 3
velo va00 va01
else
aero 0
divv va00 3.0
velo va00 1
endi
wait 15
repe
doif rand 0 5 eq 0
setv va02 rtyp grap posx posy
doif va02 eq 8 or va02 eq 9
else
doif ov50 gt 30
doif room ownr ne -1
altr room ownr 4 0.01
endi
kill ownr
stop
endi
endi
rnge 700
setv va00 rand 0 3
esee 2 6 36468
addv va00 1
next
* Create new leaf
doif va02 eq 8 or va02 eq 9
doif va00 lt 4
setv va01 posx
setv va02 post
subv va02 5
reps 2
new: simp 2 6 36468 "betaship_tools" 1 1 rand 1200 4000
mesg wrt+ targ 1000 va01 va02 0
repe
elif va00 gt 8
doif room ownr ne -1
altr room ownr 4 1
endi
kill ownr
stop
endi
endi
endi
endi
targ ownr
tick rand 50 85
endm
* eat
scrp 2 6 36468 12
stim writ from 77 rand 1 2
kill ownr
endm
* collide
scrp 2 6 36468 6
setv va00 grap posx posy
doif rtyp va00 eq 8 or rtyp va00 eq 9
else
doif room ownr ne -1
altr room ownr 4 1
endi
kill ownr
stop
endi
endm
rscr
enum 2 6 36468
kill targ
next
enum 2 5 36468
kill targ
next