REM Dixaroc

COMPUTER_PLAYER(PLAYER1,2)
COMPUTER_PLAYER(PLAYER2,2)

SET_GENERATE_SPEED(25)

MAX_CREATURES(PLAYER0,50)

START_MONEY(PLAYER0,0)
START_MONEY(PLAYER1,5)
START_MONEY(PLAYER2,5000)

DISPLAY_OBJECTIVE(925,PLAYER0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,0)

MAGIC_AVAILABLE(PLAYER2,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_SLAP,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_SIGHT,1,0) 
MAGIC_AVAILABLE(PLAYER2,POWER_OBEY,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_LIGHTNING,1,0)

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

ROOM_AVAILABLE(PLAYER2,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER2,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER2,WORKSHOP,1,1)
ROOM_AVAILABLE(PLAYER2,TORTURE,1,1)
ROOM_AVAILABLE(PLAYER2,BARRACKS,1,0)
ROOM_AVAILABLE(PLAYER2,TRAINING,1,1)

TRAP_AVAILABLE(PLAYER2,LIGHTNING,1,0)
TRAP_AVAILABLE(PLAYER2,POISON_GAS,1,0)

CREATE_PARTY(START_ONE)
	ADD_TO_PARTY(START_ONE,DWARFA,4,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(START_ONE,DWARFA,4,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(START_ONE,BARBARIAN,2,0,ATTACK_ENEMIES,0)		
	ADD_TO_PARTY(START_ONE,BARBARIAN,2,0,ATTACK_ENEMIES,0)		
	ADD_TO_PARTY(START_ONE,BARBARIAN,2,0,ATTACK_ENEMIES,0)

CREATE_PARTY(START_TWO)
	ADD_TO_PARTY(START_TWO,DWARFA,2,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(START_TWO,DWARFA,2,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(START_TWO,BARBARIAN,2,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(START_TWO,BARBARIAN,2,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(START_TWO,BARBARIAN,2,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_ONE)
	ADD_TO_PARTY(ATTACK_ONE,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ATTACK_ONE,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ATTACK_ONE,ARCHER,3,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ATTACK_ONE,DWARFA,2,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ATTACK_ONE,DWARFA,2,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(ATTACK_TWO)
	ADD_TO_PARTY(ATTACK_TWO,FAIRY,2,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ATTACK_TWO,FAIRY,2,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ATTACK_TWO,MONK,4,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ATTACK_TWO,MONK,4,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ATTACK_TWO,MONK,4,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(SHOCK_ONE)
	ADD_TO_PARTY(SHOCK_ONE,SAMURAI,3,200,ATTACK_DUNGEON_HEART,0)
	
CREATE_PARTY(SHOCK_TWO)
	ADD_TO_PARTY(SHOCK_TWO,THIEF,4,0,STEAL_GOLD,0)

CREATE_PARTY(SHOCK_THREE)
	ADD_TO_PARTY(SHOCK_TWO,GIANT,2,0,ATTACK_ROOMS,0)
	ADD_TO_PARTY(SHOCK_TWO,BARBARIAN,2,0,ATTACK_ROOMS,0)

CREATE_PARTY(DOOR_ONE)
	ADD_TO_PARTY(DOOR_ONE,DWARFA,7,250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DOOR_ONE,ARCHER,6,250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DOOR_ONE,ARCHER,5,250,ATTACK_ENEMIES,0)

CREATE_PARTY(WIZARD_ONE)
	ADD_TO_PARTY(WIZARD_ONE,ARCHER,3,250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZARD_ONE,ARCHER,6,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZARD_ONE,ARCHER,2,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZARD_ONE,ARCHER,5,450,ATTACK_ENEMIES,0)

CREATE_PARTY(WIZARD_TWO)
	ADD_TO_PARTY(WIZARD_TWO,BARBARIAN,5,550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZARD_TWO,BARBARIAN,6,600,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZARD_TWO,MONK,5,550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZARD_TWO,MONK,7,650,ATTACK_ENEMIES,0)

CREATE_PARTY(WIZARD_THREE)
	ADD_TO_PARTY(WIZARD_THREE,GIANT,8,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(WIZARD_THREE,ARCHER,6,0,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(WIZARD_THREE,ARCHER,5,0,ATTACK_DUNGEON_HEART,0)

IF_ACTION_POINT(1,PLAYER0)
	SET_TIMER(PLAYER_GOOD,TIMER0)
	IF(PLAYER_GOOD,TIMER0 >= 100)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,START_ONE,3,1)
	ENDIF
ENDIF

IF_ACTION_POINT(2,PLAYER0)
	SET_TIMER(PLAYER_GOOD,TIMER1)
	IF(PLAYER_GOOD,TIMER1 >= 50)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,START_TWO,4,1)
	ENDIF
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,6,4,8,0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,7,4,8,0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,8,4,8,0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,9,4,8,0)
ENDIF

IF(PLAYER0,IMP >= 1)
	DISPLAY_INFORMATION(926)
	SET_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED == 1)
	DISPLAY_INFORMATION(928)
	ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
	SET_TIMER(PLAYER_GOOD,TIMER2)
	IF(PLAYER_GOOD,TIMER2 >= 700)
		DISPLAY_INFORMATION(929)
		SET_TIMER(PLAYER_GOOD,TIMER2)
		IF(PLAYER_GOOD,TIMER2 >= 50)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_ONE,-1,2)
			SET_TIMER(PLAYER_GOOD,TIMER2)
			IF(PLAYER_GOOD,TIMER2 >= 15)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_TWO,-1,1)
			ENDIF
		ENDIF
	ENDIF
ENDIF

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

IF_ACTION_POINT(10,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SHOCK_ONE,11,3)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SHOCK_TWO,12,3)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SHOCK_THREE,13,5)
	SET_TIMER(PLAYER_GOOD,TIMER3)
ENDIF

IF_ACTION_POINT(14,PLAYER0)
	DISPLAY_INFORMATION(930)
ENDIF

IF_ACTION_POINT(15,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DOOR_ONE,-2,2)
ENDIF

IF_ACTION_POINT(16,PLAYER0)
	SET_TIMER(PLAYER_GOOD,TIMER4)
	IF(PLAYER_GOOD,TIMER4 >=100)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WIZARD_ONE,17,1)
		IF(PLAYER_GOOD,TIMER4 >=250)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WIZARD_TWO,18,1)
			IF(PLAYER_GOOD,TIMER4>=500)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WIZARD_THREE,19,1)
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF_ACTION_POINT(20,PLAYER0)
	DISPLAY_INFORMATION(931)
ENDIF

REM		*** ONCE THE WIZARD DIES ***

IF(PLAYER_GOOD,WIZARD < 1)
	ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,0)
	ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
	ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
	ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
	ROOM_AVAILABLE(PLAYER0,BARRACKS,1,1)
	ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
	MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
	MAGIC_AVAILABLE(PLAYER0,POWER_SIGHT,1,0)
	MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
	MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,1,0)
	MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
	MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)
	MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)
	MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,0)
	MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,1,0)
	DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
	DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
	DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
	TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
	TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
	TRAP_AVAILABLE(ALL_PLAYERS,LAVA,1,0)
	DISPLAY_OBJECTIVE(932,PLAYER0)
ENDIF

IF(PLAYER0,TOTAL_CREATURES == 0)
	IF(PLAYER0,FLAG1 == 0)
		LOSE_GAME
	ENDIF
ENDIF

IF(PLAYER0,TOTAL_IMPS == 0)
	IF(PLAYER0,FLAG1 == 1)
		IF_AVAILABLE(PLAYER0,POWER_IMP == 0)
			IF(PLAYER0,RESEARCH == 0)
				LOSE_GAME
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
	DISPLAY_OBJECTIVE(907,PLAYER0)
ENDIF

REM		*** WIN GAME CONDITIONS ***

IF(PLAYER_GOOD,WIZARD < 1)
	IF(PLAYER1,DUNGEON_DESTROYED == 1)
		IF(PLAYER2,DUNGEON_DESTROYED == 1)
			WIN_GAME
		ENDIF
	ENDIF
ENDIF

IF(PLAYER0,BILE_DEMON >= 1)
	DISPLAY_INFORMATION(927,PLAYER0)
ENDIF