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
|
[prototype]
feet_width="4"
friction="1000"
goes_inactive_only_when_standing="true"
hitpoints="3"
id="fumper_flapper"
mass="5"
on_change_animation_failure="[die()]"
on_change_solid_dimensions_fail="[die()]"
on_collide_feet="if(animation in ['jump', 'fall'], [animation('land'), set(velocity_x, 0)])"
on_collide_head="set(velocity_y, 0)"
on_collide_object_body="if(collide_with.vars.team != vars.team and collide_with_area = 'attack', get_hit_by(collide_with))"
on_die="[score(level,points_value), spawn_item(self), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
on_end_fall_anim="if(is_standing, animation('stand'), animation('fall'))"
on_end_hurt_anim="animation('stand')"
on_end_jump_anim="if(is_standing, animation('stand'), animation('jump'))"
on_end_land_anim="animation('stand')"
on_end_stand_anim="if(desired_facing != facing, animation('turn'), animation('start_jump'))
where desired_facing = if(level.player.x < x, -1, 1)"
on_end_start_jump_anim="[animation('jump'),set(velocity_x,400*facing),set(velocity_y,-consts.jump_power)]"
on_end_turn_anim="[set(facing, if(level.player.x < x, -1, 1)), animation('stand')]"
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_jump="if(velocity_y > 0, animation('fall'))"
on_surface_damage="die()"
on_timer="set(tmp, 'already_hit', [])"
solid_area="5,5,28,28"
solid_dimensions="enemy,common"
timer_frequency="100"
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]
damage="1"
points_value="25"
team="'evil'"
turns_at_cliffs="1"
[/vars]
[consts]
jump_power="2000"
[/consts]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duplicates="4"
duration="5"
frame_info="1,3,1,2,746,252,29,25,1,4,2,2,775,252,28,24,1,5,3,2,803,252,27,23"
frames="3"
id="stand"
image="compiled-2.png"
rect="745,249,775,278"
reverse="yes"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="5"
frame_info="0,9,2,2,172,369,29,19"
frames="1"
id="start_jump"
image="compiled-2.png"
rect="172,360,202,389"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="2"
frame_info="0,1,2,1,899,117,29,28,0,1,2,1,928,117,29,28"
frames="2"
id="jump"
image="compiled-2.png"
rect="899,116,929,145"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="2"
frame_info="0,2,2,1,941,997,29,27,0,2,2,1,970,997,29,27"
frames="2"
id="fall"
image="compiled-1.png"
rect="941,995,971,1024"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="5"
frame_info="0,9,2,2,172,369,29,19"
frames="1"
id="land"
image="compiled-2.png"
rect="172,360,202,389"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="5"
frame_info="5,4,3,2,425,277,23,24,5,4,5,2,448,277,21,24,3,4,5,2,469,277,23,24"
frames="3"
id="turn"
image="compiled-2.png"
rect="420,273,450,302"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="18"
events="6:12:18:hurtflicker"
frame_info="0,2,2,1,313,173,29,27"
frames="1"
id="hurt"
image="compiled-2.png"
rect="313,171,343,200"
[/animation]
[/prototype]
|