common_battle_decapitation = ( #head
ti_on_agent_hit, 0, 0, [], #when agent got hit
[
(store_trigger_param_1, ":agent"), #store hitted agent
(store_trigger_param_2, ":dealer"), #store dealer
(store_trigger_param_3, ":damage"), #store damage
(store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
(assign, ":bone2", reg1),
(agent_is_human, ":agent"), # agent is human
(agent_is_human, ":dealer"), # agent is human
(agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
#(neq|troop_is_hero, ":troop_no"), #agent is no hero
(agent_get_position, pos1, ":agent"),
(agent_get_position, pos2, ":dealer"),
(get_distance_between_positions, ":distance", pos1, pos2),
(is_between, ":distance", 0, 200), #no arrow or very less power hitting
#general needs end
(try_begin),
(this_or_next|eq, ":bone", hb_head),
(this_or_next|eq, ":bone2", hb_head),
(this_or_next|eq, ":bone", hb_shoulder_l),
(this_or_next|eq, ":bone2", hb_shoulder_l),
(this_or_next|eq, ":bone", hb_shoulder_r),
(eq, ":bone2", hb_shoulder_r),
#power and helmet condition begin
(ge, ":damage", 32),
#(agent_get_item_slot, ":helmet", ":agent", 4),
#(item_get_head_armor, ":head_armor", ":helmet"),
#(lt, ":head_armor", 40),
#power and helmet condition end
(play_sound_at_position, "snd_decapitation", pos0),
(copy_position, pos2, pos9),
(set_spawn_position, pos0),
(spawn_scene_prop, "spr_head"),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
# fake head
(assign, ":head_id", reg0),
(prop_instance_enable_physics, ":head_id", 1),
(agent_set_hit_points,":agent", 0, 1), #DEATH IS CERTAIN (no running around decapitated idiots :D)
#(agent_equip_item, ":agent", "itm_unvisible"), #unvisible helmet
(agent_equip_item, ":agent", "itm_decaphead"),
(str_store_troop_name, s60, ":troop_no"),
(agent_get_troop_id, ":troop_no_2", ":dealer"),
(str_store_troop_name, s61, ":troop_no_2"),
(display_message, "@{s61} has beheaded {s60}!", 0xff0000),
(try_end),
])
common_battle_arms_decapitation = (
ti_on_agent_hit, 0, 0, [], #when agent got hit
[
(store_trigger_param, ":agent", 1), #store hitted agent
(store_trigger_param, ":dealer", 2), #store dealer
(store_trigger_param, ":damage", 3), #store damage
(store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
(assign, ":bone2", reg1), #for double check
(agent_is_human, ":agent"), # agent is human
(agent_is_human, ":dealer"), # agent is human
(agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
(store_agent_hit_points, ":hp", ":agent", 1),
#(neq|troop_is_hero, ":troop_no"), #agent is no hero
(ge, ":damage", 32), #strong blow
(agent_get_position, pos1, ":agent"),
(agent_get_position, pos2, ":dealer"),
(get_distance_between_positions, ":distance", pos1, pos2),
(is_between, ":distance", 0, 200), #no arrow or very less power hitting
(troop_get_type,":victim_gender",":agent"),
(store_random_in_range, ":dearm", 0,100),
(le, ":dearm", 12), #because arm decap happened 75% of the time
#general needs end
(try_begin),
#left hand begin
(this_or_next|eq, ":bone", hb_hand_l),
(this_or_next|eq, ":bone2", hb_hand_l),
(this_or_next|eq, ":bone", hb_forearm_l),
(eq, ":bone2", hb_forearm_l),
(play_sound_at_position, "snd_decapitation", pos0),
(copy_position, pos2, pos9),
(set_spawn_position, pos0),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(spawn_scene_prop, "spr_hand"),
(assign, ":hand_id", reg0),
(prop_instance_enable_physics, ":hand_id", 1),
#check if one or two decap hands
(try_begin),
(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
(else_try),
(assign, ":new_hand_item", "itm_decaphand"),
(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
(try_end),
(agent_equip_item, ":agent", ":new_hand_item"),
#drop weapon (because he has no hand anymore)
(try_begin),
(lt, ":damage", ":hp"),
(agent_get_wielded_item,":weapon",":agent",0),
(ge, ":weapon", 0),
(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
(val_add, ":weapon_slot_number", 1),
(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
(position_move_y, pos4, 5),
(position_rotate_z, pos4, 90),
(set_spawn_position, pos4),
(spawn_item, ":weapon", 0, 180),
(try_end),
#bleed
(agent_set_animation, ":agent", "anim_bleeding", 1),
#scream
(try_begin),
(eq, ":victim_gender", 1),
(agent_play_sound, ":agent", "snd_woman_hit"),
(else_try),
(agent_play_sound, ":agent", "snd_man_hit"),
(try_end),
#telling of the chopping
(str_store_troop_name, s60, ":troop_no"),
(agent_get_troop_id, ":troop_no_2", ":dealer"),
(str_store_troop_name, s61, ":troop_no_2"),
(display_message, "@{s61} has chopped of {s60} his left hand!", 0xff0000),
#right hand end
(else_try),
#left hand begin
(this_or_next|eq, ":bone", hb_hand_r),
(this_or_next|eq, ":bone2", hb_hand_r),
(this_or_next|eq, ":bone", hb_forearm_r),
(eq, ":bone2", hb_forearm_r),
(play_sound_at_position, "snd_decapitation", pos0),
(copy_position, pos2, pos9),
(set_spawn_position, pos0),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(spawn_scene_prop, "spr_hand"),
(assign, ":hand_id", reg0),
(prop_instance_enable_physics, ":hand_id", 1),
#check if one or two decap hands
(try_begin),
(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
(else_try),
(assign, ":new_hand_item", "itm_decaphand"),
(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
(try_end),
(agent_equip_item, ":agent", ":new_hand_item"),
(store_agent_hit_points, ":hp", ":agent", 1),
#drop weapon (because he has no hand anymore)
(try_begin),
(lt, ":damage", ":hp"),
(agent_get_wielded_item,":weapon",":agent",0),
(ge, ":weapon", 0),
(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
(val_add, ":weapon_slot_number", 1),
(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
(position_move_y, pos4, 5),
(position_rotate_z, pos4, 90),
(set_spawn_position, pos4),
(spawn_item, ":weapon", 0, 180),
(try_end),
#bleed
(agent_set_animation, ":agent", "anim_bleeding", 1),
#scream
(try_begin),
(eq, ":victim_gender", 1),
(agent_play_sound, ":agent", "snd_woman_hit"),
(else_try),
(agent_play_sound, ":agent", "snd_man_hit"),
(try_end),
#telling of the chopping
(str_store_troop_name, s60, ":troop_no"),
(agent_get_troop_id, ":troop_no_2", ":dealer"),
(str_store_troop_name, s61, ":troop_no_2"),
(display_message, "@{s61} has chopped of {s60} his right hand!", 0xff0000),
(try_end),
])
common_battle_legs_decapitation = (
ti_on_agent_hit, 0, 0, [], #when agent got hit
[
(store_trigger_param_1, ":agent"), #store hitted agent
(store_trigger_param_2, ":dealer"), #store dealer
(store_trigger_param_3, ":damage"), #store damage
(store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
(assign, ":bone2", reg1), #for double check
(agent_is_human, ":agent"), # agent is human
(agent_is_human, ":dealer"), # agent is human
(agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
#(neq|troop_is_hero, ":troop_no"), #agent is no hero
(ge, ":damage", 30), #strongest blow of all because legs are harder to decap
(agent_get_position, pos1, ":agent"),
(agent_get_position, pos2, ":dealer"),
(get_distance_between_positions, ":distance", pos1, pos2),
(is_between, ":distance", 0, 200), #no arrow or very less power hitting
(troop_get_type,":victim_gender",":agent"),
#general needs end
(try_begin),
#left hand begin
(this_or_next|eq, ":bone", hb_foot_l),
(this_or_next|eq, ":bone2", hb_foot_l),
(this_or_next|eq, ":bone", hb_thigh_l),
(this_or_next|eq, ":bone2", hb_thigh_l),
(this_or_next|eq, ":bone", hb_calf_l),
(eq, ":bone2", hb_calf_l),
(play_sound_at_position, "snd_decapitation", pos0),
(copy_position, pos2, pos9),
(set_spawn_position, pos0),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(spawn_scene_prop, "spr_leg"),
(assign, ":leg_id", reg0),
(prop_instance_enable_physics, ":leg_id", 1),
#check if one or two decap hands
(try_begin),
(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
(assign, ":new_hand_item", "itm_invisible_leg"), #both hands chopped
(else_try),
(assign, ":new_hand_item", "itm_invisible_leg"),
(agent_set_slot, ":agent", slot_agent_right_legchop, 1),
(try_end),
(agent_equip_item, ":agent", ":new_hand_item"),
(store_agent_hit_points, ":hp", ":agent", 1),
#drop weapon (because he has no hand anymore)
#bleed
(agent_set_animation, ":agent", "anim_bleeding", 1),
#scream
(try_begin),
(eq, ":victim_gender", 1),
(agent_play_sound, ":agent", "snd_woman_hit"),
(else_try),
(agent_play_sound, ":agent", "snd_man_hit"),
(try_end),
#telling of the chopping
(str_store_troop_name, s60, ":troop_no"),
(agent_get_troop_id, ":troop_no_2", ":dealer"),
(str_store_troop_name, s61, ":troop_no_2"),
(display_message, "@{s61} has chopped of {s60} his left leg!", 0xff0000),
#right hand end
(else_try),
#left hand begin
(this_or_next|eq, ":bone", hb_foot_r),
(this_or_next|eq, ":bone2", hb_foot_r),
(this_or_next|eq, ":bone", hb_thigh_r),
(this_or_next|eq, ":bone2", hb_thigh_r),
(this_or_next|eq, ":bone", hb_calf_r),
(eq, ":bone2", hb_calf_r),
(play_sound_at_position, "snd_decapitation", pos0),
(copy_position, pos2, pos9),
(set_spawn_position, pos0),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(particle_system_burst, "psys_decap_blood", pos2, 5),
(spawn_scene_prop, "spr_leg"),
(assign, ":leg_id", reg0),
(prop_instance_enable_physics, ":leg_id", 1),
#check if one or two decap hands
(try_begin),
(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
(assign, ":new_hand_item", "itm_invisible_leg"),
(else_try),
(assign, ":new_hand_item", "itm_invisible_leg"),
(agent_set_slot, ":agent", slot_agent_right_legchop, 1),
(try_end),
(agent_equip_item, ":agent", ":new_hand_item"),
(store_agent_hit_points, ":hp", ":agent", 1),
#drop weapon (because he has no hand anymore)
#bleed
(agent_set_animation, ":agent", "anim_bleeding", 1),
#scream
(try_begin),
(eq, ":victim_gender", 1),
(agent_play_sound, ":agent", "snd_woman_hit"),
(else_try),
(agent_play_sound, ":agent", "snd_man_hit"),
(try_end),
#telling of the chopping
(str_store_troop_name, s60, ":troop_no"),
(agent_get_troop_id, ":troop_no_2", ":dealer"),
(str_store_troop_name, s61, ":troop_no_2"),
(display_message, "@{s61} has chopped of {s60} his right leg!", 0xff0000),
(try_end),
])