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
|
[prototype]
has_feet="no"
hitpoints="5"
id="large_breakable_block"
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_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="[spawn('breakable_block_chunk.particle_system_holder', x,y,facing),
sound('BlockBreak.ogg'),
map([0]*3d2, spawn('breakable_block_chunk',x+1d30, y+1d30, if(1d2=2,1,-1))),
map([0]*3d2, spawn('breakable_block_chunk',x+1d30, y+1d30, if(1d2=2,1,-1), add(variations, ['big'])))
]"
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)
])"
solid_area="0,0,47,47"
zorder="-1"
[consts]
flinch_threshold="3"
[/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]
[animation]
body_area="all"
duration="1000000"
frame_info="0,0,0,0,192,464,48,48"
frames="1"
id="normal5"
image="compiled-1.png"
rect="192,464,239,511"
[/animation]
[animation]
body_area="all"
duration="1000000"
frame_info="0,0,0,0,144,464,48,48"
frames="1"
id="normal4"
image="compiled-1.png"
rect="144,464,191,511"
[/animation]
[animation]
body_area="all"
duration="1000000"
frame_info="0,0,0,0,96,464,48,48"
frames="1"
id="normal3"
image="compiled-1.png"
rect="96,464,143,511"
[/animation]
[animation]
body_area="all"
duration="1000000"
frame_info="0,0,0,0,48,464,48,48"
frames="1"
id="normal2"
image="compiled-1.png"
rect="48,464,95,511"
[/animation]
[animation]
body_area="all"
duration="1000000"
frame_info="0,0,0,0,0,464,48,48"
frames="1"
id="normal1"
image="compiled-1.png"
rect="0,464,47,511"
[/animation]
[editor_info]
category="props"
[/editor_info]
[properties]
flash_color="def(collide_with) null()"
handle_damage="def(collide_with) execute(me, [add(me.hitpoints, -1),if(hitpoints > 1, set(animation, 'normal' + (hitpoints-1)))])"
handle_knockback="def(collide_with) null()"
hurt_velocity_x="0"
hurt_velocity_y="0"
[/properties]
[/prototype]
|