#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure description_p_proc;
procedure look_at_p_proc;
procedure use_p_proc;
procedure use_skill_on_p_proc;

import variable messing_with_fridge;


procedure start
begin
	if (script_action == description_proc) then begin
		call description_p_proc;
	end
	else begin
		if (script_action == look_at_proc) then begin
			call look_at_p_proc;
		end
		else begin
			if (script_action == use_proc) then begin
				call use_p_proc;
			end
			else begin
				if (script_action == use_skill_on_proc) then begin
					call use_skill_on_p_proc;
				end
			end
		end
	end
end

procedure description_p_proc
begin
	script_overrides;
	display_msg(message_str(SCRIPT_CRASHBOX, 101));
end

procedure look_at_p_proc
begin
	display_msg(message_str(SCRIPT_CRASHBOX, 100));
end

procedure use_p_proc
begin
	if (global_var(GVAR_RENT_TIME) < (game_time / (10 * 60 * 60 * 24))) then begin
		messing_with_fridge := 1;
	end
end

procedure use_skill_on_p_proc
begin
	if (action_being_used == 10) then begin
		if (not(is_success(roll_vs_skill(source_obj, action_being_used, 0)))) then begin
			if (global_var(GVAR_RENT_TIME) < (game_time / (10 * 60 * 60 * 24))) then begin
				messing_with_fridge := 1;
			end
		end
	end
end