/*
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/*
Name: Arroyo Village
Location: Arroyo
Description: This is the Map Script for the Village of Arroyo
Log:
Please note any changes that have been made to the file in Updated. Then comment
the code which you have changed/altered/commented out. Please, do not delete any
code which was written.
Created: December 04, 1997
Updated:
*/
/* Include Files */
/* Note, the Following Lines need to be in this order so that
the script will be compilable. The define Name is referenced
in a module from define.h and used in command.h. Please do
not change the ordering.
-rwh2 11/13/97
*/
#include "..\headers\define.h"
#include "..\headers\ArGarden.h"
#include "..\headers\updatmap.h"
#define NAME SCRIPT_ARGARDEN
#include "..\headers\command.h"
procedure start;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure Make_Geckos;
procedure Make_Plants;
procedure Kill_Brat;
export variable Nagor_Tile;
procedure start begin
end
procedure map_enter_p_proc begin
variable item;
Lighting;
if (map_var(MVAR_Last_Respawn_Map) == 0) then begin
set_map_var(MVAR_Last_Respawn_Map,game_time);
call Make_Geckos;
call Make_Plants;
if (not(tile_contains_obj_pid(24298,0,PID_XANDER_ROOT))) then begin
item:=create_object(PID_XANDER_ROOT,0,0);
move_to(item,24298,0);
end
end
if (((game_time - map_var(MVAR_Last_Respawn_Map)) >= ONE_GAME_DAY) and (not(is_loading_game))) then begin
set_map_var(MVAR_Last_Respawn_Map,game_time);
call Make_Geckos;
call Make_Plants;
if (not(tile_contains_obj_pid(24298,0,PID_XANDER_ROOT))) then begin
item:=create_object(PID_XANDER_ROOT,0,0);
move_to(item,24298,0);
end
end
if ((global_var(GVAR_ARROYO_DOG) == DOG_RUN_OFF) and (map_var(MVAR_Kill_Runaway) == 0)) then begin
set_map_var(MVAR_Kill_Runaway,1);
call Kill_Brat;
end
set_global_var(GVAR_LOAD_MAP_INDEX,0);
end
procedure map_update_p_proc begin
Lighting;
end
procedure Make_Geckos begin
variable Gecko_Counter:=0;
variable SmGecko_Counter:=0;
variable New_Geckos:=0;
variable New_SmGeckos:=0;
variable item;
variable item_hex;
// Small Geckos
if (map_var(MVAR_Current_Gecko_Easy) < MIN_SMALL_GECKO) then begin
New_SmGeckos:=random(MIN_SMALL_GECKO,MAX_SMALL_GECKO);
debug_msg("Making "+New_SmGeckos+" new small Geckos.");
while (SmGecko_Counter < New_SmGeckos) do begin
Next_Hex;
item:=create_object_sid(PID_GECKO_SMALL,0,0,SCRIPT_ACGECKO);
while (item_hex <= 0) do begin
item_hex:=tile_num_in_direction(map_var(MVAR_Last_Spot),random(0,5),random(0,10));
end
set_map_var(MVAR_Current_Gecko_Easy,map_var(MVAR_Current_Gecko_Easy)+1);
critter_attempt_placement(item,item_hex,0);
SmGecko_Counter+=1;
item_hex:=0;
end
end
else if ((map_var(MVAR_Current_Gecko_Easy) >= MIN_SMALL_GECKO) and (map_var(MVAR_Current_Gecko_Easy) < MAX_SMALL_GECKO)) then begin
New_SmGeckos:=random(0,MAX_SMALL_GECKO-MIN_SMALL_GECKO);
debug_msg("Making "+New_SmGeckos+" new small Geckos.");
while (SmGecko_Counter < New_SmGeckos) do begin
Next_Hex;
item:=create_object_sid(PID_GECKO_SMALL,0,0,SCRIPT_ACGECKO);
while (item_hex <= 0) do begin
item_hex:=tile_num_in_direction(map_var(MVAR_Last_Spot),random(0,5),random(0,10));
end
set_map_var(MVAR_Current_Gecko_Easy,map_var(MVAR_Current_Gecko_Easy)+1);
SmGecko_Counter+=1;
critter_attempt_placement(item,item_hex,0);
item_hex:=0;
end
end
item_hex:=0;
// Tough small Geckos
if (map_var(MVAR_Current_Gecko_Hard) < MIN_TOUGH_GECKO) then begin
New_Geckos:=random(MIN_TOUGH_GECKO,MIN_TOUGH_GECKO);
debug_msg("Making "+New_Geckos+" new small tough Geckos.");
while (Gecko_Counter < New_Geckos) do begin
Next_Hex;
item:=create_object_sid(PID_TOUGH_GECKO_SMALL,0,0,SCRIPT_ACGECKO);
while (item_hex <= 0) do begin
item_hex:=tile_num_in_direction(map_var(MVAR_Last_Spot),random(0,5),random(0,10));
end
set_map_var(MVAR_Current_Gecko_Hard,map_var(MVAR_Current_Gecko_Hard)+1);
critter_attempt_placement(item,item_hex,0);
Gecko_Counter+=1;
item_hex:=0;
end
end
else if ((map_var(MVAR_Current_Gecko_Hard) >= MIN_TOUGH_GECKO) and (map_var(MVAR_Current_Gecko_Hard) < MAX_TOUGH_GECKO)) then begin
New_Geckos:=random(0,MAX_TOUGH_GECKO-MIN_TOUGH_GECKO);
debug_msg("Making "+New_Geckos+" new small tough Geckos.");
while (Gecko_Counter < New_Geckos) do begin
Next_Hex;
item:=create_object_sid(PID_TOUGH_GECKO_SMALL,0,0,SCRIPT_ACGECKO);
while (item_hex <= 0) do begin
item_hex:=tile_num_in_direction(map_var(MVAR_Last_Spot),random(0,5),random(0,10));
end
set_map_var(MVAR_Current_Gecko_Hard,map_var(MVAR_Current_Gecko_Hard)+1);
critter_attempt_placement(item,item_hex,0);
Gecko_Counter+=1;
item_hex:=0;
end
end
end
procedure Make_Plants begin
variable Xander_Counter:=0;
variable New_Xanders:=0;
variable Broc_Counter:=0;
variable New_Broc:=0;
variable item;
variable item_hex;
// Xander Root Restock
New_Xanders:=random(MIN_XANDER_ROOT,MAX_XANDER_ROOT);
debug_msg("Making "+New_Xanders+" new Xander Roots.");
while (Xander_Counter < New_Xanders) do begin
Next_Hex;
item:=create_object(PID_XANDER_ROOT,0,0);
item_hex:=tile_num_in_direction(map_var(MVAR_Last_Spot),random(0,5),random(0,10));
move_to(item,item_hex,0);
Xander_Counter+=1;
end
// Broc Flower Restock
New_Broc:=random(MIN_BROC_FLOWER,MAX_BROC_FLOWER);
debug_msg("Making "+New_Broc+" new Broc Flowers.");
while (Broc_Counter < New_Broc) do begin
Next_Hex;
item:=create_object(PID_BROC_FLOWER,0,0);
item_hex:=tile_num_in_direction(map_var(MVAR_Last_Spot),random(0,5),random(0,10));
move_to(item,item_hex,0);
Broc_Counter+=1;
end
end
procedure Kill_Brat begin
variable dog;
variable cousin;
variable gecko;
variable spear
kill_critter_type(PID_DOG,KILL_DONT_LEAVE_BODY);
cousin:=create_object(PID_PRIMITIVE_VILLAGER_MALE,0,0);
gecko:=create_object(PID_TOUGH_GECKO_SMALL,0,0);
spear:=create_object(PID_SPEAR,0,0);
critter_attempt_placement(cousin,HEX_DEAD_COUSIN,0);
critter_attempt_placement(gecko,HEX_DEAD_GECKO,0);
if (map_var(MVAR_Dog_Already_Dead) == 0) then begin
dog:=create_object(PID_DOG,0,0);
critter_attempt_placement(dog,HEX_DEAD_DOG,0);
end
Face_Critter(cousin,gecko);
add_mult_objs_to_inven(cousin,spear,1);
kill_critter(dog,ANIM_fall_front_blood_sf);
kill_critter(cousin,ANIM_fall_front_blood_sf);
kill_critter(gecko,ANIM_fall_back_blood_sf);
end