
SET_GENERATE_SPEED(700)

MAX_CREATURES(PLAYER0,20)
MAX_CREATURES(PLAYER1,25)

START_MONEY(PLAYER0,15000)
START_MONEY(PLAYER1,25000)

COMPUTER_PLAYER(PLAYER1,6)

ADD_CREATURE_TO_POOL(SORCEROR,10)
ADD_CREATURE_TO_POOL(DRAGON,15)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,15)
ADD_CREATURE_TO_POOL(ORC,25)
ADD_CREATURE_TO_POOL(TROLL,8)
ADD_CREATURE_TO_POOL(KNIGHT,12)

CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER1,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER0,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)
CREATURE_AVAILABLE(PLAYER1,KNIGHT,1,1)


ROOM_AVAILABLE(PLAYER1,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(PLAYER0,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER1,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER1,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(PLAYER0,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(PLAYER1,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_OBEY,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,1,0)


TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,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)


RESEARCH(ALL_PLAYERS,ROOM,BRIDGE,3000)
RESEARCH(PLAYER1,MAGIC,POWER_SIGHT,5000)
RESEARCH(ALL_PLAYERS,ROOM,GUARD_POST,5000)
RESEARCH(PLAYER0,MAGIC,POWER_CALL_TO_ARMS,5000)
RESEARCH(ALL_PLAYERS,ROOM,WORKSHOP,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_SPEED,10000)
RESEARCH(ALL_PLAYERS,ROOM,PRISON,20000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_CONCEAL,15000)
RESEARCH(PLAYER0,ROOM,BARRACKS,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_PROTECT,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_HEAL_CREATURE,15000)
RESEARCH(PLAYER1,ROOM,TORTURE,20000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_LIGHTNING,25000)
RESEARCH(PLAYER1,ROOM,TEMPLE,25000)
RESEARCH(PLAYER0,MAGIC,POWER_OBEY,15000)
RESEARCH(PLAYER1,MAGIC,POWER_CHICKEN,25000)
RESEARCH(PLAYER1,ROOM,GRAVEYARD,50000)
RESEARCH(PLAYER0,MAGIC,POWER_DESTROY_WALLS,400000)


DISPLAY_OBJECTIVE(118,PLAYER0)



CREATE_PARTY(ATTACK)
	ADD_TO_PARTY(ATTACK,ARCHER,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ATTACK,THIEF,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ATTACK,ARCHER,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ATTACK,THIEF,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(SCOUT)
	ADD_TO_PARTY(SCOUT,GIANT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SCOUT,GIANT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SCOUT,DWARFA,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SCOUT,DWARFA,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SCOUT,DWARFA,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(RUNNER)
	ADD_TO_PARTY(RUNNER,ARCHER,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(RUNNER,BARBARIAN,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(RUNNER,ARCHER,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(RUNNER,ARCHER,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(KNIGHT)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,AVATAR,10,0,ATTACK_ENEMIES,0)
	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(SUPPORT)
	ADD_TO_PARTY(SUPPORT,WIZARD,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SUPPORT,AVATAR,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SUPPORT,WIZARD,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SUPPORT,WIZARD,10,0,ATTACK_ENEMIES,0)



REM ****** ROOMS *****

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

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

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

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

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


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


REM ***** ENEMYS IMPS *****

	SET_TIMER(PLAYER1,TIMER0)

IF(PLAYER1,TIMER0 >= 1200)
	IF(PLAYER1,IMP <= 18)
        NEXT_COMMAND_REUSABLE
	ADD_CREATURE_TO_LEVEL(PLAYER1,IMP,PLAYER1,1,1,500)
        NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER1,TIMER0)
    ENDIF
ENDIF

IF(PLAYER1,KNIGHT >= 10)
	NEXT_COMMAND_REUSABLE
	CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
ENDIF

IF(PLAYER1,KNIGHT <= 10)
	NEXT_COMMAND_REUSABLE
	CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,0)
ENDIF


IF(PLAYER1,TOTAL_CREATURES <= 1)
	ADD_CREATURE_TO_LEVEL(PLAYER1,SORCEROR,PLAYER1,6,9,0)
ENDIF


IF(PLAYER0, GAME_TURN > 4000)
	DISPLAY_INFORMATION(119,PLAYER0)
ENDIF


IF(PLAYER0, GAME_TURN > 9000)
	DISPLAY_INFORMATION(123,PLAYER0)
ENDIF


IF_ACTION_POINT(1,PLAYER0)
	ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,-1,DUNGEON_HEART,0,10,1500)
	ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,-2,DUNGEON_HEART,0,10,1500)
	ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,-3,DUNGEON_HEART,0,10,1500)
	DISPLAY_OBJECTIVE(,PLAYER0)
	SET_TIMER(PLAYER_GOOD,TIMER0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 2000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK,2,3)
ENDIF


IF(PLAYER_GOOD,TIMER0 >= 6000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK,2,4)
ENDIF


IF(PLAYER1,DUNGEON_DESTROYED==1)
	IF(PLAYER_GOOD,DUNGEON_DESTROYED==0)
		DISPLAY_OBJECTIVE(120,PLAYER0)
	ENDIF
ENDIF




REM ******* FINALE *******


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

IF(PLAYER0,TIMER1 > 1000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SCOUT,2,5)
ENDIF


IF(PLAYER0,TIMER1 > 4000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,RUNNER,2,5)
ENDIF


IF(PLAYER0,TIMER1 > 7000)
	SET_FLAG(PLAYER0,FLAG0,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-2,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SUPPORT,-3,2)
ENDIF


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




