REM titan2.txt - 4 apt, 1 hg(se), 2 enemy keepers
REM Map made by Kontrare in 2005.
REM In 2015 a fix for endless spawning parties was made by Loobinex, and objectives were added.
REM in 2020 dayokay converted the objectives to use a dedicated pot file

SET_GENERATE_SPEED(400)
START_MONEY(ALL_PLAYERS,8000)

COMPUTER_PLAYER(PLAYER1,1)
COMPUTER_PLAYER(PLAYER2,1)

MAX_CREATURES(ALL_PLAYERS,25)

ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,30)

CREATURE_AVAILABLE(PLAYER1,ORC,1,1)
CREATURE_AVAILABLE(PLAYER2,ORC,1,1)
CREATURE_AVAILABLE(PLAYER1,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER2,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER1,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER2,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER1,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER2,BILE_DEMON,1,1)

SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,SORCEROR,7)
SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,DRAGON,8)
SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,DARK_MISTRESS,9)

SET_CREATURE_MAX_LEVEL(PLAYER_GOOD,FAIRY,3)


IF(PLAYER0,LAIR > 0)
    ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
ENDIF

IF(PLAYER0,TREASURE > 0)
    ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ENDIF

IF(PLAYER0,GARDEN > 0)
    ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
ENDIF

IF(PLAYER0,RESEARCH > 0)
    ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
    ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)
ENDIF


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_CALL_TO_ARMS,1,1)

MAGIC_AVAILABLE(PLAYER0,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,1)

IF(PLAYER0,WORKSHOP > 0)
	ADD_CREATURE_TO_LEVEL(PLAYER0,TROLL,PLAYER0,1,5,0)
	DOOR_AVAILABLE(PLAYER0,MAGIC,1,1)
	TRAP_AVAILABLE(PLAYER0,LIGHTNING,1,0)
	TRAP_AVAILABLE(PLAYER0,BOULDER,1,0)
	DISPLAY_OBJECTIVE(17,PLAYER_GOOD)
ENDIF

REM ++++++++++++++++++++++++++++++++++++++++++++++++
REM ++++++++++++++++++++++++++++++++++++++++++++++++

CREATE_PARTY(MIX)
    ADD_TO_PARTY(MIX,THIEF,5,500,STEAL_GOLD,0)
    ADD_TO_PARTY(MIX,WITCH,5,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MIX,MONK,5,0,DEFEND_PARTY,0)
    ADD_TO_PARTY(MIX,SAMURAI,5,0,DEFEND_PARTY,0)
    ADD_TO_PARTY(MIX,BARBARIAN,5,0,DEFEND_PARTY,0)

CREATE_PARTY(WRECK)
    ADD_TO_PARTY(WRECK,DWARFA,2,0,ATTACK_ROOMS,0)
    ADD_TO_PARTY(WRECK,DWARFA,3,0,ATTACK_ROOMS,0)
    ADD_TO_PARTY(WRECK,DWARFA,3,0,ATTACK_ROOMS,0)

CREATE_PARTY(WING)
    ADD_TO_PARTY(WING,FAIRY,3,0,DEFEND_PARTY,0)
    ADD_TO_PARTY(WING,WITCH,5,0,ATTACK_ENEMIES,0)


IF(PLAYER0,TORTURE > 0)
    ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)
    ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,0)
    ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,3,DUNGEON,1,3,500)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,4,DUNGEON,2,3,500)
ENDIF

REM ++++++++++++++++++++++++++++++++++++++++++++++++
REM ++++++++++++++++++++++++++++++++++++++++++++++++

DISPLAY_OBJECTIVE(16,ALL_PLAYERS)

SET_TIMER(PLAYER1,TIMER0)
SET_TIMER(PLAYER2,TIMER0)

REM ++++++++++++++++++++++++++++++++++++++++++++++++

IF(PLAYER1,TOTAL_IMPS < 3)
    IF(PLAYER1,TIMER0 >= 1500)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER1,IMP,PLAYER1,5,1,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER1,TIMER0)
    ENDIF
ENDIF

REM ++++++++++++++++++++++++++++++++++++++++++++++++
IF(PLAYER2,TOTAL_IMPS < 3)
    IF(PLAYER2,TIMER0 >= 1500)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER2,IMP,PLAYER2,5,1,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER2,TIMER0)
    ENDIF
ENDIF
REM ++++++++++++++++++++++++++++++++++++++++++++++++

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
    SET_TIMER(PLAYER_GOOD,TIMER0)
	SET_TIMER(PLAYER_GOOD,TIMER2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,2,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WING,3,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WING,4,2)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,AVATAR,1,1,10,5000)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,1,1,10,1000)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,1,1,10,1000)
    ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,1)
    ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,1)
    DOOR_AVAILABLE(PLAYER1,STEEL,1,0)
    DOOR_AVAILABLE(PLAYER2,STEEL,1,0)
ENDIF

REM ++++++++++++++++++++++++++++++++++++++++++++++++

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
    IF(PLAYER_GOOD,TIMER2 >= 5800)
	REM IF(PLAYER0,BARRACKS > 0)
        IF(PLAYER_GOOD,FAIRY < 3)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WING,1,8)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,3,1)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,4,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER_GOOD,TIMER2)
        ENDIF
    ENDIF
ENDIF

REM ++++++++++++++++++++++++++++++++++++++++++++++++
REM ++++++++++++++++++++++++++++++++++++++++++++++++

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
    IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 0)
        IF(PLAYER_GOOD,TOTAL_CREATURES < 5)
            IF(PLAYER_GOOD,TIMER0 >= 7300)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,1,1)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,3,1)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,4,1)
                NEXT_COMMAND_REUSABLE
                SET_TIMER(PLAYER_GOOD,TIMER0)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER_GOOD,TENTACLE == 0)
    SET_TIMER(PLAYER_GOOD,TIMER1)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 0)
    IF(PLAYER_GOOD,TIMER1 >= 4300)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX,4,1)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER1)
    ENDIF
ENDIF

IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
    IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
        DISPLAY_OBJECTIVE(15,ALL_PLAYERS)
	WIN_GAME
    ENDIF
ENDIF
