I need a bit more explanation in order to understand what you want to happen. That's why I commented the script, so it explains what I thought you wanted it to do,...
Is this it?
- If 5 minutes pass, and the player has no imps, he loses
- If 5 minutes pass, and the player has no imps, the avatar spawns
- If 5 minutes pass, and the player has at least one imp, he does not lose the game, but does not win either,...
That is just this:
Code:
REM When the player has a creature, give him the spell Possess
IF(PLAYER0,TOTAL_CREATURES >= 1)
MAGIC_AVAILABLE(PLAYER0,POWER_POSSESS,1,1)
SET_FLAG(PLAYER1,FLAG1,1)
ENDIF
REM If the player has no creatures anymore, he loses the game.
IF(PLAYER0,FLAG1 = 1)
IF(PLAYER0,TOTAL_CREATURES <= 0)
QUICK_OBJECTIVE(6,"You have no creatures left, which means you are defeated keeper!",PLAYER0)
LOSE_GAME
ENDIF
ENDIF
REM at 5 minutes into the game, take away the icon for the spell Possess
IF(PLAYER0,GAME_TURN >= 6000)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_POSSESS,0,0)
QUICK_OBJECTIVE(8,"5 minutes are up. You now have Possess",ALL_PLAYERS)
ENDIF
REM At 5 minutes, if the player has no imps left, the player is defeated and the avatar spawns.
IF(PLAYER0,GAME_TURN >= 6000)
IF_CONTROLS(PLAYER0, IMP <= 0)
ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFEAT,4,1)
QUICK_OBJECTIVE(7,"You failed to rescue your imps in time. You have been defeated!",ALL_PLAYERS)
LOSE_GAME
ENDIF
ENDIF
In this code there are 2 lose conditions, if all your creatures are defeated, or if in 5 minutes time you have no imps.
Does this work?