REM Play Level Manudania

REM ******* Basic settings *******

SET_GENERATE_SPEED(300)

MAX_CREATURES(PLAYER0,26)
MAX_CREATURES(PLAYER1,10)
MAX_CREATURES(PLAYER2,34)

START_MONEY(PLAYER0,8000)
START_MONEY(PLAYER1,0)
START_MONEY(PLAYER2,25000)
START_MONEY(PLAYER3,9999999)

COMPUTER_PLAYER(PLAYER1,0)
COMPUTER_PLAYER(PLAYER2,0)
COMPUTER_PLAYER(PLAYER_GOOD,0)

ALLY_PLAYERS(PLAYER0,PLAYER1)
ALLY_PLAYERS(PLAYER2,PLAYER3)
ALLY_PLAYERS(PLAYER2,PLAYER_GOOD)
ALLY_PLAYERS(PLAYER3,PLAYER_GOOD)

ADD_CREATURE_TO_POOL(FLY,20)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(SORCEROR,8)
ADD_CREATURE_TO_POOL(BILE_DEMON,6)
ADD_CREATURE_TO_POOL(DRAGON,12)
ADD_CREATURE_TO_POOL(HELL_HOUND,20)

ADD_CREATURE_TO_POOL(TROLL,30)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,12)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(HORNY,12)

REM ********** Available creatures **********

CREATURE_AVAILABLE(PLAYER2,FLY,1,1)
CREATURE_AVAILABLE(PLAYER2,BUG,1,1)
CREATURE_AVAILABLE(PLAYER2,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER2,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(PLAYER2,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER2,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER2,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER2,HELL_HOUND,1,1)

CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER0,HORNY,1,1)
CREATURE_AVAILABLE(PLAYER1,TROLL,1,1)

REM ********** Available rooms **********

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
ROOM_AVAILABLE(PLAYER2,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)
ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER2,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,0)

REM ********** Available spells **********

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_DISEASE,1,0)

REM ********** Available doors & traps **********

DOOR_AVAILABLE(PLAYER0,WOOD,1,0)
DOOR_AVAILABLE(PLAYER0,BRACED,1,0)
DOOR_AVAILABLE(PLAYER0,STEEL,1,0)
DOOR_AVAILABLE(PLAYER0,MAGIC,1,0)
TRAP_AVAILABLE(PLAYER0,ALARM,1,0)
TRAP_AVAILABLE(PLAYER0,LIGHTNING,1,0)
TRAP_AVAILABLE(PLAYER0,BOULDER,1,0)
TRAP_AVAILABLE(PLAYER0,WORD_OF_POWER,1,0)

REM ********** Game settings **********

SET_CREATURE_HEALTH(KNIGHT,4500)
SET_CREATURE_ARMOUR(KNIGHT,220)

REM ********** Party's **********

CREATE_PARTY(ONE)
    ADD_TO_PARTY(ONE,KNIGHT,10,2000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,VAMPIRE,10,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,VAMPIRE,10,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,SAMURAI,10,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,SAMURAI,9,800,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,SAMURAI,9,800,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
    ADD_TO_PARTY(TWO,DRAGON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,DRAGON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,HELL_HOUND,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,BUG,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,BUG,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,FLY,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,FLY,10,0,ATTACK_ENEMIES,0)

REM ********** Triggers & End game **********

DISPLAY_OBJECTIVE(1,PLAYER0)

IF(PLAYER0,ORC >= 1)
    DISPLAY_INFORMATION(3,PLAYER0)
ENDIF

IF(PLAYER0,GARDEN > 0)
    IF(PLAYER0,GARDEN < 49)
        DISPLAY_INFORMATION(4,PLAYER0)
    ENDIF
ENDIF

IF(PLAYER0,HORNY >= 1)
    DISPLAY_INFORMATION(5,PLAYER0)
ENDIF

IF(PLAYER0,DARK_MISTRESS >= 1)
    DISPLAY_INFORMATION(6,PLAYER0)
ENDIF

CREATE_PARTY(A)
    ADD_TO_PARTY(A,DRAGON,1,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(A,DRAGON,1,0,ATTACK_ENEMIES,0)

IF_ACTION_POINT(1,PLAYER0)
    ADD_CREATURE_TO_LEVEL(PLAYER3,DRAGON,2,3,3,0)
    ADD_CREATURE_TO_LEVEL(PLAYER3,BUG,2,5,5,0)
    ADD_CREATURE_TO_LEVEL(PLAYER3,SPIDER,2,4,9,0)
    ADD_CREATURE_TO_LEVEL(PLAYER3,BILE_DEMON,2,1,3,0)
    ADD_CREATURE_TO_LEVEL(PLAYER3,HELL_HOUND,2,5,10,0)
ENDIF

SET_TIMER(PLAYER0,TIMER0)

IF(PLAYER0,TIMER0 >= 3300)
    IF(PLAYER_GOOD,VAMPIRE < 5)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,VAMPIRE,3,1,3,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER0,TIMER0)
    ENDIF
ENDIF

SET_TIMER(PLAYER_GOOD,TIMER0)

IF(PLAYER_GOOD,TIMER0 >= 1100)
    IF(PLAYER1,DUNGEON_DESTROYED == 0)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DRAGON,4,1,1,0)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,4,2,1,0)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,HELL_HOUND,4,1,2,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER0)
    ENDIF
ENDIF

SET_TIMER(PLAYER_GOOD,TIMER1)

IF(PLAYER_GOOD,TIMER1 >= 4000)
    SET_TIMER(PLAYER_GOOD,TIMER2)
ENDIF

IF(PLAYER_GOOD,TIMER1 >= 8000)
    DISPLAY_INFORMATION(2,PLAYER0)
    TUTORIAL_FLASH_BUTTON(37,-1)
    SET_TIMER(PLAYER_GOOD,TIMER3)
    ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,5,DUNGEON_HEART,0,1,0)
    ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,6,DUNGEON_HEART,0,1,0)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,A,7,DUNGEON_HEART,0,1,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,5,2,1,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,6,2,1,0)
ENDIF

IF(PLAYER_GOOD,TIMER1 >= 12000)
    SET_TIMER(PLAYER_GOOD,TIMER4)
ENDIF

IF(PLAYER_GOOD,TIMER2 >= 12000)
    IF(PLAYER_GOOD,VAMPIRE >= 1)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DRAGON,-1,3,7,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER2)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER3 >= 12000)
    IF(PLAYER_GOOD,VAMPIRE >= 1)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,VAMPIRE,-1,3,7,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER3)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER4 >= 12000)
    IF(PLAYER_GOOD,VAMPIRE >= 1)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,-1,2,9,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER4)
    ENDIF
ENDIF

IF(PLAYER2,BATTLES_LOST >= 10)
    SET_TIMER(PLAYER_GOOD,TIMER5)
ENDIF

IF(PLAYER2,BATTLES_LOST >= 25)
    SET_TIMER(PLAYER_GOOD,TIMER6)
ENDIF

IF(PLAYER2,BATTLES_LOST >= 60)
    SET_TIMER(PLAYER_GOOD,TIMER7)
ENDIF

IF(PLAYER_GOOD,TIMER5 >= 9000)
    IF(PLAYER_GOOD,VAMPIRE >= 1)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FLY,8,5,10,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER5)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER6 >= 9000)
    IF(PLAYER_GOOD,VAMPIRE >= 1)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,-1,2,10,0)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,-1,3,9,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER6)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER7 >= 4000)
    IF(PLAYER_GOOD,VAMPIRE >= 1)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FLY,8,1,10,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER7)
    ENDIF
ENDIF

IF(PLAYER_GOOD,VAMPIRE == 0)
    IF(PLAYER2,DUNGEON_DESTROYED == 1)
        IF(PLAYER_GOOD,DRAGON == 0)
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,1)
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-1,2)
            IF(PLAYER_GOOD,KNIGHT == 0)
                WIN_GAME
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

IF(PLAYER2,DUNGEON_DESTROYED == 1)
    IF(PLAYER_GOOD,DRAGON >= 1)
        DISPLAY_OBJECTIVE(7,PLAYER0)
    ENDIF
ENDIF
