REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for Level TulipScent
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 creatures for the player:
REM   TENTACLE - this is a rare case where it can be attracted
REM New powers for the player:
REM   POWER_OBEY - castable from the beginning

REM Flags used:
REM   None
REM Timers used:
REM   PLAYER_GOOD,TIMER0 - Makes delay between parties after AP4 activation

SET_GENERATE_SPEED(750)

REM Computer Player stuff
COMPUTER_PLAYER(PLAYER1,0)

SET_COMPUTER_CHECKS(PLAYER1,"CHECK FOR NEUTRAL PLACES",15000,0,0,0,65000)
REM "CHECK FOR QUICK ATTACK" CheckEvery AttackPercent CTADuration MinForAttack LastCheck
SET_COMPUTER_CHECKS(PLAYER1,"CHECK FOR QUICK ATTACK",700,70,3000,8,12500)
SET_COMPUTER_PROCESS(PLAYER1,"ATTACK SAFE ATTACK",-1,100,17,100,0)
SET_COMPUTER_PROCESS(PLAYER1,"ATTACK PLAN 1",-1,100,17,100,0)

START_MONEY(PLAYER0,27500)
START_MONEY(PLAYER1,33500)

MAX_CREATURES(PLAYER0,17)
MAX_CREATURES(PLAYER1,17)

ADD_CREATURE_TO_POOL(TROLL,8)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,2)
ADD_CREATURE_TO_POOL(TENTACLE,30)
ADD_CREATURE_TO_POOL(SKELETON,30)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,30)
ADD_CREATURE_TO_POOL(SORCEROR,21)
ADD_CREATURE_TO_POOL(DRAGON,35)
ADD_CREATURE_TO_POOL(HELL_HOUND,40)

REM	Creature availability
CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER0,SKELETON,1,1)
CREATURE_AVAILABLE(PLAYER1,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER1,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER1,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER1,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER1,HELL_HOUND,1,1)
CREATURE_AVAILABLE(PLAYER1,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,BRIDGE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,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)
ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,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,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
REM Don't give POWER_CHICKEN to human player, he can find spellbook on a level
MAGIC_AVAILABLE(PLAYER1,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_ARMAGEDDON,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)

REM	Doors and traps availability
TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LAVA,1,0)

CREATE_PARTY(THIEFGUARD)
	ADD_TO_PARTY(THIEFGUARD,ARCHER,5,750,DEFEND_PARTY,0)
	ADD_TO_PARTY(THIEFGUARD,ARCHER,5,750,DEFEND_PARTY,0)
	ADD_TO_PARTY(THIEFGUARD,ARCHER,5,750,DEFEND_PARTY,0)
	ADD_TO_PARTY(THIEFGUARD,THIEF,7,1750,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(DWARVES)
	ADD_TO_PARTY(DWARVES,DWARFA,5,800,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DWARVES,DWARFA,5,800,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DWARVES,DWARFA,5,800,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DWARVES,DWARFA,5,800,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DWARVES,ARCHER,5,800,ATTACK_ENEMIES,0)

CREATE_PARTY(BARBS)
	ADD_TO_PARTY(BARBS,BARBARIAN,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(BARBS,BARBARIAN,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(BARBS,BARBARIAN,6,1000,ATTACK_ENEMIES,0)

CREATE_PARTY(WIZARDS)
	ADD_TO_PARTY(WIZARDS,WIZARD,5,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZARDS,WIZARD,5,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZARDS,WIZARD,5,1200,ATTACK_ENEMIES,0)

CREATE_PARTY(GIANTGUARD)
	ADD_TO_PARTY(GIANTGUARD,GIANT,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(GIANTGUARD,ARCHER,2,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(GIANTGUARD,ARCHER,2,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(GIANTGUARD,ARCHER,2,300,ATTACK_ENEMIES,0)

CREATE_PARTY(THIEVES)
	ADD_TO_PARTY(THIEVES,THIEF,7,2000,STEAL_GOLD,0)
	ADD_TO_PARTY(THIEVES,THIEF,6,2000,STEAL_GOLD,0)
	ADD_TO_PARTY(THIEVES,THIEF,6,2000,STEAL_GOLD,0)
	ADD_TO_PARTY(THIEVES,THIEF,6,2000,STEAL_GOLD,0)

CREATE_PARTY(WITCHES)
	ADD_TO_PARTY(WITCHES,WITCH,4,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,4,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,4,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,4,1200,ATTACK_ENEMIES,0)

CREATE_PARTY(ELITE)
	ADD_TO_PARTY(ELITE,SAMURAI,9,4000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ELITE,WIZARD,8,2000,STEAL_SPELLS,0)
	ADD_TO_PARTY(ELITE,BARBARIAN,8,2000,STEAL_GOLD,0)
	ADD_TO_PARTY(ELITE,GIANT,7,2000,STEAL_SPELLS,0)

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

REM "It appears you have a rival. Another Keeper believes he is more ruthless and evil than you. We shall soon see."
DISPLAY_OBJECTIVE(125,PLAYER0)

IF(PLAYER0,GAME_TURN >= 100)
	REM "You will not find any easy path through this region. You will have to fight hard to gain any advantage."
	DISPLAY_INFORMATION(120)
ENDIF

IF(PLAYER0,GAME_TURN >= 2000)
	REM "Try the Must Obey spell. When activated, it constantly forces your creatures to obey to all your orders, making all of them working faster without the possibility for them to take a nap. Be sure to have plenty of money so that the spell will stay activated."
	DISPLAY_INFORMATION(177)
ENDIF

IF(PLAYER0,GAME_TURN >= 5000)
	REM "This ancient realm is rich in magical artifacts. Go forth and plunder."
	DISPLAY_INFORMATION(126)
ENDIF

IF(PLAYER0,TENTACLE > 0)
	REM "A Tentacle has joined your dungeon. These little creatures enjoy to be in water and their spine can even pierce the most solid armors and paralyze your enemies! Marvellous!"
	DISPLAY_INFORMATION(178)
ENDIF

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

IF_ACTION_POINT(4,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DWARVES,-1,1)
	SET_TIMER(PLAYER_GOOD,TIMER0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 1500)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARBS,-1,1)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WIZARDS,-4,1)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GIANTGUARD,-5,1)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,-3,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WITCHES,-2,1)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARBS,9,1)
ENDIF

IF_AVAILABLE(PLAYER0,POWER_CONCEAL >= 1)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ELITE,10,DUNGEON,0,6,500)
ENDIF

IF(PLAYER0,TOTAL_CREATURES >= 17)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ELITE,10,DUNGEON,0,6,500)
ENDIF

IF(PLAYER1,TOTAL_CREATURES >= 17)
	IF_AVAILABLE(PLAYER1,POWER_CONCEAL >= 1)
		ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ELITE,10,DUNGEON,1,6,500)
	ENDIF
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED == 1)
	WIN_GAME
ENDIF
