Add support for mission objectives

Objectives can be either primary or secondary objectives. Primary ones
influence the outcome of the game.  If all primary objectives are
completed the game is won, and lost when any of them fails.

Objectives can be added at any stage during the game, allowing to react
dynamically to game events.

The objectives backend only contains the information about the
objectives themselves. It does not check if objectives are completed or
failed.  Instead, the state of objectives must be manually marked. The
backend, however, does check whether the game is won or lost.
This commit is contained in:
Oliver Brakmann
2014-07-27 11:00:55 +02:00
parent 09652dad23
commit a3bf3e7403
8 changed files with 228 additions and 1 deletions

View File

@@ -273,6 +273,15 @@ namespace OpenRA.Traits
public interface IObjectivesPanel { string ObjectivesPanel { get; } }
public interface INotifyObjectivesUpdated
{
void OnPlayerWon(Player winner);
void OnPlayerLost(Player loser);
void OnObjectiveAdded(Player player, int objectiveID);
void OnObjectiveCompleted(Player player, int objectiveID);
void OnObjectiveFailed(Player player, int objectiveID);
}
public static class DisableExts
{
public static bool IsDisabled(this Actor a)