#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure lighting;


procedure start
begin
	if (script_action == map_enter_proc) then begin
		call map_enter_p_proc;
	end
	else begin
		if (script_action == map_update_proc) then begin
			call map_update_p_proc;
		end
	end
end

procedure map_enter_p_proc
begin
	call lighting;
end

procedure map_update_p_proc
begin
	call lighting;
end

procedure lighting
begin
	if ((game_time_hour >= 600) and (game_time_hour < 700)) then begin
		obj_set_light_level(self_obj, game_time_hour - 600 + 40, 8);
	end
	else begin
		if ((game_time_hour >= 1800) and (game_time_hour < 1900)) then begin
			obj_set_light_level(self_obj, 100 - (game_time_hour - 1800), 8);
		end
		else begin
			if ((game_time_hour >= 700) and (game_time_hour < 1800)) then begin
				obj_set_light_level(self_obj, 100, 8);
			end
			else begin
				obj_set_light_level(self_obj, 40, 8);
			end
		end
	end
end