-
Notifications
You must be signed in to change notification settings - Fork 1
/
36463_food_pp.cos
127 lines (112 loc) · 2.17 KB
/
36463_food_pp.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
** CAOS2PRAY
*# Pray-File "gb_pp_betafood.agent"
*# DSGB-Name "Betaship Food PP"
*# Depend blnk.c16
*# Attach betaship_agents.c16 betaship.catalogue
*# Attach betaship_dead.c16
*# desc = "A food patch from the Betaship"
*# Agent Animation File = "betaship_agents.c16"
*# Agent Animation Gallery = "betaship_agents"
*# Agent Sprite First Image = 2
*# GB_Category = 1
*# Agent Author = "Pilla"
*# link 36463_dead.cos 36463_deadremover.cos
**
** Food script
**
** Gardenbox invisible flag holding name variables
new: simp 1 205 36463 "blnk" 0 0 9000
* Spawn script
setv name "spawn_script" 1009
sets name "sprite_file" "betaship_agents"
setv name "sprite_pose" 2
setv name "prod_fmly" 2
setv name "prod_gnus" 11
setv name "prod_spcs" 36463
setv name "density" 1
setv name "tickfrom" 200
setv name "tickto" 260
** Contact patch core agent
seta va00 targ
enum 1 1 22929
mesg wrt+ targ 1000 va00 0 0
next
**
** Creation script
**
** Food creation
scrp 1 205 36463 1009
new: simp name "prod_fmly" name "prod_gnus" name "prod_spcs" name "sprite_file" 1 name "sprite_pose" name "patch_plane"
* Attr: mouseable 2 + collide 64 + physics 128 = 194
attr 194
* Bhvr: eat 16 + pick up 32
bhvr 48
* Set physics attributes
accg 0
aero 3
* Set collision attributes
perm 60
fric 60
elas 30
* Move to the spot if possible
mvto _p1_ _p2_
setv name "patch_id" mame "patch_id"
tick rand mame "tickfrom" mame "tickto"
endm
**
** Eat script
**
** Food eat
scrp 2 11 36463 12
snde "chwp"
stim writ from 79 2
kill ownr
endm
**
** Pickup script
**
scrp 2 11 36463 4
* Emit food smell
emit 8 0.3
* Set gravity
accg 2
* Decouple from patch
setv name "patch_id" 0
endm
**
** Timer script
**
** Food
scrp 2 11 36463 9
* If around for long enough, kill it
doif carr eq null
addv ov00 1
endi
doif ov00 gt rand 6 8
* Emit food smell
emit 8 0.3
* Set gravity
accg 2
* Decouple from patch
setv name "patch_id" 0
doif carr eq null
doif ov00 gt 13
gsub detritus
endi
endi
endi
subr detritus
slow
targ ownr
setv va00 posl
setv va01 post
new: simp 2 10 36463 "betaship_dead" 1 2 rand 1000 3000
mesg wrt+ targ 1000 va00 va01 0
targ ownr
attr 16
show 0
wait 20
kill ownr
stop
retn
endm