
SET_GENERATE_SPEED(300)


MAX_CREATURES(PLAYER0,20)
MAX_CREATURES(PLAYER1,30)
MAX_CREATURES(PLAYER2,30)


START_MONEY(PLAYER0,10000)
START_MONEY(PLAYER1,15000)
START_MONEY(PLAYER2,15000)


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


ALLY_PLAYERS(PLAYER1,PLAYER2)


ADD_CREATURE_TO_POOL(SORCEROR,15)
ADD_CREATURE_TO_POOL(DRAGON,15)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,15)
ADD_CREATURE_TO_POOL(BILE_DEMON,15)
ADD_CREATURE_TO_POOL(DEMONSPAWN,15)
ADD_CREATURE_TO_POOL(SPIDER,10)
ADD_CREATURE_TO_POOL(ORC,30)
ADD_CREATURE_TO_POOL(TROLL,6)
ADD_CREATURE_TO_POOL(TENTACLE,6)
ADD_CREATURE_TO_POOL(HELL_HOUND,15)


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

ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,BRIDGE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,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(PLAYER1,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,1,0)


DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)


RESEARCH(ALL_PLAYERS,ROOM,BRIDGE,3000)
RESEARCH(PLAYER1,MAGIC,POWER_SIGHT,5000)
RESEARCH(PLAYER2,MAGIC,POWER_SIGHT,5000)
RESEARCH(PLAYER3,MAGIC,POWER_SIGHT,5000)
RESEARCH(ALL_PLAYERS,ROOM,GUARD_POST,5000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_CALL_TO_ARMS,5000)
RESEARCH(ALL_PLAYERS,ROOM,WORKSHOP,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_HOLD_AUDIENCE,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_SPEED,10000)
RESEARCH(ALL_PLAYERS,ROOM,PRISON,20000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_CONCEAL,15000)
RESEARCH(ALL_PLAYERS,ROOM,BARRACKS,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_PROTECT,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_HEAL_CREATURE,15000)
RESEARCH(ALL_PLAYERS,ROOM,TORTURE,20000)
RESEARCH(ALL_PLAYERS,ROOM,TEMPLE,25000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_LIGHTNING,25000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_CHICKEN,25000)
RESEARCH(PLAYER0,MAGIC,POWER_DESTROY_WALLS,300000)



DISPLAY_OBJECTIVE(95,PLAYER0)



CREATE_PARTY(FINALE)
	ADD_TO_PARTY(FINALE,GHOST,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALE,AVATAR,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALE,GHOST,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALE,GHOST,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALE,GHOST,10,0,ATTACK_ENEMIES,0)



	SET_TIMER(PLAYER1,TIMER0)

IF(PLAYER1,TIMER0 >= 1500)
	IF(PLAYER1,IMP <= 15)
        NEXT_COMMAND_REUSABLE
	ADD_CREATURE_TO_LEVEL(PLAYER1,IMP,PLAYER1,2,1,500)
        NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER1,TIMER0)
    ENDIF
ENDIF

	SET_TIMER(PLAYER2,TIMER0)

IF(PLAYER2,TIMER0 >= 1500)
	IF(PLAYER2,IMP <= 15)
        NEXT_COMMAND_REUSABLE
	ADD_CREATURE_TO_LEVEL(PLAYER2,IMP,PLAYER2,3,1,500)
        NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER2,TIMER0)
    ENDIF
ENDIF

IF(PLAYER0,SCAVENGER > 0)
	ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,1)
ENDIF

IF(PLAYER0,GRAVEYARD > 0)
	ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
ENDIF

IF(PLAYER1,WORKSHOP > 20)
	ROOM_AVAILABLE(PLAYER1,WORKSHOP,0,0)
ENDIF

IF(PLAYER2,WORKSHOP > 20)
	ROOM_AVAILABLE(PLAYER3,WORKSHOP,0,0)
ENDIF



IF(PLAYER0,ENTRANCE > 0)
	DISPLAY_INFORMATION(96,PLAYER0)
ENDIF


IF(PLAYER0, GAME_TURN > 10000)
	IF(PLAYER1,TOTAL_CREATURES <= 1)
		DISPLAY_OBJECTIVE(97,PLAYER0)
		ADD_CREATURE_TO_LEVEL(PLAYER1,HORNY,PLAYER1,5,10,0)
	ENDIF
ENDIF

IF(PLAYER0, GAME_TURN > 10000)
	IF(PLAYER2,TOTAL_CREATURES <= 1)
		DISPLAY_OBJECTIVE(97,PLAYER0)
		ADD_CREATURE_TO_LEVEL(PLAYER2,HORNY,PLAYER2,5,10,0)
	ENDIF
ENDIF



IF(PLAYER0, ALL_DUNGEONS_DESTROYED == 1)
	SET_FLAG(PLAYER0,FLAG0,2)
	SET_TIMER(PLAYER0,TIMER0)
ENDIF



IF(PLAYER0,TIMER0 > 2500)
	DISPLAY_OBJECTIVE(100,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALE,-1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALE,-2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALE,-3,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALE,-4,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALE,-5,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALE,-6,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALE,-7,1)
	SET_FLAG(PLAYER0,FLAG0,1)
ENDIF




IF(PLAYER0, ALL_DUNGEONS_DESTROYED == 1)
	IF(PLAYER_GOOD,AVATAR==0)
		IF(PLAYER0,FLAG0==1)
			DISPLAY_OBJECTIVE(101,PLAYER0)
			WIN_GAME
		ENDIF
	ENDIF
ENDIF

