REM PLAY Level 28

LEVEL_VERSION(1)

BONUS_LEVEL_TIME(12000)
SET_TIMER(PLAYER0,TIMER0)
SET_TIMER(PLAYER0,TIMER1)

SET_GENERATE_SPEED(1000)

REM MAX_CREATURES(PLAYER0,50)
REM MAX_CREATURES(ALL_PLAYERS,50)

REM START_MONEY(PLAYER0,7500)
REM START_MONEY(PLAYER1,3500)
REM START_MONEY(PLAYER2,3500)
REM START_MONEY(PLAYER3,3500)


 REM     Computer Player stuff
 rem		COMPUTER_PLAYER(PLAYER1)

COMPUTER_PLAYER(PLAYER1,6)
COMPUTER_PLAYER(PLAYER2,6)
COMPUTER_PLAYER(PLAYER3,6)

ALLY_PLAYERS(PLAYER1,PLAYER2,1)
ALLY_PLAYERS(PLAYER1,PLAYER3,1)

ALLY_PLAYERS(PLAYER2,PLAYER3,1)

REM ALL PLAYERS

REM ADD_CREATURE_TO_POOL(FLY,13)
REM ADD_CREATURE_TO_POOL(SPIDER,20)
REM ADD_CREATURE_TO_POOL(DEMONSPAWN,30)
REM ADD_CREATURE_TO_POOL(TROLL,30)
REM ADD_CREATURE_TO_POOL(SORCEROR,9)
REM ADD_CREATURE_TO_POOL(BILE_DEMON,5)
REM ADD_CREATURE_TO_POOL(DARK_MISTRESS,35)
REM ADD_CREATURE_TO_POOL(BUG,15)
REM ADD_CREATURE_TO_POOL(HELL_HOUND,10)


REM Creature_Availability

	REM CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,0)
	REM CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,0)

REM Room_Availability

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

REM Spells
		
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)
	REM MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)


REM  doors & traps

	REM DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
	REM TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
	REM DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
	REM TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
	REM DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
	REM TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
	REM DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
	REM TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
	REM TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)
		

REM  research order	

	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_SPEED,3000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_CALL_TO_ARMS,2000)
	REM RESEARCH(ALL_PLAYERS,ROOM,WORKSHOP,4000)
	REM RESEARCH(ALL_PLAYERS,ROOM,BARRACKS,4000)
	REM RESEARCH(ALL_PLAYERS,ROOM,GUARD_POST,4000)
	REM RESEARCH(ALL_PLAYERS,ROOM,BRIDGE,4000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_HEAL_CREATURE,4000)
	REM RESEARCH(ALL_PLAYERS,ROOM,PRISON,6000)
	REM RESEARCH(ALL_PLAYERS,ROOM,TORTURE,6000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_SIGHT,5000)
	REM RESEARCH(ALL_PLAYERS,ROOM,SCAVENGER,12000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_LIGHTNING,8000)
	REM RESEARCH(ALL_PLAYERS,ROOM,POWER_TEMPLE,10000)
	REM RESEARCH(ALL_PLAYERS,ROOM,TEMPLE,10000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_PROTECT,4000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_CONCEAL,4000)
	REM RESEARCH(ALL_PLAYERS,ROOM,GRAVEYARD,8000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_DISEASE,8000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_CAVE_IN,6000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_CHICKEN,6000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_DESTROY_WALLS,12000)
	REM RESEARCH(ALL_PLAYERS,MAGIC,POWER_HOLD_AUDIENCE,16000)

REM CREATE_TEXT(0"MAKE HASTE TO SUBJUGATE YOUR ADVERSARY HERE, THE DUNGEON KEEPER CAKE-BOY.")
REM DISPLAY_OBJECTIVE(0,PLAYER0)
QUICK_OBJECTIVE(0, "Make haste to subjugate your adversaries here, the Dungeon Keeper cake-boys.", ALL_PLAYERS)

ADD_CREATURE_TO_LEVEL(PLAYER0,SPIDER,PLAYER0,1,3,0)

SET_FLAG(PLAYER0,FLAG0,0)

REM IF(PLAYER0,DUNGEON_DESTROYED == 1)
   	REM LOSE_GAME
REM ENDIF

IF(PLAYER0,TIMER0 >= 6000)
	DISPLAY_OBJECTIVE(150,ALL_PLAYERS)
ENDIF

IF(PLAYER0,TIMER0 >= 12000)
	DISPLAY_OBJECTIVE(151,ALL_PLAYERS)
	LOSE_GAME
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	IF(PLAYER0,TIMER1 >= 200)
		IF(PLAYER0,FLAG0 == 1)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FLY,1,10,1,0)
		ENDIF
		IF(PLAYER0,FLAG0 == 0)
			IF(PLAYER1,DUNGEON_DESTROYED == 0)
				NEXT_COMMAND_REUSABLE
				ADD_CREATURE_TO_LEVEL(PLAYER1,FLY,1,3,1,0)
			ENDIF
			IF(PLAYER2,DUNGEON_DESTROYED == 0)
				NEXT_COMMAND_REUSABLE
				ADD_CREATURE_TO_LEVEL(PLAYER2,FLY,1,3,1,0)
			ENDIF
			IF(PLAYER3,DUNGEON_DESTROYED == 0)
				NEXT_COMMAND_REUSABLE
				ADD_CREATURE_TO_LEVEL(PLAYER3,FLY,1,3,1,0)
			ENDIF
		ENDIF
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER0,TIMER1)
	ENDIF
	IF(PLAYER0,TIMER1 < 200)
		NEXT_COMMAND_REUSABLE
		RESET_ACTION_POINT(1)
	ENDIF
ENDIF

IF_ACTION_POINT(1,PLAYER1)
	NEXT_COMMAND_REUSABLE
	RESET_ACTION_POINT(1)
ENDIF

IF_ACTION_POINT(1,PLAYER2)
	NEXT_COMMAND_REUSABLE
	RESET_ACTION_POINT(1)
ENDIF

IF_ACTION_POINT(1,PLAYER3)
	NEXT_COMMAND_REUSABLE
	RESET_ACTION_POINT(1)
ENDIF

IF_ACTION_POINT(1,PLAYER_GOOD)
	NEXT_COMMAND_REUSABLE
	RESET_ACTION_POINT(1)
ENDIF

IF_CONTROLS(​PLAYER1,​TOTAL_CREATURES == 0)
	SET_HEART_HEALTH(PLAYER1,0)
	LEVEL_UP_CREATURE(PLAYER0,SPIDER,ANYWHERE,1)
ENDIF

IF_CONTROLS(​PLAYER2,​TOTAL_CREATURES == 0)
	SET_HEART_HEALTH(PLAYER2,0)
	LEVEL_UP_CREATURE(PLAYER0,SPIDER,ANYWHERE,1)
ENDIF

IF_CONTROLS(​PLAYER3,​TOTAL_CREATURES == 0)
	SET_HEART_HEALTH(PLAYER3,0)
	LEVEL_UP_CREATURE(PLAYER0,SPIDER,ANYWHERE,1)
ENDIF

IF_CONTROLS(​PLAYER_GOOD,​TOTAL_CREATURES == 0)
	LEVEL_UP_CREATURE(PLAYER0,SPIDER,ANYWHERE,1)
ENDIF

IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
	SET_FLAG(PLAYER0,FLAG0,1)
ENDIF

IF(PLAYER0,FLAG0 == 1)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FLY,1,20,1,0)
	IF_CONTROLS(​PLAYER_GOOD,​TOTAL_CREATURES == 0)
		WIN_GAME
	ENDIF
ENDIF

IF_CONTROLS(​PLAYER0,​TOTAL_CREATURES == 0)
	LOSE_GAME
ENDIF

rem IF(PLAYER1,DUNGEON_DESTROYED == 1)
rem 	WIN_GAME
rem ENDIF








