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
|
[object_type]
id="bat"
on_become_active="[if(vars.bat, if(vars.bat.hitpoints <= 0,fire_event('create')))]"
on_child_spawned="[
set(child.vars.zone_x1, vars.zone_x1),
set(child.vars.zone_x2, vars.zone_x2),
set(child.vars.zone_y1, vars.zone_y1),
set(child.vars.zone_y2, vars.zone_y2),
set(vars.bat, child)
]"
on_create="[set(alpha, 0), spawn('bat.instance', midpoint_x, midpoint_y, facing)]"
[vars]
bat="null()"
points_value="7"
[/vars]
[animation]
duration="1000000"
frame_info="1,1,1,3,192,576,16,24"
frames="1"
id="hang"
image="compiled-2.png"
rect="191,575,208,602"
[/animation]
[object_type]
dies_on_inactive="yes"
hitpoints="1"
id="instance"
on_create="[set(vars.start_x, x), set(vars.start_y, y)]"
on_die="[score(level,points_value), spawn_item(self), death_burst_tracked(self)]"
on_end_alert_anim="[set(velocity_y, 200), set(accel_y, -2), animation('fly')]"
on_end_fly_anim="animation('fly')"
on_end_hang_anim="if(level.player.midpoint_x > vars.zone_x1 and level.player.midpoint_x < vars.zone_x2 and level.player.midpoint_y > vars.zone_y1 and level.player.midpoint_y < vars.zone_y2, [set(animation, 'alert'), set(vars.flying, 1)], set(animation, 'hang'))"
on_end_hurt_anim="[set(velocity_y, 200), set(accel_y, -2), animation('fly')]"
on_end_stand_anim="set(animation, 'hang')"
on_enter_water="die()"
on_restore="[set(type,consts.basic_type),set(hitpoints,1),set(vars.flying, 0), animation('hang'), set(x, vars.start_x), set(y, vars.start_y),fire_event('create')]"
prototype="hittable"
tags="swallowable"
traction_in_air="1000"
zorder="21"
[vars]
points_value="7"
[/vars]
[properties]
attack_damage="if(animation = 'thrown', 5, 1)"
team="'evil'"
[/properties]
[vars]
flying="0"
start_x="0"
start_y="0"
zone_x1="0"
zone_x2="0"
zone_y1="0"
zone_y2="0"
[/vars]
[consts]
basic_type="'bat.instance'"
thrown_type="'bat.thrown'"
[/consts]
[animation]
body_area="all"
duration="0"
id="stand"
image="enemies/bat.png"
rect="1,1,18,28"
[/animation]
[animation]
accel_x="0"
accel_y="0"
body_area="all"
duration="10"
frames="2"
frames_per_row="2"
id="hang"
image="enemies/bat.png"
pad="3"
rect="1,1,18,28"
velocity_x="0"
velocity_y="0"
[/animation]
[animation]
body_area="all"
duration="20"
frames="1"
frames_per_row="1"
id="alert"
image="enemies/bat.png"
pad="0"
rect="43,1,60,28"
[/animation]
[animation]
accel_x="-10"
attack_area="all"
body_area="all"
duration="8"
frames="4"
frames_per_row="4"
id="fly"
image="enemies/bat.png"
pad="3"
rect="1,32,26,70"
reverse="no"
[/animation]
[animation]
body_area="all"
duration="10"
frames="1"
frames_per_row="1"
id="hurt"
image="enemies/bat.png"
pad="0"
rect="120,32,145,70"
[/animation]
[/object_type]
[object_type]
id="thrown"
on_die="[score(level,points_value), spawn_item(self), death_burst_tracked(self)]"
on_enter_on_back_anim="die()"
on_enter_water="die()"
prototype="throwable_small_enemy"
solid_area="8,11,15,21"
solid_dimensions="common,enemy"
[consts]
basic_type="'bat.instance'"
thrown_type="'bat.thrown'"
[/consts]
[animation]
accel_y="70"
body_area="none"
duration="30"
frames="1"
frames_per_row="1"
id="thrown"
image="enemies/bat.png"
pad="0"
rect="1,1,18,28"
thrown_area="all"
[/animation]
[animation]
body_area="all"
duration="5"
frames="1"
id="on_back"
image="enemies/ant-flying-black.png"
rect="1,1,18,28"
[/animation]
[/object_type]
[/object_type]
|