more ported bits
This commit is contained in:
@@ -19,7 +19,7 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
|
|
||||||
if (target.Owner == self.Owner)
|
if (target.Owner == self.Owner)
|
||||||
{
|
{
|
||||||
if (target.Health == target.LegacyInfo.Strength)
|
if (target.Health == target.Info.Traits.WithInterface<OwnedActorInfo>().First().HP)
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
target.InflictDamage(self, -EngineerCapture.EngineerDamage, Rules.WarheadInfo["Super"]);
|
target.InflictDamage(self, -EngineerCapture.EngineerDamage, Rules.WarheadInfo["Super"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
|
|
||||||
var desiredFacing = Util.GetFacing(d, unit.Facing);
|
var desiredFacing = Util.GetFacing(d, unit.Facing);
|
||||||
if (unit.Altitude == CruiseAltitude)
|
if (unit.Altitude == CruiseAltitude)
|
||||||
Util.TickFacing(ref unit.Facing, desiredFacing, self.LegacyInfo.ROT);
|
Util.TickFacing(ref unit.Facing, desiredFacing, self.Info.Traits.Get<PlaneInfo>().ROT);
|
||||||
var speed = .2f * Util.GetEffectiveSpeed(self);
|
var speed = .2f * Util.GetEffectiveSpeed(self);
|
||||||
var angle = unit.Facing / 128f * Math.PI;
|
var angle = unit.Facing / 128f * Math.PI;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
Actor ChooseAirfield(Actor self)
|
Actor ChooseAirfield(Actor self)
|
||||||
{
|
{
|
||||||
var airfield = Game.world.Actors
|
var airfield = Game.world.Actors
|
||||||
.Where(a => a.LegacyInfo == Rules.UnitInfo["AFLD"] /* todo: generalize this */
|
.Where(a => a.Info.Name == "afld"
|
||||||
&& a.Owner == self.Owner
|
&& a.Owner == self.Owner
|
||||||
&& !Reservable.IsReserved(a))
|
&& !Reservable.IsReserved(a))
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@@ -41,7 +41,7 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
var unit = self.traits.Get<Unit>();
|
var unit = self.traits.Get<Unit>();
|
||||||
var speed = .2f * Util.GetEffectiveSpeed(self);
|
var speed = .2f * Util.GetEffectiveSpeed(self);
|
||||||
var approachStart = landPos - new float2(unit.Altitude * speed, 0);
|
var approachStart = landPos - new float2(unit.Altitude * speed, 0);
|
||||||
var turnRadius = (128f / self.LegacyInfo.ROT) * speed / (float)Math.PI;
|
var turnRadius = (128f / self.Info.Traits.Get<PlaneInfo>().ROT) * speed / (float)Math.PI;
|
||||||
|
|
||||||
/* work out the center points */
|
/* work out the center points */
|
||||||
var fwd = -float2.FromAngle(unit.Facing / 128f * (float)Math.PI);
|
var fwd = -float2.FromAngle(unit.Facing / 128f * (float)Math.PI);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
if( desiredFacing == unit.Facing )
|
if( desiredFacing == unit.Facing )
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
|
|
||||||
Util.TickFacing( ref unit.Facing, desiredFacing, self.LegacyInfo.ROT );
|
Util.TickFacing( ref unit.Facing, desiredFacing, self.Info.Traits.Get<MobileInfo>().ROT );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using OpenRa.Game.Traits.Activities;
|
using System;
|
||||||
using System;
|
using System.Linq;
|
||||||
using OpenRa.Game.GameRules;
|
using OpenRa.Game.GameRules;
|
||||||
|
using OpenRa.Game.Traits.Activities;
|
||||||
|
|
||||||
namespace OpenRa.Game.Traits
|
namespace OpenRa.Game.Traits
|
||||||
{
|
{
|
||||||
@@ -17,11 +18,10 @@ namespace OpenRa.Game.Traits
|
|||||||
public IDisposable reservation;
|
public IDisposable reservation;
|
||||||
public Helicopter(Actor self) {}
|
public Helicopter(Actor self) {}
|
||||||
|
|
||||||
// todo: push into data!
|
|
||||||
static bool HeliCanEnter(Actor a)
|
static bool HeliCanEnter(Actor a)
|
||||||
{
|
{
|
||||||
if (a.LegacyInfo == Rules.UnitInfo["HPAD"]) return true;
|
if (a.Info.Name == "hpad") return true;
|
||||||
if (a.LegacyInfo == Rules.UnitInfo["FIX"]) return true;
|
if (a.Info.Name == "fix") return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ namespace OpenRa.Game.Traits
|
|||||||
{
|
{
|
||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
self.QueueActivity(new HeliFly(Util.CenterOfCell(order.TargetLocation)));
|
self.QueueActivity(new HeliFly(Util.CenterOfCell(order.TargetLocation)));
|
||||||
self.QueueActivity(new Turn(self.LegacyInfo.InitialFacing));
|
self.QueueActivity(new Turn(self.Info.Traits.WithInterface<OwnedActorInfo>().FirstOrDefault().InitialFacing));
|
||||||
self.QueueActivity(new HeliLand(true));
|
self.QueueActivity(new HeliLand(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace OpenRa.Game.Traits
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
var umt = self.traits.WithInterface<IMovement>().First().GetMovementType();
|
var umt = self.traits.WithInterface<IMovement>().First().GetMovementType();
|
||||||
if (!underCursor.LegacyInfo.PassengerTypes.Contains(umt))
|
if (!underCursor.Info.Traits.Get<CargoInfo>().PassengerTypes.Contains(umt))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return new Order("EnterTransport", self, underCursor, int2.Zero, null);
|
return new Order("EnterTransport", self, underCursor, int2.Zero, null);
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ namespace OpenRa.Game.Traits
|
|||||||
// todo: push into data!
|
// todo: push into data!
|
||||||
static bool PlaneCanEnter(Actor a)
|
static bool PlaneCanEnter(Actor a)
|
||||||
{
|
{
|
||||||
if (a.LegacyInfo == Rules.UnitInfo["AFLD"]) return true;
|
if (a.Info.Name == "afld") return true;
|
||||||
if (a.LegacyInfo == Rules.UnitInfo["FIX"]) return true;
|
if (a.Info.Name == "fix") return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user