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
|
[prototype]
feet_width="4"
friction="1000"
has_feet="no"
hitpoints="2"
id="mosquito"
mass="5"
on_collide="[set(facing, -facing),animation('turn'),set(velocity_x,0)]"
on_collide_object_body="if(collide_with.vars.team != vars.team and collide_with_area = 'attack',
if(not (me in collide_with.tmp.already_hit), [set(collide_with.tmp, 'already_hit', collide_with.tmp.already_hit + [me]),
set(hitpoints, hitpoints - collide_with.vars.damage), animation('hurt'), set(green, 100), set(blue, 100), set(velocity_x,600 * collide_with.facing)]))"
on_create="animation('fly')"
on_die="[score(level,points_value), spawn_item(self), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
on_end_anim="animation('fly')"
on_end_hurt_anim="animation('fly')"
on_end_turn_anim="animation('fly')"
on_enter_anim="set(tmp, 'already_hit', [])"
on_hurtflicker="if(green = 100,[set(green, 255), set(blue, 255)],[set(green, 100), set(blue, 100)])"
on_jumped_on="[if(jumped_on_by.mass >= 1000, die(), animation('spring'))]"
on_leave_hurt_anim="[set(green, 255), set(blue, 255)]"
on_surface_damage="die()"
on_timer="if(solid(level, front + facing*50, y, 1, y2 - y) or (facing < 0 and x < vars.x_bound) or (facing > 0 and x2 > vars.x2_bound),
[facing(-facing), animation('turn')])"
solid_area="2,12,30,28"
springiness="100"
timer_frequency="2"
traction="1000"
traction_in_air="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="5"
team="'evil'"
[/vars]
[properties]
hurt_velocity_y="0"
[/properties]
[animation]
accel_x="10"
attack_area="15,18,26,26"
body_area="all"
duplicates="12"
duration="6"
frame_info="4,9,3,3,165,746,24,19,3,8,3,3,189,746,25,20"
frames="2"
id="fly"
image="compiled-0.png"
rect="161,737,191,767"
[/animation]
[animation]
accel_x="10"
attack_area="15,18,26,26"
body_area="all"
duration="6"
frame_info="4,9,3,3,214,746,24,19,3,8,3,3,238,746,25,20"
frames="2"
id="fly"
image="compiled-0.png"
rect="210,737,240,767"
reverse="yes"
[/animation]
[animation]
body_area="all"
duration="3"
frame_info="4,9,3,3,0,348,24,19,4,12,2,3,24,348,25,16,4,15,2,3,49,348,25,13,4,9,3,3,74,348,24,19,4,7,4,3,98,348,23,21"
frames="5"
id="spring"
image="compiled-2.png"
rect="-4,339,26,369"
[/animation]
[animation]
attack_area="0,18,26,26"
body_area="all"
duration="10"
frame_info="6,9,6,3,401,369,19,19"
frames="1"
id="turn"
image="compiled-2.png"
rect="395,360,425,390"
[/animation]
[animation]
body_area="all"
duration="18"
events="6:12:18:hurtflicker"
frame_info="4,9,3,3,377,369,24,19"
frames="1"
id="hurt"
image="compiled-2.png"
rect="373,360,403,390"
[/animation]
[/prototype]
|