de-legacied Minelayer
This commit is contained in:
@@ -2,7 +2,15 @@
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class MinelayerInfo : StatelessTraitInfo<Minelayer> { }
|
||||
class MinelayerInfo : ITraitInfo
|
||||
{
|
||||
public readonly string Mine = "minv";
|
||||
|
||||
public object Create( Actor self )
|
||||
{
|
||||
return new Minelayer();
|
||||
}
|
||||
}
|
||||
|
||||
class Minelayer : IIssueOrder, IResolveOrder
|
||||
{
|
||||
@@ -33,7 +41,7 @@ namespace OpenRa.Game.Traits
|
||||
// todo: delay a bit? (req making deploy-mine an activity)
|
||||
|
||||
Game.world.AddFrameEndTask(
|
||||
w => w.Add(new Actor(self.LegacyInfo.Primary, self.Location, self.Owner)));
|
||||
w => w.Add(new Actor(self.Info.Traits.Get<MinelayerInfo>().Mine, self.Location, self.Owner)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
public UnitMovementType GetMovementType()
|
||||
{
|
||||
switch (Rules.UnitCategory[self.LegacyInfo.Name])
|
||||
switch (Rules.UnitCategory[self.Info.Name])
|
||||
{
|
||||
case "Infantry":
|
||||
return UnitMovementType.Foot;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRa.Game
|
||||
var crusher = GetUnitsAt(cell).Where(b => a != b && Game.IsActorCrushableByActor(a, b)).FirstOrDefault();
|
||||
if (crusher != null)
|
||||
{
|
||||
Log.Write("{0} crushes {1}", crusher.LegacyInfo.Name, a.LegacyInfo.Name);
|
||||
Log.Write("{0} crushes {1}", crusher.Info.Name, a.Info.Name);
|
||||
// Apply the crush action
|
||||
foreach (var crush in a.traits.WithInterface<ICrushable>())
|
||||
crush.OnCrush(crusher);
|
||||
|
||||
@@ -149,6 +149,10 @@ namespace RulesConverter
|
||||
{ "SpawnOffset", "SpawnOffset" },
|
||||
{ "Produces", "Produces" } }
|
||||
},
|
||||
|
||||
{ "Minelayer", new PL {
|
||||
{ "Mine", "Primary" } }
|
||||
},
|
||||
};
|
||||
|
||||
traitMap["RenderUnit"] = traitMap["RenderBuilding"];
|
||||
|
||||
Reference in New Issue
Block a user