procedure use_obj_on_p_proc; // Not always in scripts.
variable tolerance;
variable drugs;
variable dead;
procedure use_obj_on_p_proc
begin
if ((obj_pid(obj_being_used_with) == 259) or (obj_pid(obj_being_used_with) == 110) or (obj_pid(obj_being_used_with) == 87) or (obj_pid(obj_being_used_with) == 53) or (obj_pid(obj_being_used_with) == 125) or (obj_pid(obj_being_used_with) == 469) or (obj_pid(obj_being_used_with) == 311) or (obj_pid(obj_being_used_with) == 144) or (obj_pid(obj_being_used_with) == 109) or (obj_pid(obj_being_used_with) == 40) or (obj_pid(obj_being_used_with) == 273)) then begin // these are all on the same line.
if local_var(16) <= 0 then begin
set_local_var(15, game_time);
if ((obj_pid(obj_being_used_with) == 259) or (obj_pid(obj_being_used_with) == 110) or (obj_pid(obj_being_used_with) == 87) or (obj_pid(obj_being_used_with) == 53)) then begin
set_local_var(16, 10);
end
if ((obj_pid(obj_being_used_with) == 125) or (obj_pid(obj_being_used_with) == 469) or (obj_pid(obj_being_used_with) == 311) or (obj_pid(obj_being_used_with) == 144)) then begin
set_local_var(16, 5);
end
if ((obj_pid(obj_being_used_with) == 109) or (obj_pid(obj_being_used_with) == 40) or (obj_pid(obj_being_used_with) == 273)) then begin
set_local_var(16, 2);
end
end
else begin
if ((obj_pid(obj_being_used_with) == 259) or (obj_pid(obj_being_used_with) == 110) or (obj_pid(obj_being_used_with) == 87) or (obj_pid(obj_being_used_with) == 53)) then begin
set_local_var(16, local_var(16) +10);
end
if ((obj_pid(obj_being_used_with) == 125) or (obj_pid(obj_being_used_with) == 469) or (obj_pid(obj_being_used_with) == 311) or (obj_pid(obj_being_used_with) == 144)) then begin
set_local_var(16, local_var(16) +5);
end
if ((obj_pid(obj_being_used_with) == 109) or (obj_pid(obj_being_used_with) == 40) or (obj_pid(obj_being_used_with) == 273)) then begin
set_local_var(16, local_var(16) +2);
end
end
end
end
procedure critter_p_proc
begin
tolerance := (100 + (5 * (get_critter_stat(self_obj, 2) - 10)));
if (local_var(16) > 0 and local_var(16) < tolerance) and (drugs != 1) then begin
if ((game_time - local_var(15)) >= (15 * (60 * 10))) then begin
drugs := 1;
end
end
if (local_var(16) > 0 and local_var(16) < tolerance) and (drugs == 1) then begin
set_local_var(16, local_var(16) - ((game_time - local_var(15)) / (15 * (60 * 10))));
set_local_var(15, game_time);
drugs := 0;
end
if local_var(16) >= tolerance then begin
if drugs == 0 then begin
float_msg(self_obj,"Aaaaargh!",2);
set_local_var(15, game_time + game_ticks(3));
drugs := 1;
end
else begin
if game_time >= local_var(15) then begin
dead := random(62, 63);
reg_anim_func(2, self_obj);
reg_anim_func(1, 1);
reg_anim_animate(self_obj, dead, -1);
reg_anim_func(3, 0);
call destroy_p_proc;
kill_critter(self_obj, dead);
end
end
end
end
procedure destroy_p_proc
begin
// if (source_obj == dude_obj) then begin // Replace this line with the following one.
if ((source_obj == dude_obj) or (dead >= 62)) then begin // To get karma reaction for the OD kill, is this a good idea?