REM ********************************************
REM
REM Script for Level 205
REM
REM ********************************************
LEVEL_VERSION(1)
SET_GENERATE_SPEED(400)

MAX_CREATURES(PLAYER0,15)

START_MONEY(ALL_PLAYERS,15000)


ADD_CREATURE_TO_POOL(TUNNELLER,20)
ADD_CREATURE_TO_POOL(BARBARIAN,20)
ADD_CREATURE_TO_POOL(ARCHER,20)
ADD_CREATURE_TO_POOL(DWARFA,20)
ADD_CREATURE_TO_POOL(FAIRY,20)
ADD_CREATURE_TO_POOL(THIEF,20)

CREATURE_AVAILABLE(PLAYER0,THIEF,1,0)
CREATURE_AVAILABLE(PLAYER0,DWARFA,1,0)
CREATURE_AVAILABLE(PLAYER0,TUNNELLER,1,0)
CREATURE_AVAILABLE(PLAYER0,ARCHER,1,0)
CREATURE_AVAILABLE(PLAYER0,BARBARIAN,1,0)
CREATURE_AVAILABLE(PLAYER0,FAIRY,1,0)

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

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,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_SPEED,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)


SET_TIMER(PLAYER0,TIMER0)
IF(PLAYER0,GAME_TURN > 10000)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,IMP,3,1,3,0)
ENDIF

IF(PLAYER0,GAME_TURN > 10900)
    REM "The Spawners have come, be ready for their offspring."
    DISPLAY_OBJECTIVE(10,ALL_PLAYERS)
ENDIF

IF(PLAYER0,GAME_TURN > 20)
    REM "Welcome to this realm, noble hero. It is your holy quest to vanquish the spawners from here forever. They spawn in a pit of lava, heavily guarded. If only you could cover it up....."
    DISPLAY_OBJECTIVE(11,ALL_PLAYERS)
ENDIF

IF(PLAYER0,GAME_TURN > 150)
    REM "There is new technology available to you, oh noble one. Build a library to research them. Wizards are attracted to libraries, but they do not see the spawners as much of a threat, and so will not come. Make do without them!"
    DISPLAY_INFORMATION(12,ALL_PLAYERS)
ENDIF

IF(PLAYER0,THIEF > 0)
    REM "A Thief has joined you! They are weak at low levels, but later they can become very sneaky. One day, they will learn the error of thier ways (level 11 :P)"
    DISPLAY_INFORMATION(13,ALL_PLAYERS)
ENDIF

IF(PLAYER0,BARBARIAN > 0)
    REM "A Barbarian has joined you! These are mean, strong heros, with attitude!"
    DISPLAY_INFORMATION(14,ALL_PLAYERS)
ENDIF

IF(PLAYER0,FAIRY > 0)
    REM "A Fairy, how lovely! They are good researchers, and very destructive"
    DISPLAY_INFORMATION(15,ALL_PLAYERS)
ENDIF

IF(PLAYER0,BRIDGE >= 41)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,HORNY,4,1,5,0)
ENDIF

IF(PLAYER0,BRIDGE >= 41)
    REM "Very clever! But it looks like a Horned Reaper has come for revenge... and he looks angry!"
    DISPLAY_INFORMATION(16,ALL_PLAYERS)
    IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
        DISPLAY_INFORMATION(17,ALL_PLAYERS)
        REM "Well done! Thats another bit of evil destroyed! Congratulations!"
        WIN_GAME
    ENDIF
ENDIF


IF(PLAYER0,BRIDGE < 41)
    IF(PLAYER0,GAME_TURN > 10900)
        IF(PLAYER0,TIMER0 >= 600)
            IF(PLAYER_GOOD,TOTAL_CREATURES < 40)
                NEXT_COMMAND_REUSABLE
                ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DEMONSPAWN,1,1,1,0)
                NEXT_COMMAND_REUSABLE
                SET_TIMER(PLAYER0,TIMER0)
            ENDIF
        ENDIF
    ENDIF
ENDIF
