REM ********************************************
REM
REM Script for Level 202
REM
REM ********************************************

REM **********     SETUP COMMANDS     **********


REM ***** Set the Generation Speed of the  *****
REM ***** Entrances                        *****
REM ***** I left this as 500 because I     *****
REM ***** don't know how fast I should let *****
REM ***** it go		(LP)		   *****

SET_GENERATE_SPEED(500)


REM ***** Set the computer players going   *****
REM ***** Type 0 is a general player with  *****
REM ***** everything turned on (LP)        *****
REM ***** Type 4 is defensive 4X4 (LP)     *****


REM Player		Player Type

COMPUTER_PLAYER(PLAYER1,4)


REM ***** Set the maximum number of        *****
REM ***** creatures each player can have   *****
REM ***** 30 seems O.K. (LP)               *****


REM Player		Number of creatures

MAX_CREATURES(PLAYER0,30)
MAX_CREATURES(PLAYER1,30)


REM ***** Set the amount of gold each      *****
REM ***** player starts with               *****
REM ***** Again, 10000 seems O.K. (LP)     *****

REM Player		Amount of gold

START_MONEY(PLAYER0,10000)
START_MONEY(PLAYER1,10000)




REM **********       SET MAGIC        **********
REM **********     AND CREATURES      **********

REM ***** Setup the creature pool          *****
REM ***** Seems fine for a default (LP)    *****

REM Creature Name	Number of creatures

ADD_CREATURE_TO_POOL(BUG,10)
ADD_CREATURE_TO_POOL(FLY,10)
ADD_CREATURE_TO_POOL(SPIDER,5)
ADD_CREATURE_TO_POOL(SORCEROR,30)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(TROLL,10)
ADD_CREATURE_TO_POOL(ORC,10)
ADD_CREATURE_TO_POOL(HELL_HOUND,10)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,10)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)


REM ***** Enable each player to recieve    *****
REM ***** creatures from pool              *****

REM Player		Creatures	Can be available	Is now available

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


REM ***** Set the rooms available to each  *****
REM ***** player                           *****
REM ***** (LP)                             *****

REM Player		Room type	Can be available	Is available

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)

ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BRIDGE,1,0)


REM ***** Set the doors available to each  *****
REM ***** player                           *****
REM ***** All but magic can be researched  *****
REM ***** None available from start  (LP)  *****

REM Player		Door type		Can be available	Is available

DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,0,0)


REM ***** Set the traps available to each  *****
REM ***** player                           *****

REM Player		Trap type		Can be available	Is available

TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,ALARM,0,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,0,0)
TRAP_AVAILABLE(ALL_PLAYERS,LAVA,1,0)


REM ***** Set the spells available to each *****
REM ***** player                           *****

REM Player		Spell type		Can be available	Is available

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,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(ALL_PLAYERS,POWER_HOLD_AUDIENCE,0,0)
MAGIC_AVAILABLE(ALL_PLAYERS,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(ALL_PLAYERS,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,0,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,0,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_ARMAGEDDON,0,0)




REM **********  ADJUST ANY CREATURE   **********
REM ********** OR RESEARCH STATISTICS **********




REM ********** SETUP FLAGS AND TIMERS **********




REM **********     CREATE AND ADD     **********
REM **********  CREATURES TO PARTIES  **********

REM ***** I have 3 parties of heroes to    *****
REM ***** create. The first (PARTY1) will  *****
REM ***** appear at Hero Door 1 when       *****
REM ***** PLAYER0 reaches A.P.1            *****
REM ***** The second (PARTY2) will         *****
REM ***** appear at Action Point 2 when    *****
REM ***** PLAYER0's money >=30000          *****
REM ***** The last party (PARTY3) will     *****
REM ***** will appear at Action Point 2    *****
REM ***** when PLAYER0's money >=40000     *****


REM ***** Create any parties               *****

REM Party Name

CREATE_PARTY(PARTY1)
CREATE_PARTY(PARTY2)
CREATE_PARTY(PARTY3)


REM ***** Add creatures to those parties   *****

REM Party Name	Creature Name	Experience 	Amount of Gold	Objective		Countdown

    ADD_TO_PARTY(PARTY1,KNIGHT,10,5000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(PARTY1,ARCHER,8,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(PARTY1,WIZARD,9,2000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(PARTY1,FAIRY,7,1500,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(PARTY1,WITCH,6,1200,ATTACK_DUNGEON_HEART,0)


    ADD_TO_PARTY(PARTY2,DWARFA,6,200,STEAL_GOLD,0)
    ADD_TO_PARTY(PARTY2,MONK,5,600,STEAL_GOLD,0)
    ADD_TO_PARTY(PARTY2,MONK,5,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(PARTY2,WIZARD,6,500,STEAL_SPELLS,0)
    ADD_TO_PARTY(PARTY2,SAMURAI,6,500,ATTACK_ROOMS,0)


    ADD_TO_PARTY(PARTY3,DWARFA,9,200,STEAL_GOLD,0)
    ADD_TO_PARTY(PARTY3,MONK,8,600,STEAL_GOLD,0)
    ADD_TO_PARTY(PARTY3,MONK,8,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(PARTY3,WIZARD,9,500,STEAL_SPELLS,0)
    ADD_TO_PARTY(PARTY3,SAMURAI,9,500,ATTACK_ROOMS,0)





REM **********      MAIN SCRIPT       **********


REM **********      IF COMMANDS       **********


REM ***** The IF commands which will       *****
REM ***** spring the parties on the player *****


REM ***** First, detect whether a creature *****
REM ***** has crossed the boundary of the  *****
REM ***** first Action Point  (LP)         *****

REM Action Point	Which player you want to detect

IF_ACTION_POINT(1,PLAYER0)
    
    REM ***** If the Action Point has been     *****
    REM ***** triggered then add PARTY1  (LP)  *****
    
    REM The player the Tunneller is assigned to		Party Name	Action Point or Hero Door	Head for	Player to head for	Experience	Gold
    
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY1,-1,DUNGEON_HEART,1,9,4000)
    
    
    REM ***** The message displayed on         *****
    REM ***** triggering the main party        *****
    
    QUICK_INFORMATION(4,"You must hurry, the townspeople will be here soon.")
    
    
ENDIF



REM ***** Next, detect when PLAYER0's cash *****
REM ***** reaches 40000 and,               *****
REM ***** add PARTY2 to the map    (LP)    *****

REM Player whose variable you want to look at	The variable name	Comparison	Value

IF(PLAYER0,MONEY >= 40000)
    
    
    REM The player the Tunneller is assigned to		Party Name	Action Point or Hero Door	Head for	Player to head for	Experience	Gold
    
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY2,2,DUNGEON_HEART,0,6,2000)
    
    REM ***** The message displayed on         *****
    REM ***** triggering the first cash party  *****
    
    QUICK_INFORMATION(2,"Your wealth has attracted the attentions of a bunch of mercenaries. Be prepared.")
    
    
    
ENDIF


REM ***** Next, detect when PLAYER0's cash *****
REM ***** reaches 60000 and,               *****
REM ***** add PARTY3 to the map    (LP)    *****

REM Player whose variable you want to look at	The variable name	Comparison	Value

IF(PLAYER0,MONEY >= 60000)
    
    
    REM The player the Tunneller is assigned to		Party Name	Action Point or Hero Door	Head for	Player to head for	Experience	Gold
    
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY3,2,DUNGEON_HEART,0,6,2000)
    
    
    REM ***** The message displayed on         *****
    REM ***** triggering the first cash party  *****
    
    QUICK_INFORMATION(3,"Your increasing opulence draws more fools. These are better armed. Though I'm sure that will be no problem.")
    
    
    
ENDIF


REM **********     OBJECTIVES AND     **********
REM **********      INFORMATION       **********


REM ***** I don't want to include any      *****
REM ***** objectives and information as    *****
REM ***** you can only view them on levels *****
REM ***** specifically designed for The    *****
REM ***** Deeper Dungeons. Since this      *****
REM ***** level is an example level, it    *****
REM ***** would be unfair to those who     *****
REM ***** have not bought The Deeper       *****
REM ***** Dungeons to include them.        *****
REM ***** Instead, I have written them as  *****
REM ***** REM statements. If you have The  *****
REM ***** Deeper Dungeons and you want to  *****
REM ***** see the level running with the   *****
REM ***** objectives, just remove the REM  *****
REM ***** statements from the start of the *****
REM ***** lines                            *****


REM ***** Starting objective               *****

REM Objective Number	Objective Text (must be within quotes)																					Player

QUICK_INFORMATION(1,"Your brother, a fellow keeper, has foolishly left his dungeon with a skeleton staff in charge while he ravages a neighbouring land.")
IF(PLAYER0,GAME_TURN > 100)
QUICK_OBJECTIVE(2,"The ungrateful good in your brothers' area sense his absence and are approaching to destroy his dungeon. You merely want to prove that blood is not thicker than a stiletto blade between the ribs.",PLAYER0)
ENDIF


REM ***** Objective if the Hero Dungeon is *****
REM ***** destroyed                        *****

REM Objective Number	Objective Text (must be within quotes)											Player

REM QUICK_OBJECTIVE(	0,			"The corpses of the good lie strewn around you. Now go, and conquer your rival on this land. Dominion awaits ...",	PLAYER0)




REM **********      WIN AND LOSE      **********


REM ***** These are criteria you have to   *****
REM ***** set to enable the player to win  *****
REM ***** the level. I will not include a  *****
REM ***** lose game command as the player  *****
REM ***** will automatically lose when     *****
REM ***** their Dungeon Heart is destroyed *****

REM Player		Variable		Comparison	Value

IF(PLAYER1,DUNGEON_DESTROYED == 1)
    
    WIN_GAME
    
ENDIF
