REM ********************************************
REM
REM Script for Level 203
REM
REM ********************************************

SET_GENERATE_SPEED(700)

COMPUTER_PLAYER(PLAYER1,1)
COMPUTER_PLAYER(PLAYER2,0)

START_MONEY(PLAYER0,0)
START_MONEY(PLAYER1,10000)
START_MONEY(PLAYER2,10000)

MAX_CREATURES(PLAYER0,15)
MAX_CREATURES(PLAYER1,15)
MAX_CREATURES(PLAYER1,30)

ADD_CREATURE_TO_POOL(TROLL,15)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(DRAGON,10)
ADD_CREATURE_TO_POOL(ORC,10)
ADD_CREATURE_TO_POOL(BILE_DEMON,10)
ADD_CREATURE_TO_POOL(DEMONSPAWN,5)
ADD_CREATURE_TO_POOL(BUG,5)
ADD_CREATURE_TO_POOL(SPIDER,5)
ADD_CREATURE_TO_POOL(VAMPIRE,3)

CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)

CREATURE_AVAILABLE(PLAYER1,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER1,TROLL,1,1)

CREATURE_AVAILABLE(PLAYER2,ORC,1,1)
CREATURE_AVAILABLE(PLAYER2,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER2,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER2,BILE_DEMON,1,1)

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)

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_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_LIGHTNING,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_LIGHTNING,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)

CREATE_PARTY(BREAKER)
    ADD_TO_PARTY(BREAKER,SAMURAI,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(BREAKER,SAMURAI,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(BREAKER,FAIRY,10,800,DEFEND_PARTY,0)
    ADD_TO_PARTY(BREAKER,FAIRY,10,800,DEFEND_PARTY,0)
    ADD_TO_PARTY(BREAKER,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(BREAKER,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(BREAKER,AVATAR,10,4000,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(MAGMATAISI)
    ADD_TO_PARTY(MAGMATAISI,HELL_HOUND,10,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MAGMATAISI,HELL_HOUND,10,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MAGMATAISI,HELL_HOUND,10,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MAGMATAISI,DRAGON,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(MAGMATAISI,DRAGON,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(MAGMATAISI,DRAGON,10,800,ATTACK_DUNGEON_HEART,0)

QUICK_OBJECTIVE(1,"You've been tricked out of money! Fortunately, there are many abandoned places in this land. Your first priority is to claim an unused Treasure Room located behind Portal.",PLAYER0)

IF(PLAYER0,GAME_TURN > 200)
    QUICK_INFORMATION(7,",Guard your Imps! Without them, it will be hard to claim anything.")
ENDIF

IF(PLAYER0,TREASURE > 1)
    QUICK_OBJECTIVE(2,"Now find and take other rooms located in the realm. The ancient maps are indicating lair is just behind your new Treasury, others are also nearby.",PLAYER0)
ENDIF

IF(PLAYER0,TRAINING > 1)
    QUICK_OBJECTIVE(3,"The inhabitants of this kingdom are not quite happy about losing control of their underground shelter, so they might be planning to get rid of you before you'll grow too powerful. Expect them to attack until you'll prove your dominance by destroying enemy keeper on the east.",PLAYER0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ORC,-1,4,3,400)
    SET_TIMER(PLAYER0,TIMER0)
ENDIF

IF(PLAYER0,RESEARCH > 1)
    QUICK_INFORMATION(5,"When you'll find a magic door, watch out - I sense a presence of a powerful force there. And the worst thing is - it's not evil.")
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SORCEROR,-1,4,5,600)
ENDIF

IF(PLAYER0,TIMER0 > 15000)
    IF(PLAYER1,DUNGEON_DESTROYED == 0)
        NEXT_COMMAND_REUSABLE
        SET_FLAG(PLAYER0,FLAG0,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER0,TIMER0)
    ENDIF
ENDIF

IF(PLAYER0,FLAG0 == 1)
    NEXT_COMMAND_REUSABLE
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,-1,3,3,400)
    IF(PLAYER0,BATTLES_WON > 15)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SPIDER,-1,3,3,400)
        IF(PLAYER0,BATTLES_WON > 45)
            NEXT_COMMAND_REUSABLE
            ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FLY,-1,6,3,400)
            IF(PLAYER0,BATTLES_WON > 150)
                NEXT_COMMAND_REUSABLE
                ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DRAGON,-1,6,8,1600)
            ENDIF
        ENDIF
    ENDIF
    NEXT_COMMAND_REUSABLE
    SET_FLAG(PLAYER0,FLAG0,0)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BREAKER,1,2)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,HELL_HOUND,1,4,10,800)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,THIEF,1,4,10,400)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,WITCH,1,2,10,800)
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED == 1)
    QUICK_OBJECTIVE(4,"One of the enemies is defeated. This should also make heroes more careful - spies say they are going to prepare an ambush near their fortress on the south.",PLAYER0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SAMURAI,-2,5,7,800)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ORC,-3,5,7,800)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
    QUICK_INFORMATION(6,"Your creatures have found a sign saying - No bridges beyond this point. Was it magical?")
    ROOM_AVAILABLE(PLAYER0,BRIDGE,0,0)
ENDIF

REM Fortress on the south, not very deep
IF_ACTION_POINT(3,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MAGMATAISI,3,1)
ENDIF

REM Fortress on the south, deeper
IF_ACTION_POINT(4,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MAGMATAISI,4,1)
ENDIF

REM Fortress on the south, quite deep
IF_ACTION_POINT(5,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MAGMATAISI,5,1)
ENDIF

REM Fortress on the south, beyond hero heart
IF_ACTION_POINT(6,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MAGMATAISI,6,1)
ENDIF

REM Fortress on the south, bridge to green keeper
IF_ACTION_POINT(7,PLAYER0)
    QUICK_OBJECTIVE(8,"One enemy remains. Go and take everything from him!",PLAYER0)
    QUICK_INFORMATION(9,"The magic which prevented you from building bridges has ended with the defeat of heroes.")
    ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)
ENDIF

IF(PLAYER2,DUNGEON_DESTROYED == 1)
    WIN_GAME
ENDIF
