Renamed ROT to TurnSpeed on Mobile, Aircraft, Turreted and ThrowsParticle

This commit is contained in:
reaperrr
2016-03-02 21:51:36 +01:00
parent 86e4a72dce
commit cddf182996
43 changed files with 180 additions and 173 deletions

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Activities
var move = plane.FlyStep(plane.Facing);
var altitude = plane.CenterPosition.Z;
plane.Facing = Util.TickFacing(plane.Facing, desiredFacing, plane.ROT);
plane.Facing = Util.TickFacing(plane.Facing, desiredFacing, plane.TurnSpeed);
if (altitude != desiredAltitude.Length)
{

View File

@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Activities
// Can rotate facing while ascending
var desiredFacing = dist.HorizontalLengthSquared != 0 ? dist.Yaw.Facing : helicopter.Facing;
helicopter.Facing = Util.TickFacing(helicopter.Facing, desiredFacing, helicopter.ROT);
helicopter.Facing = Util.TickFacing(helicopter.Facing, desiredFacing, helicopter.TurnSpeed);
if (HeliFly.AdjustAltitude(self, helicopter, helicopter.Info.CruiseAltitude))
return this;

View File

@@ -71,7 +71,7 @@ namespace OpenRA.Mods.Common.Activities
// Rotate towards the target
var dist = pos - self.CenterPosition;
var desiredFacing = dist.HorizontalLengthSquared != 0 ? dist.Yaw.Facing : helicopter.Facing;
helicopter.Facing = Util.TickFacing(helicopter.Facing, desiredFacing, helicopter.ROT);
helicopter.Facing = Util.TickFacing(helicopter.Facing, desiredFacing, helicopter.TurnSpeed);
var move = helicopter.FlyStep(desiredFacing);
// Inside the minimum range, so reverse

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Activities
helicopter.SetPosition(self, helicopter.CenterPosition + move);
var desiredFacing = helicopter.Facing + 64;
helicopter.Facing = Util.TickFacing(helicopter.Facing, desiredFacing, helicopter.ROT / 3);
helicopter.Facing = Util.TickFacing(helicopter.Facing, desiredFacing, helicopter.TurnSpeed / 3);
return this;
}

View File

@@ -130,7 +130,7 @@ namespace OpenRA.Mods.Common.Activities
int CalculateTurnRadius(int speed)
{
return (int)(141 * speed / planeInfo.ROT / (float)Math.PI);
return (int)(141 * speed / planeInfo.TurnSpeed / (float)Math.PI);
}
}
}

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Activities
if (desiredFacing == facing.Facing)
return NextActivity;
facing.Facing = Util.TickFacing(facing.Facing, desiredFacing, facing.ROT);
facing.Facing = Util.TickFacing(facing.Facing, desiredFacing, facing.TurnSpeed);
return this;
}

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
[ActorReference]
public readonly HashSet<string> RearmBuildings = new HashSet<string> { };
public readonly int InitialFacing = 0;
public readonly int ROT = 255;
public readonly int TurnSpeed = 255;
public readonly int Speed = 1;
[Desc("Minimum altitude where this aircraft is considered airborne")]
@@ -103,7 +103,7 @@ namespace OpenRA.Mods.Common.Traits
[Sync] public int Facing { get; set; }
[Sync] public WPos CenterPosition { get; private set; }
public CPos TopLeft { get { return self.World.Map.CellContaining(CenterPosition); } }
public int ROT { get { return Info.ROT; } }
public int TurnSpeed { get { return Info.TurnSpeed; } }
bool airborne;
bool cruising;

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits
[Sync] public WPos CenterPosition { get; private set; }
[Sync] public int Facing { get; set; }
public int ROT { get { return 0; } }
public int TurnSpeed { get { return 0; } }
public Husk(ActorInitializer init, HuskInfo info)
{

View File

@@ -55,8 +55,8 @@ namespace OpenRA.Mods.Common.Traits
public readonly int InitialFacing = 0;
[Desc("Rate of Turning")]
public readonly int ROT = 255;
[Desc("Speed at which the actor turns.")]
public readonly int TurnSpeed = 255;
public readonly int Speed = 1;
@@ -339,7 +339,7 @@ namespace OpenRA.Mods.Common.Traits
set { facing = value; }
}
public int ROT { get { return Info.ROT; } }
public int TurnSpeed { get { return Info.TurnSpeed; } }
[Sync] public WPos CenterPosition { get; private set; }
[Sync] public CPos FromCell { get { return fromCell; } }

View File

@@ -37,8 +37,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speed to throw the particle (horizontal WPos/tick)")]
public readonly int Velocity = 75;
[Desc("Maximum rotation rate")]
public readonly float ROT = 15;
[Desc("Speed at which the particle turns.")]
public readonly float TurnSpeed = 15;
public object Create(ActorInitializer init) { return new ThrowsParticle(init, this); }
}
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Traits
length = (finalPos - initialPos).Length / info.Velocity;
// Facing rotation
rotation = WDist.FromPDF(Game.CosmeticRandom, 2).Length * info.ROT / 1024;
rotation = WDist.FromPDF(Game.CosmeticRandom, 2).Length * info.TurnSpeed / 1024;
var anim = new Animation(init.World, rs.GetImage(self), () => (int)facing);
anim.PlayRepeating(info.Anim);

View File

@@ -18,8 +18,8 @@ namespace OpenRA.Mods.Common.Traits
public class TurretedInfo : ITraitInfo, UsesInit<TurretFacingInit>, Requires<BodyOrientationInfo>
{
public readonly string Turret = "primary";
[Desc("Rate of Turning")]
public readonly int ROT = 255;
[Desc("Speed at which the turret turns.")]
public readonly int TurnSpeed = 255;
public readonly int InitialFacing = 128;
[Desc("Number of ticks before turret is realigned. (-1 turns off realignment)")]
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Traits
void MoveTurret()
{
var df = DesiredFacing ?? (facing != null ? facing.Facing : TurretFacing);
TurretFacing = Util.TickFacing(TurretFacing, df, info.ROT);
TurretFacing = Util.TickFacing(TurretFacing, df, info.TurnSpeed);
}
public bool FaceTarget(Actor self, Target target)

View File

@@ -599,6 +599,13 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
if (engineVersion < 20160301)
{
// Renamed ROT -> TurnSpeed
if (node.Key == "ROT")
node.Key = "TurnSpeed";
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}