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
|
[prototype]
feet_width="4"
friction="1000"
goes_inactive_only_when_standing="true"
hitpoints="3"
id="fumper_flapper"
mass="5"
on_add_object_fail="[if(collide_with.team != team and collide_with.get_hit_by, collide_with.get_hit_by(me)), die()]"
on_change_animation_failure="fire_event('solidity_fail')"
on_change_solid_dimensions_fail="fire_event('solidity_fail')"
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.team != team and collide_with.team != 'evil_harmless' and (not (collide_with.team = 'evil' and team = 'evil_harmless')), if(collide_with_area = 'attack', get_hit_by(collide_with)))"
on_die="[score(level,points_value), spawn_item(self), death_burst(self)]"
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 and is_standing, animation('start_jump'), animation('turn'))
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_process_jump="if(velocity_y > 0, animation('fall'))"
on_solidity_fail="if(tmp.in_solidity_fail, die(),
[set(tmp.in_solidity_fail, 1),
resolve_solid(me,0,-1,60),
resolve_solid(me,2,-1,250),
resolve_solid(me,-2,-1,250),
resolve_solid(me,0,-1,500),
set(tmp.in_solidity_fail, 0)
])"
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"
[consts]
basic_type="'fumper_flapper'"
flinch_threshold="3"
frogourmet_tag="'fumper_flapper'"
jump_power="2000"
[/consts]
[properties]
attack_damage="0"
attack_knockback="0"
cause_flinch="def(collide_with) execute(me, [add(me.velocity_x,me.hurt_velocity_x * sign(collide_with.midpoint_x - me.midpoint_x)),
add(me.velocity_y,me.hurt_velocity_y)])"
damage_cooldown="0"
display_hurt_visuals="def() execute(me,
[if('hurt' in available_animations,set(me.animation, 'hurt')),
hurt_flash_sequence()
])"
display_posthit_invincibility_flash_sequence="def() if(consts.posthit_invicibility_period,
map(range(consts.posthit_invicibility_period/2), 'step' ,schedule(step*2, if(step%2=0,set(alpha,50),set(alpha,255)) ) ) )"
flash_bright="def() [set(me.brightness, 1023)]"
flash_off="def() [set(me.brightness, 255),set(me.red, 255),set(me.green, 255), set(me.blue, 255)]"
flash_red="def() [set(me.red, 255),set(me.green, 100), set(me.blue, 100)]"
get_hit_by="def(collide_with) execute(me, [
if((not is_invincible) and (collide_with.attack_damage > 0) and (collide_with.attack_damage > consts.armor) and (collide_with.damage_cooldown < (cycle - vars.time_last_hit)),
[display_hurt_visuals(),
display_posthit_invincibility_flash_sequence(),
handle_flinch(collide_with),
handle_damage(collide_with),
set(vars.time_last_hit, me.cycle)]),
handle_damage_type(collide_with),
handle_knockback(collide_with)])"
handle_damage="def(collide_with) execute(me,add(me.hitpoints, - collide_with.attack_damage))"
handle_damage_type="def(collide_with) null() #virtual#"
handle_flinch="def(collide_with)
execute(me, if(collide_with.attack_damage > consts.flinch_threshold, cause_flinch(collide_with)))"
handle_knockback="def(collide_with) execute(me,add(velocity_x, collide_with.facing * collide_with.attack_knockback))"
hurt_flash_sequence="def() [ flash_bright(),
schedule(3, flash_red()),
schedule(6, flash_bright()),
schedule(9, flash_red()),
schedule(12, flash_bright()),
schedule(15, flash_off())]"
hurt_velocity_x="-200"
hurt_velocity_y="-400"
is_invincible="if(invincible or level.in_dialog or is_invincible_posthit, 1, 0)"
is_invincible_posthit="if(vars.time_last_hit and (abs(vars.time_last_hit - me.cycle) < consts.posthit_invicibility_period), 1, 0)"
[/properties]
[vars]
points_value="14"
turns_at_cliffs="1"
[/vars]
[editor_info]
category="bugs"
[/editor_info]
[properties]
attack_damage="1"
team="'evil'"
[/properties]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duplicates="4"
duration="5"
frame_info="1,3,1,2,139,527,29,25,1,4,2,2,168,527,28,24,1,5,3,2,196,527,27,23"
frames="3"
id="stand"
image="compiled-2.png"
rect="138,524,168,553"
reverse="yes"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="5"
frame_info="0,9,2,2,995,623,29,19"
frames="1"
id="start_jump"
image="compiled-2.png"
rect="995,614,1025,643"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="2"
frame_info="0,1,2,1,780,284,29,28,0,1,2,1,809,284,29,28"
frames="2"
id="jump"
image="compiled-2.png"
rect="780,283,810,312"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="2"
frame_info="0,2,2,1,381,395,29,27,0,2,2,1,410,395,29,27"
frames="2"
id="fall"
image="compiled-2.png"
rect="381,393,411,422"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="5"
frame_info="0,9,2,2,995,623,29,19"
frames="1"
id="land"
image="compiled-2.png"
rect="995,614,1025,643"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="5"
frame_info="5,4,3,2,687,552,23,24,5,4,5,2,710,552,21,24,3,4,5,2,731,552,23,24"
frames="3"
id="turn"
image="compiled-2.png"
rect="682,548,712,577"
[/animation]
[animation]
accel_y="50"
attack_area="all"
body_area="all"
duration="18"
frame_info="0,2,2,1,187,395,29,27"
frames="1"
id="hurt"
image="compiled-2.png"
rect="187,393,217,422"
[/animation]
[/prototype]
|