/******************************************************************************
 Snippet: Wilderness system (v1.0).
 Author:  Richard Woolcock (aka KaVir).
 Date:    2nd September 1998.
 ******************************************************************************
 File:    wild.h
 Purpose: Header file for the wilderness code.
 ******************************************************************************
 This code is copyright (C) 1998 by Richard Woolcock.  It may be used and
 distributed freely, as long as you do not remove this copyright notice.
 ******************************************************************************/

/******************************************************************************
 Local literals
 ******************************************************************************/

/* Shortened type names */
#define RID_T		ROOM_INDEX_DATA
#define MAP_T		       MAP_TYPE
#define RES_T		  RESOURCE_TYPE

#define MOB_VNUM_SHARK		  20000
#define MOB_VNUM_BEAR		  20001
#define MOB_VNUM_WOLF		  20002
#define MOB_VNUM_LUMBERJACK	  20003
#define MOB_VNUM_FISH		  20004

#define OBJ_VNUM_PROTOPLASM	  20000
#define OBJ_VNUM_AXE              20001
#define OBJ_VNUM_FISH		  20004

/* Wilderness update speed. */
#define PULSE_WILDERNESS	  ( 5 * PULSE_PER_SECOND)

#define WILDERNESS_LOW_VNUM	  20000 /* Beginning of wilderness zone. */
#define WILDERNESS_HIGH_VNUM	  20999 /* End of wilderness zone. */

#define WILDERNESS_SIZE		   1000 /* Size of wilderness. */

/* Wilderness actions. */
#define WA_NONE			      0
#define WA_CHOPPING_SWING	      1 /* Chopping a tree */
#define WA_CHOPPING_CHOP	      2 /* Chopping a tree */
#define WA_TRIM			      3 /* Trimming a tree */
#define WA_FISHING_MENDING	      4 /* Putting on a new line */
#define WA_FISHING_CASTING	      5 /* Casting the line out */
#define WA_FISHING_WAITING	      6 /* Waiting for a bite */
#define WA_FISHING_REELING	      7 /* Reeling in a bite */
#define WA_BUILDING_FOUNDATION        8 /* Building hut/cabin/etc */
#define WA_BUILDING_FLOOR_1	      9 /* Building hut/cabin/etc */
#define WA_BUILDING_FLOOR_2	     10 /* Building hut/cabin/etc */
#define WA_BUILDING_FLOOR_3	     11 /* Building hut/cabin/etc */
#define WA_BUILDING_ROOF_1	     12 /* Building hut/cabin/etc */
#define WA_BUILDING_ROOF_2	     13 /* Building hut/cabin/etc */
#define WA_BUILDING_ROOF_3	     14 /* Building hut/cabin/etc */
#define WA_BUILDING_1		     15 /* Building hut/cabin/etc */
#define WA_BUILDING_2		     16 /* Building hut/cabin/etc */
#define WA_BUILDING_3		     17 /* Building hut/cabin/etc */
#define WA_BUILDING_COMPLETE	     18 /* Building hut/cabin/etc */
#define WA_DIGGING_SWING	     19 /* Digging the inside mine */
#define WA_DIGGING_CHOP		     20 /* Digging the inside mine */
#define WA_SAW			     21 /* Sawing up a log */
#define WA_MINING_SWING		     22 /* Mining */
#define WA_MINING_CHOP		     23 /* Mining */
#define WA_HOE			     24 /* Hoeing a field */
#define WA_SEED			     25 /* Seeding a field */
#define WA_SCYTHE		     26 /* Scything a field */
#define WA_ROAD			     27 /* Laying a road */

/* Tool types. */
#define TOOL_PEN		      1
#define TOOL_PLIERS		      2
#define TOOL_SCALPEL		      3
#define TOOL_FISHING_ROD	      4
#define TOOL_SHOVEL		      5
#define TOOL_PICK		      6
#define TOOL_HAMMER		      7
#define TOOL_NAILS		      8
#define TOOL_SAW		      9
#define TOOL_HOE		     10
#define TOOL_SEEDS		     11
#define TOOL_SCYTHE		     12

/* Wilderness room types. */
#define WILD_AREA_LINK		      '@'
#define WILD_ROAD		      '_'
#define WILD_HUT_OWNED		      'a'
#define WILD_CABIN_OWNED	      'A'
#define WILD_BUILDING_BURNED	      'b'
#define WILD_BUILDING_DESTROYED	      'B'
#define WILD_BUILDING_CONSTRUCTION    'c'
#define WILD_SCORCHED_GROUND	      'C'
#define WILD_WATER_DEEP_1	      'd'
#define WILD_WATER_DEEP_2	      'D'
#define WILD_FOREST_1		      'e'
#define WILD_FOREST_2		      'E'
#define WILD_FOREST_3		      'f'
#define WILD_FOREST_4		      'F'
#define WILD_HUT		      'g'
#define WILD_HUT_LOCKED		      'G'
#define WILD_CABIN		      'h'
#define WILD_CABIN_LOCKED	      'H'
#define WILD_COTTAGE		      'i'
#define WILD_COTTAGE_LOCKED	      'I'
#define WILD_HOUSE		      'j'
#define WILD_HOUSE_LOCKED	      'J'
#define WILD_FIELD_HOED		      'k'
#define WILD_FIELD_SEEDED	      'K'
#define WILD_FIELD_WHEAT	      'l'
#define WILD_MOUNTAINS_NONE	      'm'
#define WILD_MOUNTAINS_STONE	      'M'
#define WILD_MOUNTAINS_IRON	      'n'
#define WILD_MOUNTAINS_GOLD	      'N'
#define WILD_MOUNTAINS_OIL	      'o'
#define WILD_MINE_STRUCTURE_EMPTY     'O'
#define WILD_PLAINS		      'p'
#define WILD_MINE_STONE_1	      'P'
#define WILD_MINE_STONE_2	      'q'
#define WILD_MINE_IRON_1	      'Q'
#define WILD_MINE_IRON_2	      'r'
#define WILD_MINE_GOLD_1	      'R'
#define WILD_MINE_GOLD_2	      's'
#define WILD_MINE_OIL_1		      'S'
#define WILD_MINE_OIL_2		      't'
#define WILD_MINE_EMPTY		      'T'
#define WILD_MINE_STRUCTURE_STONE     'u'
#define WILD_MINE_STRUCTURE_IRON      'U'
#define WILD_MINE_STRUCTURE_GOLD      'v'
#define WILD_MINE_STRUCTURE_OIL       'V'
#define WILD_WATER_1		      'w'
#define WILD_WATER_2		      'W'
#define WILD_MOUNTAINS_COAL	      'x'
#define WILD_MINE_COAL_1	      'X'
#define WILD_MINE_COAL_2	      'y'
#define WILD_MINE_STRUCTURE_COAL      'Y'
#define WILD_COTTAGE_OWNED	      'z'
#define WILD_HOUSE_OWNED	      'Z'

/******************************************************************************
 Local enumerated types
 ******************************************************************************/

/* Resource types. */
typedef enum
{
    RESOURCE_TREE,	/* A chopped down tree.		 */
    RESOURCE_LOG,	/* A tree with the bits cut off. */
    RESOURCE_ROCK,	/* A piece of rock.		 */
    RESOURCE_IRON,	/* A piece of iron ore.		 */
    RESOURCE_GOLD,	/* A piece of iron ore.		 */
    RESOURCE_OIL,	/* A pool of oil.		 */
    RESOURCE_WHEAT,	/* A bundle of wheat.		 */
} RESOURCE_TYPE;

/* Large wilderness map location types. */
typedef enum
{
   SEA  = WILD_PLAINS,
   LAND = WILD_WATER_1
} MAP_TYPE;

/******************************************************************************
 Required macros
 ******************************************************************************/

/* Checks if the room is within the wilderness */
#define IN_WILDERNESS(v) ((v) >= WILDERNESS_LOW_VNUM && \
			  (v) <= WILDERNESS_HIGH_VNUM)

/******************************************************************************
 Required operation prototypes for wild_data.c
 ******************************************************************************/

char	map_data		args( ( int x, int y ) );
void	set_map_data		args( ( int x, int y, char room_type ) );
bool	map_changed		args( ( int x, int y ) );
void	set_map_changed		args( ( int x, int y, bool changed ) );
MAP_T	map_big			args( ( int x, int y ) );
void	set_world_saving	args( ( bool save_world ) );
bool	check_world_saving	args( ( void ) );

/******************************************************************************
 Required operation prototypes for wild_io.c
 ******************************************************************************/

void	wild_write		args( ( int x, int y ) );
void	wild_read		args( ( int x, int y ) );
void	world_read		args( ( void ) );

/******************************************************************************
 Required operation prototypes for wild_move.c
 ******************************************************************************/

void	put_area_vnum		args( ( int vnum ) );
int	next_home		args( ( CHAR_DATA *ch, int door ) );
RID_T *	next_room		args( ( int x, int y, int room ) );
void	char_from_wilderness	args( ( CHAR_DATA *ch ) );
RID_T *	wilderness_room		args( ( CHAR_DATA *ch, RID_T *room ) );

/******************************************************************************
 Required operation prototypes for wild_info.c
 ******************************************************************************/

void	draw_map		args( ( CHAR_DATA *ch ) );

/******************************************************************************
 Required operation prototypes for wild_spec.c
 ******************************************************************************/

DECLARE_SPEC_FUN( spec_wildmob );
DECLARE_SPEC_FUN( spec_lumberjack );

/******************************************************************************
 Required operation prototypes for wild_update.c
 ******************************************************************************/

void	wilderness_update	args( ( void ) );
