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
|
[prototype]
[vars]
team="'evil'"
points_value="5"
turns_at_cliffs=1
damage=1
[/vars]
[tmp]
on_back_count=0
#if we're re-running the thrown animation.
cycle_thrown_anim=0
[/tmp]
[editor_info]
category=bugs
[/editor_info]
[consts]
thrown_damage=5
normal_damage=1
springiness=190
spring_amount=1200
bounce_roundness=70
solid_dimensions="['enemy', 'common']"
DISTANCE_TO_CLIFF_CHECK=30
CYCLE_THROWN_ANIM=0
[/consts]
prototype=hittable
mass=5
friction=1000
traction=1000
timer_frequency=5
hitpoints=5
solid_area=5,10,20,25
solid_dimensions=enemy,common
tags=swallowable
on_die="[score(level,points_value), spawn_item(self), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
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_head="set(velocity_y, -velocity_y/2)"
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_jumped_on="[if(jumped_on_by.mass >= 20, die())]"
on_bounced_on="[if(animation = 'on_back', die(), animation('spring'))]"
on_stomped_on="[add(hitpoints, -3), set(green, 0), set(blue, 0),
schedule(4, [set(green, 255), set(blue, 255)])]"
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_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_leave_thrown_anim="[set(solid_dimensions_in, consts.solid_dimensions), set(vars.team, 'evil'), set(vars.damage, consts.normal_damage)]"
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_change_animation_failure="[die()]"
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_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_leave_on_back_anim="set(brightness, 256)"
on_enter_walk_anim="if(not is_standing, animation('stand'))"
on_process_stand="if(is_standing, animation('walk'))"
on_enter_water="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())])"
on_end_turn_anim="animation('walk')"
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_end_hurt_anim="animation('walk')"
on_surface_damage="die()"
feet_width=4
[base:animation]
accel_x=0
accel_y=80
body_area=all
[/animation]
[animation]
id=stand
rect=3,1,27,28
frames=1
duration=6
attack_area=15,18,26,26
[/animation]
[animation]
id=thrown
thrown_area=0,0,31,36
duration=60
rect=31,33,55,60
frames=1
body_area=none
[/animation]
[animation]
id=on_back
rect=31,33,55,60
frames=2
duration=5
[/animation]
[animation]
id=walk #blink variant
attack_area=15,18,26,26
accel_x=250
rect=89,1,113,28
frames=3
duration=6
[/animation]
[animation]
id=walk
attack_area=15,18,26,26
duplicates=6
accel_x=250
rect=3,1,27,28
frames=3
duration=6
[/animation]
[animation]
id=spring
rect=3,33,27,60
frames=1
duration=4
[/animation]
[animation]
id=turn
rect=3,65,27,92
frames=3
duration=4
attack_area=0,18,26,26
[/animation]
[animation]
id=hurt
rect=90,65,114,92
frames=1
duration=18
events="6:12:18:hurtflicker"
[/animation]
[/prototype]
|