REM ********************************************
REM
REM Script for Level 206
REM
REM ********************************************

START_MONEY(ALL_PLAYERS,20000)
COMPUTER_PLAYER(PLAYER1,10)
ALLY_PLAYERS(PLAYER0,PLAYER1)

MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)

IF(PLAYER0,IMP < 1)
    NEXT_COMMAND_REUSABLE
    ADD_CREATURE_TO_LEVEL(PLAYER0,IMP,PLAYER0,3,3,0)
ENDIF

SET_TIMER(PLAYER0,TIMER0)
SET_FLAG(PLAYER0,FLAG0,1)

CREATE_PARTY(ASIGAL)
    ADD_TO_PARTY(ASIGAL,SAMURAI,3,1200,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ASIGAL,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ASIGAL,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ASIGAL,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ASIGAL,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(TOTSUNIN)
    ADD_TO_PARTY(TOTSUNIN,BILE_DEMON,5,1600,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOTSUNIN,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOTSUNIN,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOTSUNIN,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOTSUNIN,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(TSUYOGAL)
    ADD_TO_PARTY(TSUYOGAL,SAMURAI,5,1600,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TSUYOGAL,SAMURAI,2,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TSUYOGAL,SAMURAI,2,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TSUYOGAL,SAMURAI,2,400,ATTACK_DUNGEON_HEART,0)


IF(PLAYER0,TIMER0 > 1200)
    NEXT_COMMAND_REUSABLE
    SET_TIMER(PLAYER0,TIMER0)
    
    IF(PLAYER0,FLAG0 == 1)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ASIGAL,-1,2)
    ENDIF
    
    IF(PLAYER0,FLAG1 == 1)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,-2,5,3,400)
    ENDIF
    
    IF(PLAYER0,FLAG2 == 1)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ASIGAL,-3,1)
    ENDIF
    
    IF(PLAYER0,FLAG3 == 1)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TOTSUNIN,-4,1)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ASIGAL,-4,1)
    ENDIF
    
    IF(PLAYER0,FLAG4 == 1)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TSUYOGAL,-5,2)
    ENDIF
    
    IF(PLAYER0,FLAG5 == 1)
        NEXT_COMMAND_REUSABLE
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TSUYOGAL,-6,3)
    ENDIF
    
    IF(PLAYER0,FLAG0 == 2)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER1,ARCHER,3,5,3,0)
    ENDIF
    
    IF(PLAYER0,FLAG2 == 2)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER1,SAMURAI,5,5,1,0)
    ENDIF
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    SET_FLAG(PLAYER0,FLAG1,1)
    SET_FLAG(PLAYER0,FLAG2,1)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
    SET_FLAG(PLAYER0,FLAG3,1)
    SET_FLAG(PLAYER0,FLAG4,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
    SET_FLAG(PLAYER0,FLAG0,2)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
    SET_FLAG(PLAYER0,FLAG1,0)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
    SET_FLAG(PLAYER0,FLAG2,2)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
    SET_FLAG(PLAYER0,FLAG3,0)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
    SET_FLAG(PLAYER0,FLAG4,0)
ENDIF

IF(PLAYER_GOOD,TOTAL_CREATURES < 3)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TSUYOGAL,-6,2)
    SET_FLAG(PLAYER0,FLAG5,1)
ENDIF

IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
    WIN_GAME
ENDIF
