Merge pull request #8720 from abcdefg30/parashadow

Use the correct ShadowPalette for d2k paradrops
This commit is contained in:
Matthias Mailänder
2015-07-20 21:56:50 +02:00
9 changed files with 57 additions and 23 deletions

View File

@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
[SequenceReference("ShadowImage")] public readonly string ShadowSequence = null; [SequenceReference("ShadowImage")] public readonly string ShadowSequence = null;
[Desc("Palette used to render the paradropped unit's shadow.")] [Desc("Palette used to render the paradropped unit's shadow.")]
public readonly string ShadowPalette = "player"; public readonly string ShadowPalette = "shadow";
[Desc("Shadow position relative to the paradropped unit's intended landing position.")] [Desc("Shadow position relative to the paradropped unit's intended landing position.")]
public readonly WVec ShadowOffset = new WVec(0, 128, 0); public readonly WVec ShadowOffset = new WVec(0, 128, 0);

View File

@@ -16,7 +16,13 @@ else
ChangeStance = true ChangeStance = true
end end
IdleHunt = function(actor) Trigger.OnIdle(actor, actor.Hunt) end IdleHunt = function(actor)
Trigger.OnIdle(actor, function(a)
if a.IsInWorld then
a.Hunt()
end
end)
end
ProduceUnits = function(factory, count) ProduceUnits = function(factory, count)
if ussr.IsProducing("e1") then if ussr.IsProducing("e1") then

View File

@@ -27,7 +27,13 @@ else
ChangeStance = true ChangeStance = true
end end
IdleHunt = function(actor) Trigger.OnIdle(actor, actor.Hunt) end IdleHunt = function(actor)
Trigger.OnIdle(actor, function(a)
if a.IsInWorld then
a.Hunt()
end
end)
end
Tick = function() Tick = function()
if TeleportJeepCamera and Jeep.IsInWorld then if TeleportJeepCamera and Jeep.IsInWorld then

View File

@@ -36,9 +36,17 @@ ParadropWaypoints = { Paradrop1, Paradrop2, Paradrop3, Paradrop4, Paradrop5, Par
BindActorTriggers = function(a) BindActorTriggers = function(a)
if a.HasProperty("Hunt") then if a.HasProperty("Hunt") then
if a.Owner == allies then if a.Owner == allies then
Trigger.OnIdle(a, a.Hunt) Trigger.OnIdle(a, function(a)
if a.IsInWorld then
a.Hunt()
end
end)
else else
Trigger.OnIdle(a, function(a) a.AttackMove(AlliedTechnologyCenter.Location) end) Trigger.OnIdle(a, function(a)
if a.IsInWorld then
a.AttackMove(AlliedTechnologyCenter.Location)
end
end)
end end
end end

View File

@@ -60,7 +60,11 @@ ParadropSovietUnits = function()
local units = powerproxy.SendParatroopers(MCVDeployLocation.CenterPosition, false, 256 - 53) local units = powerproxy.SendParatroopers(MCVDeployLocation.CenterPosition, false, 256 - 53)
Utils.Do(units, function(a) Utils.Do(units, function(a)
Trigger.OnIdle(a, a.Hunt) Trigger.OnIdle(a, function(actor)
if actor.IsInWorld then
actor.Hunt()
end
end)
end) end)
powerproxy.Destroy() powerproxy.Destroy()

View File

@@ -1252,6 +1252,10 @@ Rules:
powerproxy.paratroopers: powerproxy.paratroopers:
ParatroopersPower: ParatroopersPower:
DropItems: E1,E1,E1,E2,E2 DropItems: E1,E1,E1,E2,E2
powerproxy.allied:
Inherits: powerproxy.paratroopers
ParatroopersPower:
DropItems: ARTY,ARTY,ARTY
CAMERA.sam: CAMERA.sam:
Inherits: CAMERA Inherits: CAMERA
RevealsShroud: RevealsShroud:
@@ -1261,12 +1265,6 @@ Rules:
RevealsShroud: RevealsShroud:
Range: 1000 Range: 1000
ARTY: ARTY:
Parachutable:
KilledOnImpassableTerrain: false
WithParachute:
UpgradeTypes: parachute
UpgradeMinEnabledLevel: 1
Image: parach
UpgradeManager: UpgradeManager:
BodyOrientation: BodyOrientation:
AFLD.mission: AFLD.mission:

View File

@@ -28,7 +28,6 @@ else --Difficulty == "Hard"
LongBowReinforcements = { "heli" } LongBowReinforcements = { "heli" }
end end
AlliedArtilleryParadrops = { "arty", "arty", "arty" }
AlliedAirReinforcementsWaypoints = AlliedAirReinforcementsWaypoints =
{ {
{ AirReinforcementsEntry1.Location, AirReinforcementsEntry2.Location }, { AirReinforcementsEntry1.Location, AirReinforcementsEntry2.Location },
@@ -186,7 +185,11 @@ SendSovietParadrops = function(table)
local units = powerproxy.SendParatroopers(table[2].CenterPosition, false, table[1]) local units = powerproxy.SendParatroopers(table[2].CenterPosition, false, table[1])
Utils.Do(units, function(unit) Utils.Do(units, function(unit)
Trigger.OnIdle(unit, unit.Hunt) Trigger.OnIdle(unit, function(a)
if a.IsInWorld then
a.Hunt()
end
end)
end) end)
end end
@@ -279,21 +282,20 @@ TimerExpired = function()
end end
end end
DropAlliedArtillery = function(table) DropAlliedArtillery = function(facing, dropzone)
local plane = Actor.Create("badr", true, { Owner = allies, Location = table[1] }) local proxy = Actor.Create("powerproxy.allied", true, { Owner = allies })
Utils.Do(AlliedArtilleryParadrops, function(type) proxy.SendParatroopers(dropzone, false, facing)
local unit = Actor.Create(type, false, { Owner = allies }) proxy.Destroy()
plane.LoadPassenger(unit)
end)
plane.Paradrop(table[2])
end end
SendLongBowReinforcements = function() SendLongBowReinforcements = function()
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived") Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
Reinforcements.Reinforce(allies, LongBowReinforcements, AlliedAirReinforcementsWaypoints[1]) Reinforcements.Reinforce(allies, LongBowReinforcements, AlliedAirReinforcementsWaypoints[1])
Reinforcements.Reinforce(allies, LongBowReinforcements, AlliedAirReinforcementsWaypoints[2]) Reinforcements.Reinforce(allies, LongBowReinforcements, AlliedAirReinforcementsWaypoints[2])
if ParadropArtillery then if ParadropArtillery then
DropAlliedArtillery({ Utils.Random(AlliedAirReinforcementsWaypoints)[1], Alliesbase.Location }) local facing = Utils.RandomInteger(Facing.NorthWest, Facing.SouthWest)
DropAlliedArtillery(facing, Alliesbase.CenterPosition)
end end
end end

View File

@@ -35,7 +35,13 @@ ParaWaves =
{ AttackTicks * 3, { "SovietSquad", SovietParaDrop1 } } { AttackTicks * 3, { "SovietSquad", SovietParaDrop1 } }
} }
IdleHunt = function(unit) Trigger.OnIdle(unit, unit.Hunt) end IdleHunt = function(unit)
Trigger.OnIdle(unit, function(a)
if a.IsInWorld then
a.Hunt()
end
end)
end
GuardHarvester = function(unit, harvester) GuardHarvester = function(unit, harvester)
if not unit.IsDead then if not unit.IsDead then

View File

@@ -128,7 +128,11 @@
WithParachute: WithParachute:
UpgradeTypes: parachute UpgradeTypes: parachute
UpgradeMinEnabledLevel: 1 UpgradeMinEnabledLevel: 1
ShadowImage: parach-shadow
ShadowSequence: idle
Image: parach Image: parach
Sequence: idle
OpeningSequence: open
Offset: 0,0,200 Offset: 0,0,200
^Tank: ^Tank: