#include <define.h>

//#define NAME                    SCRIPT_

#include <command.h>
//#include <ModReact.h>



procedure start;
#include <push.h>

variable once;
variable Passed_Times;


procedure start
begin
	if (script_action == spatial_proc) then begin
		if (global_var(GVAR_VATS_ALERT) == 1) then begin
			if (is_success(roll_vs_skill(source_obj, 11, 0)) and (once == 0)) then begin
				give_exp_points(25);
				reg_anim_func(2, source_obj);
				if (source_obj != dude_obj) then begin
					display_msg(proto_data(obj_pid(source_obj), 1) + message_str(SCRIPT_TRAPFLOR, 100));
				end
				else begin
					Passed_Times := Passed_Times + 1;
					if (Passed_Times > 2) then begin
						once := 1;
					end
					display_msg(message_str(SCRIPT_TRAPFLOR, 101));
				end
			end
			else begin
				if (once == 0) then begin
					once := 1;
					critter_dmg(source_obj, random(15, 40), 3);
				end
			end
		end
	end
end