REM Play Level Ninja Fortress

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

SET_GENERATE_SPEED(400)

MAX_CREATURES(PLAYER0,22)

START_MONEY(PLAYER0,10000)

ADD_CREATURE_TO_POOL(BUG,6)
ADD_CREATURE_TO_POOL(DEMONSPAWN,7)
ADD_CREATURE_TO_POOL(SORCEROR,5)
ADD_CREATURE_TO_POOL(BILE_DEMON,6)
ADD_CREATURE_TO_POOL(TROLL,9)
ADD_CREATURE_TO_POOL(ORC,8)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,11)
ADD_CREATURE_TO_POOL(HELL_HOUND,2)
ADD_CREATURE_TO_POOL(HORNY,7)

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

CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SKELETON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,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(ALL_PLAYERS,TRAINING,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)

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

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,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_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,1,0)

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

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

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

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

SET_CREATURE_MAX_LEVEL(PLAYER0,BUG,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,DEMONSPAWN,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,SORCEROR,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,BILE_DEMON,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,ORC,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,TROLL,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,DARK_MISTRESS,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,HELL_HOUND,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,HORNY,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,SKELETON,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,GHOST,6)
SET_CREATURE_MAX_LEVEL(PLAYER0,SPIDER,6)

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

CREATE_PARTY(ONE)
    ADD_TO_PARTY(ONE,THIEF,4,0,STEAL_GOLD,0)

CREATE_PARTY(TWO)
    ADD_TO_PARTY(TWO,AVATAR,5,6000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,SAMURAI,5,700,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,SAMURAI,5,700,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,SAMURAI,7,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,SAMURAI,7,900,ATTACK_ENEMIES,0)

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

SET_TIMER(PLAYER0,TIMER0)

IF(PLAYER0,TOTAL_CREATURES >= 18)
    SET_TIMER(PLAYER0,TIMER1)
ENDIF

IF(PLAYER0,TIMER0 >= 5000)
    IF(PLAYER0,SKELETON < 18)
        IF(PLAYER_GOOD,THIEF < 5)
            IF(PLAYER_GOOD,DUNGEON_DESTROYED == 0)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,1,1)
                NEXT_COMMAND_REUSABLE
                SET_TIMER(PLAYER0,TIMER0)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,TIMER1 >= 4000)
    IF(PLAYER_GOOD,DUNGEON_DESTROYED == 0)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,2,4,4,0)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,2,2,6,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER0,TIMER1)
    ENDIF
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,3,1)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,3,2,6,0)
    IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
        WIN_GAME
    ENDIF
ENDIF
