
START_MONEY(PLAYER0,12000)
MAX_CREATURES(PLAYER0,30)

CREATURE_AVAILABLE(PLAYER0,BARBARIAN,1,1)
CREATURE_AVAILABLE(PLAYER0,GHOST,1,1)
CREATURE_AVAILABLE(PLAYER0,VAMPIRE,1,1)
CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
CREATURE_AVAILABLE(PLAYER0,IMP,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER0,FLY,1,1)
CREATURE_AVAILABLE(PLAYER0,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER0,SKELETON,1,1)
CREATURE_AVAILABLE(PLAYER_GOOD,ARCHER,1,1)
CREATURE_AVAILABLE(PLAYER_GOOD,THIEF,1,1)
CREATURE_AVAILABLE(PLAYER_GOOD,TUNNELLER,1,1)
CREATURE_AVAILABLE(PLAYER_GOOD,KNIGHT,1,1)
CREATURE_AVAILABLE(PLAYER_GOOD,DWARFA,1,1)

ADD_CREATURE_TO_POOL(SKELETON,10)
ADD_CREATURE_TO_POOL(GHOST,10)
ADD_CREATURE_TO_POOL(VAMPIRE,5)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(FLY,20)
ADD_CREATURE_TO_POOL(DRAGON,10)

MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)

ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
ROOM_AVAILABLE(PLAYER0,TRAINING,1,0)
ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,1)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ROOM_AVAILABLE(PLAYER0,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)

TRAP_AVAILABLE(PLAYER0,ALARM,1,1)
TRAP_AVAILABLE(PLAYER0,POISON_GAS,1,0)
TRAP_AVAILABLE(PLAYER0,LIGHTNING,1,1)
DOOR_AVAILABLE(PLAYER0,BRACED,1,0)
DOOR_AVAILABLE(PLAYER0,WOOD,1,1)

CREATE_PARTY(HP)
    ADD_TO_PARTY(HP,KNIGHT,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,THIEF,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,WIZARD,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,THIEF,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,MONK,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,GIANT,5,900,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,BARBARIAN,5,900,ATTACK_ENEMIES,0)

CREATE_PARTY(MO)
    ADD_TO_PARTY(HP,THIEF,2,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,WIZARD,2,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,THIEF,2,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,MONK,2,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,ARCHER,2,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HP,WITCH,2,200,ATTACK_ENEMIES,0)

CREATE_PARTY(ID)
    ADD_TO_PARTY(ID,DWARFA,5,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ID,DWARFA,5,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ID,DWARFA,5,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ID,DWARFA,5,500,ATTACK_ENEMIES,0)

IF(PLAYER_GOOD,GAME_TURN >= 600)
    ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,-1,ACTION_POINT,3,1,600)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
    SET_TIMER(PLAYER_GOOD,TIMER1)

    IF(PLAYER_GOOD,TIMER1 >= 2000)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ID,-1,1)
    ENDIF
ENDIF

IF_ACTION_POINT(4,PLAYER0)
    SET_TIMER(PLAYER_GOOD,TIMER2)

    IF(PLAYER_GOOD,TIMER2 >= 2000)
        ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ID,-2,ACTION_POINT,4,2,600)
    ENDIF
ENDIF

IF(PLAYER0,ENTRANCE > 13)

    SET_TIMER(PLAYER_GOOD,TIMER0)

    IF(PLAYER_GOOD,TIMER0 >= 2000)
        ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,MO,-2,ACTION_POINT,4,9,600)
    ENDIF

    IF(PLAYER_GOOD,TIMER0 >= 4000)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MO,-2,2)
    ENDIF

    IF(PLAYER_GOOD,TIMER0 >= 6000)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HP,-1,1)
        IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
            WIN_GAME
        ENDIF
    ENDIF

ENDIF

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF
