
SET_GENERATE_SPEED(550)


MAX_CREATURES(PLAYER0,10)
MAX_CREATURES(PLAYER1,15)
MAX_CREATURES(PLAYER2,15)


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


ALLY_PLAYERS(PLAYER1,PLAYER2)


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


ADD_CREATURE_TO_POOL(SORCEROR,15)
ADD_CREATURE_TO_POOL(DRAGON,25)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,15)
ADD_CREATURE_TO_POOL(BILE_DEMON,15)
ADD_CREATURE_TO_POOL(DEMONSPAWN,5)
ADD_CREATURE_TO_POOL(SPIDER,10)
ADD_CREATURE_TO_POOL(ORC,25)
ADD_CREATURE_TO_POOL(TROLL,6)
ADD_CREATURE_TO_POOL(TENTACLE,6)
ADD_CREATURE_TO_POOL(FLY,4)


CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)		
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER0,FLY,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(PLAYER0,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)
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,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(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_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_OBEY,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,1,0)


DOOR_AVAILABLE(PLAYER0,WOOD,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,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)
TRAP_AVAILABLE(PLAYER0,BOULDER,1,0)


RESEARCH(PLAYER0,ROOM,BRIDGE,3000)
RESEARCH(PLAYER1,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,MAGIC,POWER_CAVE_IN,25000)
RESEARCH(ALL_PLAYERS,ROOM,TEMPLE,25000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_LIGHTNING,25000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_OBEY,15000)
RESEARCH(ALL_PLAYERS,ROOM,GRAVEYARD,50000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_CHICKEN,25000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_DISEASE,50000)
RESEARCH(PLAYER0,MAGIC,POWER_DESTROY_WALLS,300000)


	SET_TIMER(PLAYER1,TIMER0)

IF(PLAYER1,TIMER0 >= 1000)
	IF(PLAYER1,IMP <= 30)
        NEXT_COMMAND_REUSABLE
	ADD_CREATURE_TO_LEVEL(PLAYER1,IMP,PLAYER1,3,1,1000)
        NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER1,TIMER0)
    ENDIF
ENDIF

	SET_TIMER(PLAYER2,TIMER0)

IF(PLAYER2,TIMER0 >= 1000)
	IF(PLAYER1,IMP <= 25)
        NEXT_COMMAND_REUSABLE
	ADD_CREATURE_TO_LEVEL(PLAYER2,IMP,PLAYER2,3,1,1000)
        NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER2,TIMER0)
    ENDIF
ENDIF



DISPLAY_OBJECTIVE(52,PLAYER0)


CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,WIZARD,7,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,SAMURAI,8,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,SAMURAI,8,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,6,0,ATTACK_ENEMIES,0)

CREATE_PARTY(WITCHES)
	ADD_TO_PARTY(WITCHES,WITCH,8,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,6,0,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,SAMURAI,9,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,SAMURAI,9,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,SAMURAI,9,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,DWARFA,9,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,DWARFA,9,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,DWARFA,9,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,DWARFA,9,1000,ATTACK_ENEMIES,0)


CREATE_PARTY(KNIGHT)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,AVATAR,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(FIN)
	ADD_TO_PARTY(FIN,SAMURAI,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN,SAMURAI,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN,SAMURAI,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN,SAMURAI,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN,SAMURAI,10,0,ATTACK_ENEMIES,0)





IF(PLAYER0, GAME_TURN > 5000)
	DISPLAY_OBJECTIVE(54,PLAYER0)
	CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
ENDIF


IF(PLAYER0,TOTAL_GOLD_MINED > 80000)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,1)
ENDIF

IF(PLAYER0,TOTAL_GOLD_MINED > 160000)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,1)
ENDIF

IF(PLAYER0,TOTAL_GOLD_MINED > 250000)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,2)
ENDIF

IF(PLAYER0,TOTAL_GOLD_MINED > 320000)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WITCHES,-1,2)
ENDIF


IF_ACTION_POINT(2,PLAYER0)
	DISPLAY_INFORMATION(55,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,2)
ENDIF


IF(PLAYER1,DUNGEON_DESTROYED==0)
	IF(PLAYER2,DUNGEON_DESTROYED==1)
		DISPLAY_OBJECTIVE(56,PLAYER0)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,1,2)
	ENDIF
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED==1)
	IF(PLAYER2,DUNGEON_DESTROYED==0)
		DISPLAY_OBJECTIVE(56,PLAYER0)
	ENDIF
ENDIF


IF(PLAYER0, ALL_DUNGEONS_DESTROYED == 1)
		DISPLAY_OBJECTIVE(57,PLAYER0)
	SET_TIMER(PLAYER0,TIMER1)
ENDIF


IF(PLAYER0,TIMER1 > 2500)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIN,-1,1)
ENDIF

IF(PLAYER0,TIMER1 > 2550)
	SET_FLAG(PLAYER0,FLAG0,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,1)
ENDIF




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



