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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
|
[prototype]
feet_width="4"
friction="1000"
hitpoints="5"
id="ant_gold"
mass="5"
on_add_object_fail="[if(collide_with.vars.team != vars.team and collide_with.get_hit_by, collide_with.get_hit_by(me)), die()]"
on_bounced_on="[if(animation = 'on_back', die(), animation('spring'))]"
on_change_animation_failure="[die()]"
on_change_solid_dimensions_fail="if(tmp.in_change_dimensions_fail or (not collide_with), die(),
[set(tmp.in_change_dimensions_fail, 1),
fire_event(collide_with, 'blocking_thrown_object'),
set(solid_dimensions_in, consts.solid_dimensions),
set(tmp.in_change_dimensions_fail, 0)
])"
on_collide="if(animation in ['thrown', 'on_back'], set(velocity_x, -velocity_x/2), if(not (animation in ['hurt']), [set(facing, -facing),animation('turn'),set(velocity_x,0)]))"
on_collide_feet="[if(animation in ['thrown', 'on_back'] and collide_with and collide_with.get_hit_by and collide_with.vars.team != vars.team and vars.damage > 0, [collide_with.get_hit_by(me), die()]),
if(animation = 'thrown' and velocity_y + abs(velocity_x) > 600,
[set(velocity_y, -(velocity_y*3)/5 - (velocity_x*slope_standing_on)/90), set(velocity_x, (velocity_x*4)/5 + (velocity_y*slope_standing_on)/90)], if(animation = 'thrown', [set(tmp.on_back_count, 0), animation('on_back')], if(animation != 'on_back', animation('walk'))))]"
on_collide_head="set(velocity_y, -velocity_y/2)"
on_collide_object_body="if(collide_with.vars.team != vars.team and collide_with_area = 'attack', get_hit_by(collide_with))"
on_collide_object_thrown="[if(collide_with_area = 'body' and collide_with.vars.team != vars.team and vars.damage > 0,
[if(collide_with.get_hit_by, [collide_with.get_hit_by(me)]), die()])]"
on_die="[score(level,points_value), spawn_item(self), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
on_end_anim="if(animation in ['on_back', 'thrown'], [set(tmp.on_back_count, tmp.on_back_count+1), if(tmp.on_back_count > 10, [animation('walk'), set(tmp.on_back_count, 0)],
if(CYCLE_THROWN_ANIM and (not is_standing), [set(tmp.cycle_thrown_anim, 1), animation('thrown')],
animation('on_back'))
)], animation('walk'))"
on_end_hurt_anim="animation('walk')"
on_end_turn_anim="animation('walk')"
on_enter_anim="set(tmp.already_hit, [])"
on_enter_thrown_anim="[if((not tmp.cycle_thrown_anim), set(vars.damage, consts.thrown_damage), set(tmp.cycle_thrown_anim, 0))]"
on_enter_walk_anim="if(not is_standing, animation('stand'))"
on_enter_water="die()"
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 >= 20, die())]"
on_leave_hurt_anim="[set(green, 255), set(blue, 255)]"
on_leave_on_back_anim="set(brightness, 256)"
on_leave_thrown_anim="[set(solid_dimensions_in, consts.solid_dimensions), set(vars.team, 'evil'), set(vars.damage, consts.normal_damage)]"
on_process_on_back="if(tmp.on_back_count > 8, [if(tmp.on_back_count > 10 and time_in_animation > 7, set(velocity_y, velocity_y-300)), set(brightness, if(cycle%6 > 2, 256, 512))])"
on_process_stand="if(is_standing, animation('walk'))"
on_stomped_on="[add(hitpoints, -3), set(green, 0), set(blue, 0),
schedule(4, [set(green, 255), set(blue, 255)])]"
on_surface_damage="die()"
on_timer="if(not (animation in ['thrown', 'on_back']), [set(rotate, slope_standing_on), if(turns_at_cliffs and is_standing and animation = 'walk' and distance_to_cliff < DISTANCE_TO_CLIFF_CHECK,[set(facing, -facing),animation('turn')],null())])"
solid_area="5,10,20,25"
solid_dimensions="enemy,common"
tags="swallowable"
timer_frequency="5"
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]
cycle_thrown_anim="0"
on_back_count="0"
time_last_hit="0"
[/tmp]
[vars]
damage="1"
points_value="5"
team="'evil'"
turns_at_cliffs="0"
[/vars]
[consts]
CYCLE_THROWN_ANIM="0"
DISTANCE_TO_CLIFF_CHECK="30"
bounce_roundness="70"
normal_damage="1"
solid_dimensions="['enemy', 'common']"
spring_amount="1200"
springiness="190"
thrown_damage="5"
[/consts]
[animation]
accel_x="0"
accel_y="80"
attack_area="15,18,26,26"
body_area="all"
duration="6"
frame_info="5,9,4,2,985,407,16,17"
frames="1"
id="stand"
image="compiled-2.png"
rect="980,398,1004,425"
rotate_on_slope="yes"
[/animation]
[animation]
accel_x="0"
accel_y="80"
body_area="none"
duration="60"
frame_info="4,9,4,2,1001,407,17,17"
frames="1"
id="thrown"
image="compiled-2.png"
rect="997,398,1021,425"
rotate_on_slope="yes"
thrown_area="0,0,31,36"
[/animation]
[animation]
accel_x="0"
accel_y="80"
body_area="all"
duration="5"
frame_info="4,9,4,2,275,425,17,17,4,9,4,2,292,425,17,17"
frames="2"
id="on_back"
image="compiled-2.png"
rect="271,416,295,443"
rotate_on_slope="yes"
[/animation]
[animation]
accel_x="350"
accel_y="80"
attack_area="15,18,26,26"
body_area="all"
duration="6"
frame_info="5,9,4,2,0,425,16,17,5,10,4,2,16,425,16,16,5,9,4,2,32,425,16,17"
frames="3"
id="walk"
image="compiled-2.png"
rect="-5,416,19,443"
rotate_on_slope="yes"
[/animation]
[animation]
accel_x="350"
accel_y="80"
attack_area="15,18,26,26"
body_area="all"
duplicates="6"
duration="6"
frame_info="5,9,4,2,48,425,16,17,5,10,4,2,64,425,16,16,5,9,4,2,80,425,16,17"
frames="3"
id="walk"
image="compiled-2.png"
rect="43,416,67,443"
rotate_on_slope="yes"
[/animation]
[animation]
accel_x="0"
accel_y="80"
body_area="all"
duration="4"
frame_info="4,13,3,2,587,458,18,13"
frames="1"
id="spring"
image="compiled-2.png"
rect="583,445,607,472"
rotate_on_slope="yes"
[/animation]
[animation]
accel_x="0"
accel_y="80"
attack_area="0,18,26,26"
body_area="all"
duration="4"
frame_info="5,10,5,2,320,400,15,16,6,10,6,2,335,400,13,16,5,10,5,2,348,400,15,16"
frames="3"
id="turn"
image="compiled-0.png"
rect="315,390,339,417"
rotate_on_slope="yes"
[/animation]
[animation]
accel_x="0"
accel_y="80"
body_area="all"
duration="18"
events="6:12:18:hurtflicker"
frame_info="5,9,4,1,622,389,16,18"
frames="1"
id="hurt"
image="compiled-2.png"
rect="617,380,641,407"
rotate_on_slope="yes"
[/animation]
[/prototype]
|