REM	Level 301, Tymnath Herez 91.1.0
REM	Author: Duke Ragereaver, Created on 19 Mar 2017
REM	Updated for use of pot file and extra messages by dayokay Dec2020

REM	Description: This is an ancient realm. Its wealth and knowledge is desired by many despicable Keepers.
REM	As of late two powerful Keepers by the names of Prerun and Swailihr have set their sight on this realm.
REM	Both have their own wicked designs for this realm so it is likely they will not be on friendly terms.
REM	Against such overwhelming forces, the Heroes have retreated to their holdouts. Your location is central
REM	in the realm so you will have a lot room to manoeuvre. Make up your mind what areas should have your
REM	initial attention, but be watchful not to overstretch your lines.

SET_GENERATE_SPEED(625)
MAX_CREATURES(PLAYER0,24)
MAX_CREATURES(PLAYER1,34)
MAX_CREATURES(PLAYER2,28)
START_MONEY(PLAYER0,30000)
START_MONEY(PLAYER1,800000)
START_MONEY(PLAYER2,500000)

COMPUTER_PLAYER(PLAYER1,1)
COMPUTER_PLAYER(PLAYER2,1)

IF(PLAYER2,WORKSHOP >= 49)
	NEXT_COMMAND_REUSABLE
	ROOM_AVAILABLE(PLAYER2,WORKSHOP,0,0)
ENDIF

IF(PLAYER2,WORKSHOP < 49)
	NEXT_COMMAND_REUSABLE
	ROOM_AVAILABLE(PLAYER2,WORKSHOP,1,1)
ENDIF

IF(PLAYER1,WORKSHOP >= 72)
	NEXT_COMMAND_REUSABLE
	ROOM_AVAILABLE(PLAYER1,WORKSHOP,0,0)
ENDIF

IF(PLAYER1,WORKSHOP < 72)
	NEXT_COMMAND_REUSABLE
	ROOM_AVAILABLE(PLAYER1,WORKSHOP,1,1)
ENDIF

ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,25)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,25)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(BUG,15)
ADD_CREATURE_TO_POOL(SPIDER,15)
ADD_CREATURE_TO_POOL(FLY,15)
ADD_CREATURE_TO_POOL(ORC,30)
ADD_CREATURE_TO_POOL(DRAGON,25)
ADD_CREATURE_TO_POOL(DEMONSPAWN,15)
ADD_CREATURE_TO_POOL(VAMPIRE,3)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(HELL_HOUND,15)

CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER2,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER0,FLY,1,1)
CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(PLAYER1,VAMPIRE,1,1)
CREATURE_AVAILABLE(PLAYER1,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER1,BARRACKS,1,0)
ROOM_AVAILABLE(PLAYER2,BARRACKS,1,0)
ROOM_AVAILABLE(PLAYER1,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER2,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER1,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER2,TORTURE,1,1)
ROOM_AVAILABLE(PLAYER1,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER2,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER1,BRIDGE,1,0)
ROOM_AVAILABLE(PLAYER2,BRIDGE,1,0)
ROOM_AVAILABLE(PLAYER1,GRAVEYARD,1,1)
ROOM_AVAILABLE(PLAYER1,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER2,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER2,PRISON,1,0)

SET_COMPUTER_PROCESS(PLAYER1,"BUILD A TRAINING ROOM",0,5,6,6,0)
SET_COMPUTER_PROCESS(PLAYER2,"BUILD A TRAINING ROOM",0,5,6,6,0)
SET_COMPUTER_PROCESS(PLAYER2,"BUILD A TORTURE ROOM",-5,5,6,5,0)
SET_COMPUTER_PROCESS(PLAYER1,"BUILD A GRAVEYARD ROOM",0,5,6,11,0)
SET_COMPUTER_PROCESS(PLAYER1,"BUILD A WORKSHOP ROOM",-10,6,6,8,0)
SET_COMPUTER_PROCESS(PLAYER2,"BUILD A WORKSHOP ROOM",-10,7,7,8,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,1,0)

TRAP_AVAILABLE(PLAYER0,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)

REM	QUICK_OBJECTIVE(0,"The mighty Keepers Prerun (Blue) and Swailihr (Green) are eager to seize this realm and each will not hesitate to start the conflict. The Heroes have dug themselves in the rather naive hope that they can survive the upcoming onslaught. It is a shame they hold onto strategic positions and possess some crucial knowledge and treasures.",PLAYER0)
DISPLAY_OBJECTIVE (1,PLAYER0)

IF(PLAYER0,BRIDGE > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,BRIDGE,1,1)
	TUTORIAL_FLASH_BUTTON(18,100)
ENDIF

IF(PLAYER0,GUARD_POST > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,1)
	TUTORIAL_FLASH_BUTTON(19,100)
ENDIF

IF(PLAYER0,WORKSHOP > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,1)
	TUTORIAL_FLASH_BUTTON(13,100)
ENDIF

IF(PLAYER0,BARRACKS > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,1)
	TUTORIAL_FLASH_BUTTON(16,100)
ENDIF

IF(PLAYER0,PRISON > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,1)
	TUTORIAL_FLASH_BUTTON(11,100)
ENDIF

IF(PLAYER0,TORTURE > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,1)
	TUTORIAL_FLASH_BUTTON(17,100)
ENDIF

IF(PLAYER0,TEMPLE > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,1)
	TUTORIAL_FLASH_BUTTON(12,100)
ENDIF

IF(PLAYER0,GRAVEYARD > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,1)
	TUTORIAL_FLASH_BUTTON(15,100)
ENDIF

IF(PLAYER0,SCAVENGER > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,1,1)
	TUTORIAL_FLASH_BUTTON(14,100)
ENDIF

IF(PLAYER0,FLAG4==0)
	IF(PLAYER1, DUNGEON_DESTROYED==1)
		SET_FLAG(PLAYER0,FLAG4,1)
		DISPLAY_OBJECTIVE(2,PLAYER2)
	ENDIF
ENDIF

IF(PLAYER0,FLAG4==0)
	IF(PLAYER2, DUNGEON_DESTROYED==1)
		SET_FLAG(PLAYER0,FLAG4,1)
		DISPLAY_OBJECTIVE(2,PLAYER1)
	ENDIF
ENDIF

IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
	DISPLAY_INFORMATION(4)
	IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
		DISPLAY_OBJECTIVE(3,PLAYER0)
		WIN_GAME
	ENDIF
ENDIF
