REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for Level Woodly Rhyme
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 powers for the player:
REM   POWER_ARMAGEDDON - Researchable
REM New manufacture for the player:
REM   TRAP_WORD_OF_POWER - it's a good place to introduce it

SET_GENERATE_SPEED(500)

MAX_CREATURES(PLAYER0,40)
MAX_CREATURES(PLAYER1,35)
MAX_CREATURES(PLAYER2,35)

START_MONEY(PLAYER0,7500)
START_MONEY(PLAYER1,7500)
START_MONEY(PLAYER2,7500)

REM Computer Player stuff
COMPUTER_PLAYER(PLAYER1,0)
COMPUTER_PLAYER(PLAYER2,1)

ADD_CREATURE_TO_POOL(TROLL,30)
ADD_CREATURE_TO_POOL(SORCEROR,25)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,35)
ADD_CREATURE_TO_POOL(DRAGON,17)
ADD_CREATURE_TO_POOL(HELL_HOUND,15)
ADD_CREATURE_TO_POOL(VAMPIRE,3)
ADD_CREATURE_TO_POOL(ORC,25)

REM Creature availability
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,VAMPIRE,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,SCAVENGER,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_DISEASE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_ARMAGEDDON,1,0)

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

CREATE_PARTY(ONE)
    ADD_TO_PARTY(ONE,ARCHER,4,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,ARCHER,4,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,ARCHER,4,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,ARCHER,4,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,WIZARD,5,600,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
    ADD_TO_PARTY(TWO,DWARFA,4,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,DWARFA,4,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,DWARFA,4,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,DWARFA,4,800,ATTACK_ENEMIES,0)

CREATE_PARTY(THREE)
    ADD_TO_PARTY(THREE,WITCH,6,1800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THREE,WITCH,6,1800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THREE,WITCH,6,1800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THREE,WITCH,6,1800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THREE,WITCH,6,1800,ATTACK_ENEMIES,0)

CREATE_PARTY(FOUR)
    ADD_TO_PARTY(FOUR,BARBARIAN,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FOUR,BARBARIAN,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FOUR,BARBARIAN,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FOUR,BARBARIAN,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FOUR,BARBARIAN,5,900,ATTACK_ENEMIES,0)
    
REM ****************************************************************************

REM 113 "You are one of three dungeon keepers vying for power in this land. Your rivals will give you no quarter here. Make sure none of their number escape your torture room."
REM 114 "One of your opponants is weak, destroy him."
REM 115 "Your other opponant has few creatures, strike now."
REM 116 "Take what you can from this ancient dungeon, it may we hold items which may be of interest to you."
REM 117 "Your researchers have crafted a destroy walls spell from the ether. Use it to smash down the protected walls of your unsuspecting enemy."
REM 118 "One of your opponents has developed a spell which can break down your protected walls, be on your guard."
REM 119 "You have developed a spell to end worlds. You may summon armageddon, but will you be the victor at judgement day."

DISPLAY_OBJECTIVE(113,PLAYER0)

IF(PLAYER0,GAME_TURN >= 15000)
    IF(PLAYER1,TOTAL_CREATURES >= 10)
        IF(PLAYER1,DUNGEON_DESTROYED == 0)
            DISPLAY_INFORMATION(114)
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,GAME_TURN >= 20000)
    IF(PLAYER2,TOTAL_CREATURES >= 10)
        IF(PLAYER2,DUNGEON_DESTROYED == 0)
            DISPLAY_INFORMATION(115)
        ENDIF
    ENDIF
ENDIF

IF_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS == 1)
    DISPLAY_INFORMATION(116)
    DISPLAY_INFORMATION(117)
ENDIF

IF(PLAYER0,FLAG0 == 0)
    IF_AVAILABLE(PLAYER1,POWER_DESTROY_WALLS == 1)
        DISPLAY_INFORMATION(118)
        SET_FLAG(PLAYER0,FLAG0,1)
    ENDIF
ENDIF

IF(PLAYER0,FLAG0 == 0)
    IF_AVAILABLE(PLAYER2,POWER_DESTROY_WALLS == 1)
        DISPLAY_INFORMATION(118)
        SET_FLAG(PLAYER0,FLAG0,1)
    ENDIF
ENDIF

IF_AVAILABLE(PLAYER0,POWER_ARMAGEDDON == 1)
    DISPLAY_INFORMATION(119)
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED == 1)
    IF(PLAYER2,DUNGEON_DESTROYED == 1)
        IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
            WIN_GAME
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(2,PLAYER0)
    IF(PLAYER2,FLAG5 == 0)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,2,1)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,2,1)
        SET_FLAG(PLAYER2,FLAG5,1)
    ENDIF
ENDIF

IF_ACTION_POINT(3,PLAYER0)
    IF(PLAYER2,FLAG5 == 0)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,2,1)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,2,1)
        SET_FLAG(PLAYER2,FLAG5,1)
    ENDIF
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    SET_TIMER(PLAYER_GOOD,TIMER0)
    IF(PLAYER_GOOD,TIMER0 >= 500)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,4,1)
        IF(PLAYER_GOOD,TIMER0 >= 1000)
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,5,1)
        ENDIF
    ENDIF
ENDIF

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

IF_AVAILABLE(PLAYER0,WORD_OF_POWER == 1)
REM    "You have the word of power trap available to you. This will decimate any attackers who are unfortunate enough to trigger it."
    DISPLAY_INFORMATION(106)
ENDIF
