Visible cargo for LST
This commit is contained in:
@@ -61,6 +61,7 @@
|
|||||||
<Compile Include="DeadBuildingState.cs" />
|
<Compile Include="DeadBuildingState.cs" />
|
||||||
<Compile Include="Missions\Gdi01Script.cs" />
|
<Compile Include="Missions\Gdi01Script.cs" />
|
||||||
<Compile Include="RenderGunboat.cs" />
|
<Compile Include="RenderGunboat.cs" />
|
||||||
|
<Compile Include="RenderCargo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||||
|
|||||||
41
OpenRA.Mods.Cnc/RenderCargo.cs
Normal file
41
OpenRA.Mods.Cnc/RenderCargo.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see LICENSE.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.Mods.RA;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.Cnc
|
||||||
|
{
|
||||||
|
class RenderCargoInfo : ITraitInfo, ITraitPrerequisite<CargoInfo>
|
||||||
|
{
|
||||||
|
public object Create(ActorInitializer init) { return new RenderCargo(init.self); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RenderCargo : IRenderModifier
|
||||||
|
{
|
||||||
|
Cargo cargo;
|
||||||
|
|
||||||
|
public RenderCargo(Actor self)
|
||||||
|
{
|
||||||
|
cargo = self.Trait<Cargo>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
|
||||||
|
{
|
||||||
|
foreach (var c in cargo.Passengers)
|
||||||
|
c.CenterLocation = self.CenterLocation;
|
||||||
|
|
||||||
|
return r.Concat(cargo.Passengers.SelectMany(a => a.Render()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderCursor, IOrderVoice
|
public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderCursor, IOrderVoice
|
||||||
{
|
{
|
||||||
List<Actor> cargo = new List<Actor>();
|
List<Actor> cargo = new List<Actor>();
|
||||||
|
public IEnumerable<Actor> Passengers { get { return cargo; } }
|
||||||
|
|
||||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -447,4 +447,5 @@ Rules:
|
|||||||
LocalPlayerFromMap:
|
LocalPlayerFromMap:
|
||||||
-CreateMPPlayers:
|
-CreateMPPlayers:
|
||||||
-SpawnMPUnits:
|
-SpawnMPUnits:
|
||||||
|
-ConquestVictoryConditions:
|
||||||
Gdi01Script:
|
Gdi01Script:
|
||||||
|
|||||||
@@ -106,6 +106,7 @@
|
|||||||
<!-- Hovercraft -->
|
<!-- Hovercraft -->
|
||||||
<unit name="lst">
|
<unit name="lst">
|
||||||
<sequence name="idle" start="0" facings="1" />
|
<sequence name="idle" start="0" facings="1" />
|
||||||
|
<sequence name="unload" start="0" facings="1" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- Gunboat -->
|
<!-- Gunboat -->
|
||||||
<unit name="boat">
|
<unit name="boat">
|
||||||
|
|||||||
@@ -556,6 +556,8 @@ LST:
|
|||||||
RevealsShroud:
|
RevealsShroud:
|
||||||
Range: 7
|
Range: 7
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
|
BelowUnits:
|
||||||
|
RenderCargo:
|
||||||
Cargo:
|
Cargo:
|
||||||
Types: Infantry, Vehicle
|
Types: Infantry, Vehicle
|
||||||
Passengers: 5
|
Passengers: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user