Remove the temperate RA shellmap and port the desert shellmap to Lua.

This commit is contained in:
ScottNZ
2014-03-02 18:47:24 +13:00
parent 79d1a944bc
commit 7d43ecc33f
17 changed files with 858 additions and 2277 deletions

View File

@@ -2,8 +2,8 @@ SupportPowers = { }
SupportPowers.Airstrike = function(owner, planeName, enterLocation, bombLocation)
local facing = { Map.GetFacing(CPos.op_Subtraction(bombLocation, enterLocation), 0), "Int32" }
local altitude = { Rules.TraitInfo(planeName, "AircraftInfo").CruiseAltitude, "Int32" }
local plane = Actor.Create(planeName, { Location = enterLocation, Owner = owner, Facing = facing, Altitude = altitude })
local center = WPos.op_Addition(enterLocation.CenterPosition, WVec.New(0, 0, Rules.InitialAltitude(planeName)))
local plane = Actor.Create(planeName, { Location = enterLocation, Owner = owner, Facing = facing, CenterPosition = center })
Actor.Trait(plane, "AttackBomber"):SetTarget(bombLocation.CenterPosition)
Actor.Fly(plane, bombLocation.CenterPosition)
Actor.FlyOffMap(plane)
@@ -13,8 +13,8 @@ end
SupportPowers.Paradrop = function(owner, planeName, passengerNames, enterLocation, dropLocation)
local facing = { Map.GetFacing(CPos.op_Subtraction(dropLocation, enterLocation), 0), "Int32" }
local altitude = { Rules.TraitInfo(planeName, "AircraftInfo").CruiseAltitude, "Int32" }
local plane = Actor.Create(planeName, { Location = enterLocation, Owner = owner, Facing = facing, Altitude = altitude })
local center = WPos.op_Addition(enterLocation.CenterPosition, WVec.New(0, 0, Rules.InitialAltitude(planeName)))
local plane = Actor.Create(planeName, { Location = enterLocation, Owner = owner, Facing = facing, CenterPosition = center })
Actor.FlyAttackCell(plane, dropLocation)
Actor.Trait(plane, "ParaDrop"):SetLZ(dropLocation)
local cargo = Actor.Trait(plane, "Cargo")
@@ -25,4 +25,17 @@ SupportPowers.Paradrop = function(owner, planeName, passengerNames, enterLocatio
cargo:Load(plane, passenger)
end
return plane, passengers
end
SupportPowers.Chronoshift = function(unitLocationPairs, chronosphere, duration, killCargo)
duration = duration or -1
killCargo = killCargo or true
Utils.Do(unitLocationPairs, function(pair)
local unit = pair[1]
local cell = pair[2]
local cs = Actor.TraitOrDefault(unit, "Chronoshiftable")
if cs ~= nil and cs:CanChronoshiftTo(unit, cell) then
cs:Teleport(unit, cell, duration, killCargo, chronosphere)
end
end)
end