REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for DD Level Svatona
REM  Campaign: Deeper Dungeons
REM  Authors:  based on Bullfrog script
REM            KeeperFX CCP Team
REM  Date:     17 Dec 1996 - 9 Sep 2014
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)

SET_GENERATE_SPEED(500)
SET_GAME_RULE(MapCreatureLimit,1000)
SET_GAME_RULE(ImpWorkExperience,250)
SET_GAME_RULE(AlliesShareCta,1)
SET_GAME_RULE(AlliesShareVision,1)
SET_GAME_RULE(AlliesShareDrop,1)


REM Computer Player stuff
COMPUTER_PLAYER(PLAYER1,4)
COMPUTER_PLAYER(PLAYER2,4)
COMPUTER_PLAYER(PLAYER3,4)

START_MONEY(PLAYER0,15000)
START_MONEY(PLAYER1,40000)
START_MONEY(PLAYER2,40000)
START_MONEY(PLAYER3,40000)

MAX_CREATURES(PLAYER0,15)
MAX_CREATURES(PLAYER1,25)
MAX_CREATURES(PLAYER2,25)
MAX_CREATURES(PLAYER3,25)

ALLY_PLAYERS(PLAYER1,PLAYER2,3)
ALLY_PLAYERS(PLAYER1,PLAYER3,3)
ALLY_PLAYERS(PLAYER2,PLAYER1,3)
ALLY_PLAYERS(PLAYER2,PLAYER3,3)
ALLY_PLAYERS(PLAYER3,PLAYER1,3)
ALLY_PLAYERS(PLAYER3,PLAYER2,3)

REM Creature pool
ADD_CREATURE_TO_POOL(SORCEROR,30)
ADD_CREATURE_TO_POOL(BILE_DEMON,30)
ADD_CREATURE_TO_POOL(DRAGON,30)
ADD_CREATURE_TO_POOL(DEMONSPAWN,30)
ADD_CREATURE_TO_POOL(BUG,30)
ADD_CREATURE_TO_POOL(SPIDER,30)
ADD_CREATURE_TO_POOL(TROLL,30)
ADD_CREATURE_TO_POOL(ORC,30)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,30)

REM Creature availability
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,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,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)

REM Spells availability
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,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_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)

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

CREATE_PARTY(PARTY1)
	ADD_TO_PARTY(PARTY1,WITCH,6,100,DEFEND_HEART,0)
	ADD_TO_PARTY(PARTY1,WITCH,6,100,DEFEND_HEART,0)
	ADD_TO_PARTY(PARTY1,GIANT,7,100,DEFEND_HEART,0)
	ADD_TO_PARTY(PARTY1,GIANT,7,100,DEFEND_HEART,0)
	ADD_TO_PARTY(PARTY1,SAMURAI,7,100,DEFEND_HEART,0)
	ADD_TO_PARTY(PARTY1,SAMURAI,7,100,DEFEND_HEART,0)
	ADD_TO_PARTY(PARTY1,KNIGHT,8,100,DEFEND_HEART,0)

CREATE_PARTY(PARTY2)
	ADD_TO_PARTY(PARTY2,WITCH,7,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY2,WITCH,7,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY2,GIANT,7,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY2,GIANT,7,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY2,SAMURAI,8,250,ATTACK_ENEMIES,0)

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

REM "Only one Dungeon Keeper can reign victorious over this land. Do not suffer a humiliating defeat Keeper, the penalty for such failure is torture and death."
DISPLAY_OBJECTIVE(912,PLAYER0)

REM Room availability - when claimed

IF(PLAYER0,GUARD_POST >= 1)
	ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,1)
ENDIF

IF(PLAYER0,GRAVEYARD >= 1)
	ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
ENDIF

REM Action Points triggers - each AP on this level has a corresponding PARTY which is triggered
REM if PLAYER0 reaches that AP. For example, AP1 is associated to PARTY1, and so on.

IF_ACTION_POINT(3,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY1,4,1)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY2,2,1)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	CHANGE_SLAB_TYPE(72,41,PATH,NONE)
ENDIF


REM Yellow Died

IF(PLAYER3,DUNGEON_DESTROYED == 1)
	COMPUTER_PLAYER(PLAYER1,0)
	COMPUTER_PLAYER(PLAYER2,0)
ENDIF



REM	Win conditions

	IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
		WIN_GAME
	ENDIF


REM ***  End of File  **********************************************************
