#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>

variable Damage;


procedure start
begin
	if (script_action == spatial_proc) then begin
		if (global_var(GVAR_START_POWER) and global_var(GVAR_WEAPONS_ARMED)) then begin
			if (local_var(0) == 0) then begin
				set_local_var(0, 1);
				Damage := random(1, 6);
				float_msg(dude_obj, message_str(SCRIPT_LAZRTRAP, 100), FLOAT_MSG_NORMAL);
				if (Damage == 1) then begin
					display_msg(message_str(SCRIPT_LAZRTRAP, 101));
					critter_dmg(dude_obj, 1, 0);
				end
				else begin
					display_msg(message_str(SCRIPT_LAZRTRAP, 102) + Damage + message_str(SCRIPT_LAZRTRAP, 103));
					critter_dmg(dude_obj, Damage, 0);
				end
			end
		end
	end
end