8
on_bounced_on="[if(jumped_on_by.mass >= 1000, die(), animation('spring'))]"
9
on_child_spawned="if((not vars.rotor), set(vars.rotor, child))"
10
on_collide_object_body="if(collide_with.vars.team != vars.team and collide_with_area = 'attack', get_hit_by(collide_with))"
11
on_create="[facing(1), spawn('helicopter_plant.rotor', midpoint_x, y-6, facing), set(accel_y,40), set(target_y, y)]"
12
on_die="[[score(level,points_value), spawn_item(self), spawn('die_cloud', midpoint_x, midpoint_y, facing)], set(vars.rotor.hitpoints, 0)]"
13
on_end_chargeup_anim="if(tmp.anim_repeat >= consts.chargeup_repeat, animation('shoot'), [animation('chargeup'), add(tmp.anim_repeat, 1)])"
14
on_end_hurt_anim="animation('normal')"
15
on_end_normal_anim="[animation('windup'),
16
set(tmp.spawn_velocity_x, 10*(90-rotate)),
17
set(tmp.spawn_velocity_y, 10*(90 - abs(90-rotate)))
20
on_end_shoot_anim="animation('normal')"
21
on_end_windup_anim="[animation('chargeup'), set(tmp.anim_repeat, 0)]"
22
on_enter_anim="set(tmp, 'already_hit', [])"
23
on_enter_spring_anim="die()"
24
on_hurtflicker="if(green = 100,[set(green, 255), set(blue, 255)],[set(green, 100), set(blue, 100)])"
25
on_leave_hurt_anim="[set(green, 255), set(blue, 255)]"
26
on_process="[set(vars.rotor.midpoint_x, midpoint_x), set(vars.rotor.midpoint_y, y-6)]"
27
on_process_normal="set(rotate, min(rotate+3, max(rotate-3, if(level.player.midpoint_x < midpoint_x, 180 - target, target))))
29
min(90, max(0, (((level.player.midpoint_y - 40) - midpoint_y)*25)/max(2, abs(level.player.midpoint_x - midpoint_x))))"
30
on_shoot="[spawn('pollen_ball', midpoint_x, midpoint_y, facing,
32
set(zorder, zorder-1),
33
set(velocity_x, tmp.spawn_velocity_x),
34
set(velocity_y, tmp.spawn_velocity_y),
35
]), sound('FlowerShot.ogg')]"
36
on_surface_damage="die()"
37
on_swallowed="[set(vars.rotor.hitpoints, 0), animation('normal'), set(rotate, 0), set(type, 'shooting_plant')]"
38
on_timer="if(y < target_y, set(accel_y, 30), set(accel_y, -10))"
39
solid_area="5,4,10,10"
44
traction_in_air="1000"
47
get_hit_by="def(collide_with) execute(me,
48
if(not (me in collide_with.tmp.already_hit), [
49
set(collide_with.tmp, 'already_hit', collide_with.tmp.already_hit + [me]),
50
if((not is_invincible_posthit) and (collide_with.vars.damage > 0),
51
if(collide_with.vars.damage > consts.armor,
53
if(me.hitpoints > collide_with.vars.damage,
55
if(collide_with.vars.damage <= consts.flinch_threshold,
56
schedule(4, [set(me.green, 255), set(me.blue, 255)]),
57
set(me.animation, 'hurt')),
58
set(me.green, 100), set(me.blue, 100)
60
set(me.hitpoints, me.hitpoints - collide_with.vars.damage),
61
set(tmp.time_last_hit, me.cycle)
63
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))),
64
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)))]))"
66
hurt_velocity_y="-800"
67
is_invincible_posthit="if(tmp.time_last_hit and (abs(tmp.time_last_hit - me.cycle) < consts.posthit_invicibility_period), 1, 0)"
93
frame_info="0,0,0,0,340,442,16,15"
97
image="compiled-2.png"
98
rect="340,442,355,456"
104
frame_info="0,0,0,0,340,442,16,15"
108
image="compiled-2.png"
109
rect="340,442,355,456"
115
frame_info="1,0,2,0,906,400,13,16"
119
image="compiled-0.png"
120
rect="905,400,920,415"
126
frame_info="2,0,3,0,253,425,11,17,2,0,3,0,264,425,11,17"
130
image="compiled-2.png"
131
rect="251,425,266,441"
138
frame_info="1,0,1,0,109,458,18,13"
142
image="compiled-2.png"
143
rect="108,458,127,470"
148
events="6:12:18:hurtflicker"
160
on_end_normal_anim="animation('normal')"
166
image="enemies/helicopter-plant.png"