REM LEVEL 4

SET_GENERATE_SPEED(400)


MAX_CREATURES(PLAYER0,20)

START_MONEY(PLAYER0,3000)


ADD_CREATURE_TO_POOL(BUG,10)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(SORCEROR,5)

SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,KNIGHT,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,THIEF,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,DWARFA,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,TUNNELLER,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,ARCHER,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,BARBARIAN,2)

SET_CREATURE_MAX_LEVEL(PLAYER0,DEMONSPAWN,10)

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

ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)


DOOR_AVAILABLE(PLAYER0,WOOD,1,0)
TRAP_AVAILABLE(PLAYER0,POISON_GAS,1,0)

MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,0)

rem CREATE_TEXT(1,45"BUILD UP A DUNGEON INCLUDING A TREASURE ROOM, A LAIR, A HATCHERY, A TRAINING ROOM AND A RESEARCH ROOM.  ALSO DIG TO AND CLAIM AN ENTRANCE.  DO NOT VENTURE NORTH YET AS THERE ARE POWERFUL ENEMIES THERE.")
DISPLAY_OBJECTIVE(45,PLAYER0)

IF_AVAILABLE(PLAYER0,BRIDGE==1)
rem CREATE_TEXT(5,46"YOUR RESEARCHERS HAVE GIVEN YOU THE ABILITY TO LAY DOWN BRIDGES.  YOU WILL NEED THEM TO CROSS OVER LAVA.")
DISPLAY_INFORMATION(46,PLAYER0)
ENDIF

IF(PLAYER0,TREASURE>0)
SET_FLAG(PLAYER1,FLAG0,1)
ENDIF

IF(PLAYER0,LAIR>0)
SET_FLAG(PLAYER1,FLAG1,1)
ENDIF

IF(PLAYER0,GARDEN>0)
SET_FLAG(PLAYER1,FLAG2,1)
ENDIF

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

IF(PLAYER0,RESEARCH>0)
SET_FLAG(PLAYER1,FLAG4,1)
ENDIF

IF(PLAYER0,ENTRANCE>0)
SET_FLAG(PLAYER1,FLAG6,1)
ENDIF

IF(PLAYER1,FLAG0==1)
	IF(PLAYER1,FLAG1==1)
		IF(PLAYER1,FLAG2==1)
			IF(PLAYER1,FLAG3==1)
				IF(PLAYER1,FLAG4==1)
					IF(PLAYER1,FLAG6==1)
rem					CREATE_TEXT(10,47"WHEN YOU ARE HAPPY WITH YOUR DUNGEON, BUILD A 3X3 WORKSHOP WHICH IS NOW AVAILABLE TO YOU.  THERE, YOUR CREATURES WILL BE ABLE TO BUILD DOORS AND TRAPS.")
					DISPLAY_OBJECTIVE(47,PLAYER0)
					ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,1)
					TUTORIAL_FLASH_BUTTON(13,PLAYER0)
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER0,WORKSHOP>=9)
rem	CREATE_TEXT(11,48 "TO MANUFACTURE TRAPS AND DOORS, YOU WILL NEED TO PLACE CREATURES WITHIN THE WORKSHOP.  SOME CREATURES ARE BETTER ENGINEERS THAN OTHERS.")
DISPLAY_INFORMATION(48,PLAYER0)
SET_FLAG(PLAYER1,FLAG5,1)
ENDIF

IF(PLAYER1,FLAG5==1)
	IF_AVAILABLE(PLAYER0,BRIDGE==1)
rem	CREATE_TEXT( 12,49"GOOD.  BUILD UP YOUR DUNGEON AND TRAIN UP YOUR CREATURES.  WHEN YOU FEEL READY, GO NORTH TO CRUSH THE DEFENDERS OF THIS SICKLY SWEET LAND.")
	DISPLAY_OBJECTIVE(49,PLAYER0)
	ENDIF
ENDIF

IF(PLAYER1,FLAG5==1)
	IF_AVAILABLE(PLAYER0,BRIDGE==0)
rem	CREATE_TEXT(13,50"GET YOUR RESEARCHERS TO DEVISE A WAY FOR YOU TO CROSS OVER LAVA, WHICH BARS YOUR WAY NORTH TO THE HEROES' DUNGEON.")
	DISPLAY_OBJECTIVE(50,PLAYER0)
	ENDIF
ENDIF




IF(PLAYER1,FLAG5==1)
CREATURE_AVAILABLE(PLAYER0,BUG,1,0)
CREATURE_AVAILABLE(PLAYER0,FLY,1,0)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,0)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,0)
CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
ENDIF

CREATE_PARTY(HERO1)
ADD_TO_PARTY(HERO1,ARCHER,1,100,ATTACK_ENEMIES,0)
ADD_TO_PARTY(HERO1,DWARFA,1,100,ATTACK_ENEMIES,0)
ADD_TO_PARTY(HERO1,ARCHER,1,100,ATTACK_ENEMIES,0)
ADD_TO_PARTY(HERO1,DWARFA,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(HERO2)
ADD_TO_PARTY(HERO2,THIEF,1,100,ATTACK_ENEMIES,0)
ADD_TO_PARTY(HERO2,THIEF,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(HERO3)
ADD_TO_PARTY(HERO3,BARBARIAN,1,100,ATTACK_ENEMIES,0)
ADD_TO_PARTY(HERO3,BARBARIAN,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(HERO4)
ADD_TO_PARTY(HERO4,BARBARIAN,1,100,ATTACK_ENEMIES,0)
ADD_TO_PARTY(HERO4,ARCHER, 2,100,ATTACK_ENEMIES,0)

CREATE_PARTY(KNIGHT)
ADD_TO_PARTY(KNIGHT,KNIGHT,3,20000,ATTACK_ENEMIES,200)

IF_ACTION_POINT(1,PLAYER0)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO1,3,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO3,7,1)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO2,4,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO2,8,1)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
rem CREATE_TEXT(20,51"YOU HAVE REACHED THE HEROES' DUNGEON HEART.  GET YOUR CREATURES TO DESTROY IT TO CONQUER THIS LAND.")
DISPLAY_OBJECTIVE(51,PLAYER0)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO4,-1,1)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO4,-1,1)
ENDIF

IF(PLAYER0,TROLL>0)
CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
CREATURE_AVAILABLE(PLAYER0,FLY,1,1)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
rem CREATE_TEXT(7,52"A TROLL HAS JOINED YOU.  THEY ARE EXCELLENT ENGINEERS WHO LOVE TO BUILD IN WORKSHOPS.")
DISPLAY_INFORMATION( 52,PLAYER0)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED==1)
rem CREATE_TEXT(6,53"WELL DONE.  WITH THE HEROES' DUNGEON HEART DESTROYED, THEIR POWER IS CRUSHED.  THIS LAND IS OURS.")
DISPLAY_OBJECTIVE(53,PLAYER0)
WIN_GAME
ENDIF

IF_AVAILABLE(PLAYER0,WOOD==1)
rem CREATE_TEXT(8,54"YOUR ENGINEERS HAVE COME UP WITH A WOODEN DOOR.  PLACE THEM DOWN IN CORRIDORS.  THEY WILL KEEP OUT THE ENEMY BUT ALLOW YOUR CREATURES TO PASS.  YOU CAN LOCK DOORS BY TAGGING THEM.")
DISPLAY_INFORMATION(54,PLAYER0)
ENDIF

IF_AVAILABLE(PLAYER0,POISON_GAS==1)
rem CREATE_TEXT(9,55"YOUR ENGINEERS HAVE MANUFACTURED A POISON GAS TRAP.  LAY THEM DOWN AND WHEN TRIGGERED, IT WILL SHROUD THAT AREA IN A DEADLY VAPOUR.")
DISPLAY_INFORMATION(55,PLAYER0)
ENDIF

IF_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS==1)
rem CREATE_TEXT(35,56"YOU HAVE RESEARCHED THE CALL TO ARMS SPELL.  CAST IT ONCE TO GATHER CREATURES INTO A GROUP, THEN CAST IT AGAIN TO WHERE YOU WANT THAT GROUP TO GO.  CALL TO ARMS IS FREE ON YOUR LAND, BUT COSTS ON ALL OTHER LAND.")
DISPLAY_INFORMATION(56,PLAYER0)
ENDIF	








	




