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

SET_GENERATE_SPEED(400)

START_MONEY(ALL_PLAYERS,10000)

SET_FLAG(PLAYER0,FLAG0,0)

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

ALLY_PLAYERS(PLAYER1,PLAYER2)
ALLY_PLAYERS(PLAYER1,PLAYER3)
ALLY_PLAYERS(PLAYER2,PLAYER3)

DISPLAY_OBJECTIVE(8,PLAYER0)

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

DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)

ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)

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

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

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

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

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

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

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

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

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

IF(PLAYER0,FLAG0 == 1)
  IF(PLAYER0,TOTAL_CREATURES < 1)
    DISPLAY_OBJECTIVE(5,PLAYER0)
    LOSE_GAME
  ENDIF
ENDIF

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