REM -------------------------------------------------------------------------------------------------------------------------------------------
REM Post Undead Keeper
REM Ludim
REM Made by Duke Ragereaver
REM -------------------------------------------------------------------------------------------------------------------------------------------

COMPUTER_PLAYER(PLAYER1,0)

REM -------------------------------------------------------------------------------------------------------------------------------------------

START_MONEY(PLAYER0,50000)
START_MONEY(PLAYER1,250000)

REM -------------------------------------------------------------------------------------------------------------------------------------------

SET_GENERATE_SPEED(650)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,30)
ADD_CREATURE_TO_POOL(BILE_DEMON,30)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(VAMPIRE,2)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(HELL_HOUND,20)
ADD_CREATURE_TO_POOL(SKELETON,20)


REM -------------------------------------------------------------------------------------------------------------------------------------------

MAX_CREATURES(PLAYER0,21)
MAX_CREATURES(PLAYER1,35)

REM -------------------------------------------------------------------------------------------------------------------------------------------

CREATURE_AVAILABLE(PLAYER0,SKELETON,1,1)
CREATURE_AVAILABLE(PLAYER0,GHOST,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,VAMPIRE,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER1,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER1,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER1,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER1,ORC,1,1)
CREATURE_AVAILABLE(PLAYER1,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER1,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER1,HELL_HOUND,1,1)


REM -------------------------------------------------------------------------------------------------------------------------------------------

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


REM -------------------------------------------------------------------------------------------------------------------------------------------

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)


REM -------------------------------------------------------------------------------------------------------------------------------------------


DOOR_AVAILABLE(PLAYER0,BRACED,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)

TRAP_AVAILABLE(PLAYER0,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)


REM --------------------------------------------------------------------------------------------------------------------------------------------

CREATE_PARTY(EASY_ONE)
    ADD_TO_PARTY(EASY_ONE,THIEF,3,300,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EASY_ONE,THIEF,3,300,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EASY_ONE,ARCHER,3,350,DEFEND_PARTY,0)

CREATE_PARTY(EASY_TWO)
    ADD_TO_PARTY(EASY_TWO,DWARFA,3,300,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EASY_TWO,THIEF,3,300,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EASY_TWO,ARCHER,3,350,DEFEND_PARTY,0)

CREATE_PARTY(MEDIUM_ONE)
    ADD_TO_PARTY(MEDIUM_ONE,ARCHER,5,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MEDIUM_ONE,BARBARIAN,5,600,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(MEDIUM_ONE,MONK,5,700,DEFEND_PARTY,0)

CREATE_PARTY(MEDIUM_TWO)
    ADD_TO_PARTY(MEDIUM_TWO,GIANT,4,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MEDIUM_TWO,BARBARIAN,5,600,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(MEDIUM_TWO,ARCHER,5,600,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(BRUTES)
    ADD_TO_PARTY(BRUTES,GIANT,6,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BRUTES,GIANT,6,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BRUTES,GIANT,6,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BRUTES,GIANT,6,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BRUTES,GIANT,6,500,DEFEND_PARTY,0)
    ADD_TO_PARTY(BRUTES,GIANT,6,500,DEFEND_PARTY,0)

CREATE_PARTY(DEFENDERS)
    ADD_TO_PARTY(DEFENDERS,BARBARIAN,7,750,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(DEFENDERS,GIANT,6,500,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(DEFENDERS,THIEF,7,400,STEAL_GOLD,0)
    ADD_TO_PARTY(DEFENDERS,ARCHER,8,500,DEFEND_PARTY,0)
    ADD_TO_PARTY(DEFENDERS,ARCHER,8,500,DEFEND_PARTY,0)
    ADD_TO_PARTY(DEFENDERS,ARCHER,8,500,DEFEND_PARTY,0)

REM --------------------------------------------------------------------------------------------------------------------------------------------

QUICK_OBJECTIVE(0,"An evil Keeper by the name of Dracovich has his designs for this realm. Let him know how you feel about those plans... in the appriopiate way of course.",PLAYER0)

SET_TIMER(PLAYER_GOOD,TIMER0)
SET_TIMER(PLAYER_GOOD,TIMER1)
SET_FLAG(PLAYER_GOOD,FLAG0,1)

IF(PLAYER_GOOD,TIMER0 >= 9375)
    IF(PLAYER_GOOD,FLAG0 == 1)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,EASY_ONE,-1,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER0)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER1 >= 17550)
    IF(PLAYER_GOOD,FLAG0 == 1)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,EASY_TWO,-2,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER1)
    ENDIF
ENDIF

IF(PLAYER0,TOTAL_CREATURES >= 17)
    SET_FLAG(PLAYER_GOOD,FLAG0,2)
    SET_TIMER(PLAYER_GOOD,TIMER2)
    SET_TIMER(PLAYER_GOOD,TIMER3)
ENDIF

IF(PLAYER_GOOD,TIMER2 >= 11250)
    IF(PLAYER_GOOD,FLAG0 == 2)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDIUM_ONE,-1,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER2)
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER3 >= 21250)
    IF(PLAYER_GOOD,FLAG0 == 2)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDIUM_TWO,-2,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER3)
    ENDIF
ENDIF

IF(PLAYER0,TOTAL_CREATURES >= 30)
    SET_FLAG(PLAYER_GOOD,FLAG0,3)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BRUTES,-4,1)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDERS,2,1)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDERS,-3,1)
ENDIF

IF(PLAYER0,BRIDGE >= 1)
    ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
ENDIF

IF(PLAYER1,BRIDGE >= 1)
    ROOM_AVAILABLE(PLAYER1,BRIDGE,1,1)
ENDIF

IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
    IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
        QUICK_OBJECTIVE(1,"That is one less, well done.",PLAYER0)
        WIN_GAME
    ENDIF
ENDIF
