REM KDK Level 4

SET_GENERATE_SPEED(400)
MAX_CREATURES(PLAYER0,36)
START_MONEY(PLAYER0,13000)

ADD_CREATURE_TO_POOL(BUG,12)
ADD_CREATURE_TO_POOL(TENTACLE,7)
ADD_CREATURE_TO_POOL(SPIDER,9)
ADD_CREATURE_TO_POOL(BILE_DEMON,7)
ADD_CREATURE_TO_POOL(FLY,11)
ADD_CREATURE_TO_POOL(DEMONSPAWN,8)
ADD_CREATURE_TO_POOL(TROLL,14)
ADD_CREATURE_TO_POOL(SORCEROR,7)

CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER0,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER0,FLY,1,1)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(PLAYER0,DRAGON,1,1)

MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_POSSESS,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)

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

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

SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,KNIGHT,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,THIEF,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,DWARFA,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,TUNNELLER,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,ARCHER,3)
SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,BARBARIAN,2)

SET_CREATURE_MAX_LEVEL(PLAYER0,DEMONSPAWN,10)

CREATE_PARTY(FOULBOYS)
    ADD_TO_PARTY(FOULBOYS,ARCHER,2,150,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FOULBOYS,ARCHER,2,150,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FOULBOYS,BARBARIAN,3,750,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FOULBOYS,WIZARD,1,220,ATTACK_ENEMIES,0)

CREATE_PARTY(CLIVEIN)
    ADD_TO_PARTY(CLIVEIN,DWARFA,1,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CLIVEIN,MONK,1,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CLIVEIN,MONK,1,0,ATTACK_ENEMIES,0)

CREATE_PARTY(HOODZ)
    ADD_TO_PARTY(HOODZ,ARCHER,1,110,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HOODZ,ARCHER,2,210,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HOODZ,ARCHER,2,105,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HOODZ,ARCHER,1,120,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HOODZ,ARCHER,1,170,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HOODZ,ARCHER,1,144,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HOODZ,ARCHER,1,98,ATTACK_ENEMIES,0)

CREATE_PARTY(T_REX)
    ADD_TO_PARTY(T_REX,BARBARIAN,7,1985,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(T_REX,BARBARIAN,6,1015,ATTACK_ENEMIES,0)

CREATE_PARTY(SPELLZ)
    ADD_TO_PARTY(SPELLZ,WITCH,4,960,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SPELLZ,WIZARD,4,4525,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SPELLZ,WIZARD,4,1090,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SPELLZ,FAIRY,3,1113,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SPELLZ,FAIRY,2,870,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SPELLZ,FAIRY,2,619,ATTACK_ENEMIES,0)

CREATE_PARTY(HERO1)
    ADD_TO_PARTY(HERO1,ARCHER,1,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HERO1,DWARFA,1,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HERO1,ARCHER,1,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HERO1,DWARFA,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(HERO2)
    ADD_TO_PARTY(HERO2,THIEF,1,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HERO2,THIEF,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(HERO3)
    ADD_TO_PARTY(HERO3,BARBARIAN,1,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HERO3,BARBARIAN,1,100,ATTACK_ENEMIES,0)

CREATE_PARTY(HERO4)
    ADD_TO_PARTY(HERO4,BARBARIAN,1,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HERO4,ARCHER,2,100,ATTACK_ENEMIES,0)

CREATE_PARTY(KNIGHT)
    ADD_TO_PARTY(KNIGHT,KNIGHT,3,20000,ATTACK_ENEMIES,200)


REM CREATE_TEXT(1,45"BUILD UP A DUNGEON INCLUDING A TREASURE ROOM, A LAIR, A HATCHERY, A TRAINING ROOM AND A RESEARCH ROOM.  ALSO DIG TO AND CLAIM AN ENTRANCE.  DO NOT VENTURE NORTH YET AS THERE ARE POWERFUL ENEMIES THERE.")
DISPLAY_OBJECTIVE(45,PLAYER0)

IF(PLAYER0,TREASURE > 0)
    IF(PLAYER0,LAIR > 0)
        IF(PLAYER0,GARDEN > 0)
            IF(PLAYER0,TRAINING > 0)
                IF(PLAYER0,RESEARCH > 0)
                    IF(PLAYER0,ENTRANCE > 0)
REM CREATE_TEXT(10,47"WHEN YOU ARE HAPPY WITH YOUR DUNGEON, BUILD A 3X3 WORKSHOP WHICH IS NOW AVAILABLE TO YOU.  THERE, YOUR CREATURES WILL BE ABLE TO BUILD DOORS AND TRAPS.")
                        DISPLAY_OBJECTIVE(47,PLAYER0)
                        TUTORIAL_FLASH_BUTTON(13,-1)
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,WORKSHOP >= 9)
    REM CREATE_TEXT(11,48 "TO MANUFACTURE TRAPS AND DOORS, YOU WILL NEED TO PLACE CREATURES WITHIN THE WORKSHOP.  SOME CREATURES ARE BETTER ENGINEERS THAN OTHERS.")
    DISPLAY_INFORMATION(48,PLAYER0)
ENDIF


IF_ACTION_POINT(1,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO1,3,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO3,7,1)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SPELLZ,4,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO2,4,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO2,8,1)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
    REM CREATE_TEXT(20,51"YOU HAVE REACHED THE HEROES' DUNGEON HEART.  GET YOUR CREATURES TO DESTROY IT TO CONQUER THIS LAND.")
    DISPLAY_OBJECTIVE(51,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO4,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HERO4,-1,1)
ENDIF

IF_ACTION_POINT(9,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOULBOYS,-6,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLIVEIN,-6,1)
ENDIF

IF(PLAYER0,TROLL > 0)
    REM CREATE_TEXT(7,52"A TROLL HAS JOINED YOU.  THEY ARE EXCELLENT ENGINEERS WHO LOVE TO BUILD IN WORKSHOPS.")
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HOODZ,3,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,T_REX,8,1)
    DISPLAY_INFORMATION(52,PLAYER0)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
    REM CREATE_TEXT(6,53"WELL DONE.  WITH THE HEROES' DUNGEON HEART DESTROYED, THEIR POWER IS CRUSHED.  THIS LAND IS OURS.")
    DISPLAY_OBJECTIVE(53,PLAYER0)
    WIN_GAME
ENDIF
