REM -- Vulkaan v1.0.1
REM -- Made by Yani

LEVEL_VERSION(1)
SET_GENERATE_SPEED(600)
START_MONEY(ALL_PLAYERS,2500)
COMPUTER_PLAYER(PLAYER3,0)

MAX_CREATURES(PLAYER0,15)
MAX_CREATURES(PLAYER3,25)

REM -- Make torture faster
SET_GAME_RULE(TortureConvertChance,60)

REM - Creature Pool
ADD_CREATURE_TO_POOL(FLY,5)
ADD_CREATURE_TO_POOL(BUG,10)
ADD_CREATURE_TO_POOL(DEMONSPAWN,10)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(DRAGON,10)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,50)

REM -- Available Creatures (for both Keepers)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,TENTACLE,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,0)

REM -- Player only creatures
CREATURE_AVAILABLE(PLAYER0,BUG,1,0)
CREATURE_AVAILABLE(PLAYER0,FLY,1,0)

REM -- AI only creatures
CREATURE_AVAILABLE(PLAYER3,DARK_MISTRESS,1,0)

REM -- Rooms available for Player at start
ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)

REM -- Rooms available for Player after claiming
ROOM_AVAILABLE(PLAYER0,RESEARCH,3,0)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,3,0)
ROOM_AVAILABLE(PLAYER0,PRISON,3,0)
ROOM_AVAILABLE(PLAYER0,TORTURE,3,0)
ROOM_AVAILABLE(PLAYER0,GRAVEYARD,3,0)
ROOM_AVAILABLE(PLAYER0,SCAVENGER,3,0)
ROOM_AVAILABLE(PLAYER0,BARRACKS,3,0)

REM -- Rooms available for Yellow AI
ROOM_AVAILABLE(PLAYER3,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER3,LAIR,1,1)
ROOM_AVAILABLE(PLAYER3,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER3,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER3,TRAINING,1,0)
ROOM_AVAILABLE(PLAYER3,PRISON,1,0)
ROOM_AVAILABLE(PLAYER3,GRAVEYARD,1,0)

REM -- Possession is not instantly available for Player
MAGIC_AVAILABLE(PLAYER0,POWER_POSSESS,0,0)

REM -- Spells available for Player
MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)

REM -- Spells available for Yellow AI
MAGIC_AVAILABLE(PLAYER3,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_HEAL_CREATURE,1,1)

REM -- Available traps and doors
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)

REM -- Heroes heart is destroyed
IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)

    REM -- Bridge becomes available
    ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
    REM "It seems that destroying the heroes' heart at least rendered the bridge usable again."
    DISPLAY_INFORMATION(145)
    TUTORIAL_FLASH_BUTTON(18,0)

    REM -- Yellow starts a BDSM dungeon
    ADD_CREATURE_TO_LEVEL(PLAYER3,DARK_MISTRESS,PLAYER3,7,10,0)

    REM -- Yellow can attack now
    MAGIC_AVAILABLE(PLAYER3,POWER_CALL_TO_ARMS,1,1)

ENDIF

REM -- Win condition -> Kill Yellow and Heroes Heart
IF(PLAYER3,DUNGEON_DESTROYED == 1)
    IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
        WIN_GAME
    ENDIF
ENDIF

REM -- Lose condition
IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

REM -- Hide hidden portal
CONCEAL_MAP_RECT(PLAYER0,241,220,12,9)

REM -- "There's that smell again"
PLAY_MESSAGE(PLAYER0,SPEECH,96)

REM -- Show Objective
REM "It seems you've taken an interest in this volcano, Keeper. The other keeper here has no idea you've arrived, nor do those pesky heroes. You'll have to make due without much space in order to obliterate your opponents."
DISPLAY_OBJECTIVE(146)

REM -- Show blocked magic message
IF_AVAILABLE(PLAYER0,RESEARCH >= 1)
    REM "Those pretentious heroes have found a way to block all dark research. Destroy them."
    DISPLAY_INFORMATION(147,PLAYER_GOOD)
ENDIF

REM -- Secret Temple
IF_ACTION_POINT(2,PLAYER0)

    REM -- Automatically claim the Temple and make the Horny join your cause
    CHANGE_SLAB_OWNER(7,28,PLAYER0)
    CHANGE_CREATURE_OWNER(PLAYER_NEUTRAL,HORNY,AT_ACTION_POINT[3],PLAYER0)
    REM "You found a secret temple inhabited by a Horned Reaper. It has decided to join your evil cause."
    DISPLAY_INFORMATION(148,3)

    REM -- Give Yellow AI some goodies and try to launch an attack
    ROOM_AVAILABLE(PLAYER3,BRIDGE,1,1)
    MAX_CREATURES(PLAYER3,30)
    COMPUTER_DIG_TO_LOCATION(PLAYER3,PLAYER3,6)
    COMPUTER_DIG_TO_LOCATION(PLAYER3,PLAYER3,1)
    SET_COMPUTER_CHECKS(PLAYER3,"COMPUTER CHECK HATES",200)
    SET_COMPUTER_PROCESS(PLAYER3,"ATTACK PLAN 1",1)
ENDIF

REM -- Hidden portal claimed
IF_SLAB_OWNER(80,73,PLAYER0)
    MAX_CREATURES(PLAYER0,25)
    ADD_CREATURE_TO_POOL(BILE_DEMON,10)
    ADD_CREATURE_TO_POOL(DARK_MISTRESS,10)
ENDIF

REM ----------------------- Hero Parties

CREATE_PARTY(CHEEKY)
ADD_TO_PARTY(CHEEKY,DWARFA,1,100,DEFEND_LOCATION,0)
ADD_TO_PARTY(CHEEKY,DWARFA,1,100,DEFEND_LOCATION,0)

CREATE_PARTY(KNIGHT_FIGHT)
ADD_TO_PARTY(KNIGHT_FIGHT,KNIGHT,10,500,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(KNIGHT_FIGHT,SAMURAI,8,500,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(KNIGHT_FIGHT,SAMURAI,8,500,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(KNIGHT_FIGHT,SAMURAI,8,500,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(KNIGHT_FIGHT,GIANT,7,500,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(KNIGHT_FIGHT,GIANT,7,500,ATTACK_DUNGEON_HEART,0)

REM -- Cheeky Dwarf Party at the start
IF_ACTION_POINT(5,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CHEEKY,5,1)
ENDIF

REM -- Knight Fight in castle
IF_ACTION_POINT(4,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT_FIGHT,4,1)
ENDIF
