File: kitty_spear.cfg

package info (click to toggle)
frogatto-data 1.0-2
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze
  • size: 155,116 kB
  • sloc: makefile: 1
file content (233 lines) | stat: -rw-r--r-- 7,934 bytes parent folder | download
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
[prototype]
feet_width="4"
friction="1000"
functions="#looks for the player and turns to face it#	
	  def set_facing(obj,level) if(desired_facing != obj.facing, [animation('turn'),set(obj,'facing', desired_facing)], animation('walk')
	           ) where desired_facing = if(level.player.x < obj.x, -1, 1);
	1"
hitpoints="6"
id="kitty_spear"
mass="5"
on_bounced_on="[add(hitpoints, -5), set(me.green, 0), set(me.blue, 0), schedule(4, [set(me.green, 255), set(me.blue, 255)]), if(jumped_on_by.mass >= 1000, die(), animation('spring'))]"
on_collide="if(animation in ['readyspearthrust', 'spearthrust'], [set(velocity_x, 0)], if(collide_with != level.player, [set(velocity_x,-velocity_x/2),set(facing, -facing),animation('turn')]))"
on_collide_object_body="if(collide_with.vars.team != vars.team and collide_with_area = 'attack', get_hit_by(collide_with))"
on_create="animation('stand')"
on_die="[score(level,points_value), spawn_item(self), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
on_end_alert_anim="if(facing != desired_facing,
	                    [animation('turn'), set(facing, desired_facing)],
						animation('dash'))"
on_end_dash_anim="if(abs(level.player.midpoint_x - self.midpoint_x) < 120 or facing != desired_facing, [animation('readyspearthrust'),set(vars.attack_counter,3)], animation('dash'))"
on_end_hurt_anim="if(is_standing,[set(vars.posthurt_counter, 3),animation('posthurt')],animation('hurt'))"
on_end_posthurt_anim="if(vars.posthurt_counter > 0,[set(vars.posthurt_counter, vars.posthurt_counter - 1),animation('posthurt')],animation('stand'))"
on_end_readyspearthrust_anim="if(vars.attack_counter > 0,[set(vars.attack_counter, vars.attack_counter - 1),animation('readyspearthrust')],[animation('spearthrust'),set(velocity_x, 400*facing)])"
on_end_spearthrust_anim="if(facing != desired_facing,
	                          [animation('turn'), set(facing, desired_facing)],
	                           animation('stand'))"
on_end_spring_anim="animation('walk')"
on_end_stand_anim="choose_action()"
on_end_turn_anim="if(abs(level.player.midpoint_x - midpoint_x) < 90 and
	                     level.player.y > y2 and level.player.y2 < y,
	                     animation('readyspearthrust'), animation('walk'))"
on_end_walk_anim="choose_action()"
on_enter_anim="set(tmp, 'already_hit', [])"
on_enter_water="die()"
on_hurtflicker="if(green = 100,[set(green, 255), set(blue, 255)],[set(green, 100), set(blue, 100)])"
on_leave_hurt_anim="[set(green, 255), set(blue, 255)]"
on_process="set(rotate, slope_standing_on)"
on_process_dash="if(abs(level.player.midpoint_x - self.midpoint_x) < 70, [animation('readyspearthrust'), set(vars.attack_counter, 3)])"
on_surface_damage="die()"
on_timer="if(turns_at_cliffs and is_standing and animation = 'walk' and distance_to_cliff < 30,[set(facing, -facing),animation('turn')],null())"
solid_area="6,10,26,33"
solid_dimensions="enemy,common"
timer_frequency="5"
traction="1000"
	[properties]
	get_hit_by="def(collide_with) execute(me,
	             if(not (me in collide_with.tmp.already_hit), [
				set(collide_with.tmp, 'already_hit', collide_with.tmp.already_hit + [me]),
				if((not is_invincible_posthit) and (collide_with.vars.damage > 0),
					if(collide_with.vars.damage > consts.armor,
					  [
					   if(me.hitpoints > collide_with.vars.damage,
						[
						  if(collide_with.vars.damage <= consts.flinch_threshold,
							schedule(4, [set(me.green, 255), set(me.blue, 255)]),
							set(me.animation, 'hurt')),
						  set(me.green, 100), set(me.blue, 100)
						]),
					   set(me.hitpoints, me.hitpoints - collide_with.vars.damage),
					   set(tmp.time_last_hit, me.cycle)
					  ])),
				if(collide_with.vars.damage > consts.flinch_threshold and me.hurt_velocity_y and (not collide_with.tmp.no_flinch_attack), set(me.velocity_y,(me.hurt_velocity_y))),
				if(collide_with.vars.damage > consts.flinch_threshold and me.hurt_velocity_x and (not collide_with.tmp.no_flinch_attack), set(me.velocity_x, ((me.hurt_velocity_x * collide_with.facing + collide_with.velocity_x/2)*collide_with.mass*if(collide_with.attack_force, collide_with.attack_force, 100))/(me.mass*100)))]))"
	hurt_velocity_x="400"
	hurt_velocity_y="-800"
	is_invincible_posthit="if(tmp.time_last_hit and (abs(tmp.time_last_hit - me.cycle) < consts.posthit_invicibility_period), 1, 0)"
	[/properties]

	[tmp]
	time_last_hit="0"
	[/tmp]

	[vars]
	attack_counter="0"
	damage="1"
	points_value="10"
	posthurt_counter="0"
	team="'evil'"
	turns_at_cliffs="1"
	turns_towards_player="0"
	[/vars]

	[consts]
	bounce_roundness="80"
	flinch_threshold="1"
	normal_damage="1"
	spring_amount="1400"
	springiness="200"
	thrown_damage="10"
	[/consts]

	[properties]
	choose_action="def() animation('walk')"
	desired_facing="if(level.player.midpoint_x < self.midpoint_x, -1, 1)"
	[/properties]

	[animation]
	accel_x="0"
	accel_y="80"
	body_area="all"
	duration="8"
	frame_info="7,5,0,3,335,145,34,28,7,6,0,3,369,145,34,27,7,7,0,3,403,145,34,26,7,5,0,3,437,145,34,28,7,6,0,3,471,145,34,27,7,7,0,3,505,145,34,26,7,6,0,3,539,145,34,27"
	frames="7"
	id="stand"
	image="compiled-2.png"
	rect="328,140,368,175"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="0"
	accel_y="80"
	body_area="all"
	duration="12"
	frame_info="8,6,10,3,390,997,23,27"
	frames="1"
	id="turn"
	image="compiled-1.png"
	rect="382,991,422,1026"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="300"
	accel_y="80"
	body_area="all"
	duration="6"
	frame_info="7,5,0,3,200,145,34,28,7,6,0,3,234,145,34,27,7,5,1,3,268,145,33,28,7,6,0,3,301,145,34,27"
	frames="4"
	id="walk"
	image="compiled-2.png"
	rect="193,140,233,175"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="1000"
	accel_y="80"
	body_area="all"
	duration="6"
	frame_info="5,6,1,3,250,997,35,27,5,8,1,3,285,997,35,25,5,6,1,3,320,997,35,27,5,8,1,3,355,997,35,25"
	frames="4"
	id="dash"
	image="compiled-1.png"
	rect="245,991,285,1026"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="0"
	accel_y="80"
	body_area="all"
	duration="2"
	frame_info="4,8,7,3,698,226,35,25,4,8,7,3,733,226,35,25"
	frames="2"
	id="readyspearthrust"
	image="compiled-2.png"
	rect="694,218,739,253"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="0"
	accel_y="80"
	attack_area="30,23,38,32"
	body_area="all"
	duration="6"
	frame_info="1,6,1,3,0,145,44,27,3,6,1,3,44,145,42,27,5,6,1,3,86,145,40,27,5,5,3,3,126,145,38,28,5,5,5,3,164,145,36,28"
	frames="5"
	id="spearthrust"
	image="compiled-2.png"
	rect="-1,139,44,174"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="0"
	accel_y="80"
	body_area="all"
	duration="4"
	frame_info="7,12,0,3,813,934,34,21,6,16,0,3,847,934,35,17,7,6,0,3,882,934,34,27,8,4,1,3,916,934,32,29,9,1,2,3,948,934,30,32"
	frames="5"
	id="spring"
	image="compiled-1.png"
	rect="806,922,846,957"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="0"
	accel_y="80"
	body_area="all"
	duration="12"
	events="4:8:12:hurtflicker"
	frame_info="5,3,1,5,642,117,35,28"
	frames="1"
	id="hurt"
	image="compiled-2.png"
	rect="637,114,677,149"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="0"
	accel_y="80"
	body_area="all"
	duration="4"
	frame_info="5,8,1,3,768,226,35,25,5,8,1,3,803,226,35,25"
	frames="2"
	id="posthurt"
	image="compiled-2.png"
	rect="763,218,803,253"
	rotate_on_slope="yes"
	[/animation]

	[animation]
	accel_x="0"
	accel_y="80"
	body_area="all"
	duration="6"
	frame_info="7,9,0,0,351,833,34,27,6,5,0,3,385,833,35,28,6,2,0,1,420,833,35,33,7,1,0,0,455,833,34,35,7,1,0,0,489,833,34,35,7,1,0,0,523,833,34,35"
	frames="6"
	id="alert"
	image="compiled-1.png"
	rect="344,824,384,859"
	rotate_on_slope="yes"
	[/animation]

	[properties]
	choose_action="def() if(level.player.midpoint_y > self.y and level.player.midpoint_y < self.y2 and abs(level.player.midpoint_x - self.midpoint_x) < if(facing = desired_facing, 400, 200), animation('alert'), animation('walk'))"
	[/properties]

[/prototype]