2
collide_dimensions="~key"
6
on_collide="set(velocity_x, -(velocity_x*70)/100)"
7
on_collide_feet="[set(velocity_x, (velocity_x*50)/100), if(abs(velocity_x) < 50, set(velocity_x, 0)), set(velocity_y, if(abs(velocity_y) > 50, -velocity_y/2, 0))]"
8
on_collide_head="set(velocity_y, -velocity_y)"
9
on_collide_object_body="if(collide_with_area = 'attack', get_hit_by(collide_with))"
11
add_wave(midpoint_x, y2, -2000, 5*velocity_y/2, 30*velocity_y, 300, 300),
12
add_wave(midpoint_x, y2, 2000, 5*velocity_y/2, 30*velocity_y, 300, 300),
13
add_wave(midpoint_x, y2, -1000, 3*velocity_y/2, 20*velocity_y, 200, 200),
14
add_wave(midpoint_x, y2, 1000, 3*velocity_y/2, 20*velocity_y, 200, 200),
15
add_wave(midpoint_x, y2, -500, 2*velocity_y/2, 10*velocity_y, 100, 100),
16
add_wave(midpoint_x, y2, 500, 2*velocity_y/2, 10*velocity_y, 100, 100)
18
on_hurtflicker="if(green = 100,[set(green, 255), set(blue, 255)],[set(green, 100), set(blue, 100)])"
19
on_leave_hurt_anim="[set(green, 255), set(blue, 255)]"
20
solid_area="0,0,15,15"
21
solid_dimensions="thrown"
25
get_hit_by="def(collide_with) execute(me,
26
if(not (me in collide_with.tmp.already_hit), [
27
set(collide_with.tmp, 'already_hit', collide_with.tmp.already_hit + [me]),
28
if((not is_invincible_posthit) and (collide_with.vars.damage > 0),
29
if(collide_with.vars.damage > consts.armor,
31
if(me.hitpoints > collide_with.vars.damage,
33
if(collide_with.vars.damage <= consts.flinch_threshold,
34
schedule(4, [set(me.green, 255), set(me.blue, 255)]),
35
set(me.animation, 'hurt')),
36
set(me.green, 100), set(me.blue, 100)
38
set(me.hitpoints, me.hitpoints - collide_with.vars.damage),
39
set(tmp.time_last_hit, me.cycle)
41
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))),
42
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)))]))"
44
hurt_velocity_y="-800"
45
is_invincible_posthit="if(tmp.time_last_hit and (abs(tmp.time_last_hit - me.cycle) < consts.posthit_invicibility_period), 1, 0)"
57
get_hit_by="def(collide_with) null()"
63
frame_info="0,0,0,0,612,400,16,16"
65
image="compiled-0.png"
66
rect="612,400,627,415"
72
frame_info="0,0,0,0,612,400,16,16"
74
image="compiled-0.png"
75
rect="612,400,627,415"