Rename legacy offset coordinates on Turrets and Armaments.

This commit is contained in:
Paul Chote
2013-03-29 12:19:15 +13:00
parent 9e4bab07e5
commit 27d852a425
35 changed files with 220 additions and 220 deletions

View File

@@ -33,12 +33,12 @@ namespace OpenRA.Mods.RA
public readonly string Weapon = null;
public readonly string Turret = "primary";
[Desc("Move the turret backwards when firing.")]
public readonly int Recoil = 0;
public readonly int LegacyRecoil = 0;
[Desc("Time (in frames) until the weapon can fire again.")]
public readonly int FireDelay = 0;
public readonly float RecoilRecovery = 0.2f;
public readonly int[] LocalOffset = { };
public readonly float LegacyRecoilRecovery = 0.2f;
public readonly int[] LegacyLocalOffset = { };
public object Create(ActorInitializer init) { return new Armament(init.self, this); }
}
@@ -66,12 +66,12 @@ namespace OpenRA.Mods.RA
Burst = Weapon.Burst;
var barrels = new List<Barrel>();
for (var i = 0; i < info.LocalOffset.Length / 5; i++)
for (var i = 0; i < info.LegacyLocalOffset.Length / 5; i++)
barrels.Add(new Barrel
{
TurretSpaceOffset = new PVecInt(info.LocalOffset[5 * i], info.LocalOffset[5 * i + 1]),
ScreenSpaceOffset = new PVecInt(info.LocalOffset[5 * i + 2], info.LocalOffset[5 * i + 3]),
Facing = info.LocalOffset[5 * i + 4],
TurretSpaceOffset = new PVecInt(info.LegacyLocalOffset[5 * i], info.LegacyLocalOffset[5 * i + 1]),
ScreenSpaceOffset = new PVecInt(info.LegacyLocalOffset[5 * i + 2], info.LegacyLocalOffset[5 * i + 3]),
Facing = info.LegacyLocalOffset[5 * i + 4],
});
// if no barrels specified, the default is "turret position; turret facing".
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.RA
{
if (FireDelay > 0)
--FireDelay;
Recoil = Math.Max(0f, Recoil - Info.RecoilRecovery);
Recoil = Math.Max(0f, Recoil - Info.LegacyRecoilRecovery);
}
public void CheckFire(Actor self, AttackBase attack, IMove move, IFacing facing, Target target)
@@ -139,7 +139,7 @@ namespace OpenRA.Mods.RA
foreach (var na in self.TraitsImplementing<INotifyAttack>())
na.Attacking(self, target);
Recoil = Info.Recoil;
Recoil = Info.LegacyRecoil;
if (--Burst > 0)
FireDelay = Weapon.BurstDelay;

View File

@@ -52,7 +52,7 @@ namespace OpenRA.Mods.RA
{
base.Tick(self);
if (IsProne && --remainingProneTime == 0)
turret = new Turret(Info.Offset);
turret = new Turret(Info.LegacyOffset);
}
public float GetDamageModifier(Actor attacker, WarheadInfo warhead )

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA
[Desc("Rate of Turning")]
public readonly int ROT = 255;
public readonly int InitialFacing = 128;
public readonly int[] Offset = {0,0};
public readonly int[] LegacyOffset = {0,0};
public readonly bool AlignWhenIdle = false;
public virtual object Create(ActorInitializer init) { return new Turreted(init, this); }
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA
this.info = info;
turretFacing = GetInitialTurretFacing(init, info.InitialFacing);
facing = init.self.TraitOrDefault<IFacing>();
turret = new Turret(info.Offset);
turret = new Turret(info.LegacyOffset);
}
public virtual void Tick(Actor self)