REM ********************************************
REM  Ancient Keeper campaign for KeeperFX
REM  Script for Level 4
REM  Version 1.00
REM ********************************************

COMPUTER_PLAYER(PLAYER1,0)
COMPUTER_PLAYER(PLAYER3,0)

START_MONEY(PLAYER0,11000)
START_MONEY(PLAYER1,10000)
START_MONEY(PLAYER3,20000)

DISPLAY_OBJECTIVE(11,PLAYER0)

SET_FLAG(PLAYER0,FLAG0,0)

MAGIC_AVAILABLE(PLAYER1,POWER_IMP,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER3,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_CALL_TO_ARMS,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_HEAL_CREATURE,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_SPEED,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_LIGHTNING,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_PROTECT,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_CONCEAL,1,1)

DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)

ADD_CREATURE_TO_POOL(DARK_MISTRESS,15)
ADD_CREATURE_TO_POOL(VAMPIRE,30)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER3,VAMPIRE,1,1)

IF(PLAYER0,IMP > 0)
  MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,1,1)
ENDIF

IF(PLAYER0,GARDEN>0)
  IF(PLAYER0,LAIR>0)
    DISPLAY_INFORMATION(12,PLAYER0)
  ENDIF
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED == 1)
  ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
  ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
  ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
  DISPLAY_OBJECTIVE(13,PLAYER0)
ENDIF

IF(PLAYER0,FLAG0 == 0)
  IF(PLAYER0,TREASURE > 0)
    SET_FLAG(PLAYER0,FLAG0,1)
  ENDIF
ENDIF

IF(PLAYER0,FLAG0 == 0)
  IF(PLAYER0,WORKSHOP > 0)
    SET_FLAG(PLAYER0,FLAG0,1)
  ENDIF
ENDIF

IF(PLAYER0,FLAG0 == 1)
  ROOM_AVAILABLE(PLAYER0,BRIDGE,0,0)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,TENTACLE,2,8,10,3000)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,THIEF,3,8,10,3000)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,4,8,10,3000)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,5,8,10,3000)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DRAGON,6,8,10,3000)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,7,8,10,3000)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,WIZARD,7,8,10,3000)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,8,8,10,3000)
  ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SAMURAI,8,8,10,3000)
ENDIF

IF(PLAYER_GOOD,BRIDGE == 0)
  ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
ENDIF

IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
  DISPLAY_OBJECTIVE(15,PLAYER0)
  WIN_GAME
ENDIF

IF(PLAYER0,TOTAL_CREATURES == 0)
  DISPLAY_OBJECTIVE(14,PLAYER0)
  LOSE_GAME
ENDIF
