#include "C:\Game Files\Fallout 2\HEADERS\LVL_Heal.h"
procedure start;
procedure Drop_Weapons(variable target,);
procedure start
begin
variable target;
variable attacker;
variable target_damage;
variable attacker_damage;
variable special_effect_target;
variable special_effect_attacker;
variable attack_weapon;
variable body_part;
if (init_hook) then begin
end else begin
target := get_sfall_arg;
attacker := get_sfall_arg;
target_damage := get_sfall_arg;
attacker_damage := get_sfall_arg;
special_effect_target := get_sfall_arg;
special_effect_attacker := get_sfall_arg;
attack_weapon := get_sfall_arg;
body_part := get_sfall_arg;
if (body_part == 1) and (target_damage > 0) and (special_effect_target bwand DAM_CRIP_ARM_LEFT) and (special_effect_target bwand DAM_CRITICAL) then begin
call Drop_Weapons(target);
end else if (body_part == 2) and (target_damage > 0) and (special_effect_target bwand DAM_CRIP_ARM_RIGHT) and (special_effect_target bwand DAM_CRITICAL) then begin
call Drop_Weapons(target);
end
end
end
procedure Drop_Weapons(variable target) begin
variable weapon := 0;
variable dropped_hex := 0;
variable critter_flags := 0;
critter_flags := get_proto_data(obj_pid(target), 32);
if (critter_inven_obj(target, 1)) then begin
weapon := critter_inven_obj(target, 1);
if not(critter_flags bwand DAM_BLIND) then begin
rm_obj_from_inven(target, weapon);
dropped_hex := tile_num_in_direction(tile_num(target), random(0, 5), random(1, 2));
while (tile_contains_obj_pid(dropped_hex, elevation(dude_obj), 33554499) != 0) do begin
dropped_hex := tile_num_in_direction(tile_num(target), random(0, 5), random(1, 2));
end
move_to(weapon, dropped_hex, elevation(target));
end
end
if (critter_inven_obj(target, 2)) then begin
weapon := critter_inven_obj(target, 2);
if not(critter_flags bwand DAM_BLIND) then begin
rm_obj_from_inven(target, weapon);
dropped_hex := tile_num_in_direction(tile_num(target), random(0, 5), random(1, 2));
while (tile_contains_obj_pid(dropped_hex, elevation(dude_obj), 33554499) != 0) do begin
dropped_hex := tile_num_in_direction(tile_num(target), random(0, 5), random(1, 2));
end
move_to(weapon, dropped_hex, elevation(target));
end
end
end