Added notifications for new objectives to scripted missions

Fixes #6692
This commit is contained in:
Oliver Brakmann
2014-10-06 18:01:24 +02:00
parent d288868ca6
commit 36477ae323
9 changed files with 102 additions and 69 deletions

View File

@@ -97,6 +97,16 @@ namespace OpenRA.Mods.RA.Scripting
return mo.Objectives[id].Description;
}
[ScriptActorPropertyActivity]
[Desc("Returns the type of an objective.")]
public string GetObjectiveType(int id)
{
if (id < 0 || id >= mo.Objectives.Count)
throw new LuaException("Objective ID is out of range.");
return mo.Objectives[id].Type == ObjectiveType.Primary ? "Primary" : "Secondary";
}
[ScriptActorPropertyActivity]
[Desc("Returns true if this player has lost all units/actors that have the MustBeDestroyed trait.")]
public bool HasNoRequiredUnits()