REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for Bonus Level - First Person Hidden Realm (originally 1st bonus)
REM  Campaign: DK Original
REM  Authors:  based on Bullfrog script
REM         KeeperFX CCP Team
REM  Date:   17 Aug 1997 - 02 Nov 2013
REM  Copying and copyrights:
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation; either version 2 of the License, or
REM (at your option) any later version.
REM ****************************************************************************

START_MONEY(PLAYER0,0)
LEVEL_VERSION(1)

CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,DWARFA,3,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,DWARFA,3,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,DWARFA,3,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,THIEF,3,300,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,ARCHER,3,400,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,3,400,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,3,400,ATTACK_ENEMIES,0)

CREATE_PARTY(THREE)
	ADD_TO_PARTY(THREE,WIZARD,5,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,SAMURAI,5,700,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,SAMURAI,5,700,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,SAMURAI,5,700,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,SAMURAI,5,700,ATTACK_ENEMIES,0)

CREATE_PARTY(FOUR)
	ADD_TO_PARTY(FOUR,MONK,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,MONK,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,MONK,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,FAIRY,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,FAIRY,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,FAIRY,8,2000,ATTACK_ENEMIES,0)

REM "Powerful magic permeating through the rock from the realm above prevents a dungeon from being constructed here. You will have to conquer this realm another way."
DISPLAY_OBJECTIVE(137,PLAYER0)

IF(PLAYER0,GAME_TURN >= 60)
	REM "Possess this Dragon to help you negotiate the fiery pits but be prepared to transfer your soul to a more appropriate creature when the situation demands it."
	DISPLAY_INFORMATION(138)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,2,1)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,3,1,3,0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,4,1,3,0)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,THIEF,5,4,3,0)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,7,4,3,0)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-1,1)
ENDIF

IF_ACTION_POINT(9,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-2,1)
ENDIF

SET_TIMER(PLAYER0,TIMER3)
IF(PLAYER0,TIMER3 > 30)
	NEXT_COMMAND_REUSABLE
	CREATE_EFFECTS_LINE(10,10,64,14,40,44)
	NEXT_COMMAND_REUSABLE
	CREATE_EFFECTS_LINE(10,10,-64,14,40,44)
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER0,TIMER3)
ENDIF

IF_ACTION_POINT(11,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,11,1)
ENDIF

IF_ACTION_POINT(12,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,13,1,5,100)
ENDIF

IF_ACTION_POINT(14,PLAYER0)
	CHANGE_SLAB_OWNER(6,17,PLAYER0)
	PLAY_MESSAGE(PLAYER0,SOUND,116)
ENDIF
IF_ACTION_POINT(15,PLAYER0)
	CHANGE_SLAB_OWNER(8,34,PLAYER0)
	PLAY_MESSAGE(PLAYER0,SOUND,116)
ENDIF
IF_ACTION_POINT(16,PLAYER0)
	CHANGE_SLAB_OWNER(20,23,PLAYER0)
	PLAY_MESSAGE(PLAYER0,SOUND,116)
ENDIF
IF_ACTION_POINT(17,PLAYER0)
	CHANGE_SLAB_OWNER(56,6,PLAYER0)
	PLAY_MESSAGE(PLAYER0,SOUND,116)
ENDIF

IF_ACTION_POINT(18,PLAYER0)
	CHANGE_SLAB_OWNER(3,10,PLAYER0,MATCH)
	PLAY_MESSAGE(PLAYER0,SOUND,116)
ENDIF

IF_ACTION_POINT(10,PLAYER0)
	SET_FLAG(PLAYER0,FLAG1,1)
ENDIF
IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
	SET_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER0,FLAG1 == 1)
	LEVEL_UP_CREATURE(PLAYER0,VAMPIRE,ANYWHERE,9)
	SET_TIMER(PLAYER0,TIMER1)
	BONUS_LEVEL_TIME(0)
ENDIF

IF(PLAYER0,VAMPIRE >= 1)
	REM "Possess the Vampire below. Should you succeed in killing every hero in this region, the Vampire will accompany you to the realm beyond."
	DISPLAY_OBJECTIVE(139,PLAYER0)
ENDIF

SET_TIMER(PLAYER0,TIMER0)
BONUS_LEVEL_TIME(76666)

IF(PLAYER0,TIMER0 >= 76666)
	LOSE_GAME
ENDIF

IF(PLAYER0,TOTAL_CREATURES == 0)
	LOSE_GAME
ENDIF

IF(PLAYER0,TIMER1 >= 60)
	WIN_GAME
ENDIF
