REM ********************************************
REM  Burdened Imps' Level Pack for KeeperFX
REM  Script for Level 222, Blistering Furnace
REM  Version 1.00
REM ********************************************

REM Basic stuff

SET_GENERATE_SPEED(500)
MAX_CREATURES(PLAYER0,25)
MAX_CREATURES(PLAYER1,30)
START_MONEY(PLAYER0,20000)
START_MONEY(PLAYER1,50000)
COMPUTER_PLAYER(PLAYER1,10)

SET_CREATURE_MAX_LEVEL(PLAYER0,THIEF,10)
SET_CREATURE_MAX_LEVEL(PLAYER0,DEMONSPAWN,10)

ADD_CREATURE_TO_POOL(FLY,20)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(HELL_HOUND,20)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(SKELETON,20)
ADD_CREATURE_TO_POOL(GHOST,20)
ADD_CREATURE_TO_POOL(VAMPIRE,20)

CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TENTACLE,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SKELETON,0,0)
CREATURE_AVAILABLE(ALL_PLAYERS,GHOST,0,0)
CREATURE_AVAILABLE(ALL_PLAYERS,VAMPIRE,0,0)

ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)
ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER0,PRISON,1,0)
ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER0,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,0)
ROOM_AVAILABLE(PLAYER0,SCAVENGER,0,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,LAVA,0,0)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,WOOD,0,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,0,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DISEASE,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CHICKEN,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_ARMAGEDDON,0,0)

IF(PLAYER0,BRIDGE >= 1)
    ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
ENDIF
IF(PLAYER0,WORKSHOP >= 1)
    ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,1)
ENDIF
IF(PLAYER0,BARRACKS >= 1)
    ROOM_AVAILABLE(PLAYER0,BARRACKS,1,1)
ENDIF
IF(PLAYER0,PRISON >= 1)
    ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ENDIF
IF(PLAYER0,TORTURE >= 1)
    ROOM_AVAILABLE(PLAYER0,TORTURE,1,1)
ENDIF
IF(PLAYER0,GRAVEYARD >= 1)
    ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
ENDIF
IF(PLAYER0,SCAVENGER >= 1)
    ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,1)
ENDIF
IF(PLAYER0,TEMPLE >= 1)
    ROOM_AVAILABLE(PLAYER0,TEMPLE,1,1)
ENDIF
IF(PLAYER0,SCAVENGER >= 1)
    ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,1)
ENDIF
IF(PLAYER0,GUARD_POST >= 1)
    ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,1)
ENDIF

REM ----------------------- Hero groups

CREATE_PARTY(REVENGE)
    ADD_TO_PARTY(REVENGE,KNIGHT,10,1600,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE,SAMURAI,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE,MONK,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE,GIANT,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE,GIANT,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE,WIZARD,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE,BARBARIAN,8,800,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(CHECKUP)
    ADD_TO_PARTY(CHECKUP,BARBARIAN,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(CHECKUP,BARBARIAN,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(CHECKUP,ARCHER,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(CHECKUP,ARCHER,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(CHECKUP,WITCH,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(CHECKUP,SAMURAI,8,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(CHECKUP,SAMURAI,8,800,ATTACK_DUNGEON_HEART,0)

REM ----------------------- Win/Lose conditions/Objectives

DISPLAY_OBJECTIVE(38,ALL_PLAYERS)
REM QUICK_OBJECTIVE(0,"A portal is absent on this island. Without minions you have no hope of defeating the enemy Keeper here. However, visiting the nearby hero fortress might open some recruitment options. Starving heroes make fine skeletons and you might even be able to attract a vampire or two. Or, if you feel particularly evil today, why not convert them all to your cause and create a legion of heroes?",PLAYER0)

IF(PLAYER1,DUNGEON_DESTROYED == 1)
    DISPLAY_OBJECTIVE(39,ALL_PLAYERS)
    REM QUICK_OBJECTIVE(1,"A fine display of wickedness. Congratulations, Keeper. Now, what to do with your remaining heroes...",PLAYER0)
    WIN_GAME
ENDIF

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

IF(PLAYER0,TOTAL_CREATURES == 0)
    IF(PLAYER0,ENTRANCE == 0)
        DISPLAY_OBJECTIVE(40,ALL_PLAYERS)
        REM QUICK_OBJECTIVE(2,"You cannot hope to win without minions, Keeper. You have failed.",PLAYER0)
        LOSE_GAME
    ENDIF
ENDIF

IF(PLAYER0,TOTAL_CREATURES >= 30)
    DISPLAY_OBJECTIVE(41,ALL_PLAYERS)
REM QUICK_OBJECTIVE(3,"You are well on your way, Keeper. Thirty or more minions might do to overthrow your adversary. But it will be wise to gather more. Remember, you cannot replace fallen minions easily without a portal.",PLAYER0)
ENDIF

IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
    SET_TIMER(PLAYER_GOOD,TIMER0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 5000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CHECKUP,-1,1)
    DISPLAY_INFORMATION(42,ALL_PLAYERS)
REM QUICK_INFORMATION(4,"An assortment of heroes have arrived. They will undoubtly attack your dungeon after seeing the grief you have caused to their friends. Potential future servants?")
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 15000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,REVENGE,-1,1)
    DISPLAY_INFORMATION(44,ALL_PLAYERS)
    REM QUICK_INFORMATION(5,"The lord of this land has come to revenge his comrades. What he doesn't know is that he'll soon be fighting them. One has got to love the irony in that.")
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,REVENGE,-1,1)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    SET_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
    SET_FLAG(PLAYER0,FLAG2,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
    SET_FLAG(PLAYER0,FLAG3,1)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
    SET_FLAG(PLAYER0,FLAG4,1)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
    SET_FLAG(PLAYER0,FLAG5,1)
ENDIF

IF(PLAYER0,FLAG1 == 1)
    IF(PLAYER0,FLAG2 == 1)
        IF(PLAYER0,FLAG3 == 1)
            IF(PLAYER0,FLAG4 == 1)
                IF(PLAYER0,FLAG5 == 1)
                    DISPLAY_INFORMATION(45,ALL_PLAYERS)
REM QUICK_INFORMATION(6,"Magnificent thinking, Keeper. The contamination of these holy wells by your minions' dirty feet has led to an interesting gift from the Gods. A Horned Reaper has come to aid you.")
                    ADD_CREATURE_TO_LEVEL(PLAYER0,HORNY,6,1,10,0)
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,KNIGHT == 1)
    DISPLAY_INFORMATION(46,ALL_PLAYERS)
    REM QUICK_INFORMATION(7,"Most unpleasantly done, Keeper. This knight will make an excellent addition to your force.")
ENDIF

IF(PLAYER0,DRAGON == 1)
    DISPLAY_INFORMATION(47,ALL_PLAYERS)
REM QUICK_INFORMATION(8,"A dragon has joined your cause. There may be others around. Be advised, Keeper, if you seek to imprisonate and torture your enemy, a dragon's flames can burn any victim beyond unconsciousness. It would be best to find other minions to subdue your enemy.")
ENDIF
