REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for Level Moonbrush Wood
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 New rooms for the player:
REM   GRAVEYARD - OK
REM New creatures for the player:
REM   HORNED_REAPER - OK
REM   VAMPIRE - OK
REM   DRAGON - FROM DEMONSPAWN - OK
REM New powers for the player:
REM   POWER_HOLD_AUDIENCE - CORRECTED
REM   POWER_DISEASE - OK

SET_GENERATE_SPEED(350)

MAX_CREATURES(PLAYER0,20)

START_MONEY(PLAYER0,5000)

ADD_CREATURE_TO_POOL(FLY,20)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(SORCEROR,30)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,8)
ADD_CREATURE_TO_POOL(ORC,20)
    
REM	Creature availability
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)

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,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BRIDGE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,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(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)

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

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

IF(PLAYER0,TOTAL_CREATURES == 20)
    PRINT("I SENSE AN EVIL PRESENCE. The Avatar")
ENDIF

REM "This land is ruled by four powerful wizards.  If you can overcome them, you will conquer their domain."
DISPLAY_OBJECTIVE(81,PLAYER0)

IF(PLAYER0,HORNY > 0)
REM	"The horned demon has arisen. Try not to anger him, lest he goes into a warp spasm."
	DISPLAY_INFORMATION(83)
ENDIF

IF_AVAILABLE(PLAYER0,POWER_DISEASE == 1)
REM	"Your researchers have given you the disease spell. Cast it on enemy creatures and it will devastate their dungeon, spreading like hellfire."
	DISPLAY_INFORMATION(84)
ENDIF

IF(PLAYER0,VAMPIRE > 0)
REM	"A vampire has arisen from your graveyard, nourished by the dead and fallen. Treat him and his kind well for they will be powerful allies in battle."
	DISPLAY_INFORMATION(85)
ENDIF

IF_AVAILABLE(PLAYER0,GRAVEYARD == 1)
REM	"You have researched a graveyard. Here the dead will be taken, and from within a powerful creature will arise..."
	DISPLAY_INFORMATION(86)
ENDIF

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

IF_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE == 1)
REM	"The power of hold audience has been researched. This spell should be used as a last ditch defensive spell as it will immediately teleport all of your creatures back to your dungeon heart."
	DISPLAY_INFORMATION(107)
ENDIF

SET_FLAG(PLAYER0,FLAG0,0)

IF(PLAYER0,DRAGON == 1)
	SET_FLAG(PLAYER0,FLAG0,1)
ENDIF

IF(PLAYER0,DRAGON == 0)
	SET_FLAG(PLAYER0,FLAG0,2)
ENDIF

IF(PLAYER0,DRAGON >= 1)
	IF(PLAYER0,GAME_TURN >= 10)
		IF(PLAYER0,FLAG0 == 2)
			DISPLAY_INFORMATION(165)
		ENDIF
	ENDIF
ENDIF

IF(PLAYER_GOOD,WIZARD == 0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,1,7,3000)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,THIEF,-1,3,5,3000)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,-1,3,5,3000)
	IF(PLAYER_GOOD,KNIGHT == 0)
REM		"Congratulations, this land is yours."
		DISPLAY_OBJECTIVE(82,PLAYER0)
		WIN_GAME
	ENDIF
ENDIF
