REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for Level Flowerhat
REM  Campaign: New game plus
REM  Authors:  based on Bullfrog script
REM            KeeperFX CCP Team
REM            Loobinex
REM  Date:     17 Dec 1996 - 11 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 rooms for the player:
REM   BRIDGE
REM   WORKSHOP
REM New creatures for the player:
REM   TROLL
REM New powers for the player:
REM   POWER_CALL_TO_ARMS
REM   POWER_HEAL_CREATURE
REM New manufacture for the player:
REM   DOOR_WOOD
REM   TRAP_POISON_GAS

SET_GENERATE_SPEED(400)

START_MONEY(PLAYER0,3000)

MAX_CREATURES(PLAYER0,20)

ADD_CREATURE_TO_POOL(FLY,2)
ADD_CREATURE_TO_POOL(BUG,10)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(SORCEROR,5)

SET_CREATURE_MAX_LEVEL(PLAYER0,DEMONSPAWN,10)
SET_CREATURE_MAX_LEVEL(PLAYER0,THIEF,5)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,THIEF,10)

CREATURE_AVAILABLE(PLAYER0,BUG,1,0)
CREATURE_AVAILABLE(PLAYER0,FLY,1,0)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,0)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,0)
CREATURE_AVAILABLE(PLAYER0,TROLL,1,0)

ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)

DOOR_AVAILABLE(PLAYER0,WOOD,1,0)
TRAP_AVAILABLE(PLAYER0,POISON_GAS,1,0)

MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,0)

CREATE_PARTY(WEAKLINGS)
	ADD_TO_PARTY(WEAKLINGS,ARCHER,1,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WEAKLINGS,DWARFA,1,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WEAKLINGS,ARCHER,1,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WEAKLINGS,DWARFA,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(THIEVES)
	ADD_TO_PARTY(THIEVES,THIEF,1,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THIEVES,THIEF,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(BARBS)
	ADD_TO_PARTY(BARBS,BARBARIAN,1,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(BARBS,BARBARIAN,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(HEROMIX)
	ADD_TO_PARTY(HEROMIX,BARBARIAN,1,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(HEROMIX,ARCHER,2,100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(HEROMIX,DWARFA,2,100,ATTACK_ENEMIES,0)

CREATE_PARTY(LANDLORD)
	ADD_TO_PARTY(LANDLORD,KNIGHT,4,20000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(LANDLORD,ARCHER,4,100,DEFEND_PARTY,0)
	ADD_TO_PARTY(LANDLORD,ARCHER,4,100,DEFEND_PARTY,0)
	ADD_TO_PARTY(LANDLORD,BARBARIAN,4,100,DEFEND_PARTY,0)
	ADD_TO_PARTY(LANDLORD,BARBARIAN,4,100,DEFEND_PARTY,0)
	ADD_TO_PARTY(LANDLORD,DWARFA,4,100,DEFEND_PARTY,0)
	ADD_TO_PARTY(LANDLORD,DWARFA,4,100,DEFEND_PARTY,0)
	
REM ****************************************************************************

REM "When your troops are sufficient in number and have had some training, lead them north and crush any who oppose you."
DISPLAY_OBJECTIVE(49,ALL_PLAYERS)

IF_ACTION_POINT(1,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WEAKLINGS,3,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARBS,7,1)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,4,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,8,1)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
	REM "The enemy's Dungeon Heart throbs before you. Assemble your minions nearby and administer the coup de grace."
	DISPLAY_OBJECTIVE(51,PLAYER_GOOD)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,LANDLORD,-1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HEROMIX,-1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HEROMIX,-1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,-1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WEAKLINGS,-1,1)
	IF(PLAYER_GOOD,FLAG1 >= 30)
		ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,PLAYER_GOOD,6,6,0)
	ENDIF
ENDIF

REM After a few minutes, archers start going up in strength
IF(PLAYER_GOOD,GAME_TURN > 9000)
	SET_TIMER(PLAYER_GOOD,TIMER1)
ENDIF
IF(PLAYER_GOOD,TIMER1 > 800)
	NEXT_COMMAND_REUSABLE
	LEVEL_UP_CREATURE(PLAYER_GOOD,ARCHER,LEAST_EXPERIENCED,1)
	NEXT_COMMAND_REUSABLE
	LEVEL_UP_CREATURE(PLAYER_GOOD,DWARFA,LEAST_EXPERIENCED,1)
	NEXT_COMMAND_REUSABLE
	LEVEL_UP_CREATURE(PLAYER_GOOD,BARBARIAN,LEAST_EXPERIENCED,1)
	NEXT_COMMAND_REUSABLE
	LEVEL_UP_CREATURE(PLAYER_GOOD,THIEF,LEAST_EXPERIENCED,1)
	NEXT_COMMAND_REUSABLE
	ADD_TO_FLAG(PLAYER_GOOD,FLAG1,1)
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER_GOOD,TIMER1)
ENDIF

IF(PLAYER_GOOD,FLAG1 > 6)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WEAKLINGS,7,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARBS,3,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,7,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,3,1)
ENDIF

IF(PLAYER0,TOTAL_CREATURES >= DRAWFROM(18~20))
	PLAY_MESSAGE(PLAYER0,SOUND,927)
	REVEAL_MAP_RECT(PLAYER0,120,54,1,1)
	CHANGE_SLAB_TYPE(40,18,HARD)
	REM "Transferring creatures to a new realm has been made very difficult. But surely an experienced Keeper as yourself can conquer realms without help."
	DISPLAY_OBJECTIVE(2,9)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
	REM "With the enemy Dungeon Heart in ruins, you have trounced the once proud opposition. Rule your new domain with terror and loathing, for a laugh."
	DISPLAY_OBJECTIVE(53,ALL_PLAYERS)
	WIN_GAME
ENDIF

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