REM MAP 00126 (LEVEL 2)

START_MONEY(PLAYER0,2500)
SET_GENERATE_SPEED(350)
MAX_CREATURES(PLAYER0,14)

ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)

SET_CREATURE_MAX_LEVEL(PLAYER0,DEMONSPAWN,10)


MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)


CREATURE_AVAILABLE(PLAYER0,FLY,1,1)
CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,1)

ADD_CREATURE_TO_POOL(BUG,3)
ADD_CREATURE_TO_POOL(FLY,3)
ADD_CREATURE_TO_POOL(DEMONSPAWN,24)


SET_TIMER(PLAYER0,TIMER0)

IF(PLAYER0,TIMER0>=1000)
	rem CREATE_TEXT(21,22"WHEN YOUR IMPS HAVE NO ACTIVE TASKS, THEY WILL RUN AROUND REINFORCING YOUR DUNGEON.  ROOMS WITH REINFORCED WALLS ARE MORE EFFICIENT.")
	DISPLAY_INFORMATION(22,PLAYER0)
ENDIF

CREATE_PARTY(THIEVES)
ADD_TO_PARTY(THIEVES,THIEF,1,200,STEAL_GOLD,0)

CREATE_PARTY(DWARVES)
ADD_TO_PARTY(DWARVES,DWARFA,1,200,ATTACK_ENEMIES,0)

CREATE_PARTY(ELITE)
ADD_TO_PARTY(ELITE,DWARFA,1,200,ATTACK_ENEMIES,0)
ADD_TO_PARTY(ELITE,THIEF,1,200,ATTACK_ENEMIES,0)

SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,KNIGHT,2)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,THIEF,2)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,DWARFA,2)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,TUNNELLER,2)

SET_CREATURE_STRENGTH(KNIGHT,40)
SET_CREATURE_ARMOUR(KNIGHT,50)


CREATE_PARTY(KNIGHT)
ADD_TO_PARTY(KNIGHT,KNIGHT,1,2000,ATTACK_ENEMIES,0)

rem CREATE_TEXT(15,23"POSSESS CREATURES BY CHOOSING THE POSSESS SPELL FROM THE SPELLS MENU AND LEFT-CLICK ON THE CREATURE YOU WANT TO CONTROL.  RIGHT-CLICK TO GET BACK TO NORMAL VIEW.")
DISPLAY_INFORMATION(23,PLAYER0)
rem CREATE_TEXT(2,24"FIRST OF ALL, ESTABLISH A BASIC DUNGEON.  REMEMBER, YOU WILL NEED TO BUILD A TREASURE ROOM, A LAIR AND A HATCHERY AND YOU WILL ALSO NEED TO CLAIM A CREATURE ENTRANCE.")
DISPLAY_OBJECTIVE(24,PLAYER0)


IF(PLAYER0,LAIR>=9)
SET_FLAG(PLAYER0,FLAG0,1)
ENDIF

IF(PLAYER0,TREASURE>=9)
SET_FLAG(PLAYER0,FLAG5,1)
ENDIF

IF(PLAYER0,GARDEN>=9)
SET_FLAG(PLAYER0,FLAG6,1)
ENDIF

IF(PLAYER0,ENTRANCE>0)
SET_FLAG(PLAYER0,FLAG2,1)
ENDIF

IF(PLAYER0,FLAG0==1)
	IF(PLAYER0,FLAG5==1)
		IF(PLAYER0,FLAG6==1)
			IF(PLAYER0,FLAG2==1)
				ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
				TUTORIAL_FLASH_BUTTON(10,PLAYER0)
rem				CREATE_TEXT(30,25"YOU WILL NEED STRONGER CREATURES.  BUILD A 3X3 TRAINING ROOM TO MAKE YOUR CREATURES STRONGER, AND TO GIVE THEM NEW SPELLS AND ABILITIES.")
				DISPLAY_OBJECTIVE(25,PLAYER0)
				SET_TIMER(PLAYER1,TIMER2)
				SET_FLAG(PLAYER0,FLAG0,2)
				SET_TIMER(PLAYER0,TIMER2)
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER0,FLAG0 != 2)
	IF(PLAYER0,GAME_TURN > 10000)
		IF(PLAYER0,LAIR > 0)
			IF(PLAYER0,TREASURE > 0)
				IF(PLAYER0,GARDEN > 0)
					IF(PLAYER0,ENTRANCE > 0)
						ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
						TUTORIAL_FLASH_BUTTON(10,PLAYER0)
	rem					CREATE_TEXT(30,25"YOU WILL NEED STRONGER CREATURES.  BUILD A 3X3 TRAINING ROOM TO MAKE YOUR CREATURES STRONGER, AND TO GIVE THEM NEW SPELLS AND ABILITIES.")
						DISPLAY_OBJECTIVE(25,PLAYER0)
						SET_TIMER(PLAYER0,TIMER2)
						SET_FLAG(PLAYER0,FLAG0,2)
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
ENDIF
	

IF(PLAYER0,TRAINING>=9)
	SET_FLAG(PLAYER0,FLAG3,1)
ENDIF

IF(PLAYER0,TIMER2 > 7000)
	IF(PLAYER0,TRAINING > 0)
		SET_FLAG(PLAYER0,FLAG3,1)
	ENDIF
ENDIF
		 

IF(PLAYER0,FLAG3 == 1)
	rem CREATE_TEXT(25,26"GOOD.  NOW GET YOUR IMPS TO FORTIFY THE WALLS IN YOUR ROOMS.  THIS WILL INCREASE THE EFFICIENCY OF THE ROOMS AND REPEL INVADERS.")
	DISPLAY_OBJECTIVE(26,PLAYER0)
	CREATURE_AVAILABLE(PLAYER0,FLY,1,0)
	CREATURE_AVAILABLE(PLAYER0,BUG,1,0)
	CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,1)
rem	CREATE_TEXT(32,27"A TRAINING ROOM WILL ATTRACT FIGHTERS, ESPECIALLY DEMON SPAWN.  FIGHTERS ARE GOOD FOR TRAINING.")
	DISPLAY_INFORMATION(27,PLAYER0)
	SET_TIMER(PLAYER1,TIMER0)
	IF(PLAYER0,DEMONSPAWN > 0)
rem		CREATE_TEXT(31,28"TO TRAIN CREATURES, PUT THEM IN THE TRAINING ROOM.  THE NUMBER THAT YOU WILL SEE COMING OUT IS THE AMOUNT IT COSTS A CREATURE TO TRAIN.")
		DISPLAY_INFORMATION(28,PLAYER0)
	ENDIF
ENDIF

REM info to tell player to slap creatures
IF(PLAYER0,DEMONSPAWN>0)
	SET_TIMER(PLAYER1,TIMER2)
	IF(PLAYER1,TIMER2>=500)
rem		CREATE_TEXT(35,29"REMEMBER, YOU CAN SPEED UP THE CREATURES TRAINING BY SLAPPING THEM WHILE THEY'RE IN THE TRAINING ROOM.")
		DISPLAY_INFORMATION(29,PLAYER0)
	ENDIF
ENDIF


IF(PLAYER0,DEMONSPAWN>=2)
	IF(PLAYER2,FLAG1==0)
	SET_FLAG(PLAYER2,FLAG0,1)
	CREATURE_AVAILABLE(PLAYER0,FLY,1,1)
	CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
	CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,1)
		IF(PLAYER1,TIMER0>=4000)
		ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,1,DUNGEON,0,1,500)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DWARVES,1,1)
rem		CREATE_TEXT(33,30"THE HEROES ARE ON THEIR WAY.  MAKE SURE YOUR CREATURES ARE WELL TRAINED AND READY FOR THE ATTACK.")
		DISPLAY_OBJECTIVE(30,PLAYER0)
			IF(PLAYER_GOOD,TOTAL_CREATURES==0)
				IF(PLAYER0,TOTAL_CREATURES>=8)
				ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ELITE,-1,DUNGEON,0,1,500)
					IF(PLAYER_GOOD,TOTAL_CREATURES==0)
						IF(PLAYER0,TOTAL_CREATURES>=8)
						ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,1)
							IF(PLAYER_GOOD,TOTAL_CREATURES==0)
rem							CREATE_TEXT(34,31"CONGRATULATIONS.  YOU HAVE CONQUERED THE ENEMY HORDES.")
							DISPLAY_OBJECTIVE(31,PLAYER0)
							WIN_GAME
							ENDIF
						ENDIF
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
ENDIF

				
IF_ACTION_POINT(2,PLAYER0)
	IF(PLAYER2,FLAG0==0)
		SET_FLAG(PLAYER2,FLAG1,1)
		ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,1,DUNGEON,0,1,500)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DWARVES,1,1)
rem		CREATE_TEXT(33,32"THE HEROES ARE ON THEIR WAY.  MAKE SURE YOUR CREATURES ARE WELL TRAINED AND READY FOR THE ATTACK.")
		DISPLAY_OBJECTIVE(32,PLAYER0)
		IF(PLAYER_GOOD,TOTAL_CREATURES==0)
			IF(PLAYER0,TOTAL_CREATURES>=8)
				ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ELITE,-1,DUNGEON,0,1,500)
				IF(PLAYER_GOOD,TOTAL_CREATURES==0)
					IF(PLAYER0,TOTAL_CREATURES>=8)
					ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,1)
						IF(PLAYER_GOOD,TOTAL_CREATURES==0)
rem							CREATE_TEXT(34,33"CONGRATULATIONS.  YOU HAVE CONQUERED THE ENEMY HORDES.")
							DISPLAY_OBJECTIVE(33,PLAYER0)
							WIN_GAME
						ENDIF
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
ENDIF



