REM Play Level Sin-king

REM ******* Basic settings *******

SET_GENERATE_SPEED(400)

MAX_CREATURES(PLAYER0,28)

START_MONEY(PLAYER0,10000)
START_MONEY(PLAYER1,9000000)
START_MONEY(PLAYER2,9000000)

COMPUTER_PLAYER(PLAYER_GOOD,0)

ALLY_PLAYERS(PLAYER1,PLAYER2)
ALLY_PLAYERS(PLAYER1,PLAYER_GOOD)
ALLY_PLAYERS(PLAYER2,PLAYER_GOOD)

ADD_CREATURE_TO_POOL(FLY,30)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(SPIDER,12)
ADD_CREATURE_TO_POOL(DEMONSPAWN,12)
ADD_CREATURE_TO_POOL(SORCEROR,12)
ADD_CREATURE_TO_POOL(BILE_DEMON,6)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(HELL_HOUND,20)


REM ********** Available creatures **********

CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)

REM ********** Available rooms **********

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,1,0)

REM ********** Available spells **********

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)

IF(PLAYER0,TOTAL_IMPS < 14)
    NEXT_COMMAND_REUSABLE
    MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
ENDIF

IF(PLAYER0,TOTAL_IMPS >= 14)
    NEXT_COMMAND_REUSABLE
    MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,0,0)
ENDIF

REM ********** Game settings **********

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

SET_CREATURE_HEALTH(KNIGHT,2500)
SET_CREATURE_ARMOUR(KNIGHT,200)
SET_CREATURE_STRENGTH(KNIGHT,200)
SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,THIEF,10)

REM ********** Parties **********

CREATE_PARTY(ONE)
    ADD_TO_PARTY(ONE,KNIGHT,10,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,BARBARIAN,9,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,BARBARIAN,9,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,BARBARIAN,9,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,BARBARIAN,9,100,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
    ADD_TO_PARTY(TWO,WIZARD,8,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,WIZARD,8,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,ARCHER,8,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,ARCHER,8,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TWO,WIZARD,10,100,ATTACK_ENEMIES,0)

REM ********** Triggers & End game **********

DISPLAY_OBJECTIVE(13,PLAYER0)

SET_TIMER(PLAYER0,TIMER0)

IF(PLAYER0,TIMER0 >= 2500)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,1,1,2,0)
    DISPLAY_INFORMATION(17,PLAYER0)
ENDIF

IF(PLAYER0,TIMER0 >= 5000)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,1,1,5,0)
ENDIF

IF(PLAYER0,TIMER0 >= 7500)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,1,1,8,0)
ENDIF

IF(PLAYER0,TIMER0 >= 10000)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,1,1,10,0)
ENDIF

IF(PLAYER0,TIMER0 >= 12000)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,1,2,10,0)
    SET_TIMER(PLAYER0,TIMER1)
ENDIF

SET_FLAG(PLAYER0,FLAG0,0)

IF(PLAYER0,TIMER0 >= 40000)
    SET_FLAG(PLAYER0,FLAG0,1)
    DISPLAY_INFORMATION(18,PLAYER0)
ENDIF

IF(PLAYER0,TIMER0 >= 60000)
    SET_FLAG(PLAYER0,FLAG0,2)
ENDIF

IF(PLAYER0,TIMER1 >= 1500)
    NEXT_COMMAND_REUSABLE
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,1,2,10,0)
    NEXT_COMMAND_REUSABLE
    SET_TIMER(PLAYER0,TIMER1)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,1,2)
    IF(PLAYER_GOOD,KNIGHT == 0)
        WIN_GAME
    ENDIF
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
    IF(PLAYER0,FLAG0 > 0)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,1,1)
        IF(PLAYER0,FLAG0 > 1)
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,1,1)
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(2,PLAYER0)
    DISPLAY_INFORMATION(14,PLAYER0)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
    DISPLAY_INFORMATION(15,PLAYER0)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
    DISPLAY_INFORMATION(16,PLAYER0)
ENDIF
