Moved mods/ra/lua to mods/common/lua

This commit is contained in:
ScottNZ
2013-12-18 16:09:44 +13:00
parent 23cb4defa3
commit a4f3caa6e7
13 changed files with 36 additions and 36 deletions

View File

@@ -0,0 +1,37 @@
Mission = { }
Mission.MissionOver = function(winners, losers, setWinStates)
World:SetLocalPauseState(true)
World:set_PauseStateLocked(true)
if winners then
for i, player in ipairs(winners) do
Media.PlaySpeechNotification("Win", player)
if setWinStates then
OpenRA.SetWinState(player, "Won")
end
end
end
if losers then
for i, player in ipairs(losers) do
Media.PlaySpeechNotification("Lose", player)
if setWinStates then
OpenRA.SetWinState(player, "Lost")
end
end
end
Mission.MissionIsOver = true
end
Mission.GetGroundAttackersOf = function(player)
return Utils.Where(Actor.ActorsWithTrait("AttackBase"), function(actor)
return not Actor.IsDead(actor) and Actor.IsInWorld(actor) and Actor.Owner(actor) == player and Actor.HasTrait(actor, "Mobile")
end)
end
Mission.TickTakeOre = function(player)
OpenRA.TakeOre(player, 0.01 * OpenRA.GetOreCapacity(player) / 25)
end
Mission.RequiredUnitsAreDestroyed = function(player)
return Internal.RequiredUnitsAreDestroyed(player)
end