REM Play Level Twisted

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

SET_GENERATE_SPEED(375)

MAX_CREATURES(PLAYER0,25)
MAX_CREATURES(PLAYER2,28)

START_MONEY(PLAYER0,15000)
START_MONEY(PLAYER2,25000)

COMPUTER_PLAYER(PLAYER2,10)
COMPUTER_PLAYER(PLAYER_GOOD,0)

ALLY_PLAYERS(PLAYER_GOOD,PLAYER2)

ADD_CREATURE_TO_POOL(SPIDER,12)
ADD_CREATURE_TO_POOL(DEMONSPAWN,8)
ADD_CREATURE_TO_POOL(SORCEROR,17)
ADD_CREATURE_TO_POOL(BILE_DEMON,14)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(TROLL,25)
ADD_CREATURE_TO_POOL(ORC,16)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,18)
ADD_CREATURE_TO_POOL(VAMPIRE,1)
ADD_CREATURE_TO_POOL(HORNY,12)

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

CREATURE_AVAILABLE(PLAYER0,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER0,SKELETON,1,1)
CREATURE_AVAILABLE(PLAYER0,GHOST,1,1)
CREATURE_AVAILABLE(PLAYER0,VAMPIRE,1,1)
CREATURE_AVAILABLE(PLAYER0,HORNY,1,1)

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

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

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

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
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_CAVE_IN,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)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)

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

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

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

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

REM ********** Parties **********

CREATE_PARTY(ONE)
    ADD_TO_PARTY(ONE,WITCH,10,100,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
    ADD_TO_PARTY(TWO,GIANT,10,100,ATTACK_ENEMIES,0)

CREATE_PARTY(THREE)
    ADD_TO_PARTY(THREE,SAMURAI,10,150,ATTACK_ENEMIES,0)

CREATE_PARTY(FOUR)
    ADD_TO_PARTY(FOUR,MONK,10,100,ATTACK_ENEMIES,0)


CREATE_PARTY(FIVE)
    ADD_TO_PARTY(FIVE,AVATAR,8,15000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FIVE,SAMURAI,10,2000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FIVE,SAMURAI,10,2000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FIVE,MONK,10,2000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FIVE,MONK,10,2000,ATTACK_ENEMIES,0)

CREATE_PARTY(SIX)
    ADD_TO_PARTY(SIX,KNIGHT,7,700,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SIX,THIEF,3,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SIX,THIEF,4,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SIX,THIEF,5,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SIX,THIEF,6,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SIX,ARCHER,6,300,ATTACK_ENEMIES,0)

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

IF(PLAYER0,BATTLES_WON > 0)
    SET_TIMER(PLAYER_GOOD,TIMER0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 4000)
    ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,-1,DUNGEON_HEART,0,1,100)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-2,DUNGEON_HEART,0,1,100)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 6000)
    SET_TIMER(PLAYER_GOOD,TIMER1)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,THIEF,-1,6,4,0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 8500)
    SET_TIMER(PLAYER_GOOD,TIMER2)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DWARFA,-2,5,4,0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 12000)
    SET_TIMER(PLAYER_GOOD,TIMER3)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,-1,4,4,0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 15500)
    SET_TIMER(PLAYER_GOOD,TIMER4)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,WIZARD,-2,4,5,0)
ENDIF

IF(PLAYER_GOOD,TIMER1 >= 14000)
    IF(PLAYER_GOOD,TOTAL_CREATURES > 0)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER1)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER2 >= 14000)
    IF(PLAYER_GOOD,TOTAL_CREATURES > 0)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-2,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER2)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER3 >= 14000)
    IF(PLAYER_GOOD,TOTAL_CREATURES > 0)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-1,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER3)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER4 >= 14000)
    IF(PLAYER_GOOD,TOTAL_CREATURES > 0)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-2,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER4)
    ENDIF
ENDIF

IF(PLAYER2,DUNGEON_DESTROYED == 1)
    SET_TIMER(PLAYER_GOOD,TIMER5)
ENDIF

IF(PLAYER_GOOD,TIMER5 >= 500)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,1,3)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,1,4,3,0)
ENDIF

IF(PLAYER_GOOD,KNIGHT == 0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-3,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,-3,4)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,THIEF,-3,12,2,0)
    IF(PLAYER_GOOD,AVATAR == 0)
        WIN_GAME
    ENDIF
ENDIF
