LEVEL_VERSION(1)
SET_GENERATE_SPEED(200)
START_MONEY(ALL_PLAYERS,12500)
MAX_CREATURES(PLAYER0,10)
MAX_CREATURES(PLAYER1,30)
MAX_CREATURES(PLAYER2,45)
MAX_CREATURES(PLAYER3,20)
MAX_CREATURES(PLAYER4,15)
SET_GAME_RULE(ImpWorkExperience,350)
SET_GAME_RULE(MapCreatureLimit,1000)
SET_CREATURE_PROPERTY(IMP,NO_IMPRISONMENT,1)

QUICK_OBJECTIVE(2,"Welcome Keeper.To Flourish in this Realm it is needed to think what Direction you go. You are Limited to 10 Creatures for now...")

COMPUTER_PLAYER(PLAYER1,0)
COMPUTER_PLAYER(PLAYER2,0)
COMPUTER_PLAYER(PLAYER3,0)
COMPUTER_PLAYER(PLAYER4,0)

ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(SKELETON,20)
ADD_CREATURE_TO_POOL(VAMPIRE,20)
ADD_CREATURE_TO_POOL(WITCH,20)
ADD_CREATURE_TO_POOL(WIZARD,20)
ADD_CREATURE_TO_POOL(KNIGHT,20)

CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SKELETON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,VAMPIRE,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,WITCH,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,WIZARD,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,KNIGHT,1,0)

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER1,PRISON,1,0)
ROOM_AVAILABLE(PLAYER2,PRISON,1,0)
ROOM_AVAILABLE(PLAYER3,PRISON,1,0)
ROOM_AVAILABLE(PLAYER4,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER1,GRAVEYARD,1,0)
ROOM_AVAILABLE(PLAYER2,GRAVEYARD,1,0)
ROOM_AVAILABLE(PLAYER3,GRAVEYARD,1,0)
ROOM_AVAILABLE(PLAYER4,GRAVEYARD,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_POSSESS,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)

REM IMP LIMITATION

IF_CONTROLS(PLAYER1,IMP >= 16)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER1,POWER_IMP,0,0)
ENDIF

IF_CONTROLS(PLAYER1,IMP < 16)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER1,POWER_IMP,1,1)
ENDIF

IF_CONTROLS(PLAYER2,IMP >= 16)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER2,POWER_IMP,0,0)
ENDIF

IF_CONTROLS(PLAYER2,IMP < 16)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER2,POWER_IMP,1,1)
ENDIF

IF_CONTROLS(PLAYER3,IMP >= 16)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER3,POWER_IMP,0,0)
ENDIF

IF_CONTROLS(PLAYER3,IMP < 16)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER3,POWER_IMP,1,1)
ENDIF

IF_CONTROLS(PLAYER4,IMP >= 16)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER4,POWER_IMP,0,0)
ENDIF

IF_CONTROLS(PLAYER4,IMP < 16)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER4,POWER_IMP,1,1)
ENDIF

IF_CONTROLS(PLAYER0,IMP >= 40)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER0,POWER_IMP,0,0)
	QUICK_INFORMATION(1,"You have Reached the Imp Limit.")
ENDIF

IF_CONTROLS(PLAYER0,IMP < 40)
	NEXT_COMMAND_REUSABLE
	MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
ENDIF


REM CREATURE LIMITS


IF(PLAYER4,DUNGEON_DESTROYED == 1)
	MAX_CREATURES(PLAYER0,15)
	QUICK_INFORMATION(3,"You're Creature Limit just got raised to 15! Now Carry on.")
	SET_TIMER(PLAYER0,TIMER0)
ENDIF

	IF(PLAYER0,TIMER0 >= 300)
		QUICK_INFORMATION(9,"It looks like the Battle shattered the Earth and covered some of the Gems... but otherwise it revealed a Path to your next Enemy.")
		CHANGE_SLAB_TYPE(70,92,HARD,NONE)
		CHANGE_SLAB_TYPE(70,94,HARD,NONE)
		CHANGE_SLAB_TYPE(74,75,DIRT,NONE)
		CHANGE_SLAB_TYPE(74,74,DIRT,NONE)
		CHANGE_SLAB_TYPE(74,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(73,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(72,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(71,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(70,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(69,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(68,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(67,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(66,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(65,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(64,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(63,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(62,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(61,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(60,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(59,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(58,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(57,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(56,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(55,73,DIRT,NONE)
		ZOOM_TO_LOCATION(PLAYER0,1)
	ENDIF

IF(PLAYER3,DUNGEON_DESTROYED == 1)
	MAX_CREATURES(PLAYER0,20)
	QUICK_INFORMATION(5,"You're Creature Limit just got raised to 20!")
	SET_TIMER(PLAYER0,TIMER1)
ENDIF

	IF(PLAYER0,TIMER1 >= 300)
		QUICK_INFORMATION(10,"Congratulations,the Earth is shook even more after this Battle and revealed another Path to your next Enemy.")
		CHANGE_SLAB_TYPE(75,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(76,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(77,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(78,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(79,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(80,73,DIRT,NONE)
		CHANGE_SLAB_TYPE(80,72,DIRT,NONE)
		CHANGE_SLAB_TYPE(80,71,DIRT,NONE)
		CHANGE_SLAB_TYPE(80,70,DIRT,NONE)
		ZOOM_TO_LOCATION(PLAYER0,1)
	ENDIF

IF(PLAYER1,DUNGEON_DESTROYED == 1)
	ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
	QUICK_INFORMATION(4,"You finally found the Blueprint for the Bridge... now you can fully Explore this Realm!")
	MAX_CREATURES(PLAYER0,30)
	QUICK_INFORMATION(6,"You're Creature Limit just got raised to 30!")
ENDIF


REM VAMPIRE LIMITATION

IF_CONTROLS(PLAYER0,VAMPIRE >= 4)
	NEXT_COMMAND_REUSABLE
	SET_GAME_RULE(BodiesForVampire,999)
	QUICK_INFORMATION(7,"4 Vampires are enough!")
ENDIF

IF_CONTROLS(PLAYER0,VAMPIRE < 4)
	NEXT_COMMAND_REUSABLE
	SET_GAME_RULE(BodiesForVampire,6)
ENDIF

REM SKELETON LIMITATION

IF_CONTROLS(PLAYER0,SKELETON >= 4)
	NEXT_COMMAND_REUSABLE
	SET_GAME_RULE(PrisonSkeletonChance,0)
	QUICK_INFORMATION(8,"4 Skeletons are enough!")
ENDIF

IF_CONTROLS(PLAYER0,SKELETON < 4)
	NEXT_COMMAND_REUSABLE
	SET_GAME_RULE(PrisonSkeletonChance,100)
ENDIF


IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
	WIN_GAME
ENDIF
