REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for DD Level Caddis Fell
REM  Campaign: DK Original
REM  Authors:  based on Bullfrog script
REM            KeeperFX CCP Team
REM  Date:     17 Dec 1996 - 11 Feb 2011
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 ****************************************************************************

REM	Initializations
SET_GENERATE_SPEED(500)
MAX_CREATURES(PLAYER0,20)
MAX_CREATURES(PLAYER1,30)
START_MONEY(PLAYER0,250)
START_MONEY(PLAYER1,10000)
SET_CREATURE_FEAR(FLY,30)

COMPUTER_PLAYER(PLAYER1,1)

REM	Creature pool
ADD_CREATURE_TO_POOL(SORCEROR,10)
ADD_CREATURE_TO_POOL(BILE_DEMON,10)
ADD_CREATURE_TO_POOL(DRAGON,10)
ADD_CREATURE_TO_POOL(BUG,15)
ADD_CREATURE_TO_POOL(SPIDER,15)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,10)
ADD_CREATURE_TO_POOL(TROLL,5)
ADD_CREATURE_TO_POOL(ORC,10)
ADD_CREATURE_TO_POOL(VAMPIRE,5)
ADD_CREATURE_TO_POOL(FLY,10)

REM Creature availability
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(PLAYER1,VAMPIRE,1,1)
CREATURE_AVAILABLE(PLAYER1,DRAGON,1,1)

REM Room availability - given straight away
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)

REM Room availability - researchable
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0) 
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0) 
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0) 
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0) 
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0) 
ROOM_AVAILABLE(PLAYER1,BRIDGE,1,0)
ROOM_AVAILABLE(PLAYER1,TRAINING,1,0)
ROOM_AVAILABLE(PLAYER1,PRISON,1,0) 

REM Room availability - buildable when found on map
IF(PLAYER0,BRIDGE > 0)
	ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
ENDIF
IF(PLAYER0,TRAINING > 0)
	ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
ENDIF
IF(PLAYER0,PRISON > 0)
	ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ENDIF
IF(PLAYER0,GRAVEYARD > 0)
    ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
ENDIF

REM Room availability - find but can't build
IF(PLAYER0,GARDEN > 0)
	ROOM_AVAILABLE(PLAYER0,GARDEN,0,0)
ENDIF
IF(PLAYER0,RESEARCH > 0)
	ROOM_AVAILABLE(PLAYER0,RESEARCH,0,0)
ENDIF

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_OBEY,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_CONCEAL,1,0)
REM MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,1,0)

REM Doors and traps availability
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,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LAVA,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)

REM	Party 1
CREATE_PARTY(PARTY1)
	ADD_TO_PARTY(PARTY1,SAMURAI,5,100,ATTACK_ENEMIES,0)

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

REM Party 2
CREATE_PARTY(PARTY2)
	ADD_TO_PARTY(PARTY2,ARCHER,5,100,ATTACK_ENEMIES,0)

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

REM Party 3
CREATE_PARTY(PARTY3)
	ADD_TO_PARTY(PARTY3,MONK,6,100,ATTACK_ENEMIES,0)

IF_ACTION_POINT(3,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY3,3,1)
ENDIF

REM Party 4
CREATE_PARTY(PARTY4)
	ADD_TO_PARTY(PARTY4,SAMURAI,5,100,ATTACK_ENEMIES,0)

IF_ACTION_POINT(4,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY4,4,1)
ENDIF

REM Party 5
CREATE_PARTY(PARTY5)
	ADD_TO_PARTY(PARTY5,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY5,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY5,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY5,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY5,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY5,FLY,5,0,ATTACK_ENEMIES,0)

IF_ACTION_POINT(5,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY5,4,4)
ENDIF

REM Party 6
CREATE_PARTY(PARTY6)
	ADD_TO_PARTY(PARTY6,WIZARD,5,100,ATTACK_ENEMIES,0)

IF_ACTION_POINT(6,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY6,6,1)
ENDIF

REM Party 7
CREATE_PARTY(PARTY7)
	ADD_TO_PARTY(PARTY7,FLY,7,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY7,FLY,7,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY7,FLY,7,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY7,FLY,7,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY7,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY7,FLY,5,0,ATTACK_ENEMIES,0)

IF_ACTION_POINT(7,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY7,4,4)
ENDIF

REM Party 8
CREATE_PARTY(PARTY8)
	ADD_TO_PARTY(PARTY8,SAMURAI,5,100,ATTACK_ENEMIES,0)

IF_ACTION_POINT(8,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY8,8,1)
ENDIF

REM Party 9
CREATE_PARTY(PARTY9)
	ADD_TO_PARTY(PARTY9,MONK,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY9,MONK,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY9,GIANT,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY9,GIANT,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY9,MONK,10,500,ATTACK_ENEMIES,0)

IF_ACTION_POINT(9,PLAYER0)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY9,9,ACTION_POINT,16,5,500)
ENDIF

REM Party 10
CREATE_PARTY(PARTY10)
	ADD_TO_PARTY(PARTY10,MONK,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY10,MONK,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY10,THIEF,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY10,GIANT,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY10,GIANT,10,500,ATTACK_ENEMIES,0)

IF_ACTION_POINT(10,PLAYER0)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY10,10,ACTION_POINT,16,5,500)
ENDIF

REM Party 11
CREATE_PARTY(PARTY11)
	ADD_TO_PARTY(PARTY11,BARBARIAN,10,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY11,THIEF,10,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY11,GIANT,10,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY11,MONK,10,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY11,WITCH,10,100,ATTACK_ENEMIES,0)

IF_ACTION_POINT(11,PLAYER0)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY11,11,ACTION_POINT,16,5,500)
ENDIF

REM Party 12
CREATE_PARTY(PARTY12)
	ADD_TO_PARTY(PARTY12,FLY,7,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY12,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY12,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY12,FLY,5,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY12,FLY,5,0,ATTACK_ENEMIES,0)

IF_ACTION_POINT(12,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY12,4,2)
ENDIF

REM Party 15
CREATE_PARTY(PARTY15)
	ADD_TO_PARTY(PARTY15,KNIGHT,10,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY15,SAMURAI,10,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY15,SAMURAI,10,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY15,SAMURAI,10,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY15,WIZARD,10,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(PARTY15,WIZARD,10,100,ATTACK_ENEMIES,0)

IF_ACTION_POINT(15,PLAYER0)
	DISPLAY_OBJECTIVE(933,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY15,16,1)
	SET_FLAG(PLAYER0,FLAG0,1)
ENDIF

REM	Messages
REM "Choices, choices. Choose your path wisely keeper. Some routes will be more perilous than others!"
REM "Congratulations keeper, your force is enviable. Now crush your opponent in the north."
REM "Congratulations keeper, your force is enviable. Now crush your opponent in the south."
REM "This snivelling land has been brought to its knees. Onwards keeper!"
	
DISPLAY_OBJECTIVE(913,PLAYER0)

IF(PLAYER1,DUNGEON_DESTROYED == 1)
	IF(PLAYER_GOOD,DUNGEON_DESTROYED == 0)
		DISPLAY_OBJECTIVE(915,PLAYER0)
	ENDIF
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED == 0)
	IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
		DISPLAY_OBJECTIVE(914,PLAYER0)
	ENDIF
ENDIF		

IF(PLAYER1,DUNGEON_DESTROYED == 1)
	IF(PLAYER0,FLAG0 == 1)
		IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
			IF(PLAYER_GOOD,KNIGHT == 0)
				WIN_GAME
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER0,ENTRANCE > 0)
	IF(PLAYER0,TOTAL_GOLD_MINED > 0)
		DISPLAY_OBJECTIVE(916,PLAYER0)
	ENDIF
ENDIF

REM End of File
