REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for Level Sleepiburgh
REM  Campaign: New game plus
REM  Authors:  based on Bullfrog script
REM            KeeperFX CCP Team
REM            Loobinex
REM  Date:     17 Dec 1996 - 24 Jul 2020
REM  Copying and copyrights:
REM    This program is free software; you can redistribute it and/or modify
REM    it under the terms of the GNU General Public License as published by
REM    the Free Software Foundation; either version 2 of the License, or
REM    (at your option) any later version.
REM ****************************************************************************
LEVEL_VERSION(1)

REM New powers for the player:
REM   POWER_DESTROY_WALLS - researchable

SET_GENERATE_SPEED(500)

COMPUTER_PLAYER(PLAYER1,0)
COMPUTER_PLAYER(PLAYER2,0)

SET_COMPUTER_GLOBALS(PLAYER1,60,1,1,1,1900,1)
SET_COMPUTER_GLOBALS(PLAYER2,70,1,2,1,1700,1)

SET_COMPUTER_CHECKS(PLAYER1,"CHECK FOR NEUTRAL PLACES",1000,0,0,0,30000)
REM SET_COMPUTER_CHECKS(PLAYER2,"CHECK FOR NEUTRAL PLACES",1000,0,0,0,30000)

ALLY_PLAYERS(PLAYER1,PLAYER2,1)

START_MONEY(PLAYER0,3000)
START_MONEY(PLAYER1,7500)
START_MONEY(PLAYER2,7500)

MAX_CREATURES(PLAYER0,20)
MAX_CREATURES(PLAYER1,22)
MAX_CREATURES(PLAYER2,22)

ADD_CREATURE_TO_POOL(HELL_HOUND,50)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,40)
ADD_CREATURE_TO_POOL(SORCEROR,40)
ADD_CREATURE_TO_POOL(TROLL,40)
ADD_CREATURE_TO_POOL(BILE_DEMON,40)
ADD_CREATURE_TO_POOL(DRAGON,40)
ADD_CREATURE_TO_POOL(ORC,40)

REM	Creature availability
CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,1,0)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,0)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,0)
CREATURE_AVAILABLE(PLAYER0,TROLL,1,0)

CREATURE_AVAILABLE(PLAYER1,HELL_HOUND,1,0)
CREATURE_AVAILABLE(PLAYER1,DARK_MISTRESS,1,0)
CREATURE_AVAILABLE(PLAYER1,SORCEROR,1,0)
CREATURE_AVAILABLE(PLAYER1,ORC,1,0)
CREATURE_AVAILABLE(PLAYER1,BILE_DEMON,1,0)
CREATURE_AVAILABLE(PLAYER1,DRAGON,1,0)

CREATURE_AVAILABLE(PLAYER2,HELL_HOUND,1,0)
CREATURE_AVAILABLE(PLAYER2,DARK_MISTRESS,1,0)
CREATURE_AVAILABLE(PLAYER2,SORCEROR,1,0)
CREATURE_AVAILABLE(PLAYER2,ORC,1,0)
CREATURE_AVAILABLE(PLAYER2,BILE_DEMON,1,0)
CREATURE_AVAILABLE(PLAYER2,DRAGON,1,0)
	
REM	Room availability
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,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BRIDGE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0)

REM	Spells availability
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(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,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(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)

REM	Doors and traps availability
DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
TRAP_AVAILABLE(PLAYER1,BOULDER,1,0)
TRAP_AVAILABLE(PLAYER2,BOULDER,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)

REM ****************************************************************************

IF(PLAYER1,PRISON >= 9)
	SET_CREATURE_TENDENCIES(PLAYER1,IMPRISON,1)
ENDIF

IF(PLAYER2,PRISON >= 9)
	SET_CREATURE_TENDENCIES(PLAYER2,IMPRISON,1)
ENDIF

REM "You can't swing a cat for Dungeon Keepers fighting over the destiny of this region. It should fall to you to settle the disagreement once and for all."
DISPLAY_OBJECTIVE(108,ALL_PLAYERS)

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

IF(PLAYER1,DUNGEON_DESTROYED == 1)
	IF(PLAYER2,DUNGEON_DESTROYED == 1)
		REM "Only the Lord of this Land stands between you and hectares of desolation and woe. I bet you can't wait to meet him."
		DISPLAY_OBJECTIVE(111,ALL_PLAYERS)
		SET_FLAG(PLAYER_GOOD,FLAG0,1)
	ENDIF
ENDIF

REM Spawn WIZARDs only when player gets close.
IF_ACTION_POINT(1,PLAYER0)
	SET_TIMER(PLAYER0,TIMER3)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,WIZARD,-1,5,8,0)
ENDIF

REM When both computer players are defeated and hero wizards are dead, allow Lord of the Land to come
IF(PLAYER_GOOD,FLAG0 == 1)
	IF(PLAYER0,TIMER3 >= 200)
		IF_CONTROLS(PLAYER_GOOD,WIZARD <= 0)
			ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,1,10,1000000)
			ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,-1,4,7,1000)
			SET_TIMER(PLAYER0,TIMER2)
		ENDIF
	ENDIF
ENDIF

IF(PLAYER0,TIMER2 >= 200)
	IF_CONTROLS(PLAYER_GOOD,KNIGHT <= 0)
		REM "Your continued success makes me sick. Thank you, your wickedness."
		DISPLAY_OBJECTIVE(112,ALL_PLAYERS)
		WIN_GAME
	ENDIF
ENDIF	

REM When player uses the gems, he will no longer be able to reach transfer creature special.
IF_ACTION_POINT(2,PLAYER0)
	ROOM_AVAILABLE(PLAYER0,BRIDGE,0,0)
	TUTORIAL_FLASH_BUTTON(18,100)
ENDIF

REM ****************************************************************************