Add a screen-space offset to barrel positions, and fix HTNK firing offsets. Fixes #803, 929.
This commit is contained in:
@@ -219,7 +219,8 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
var turretFacing = turreted != null ? turreted.turretFacing : facing.Facing;
|
||||
|
||||
return GetTurretPosition(self, facing, turret) + Util.RotateVectorByFacing(barrel.Position, turretFacing, .7f);
|
||||
return GetTurretPosition(self, facing, turret) + barrel.ScreenSpaceOffset
|
||||
+ Util.RotateVectorByFacing(barrel.TurretSpaceOffset, turretFacing, .7f);
|
||||
}
|
||||
|
||||
public static bool IsInRange( float2 attackOrigin, float range, Actor target )
|
||||
|
||||
@@ -18,7 +18,8 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
public class Barrel
|
||||
{
|
||||
public int2 Position; // position in turret space
|
||||
public int2 TurretSpaceOffset; // position in turret space
|
||||
public int2 ScreenSpaceOffset; // screen-space hack to make things line up good.
|
||||
public int Facing; // deviation from turret facing
|
||||
}
|
||||
|
||||
@@ -51,16 +52,17 @@ namespace OpenRA.Mods.RA
|
||||
Turret = turret;
|
||||
|
||||
var barrels = new List<Barrel>();
|
||||
for (var i = 0; i < localOffset.Length / 3; i++)
|
||||
for (var i = 0; i < localOffset.Length / 5; i++)
|
||||
barrels.Add(new Barrel
|
||||
{
|
||||
Position = new int2(localOffset[3 * i], localOffset[3 * i + 1]),
|
||||
Facing = localOffset[3 * i + 2]
|
||||
TurretSpaceOffset = new int2(localOffset[5 * i], localOffset[5 * i + 1]),
|
||||
ScreenSpaceOffset = new int2(localOffset[5 * i + 2], localOffset[5 * i + 3]),
|
||||
Facing = localOffset[5 * i + 4]
|
||||
});
|
||||
|
||||
// if no barrels specified, the default is "turret position; turret facing".
|
||||
if (barrels.Count == 0)
|
||||
barrels.Add(new Barrel { Position = int2.Zero, Facing = 0 });
|
||||
barrels.Add(new Barrel { TurretSpaceOffset = int2.Zero, ScreenSpaceOffset = int2.Zero, Facing = 0 });
|
||||
|
||||
Barrels = barrels.ToArray();
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ HELI:
|
||||
AttackHeli:
|
||||
PrimaryWeapon: HeliGun
|
||||
PrimaryOffset: 0,-3,0,2
|
||||
PrimaryLocalOffset: -5,0,0,5,0,0
|
||||
PrimaryLocalOffset: -5,0,0,0,0, 5,0,0,0,0
|
||||
FacingTolerance: 20
|
||||
LimitedAmmo:
|
||||
Ammo: 10
|
||||
@@ -102,7 +102,7 @@ ORCA:
|
||||
AttackHeli:
|
||||
PrimaryWeapon: OrcaMissiles
|
||||
PrimaryOffset: 0,-10,0,5
|
||||
PrimaryLocalOffset: -4,0,0,4,0,0
|
||||
PrimaryLocalOffset: -4,0,0,0,0, 4,0,0,0,0
|
||||
FacingTolerance: 20
|
||||
LimitedAmmo:
|
||||
Ammo: 10
|
||||
|
||||
@@ -21,7 +21,7 @@ BOAT:
|
||||
AttackTurreted:
|
||||
PrimaryWeapon: BoatMissile
|
||||
PrimaryOffset: 0,-15,0,-4
|
||||
PrimaryLocalOffset: -3,-5,0,3,-5,0,0,-5,0
|
||||
PrimaryLocalOffset: -3,-5,0,0,0, 3,-5,0,0,0, 0,-5,0,0,0
|
||||
RenderGunboat:
|
||||
AutoTarget:
|
||||
AllowMovement: false
|
||||
|
||||
@@ -692,7 +692,7 @@ GTWR:
|
||||
AttackTurreted:
|
||||
PrimaryWeapon: HighV
|
||||
PrimaryOffset: 0,0,0,-6
|
||||
PrimaryLocalOffset:0,-6,0
|
||||
PrimaryLocalOffset: 0,-6,0,0,0
|
||||
AutoTarget:
|
||||
DetectCloaked:
|
||||
Range: 3
|
||||
@@ -730,7 +730,7 @@ ATWR:
|
||||
AttackTurreted:
|
||||
PrimaryWeapon: Tomahawk
|
||||
PrimaryOffset: 0,0,5,2
|
||||
PrimaryLocalOffset:7,-7,-25,-7,-7,25
|
||||
PrimaryLocalOffset: 7,-7,0,0,-25, -7,-7,0,0,25
|
||||
Turreted:
|
||||
ROT:255
|
||||
AutoTarget:
|
||||
|
||||
@@ -159,7 +159,7 @@ FTNK:
|
||||
AttackFrontal:
|
||||
PrimaryWeapon: BigFlamer
|
||||
PrimaryOffset: 0,-5,3,2
|
||||
PrimaryLocalOffset:2,0,0,-2,0,0
|
||||
PrimaryLocalOffset: 2,0,0,0,0, -2,0,0,0,0
|
||||
RenderUnit:
|
||||
AutoTarget:
|
||||
WithMuzzleFlash:
|
||||
@@ -225,7 +225,7 @@ BIKE:
|
||||
AttackFrontal:
|
||||
PrimaryWeapon: Rockets.Bike
|
||||
PrimaryOffset: 0,0,0,-2
|
||||
PrimaryLocalOffset: -4,0,25,4,0,-25
|
||||
PrimaryLocalOffset: -4,0,0,0,25, 4,0,0,0,-25
|
||||
RenderUnit:
|
||||
AutoTarget:
|
||||
LeavesHusk:
|
||||
@@ -357,8 +357,8 @@ HTNK:
|
||||
AttackTurreted:
|
||||
PrimaryWeapon: 120mmDual
|
||||
SecondaryWeapon: MissilePack
|
||||
PrimaryLocalOffset: -5,0,0,5,0,0
|
||||
SecondaryLocalOffset: -9,2,25,9,2,-25
|
||||
PrimaryLocalOffset: -5,-5,0,-10,0, 5,-5,0,-10,0
|
||||
SecondaryLocalOffset: -9,2,0,0,25, 9,2,0,0,-25
|
||||
Recoil: 4
|
||||
RenderUnitTurreted:
|
||||
AutoTarget:
|
||||
@@ -396,7 +396,7 @@ MSAM:
|
||||
AttackFrontal:
|
||||
PrimaryWeapon: 227mm
|
||||
PrimaryOffset: 0,6,0,-3
|
||||
PrimaryLocalOffset: 3,-5,0, -3,-5,0
|
||||
PrimaryLocalOffset: 3,-5,0,0,0, -3,-5,0,0,0
|
||||
Recoil: 0
|
||||
RenderUnitTurretedAim:
|
||||
AutoTarget:
|
||||
@@ -429,8 +429,8 @@ MLRS:
|
||||
PrimaryWeapon: HonestJohn
|
||||
SecondaryWeapon: HonestJohn
|
||||
PrimaryOffset: 0,3,0,-3
|
||||
PrimaryLocalOffset: -4,0,0
|
||||
SecondaryLocalOffset: 4,0,0
|
||||
PrimaryLocalOffset: -4,0,0,0,0
|
||||
SecondaryLocalOffset: 4,0,0,0,0
|
||||
Recoil: 0
|
||||
AlignIdleTurrets: true
|
||||
RenderUnitTurretedAim:
|
||||
@@ -466,7 +466,7 @@ STNK:
|
||||
AttackFrontal:
|
||||
PrimaryWeapon: 227mm.stnk
|
||||
PrimaryOffset: 0,-5,0,-3
|
||||
PrimaryLocalOffset:1,0,0,-1,0,0
|
||||
PrimaryLocalOffset: 1,0,0,0,0, -1,0,0,0,0
|
||||
RenderUnit:
|
||||
AutoTarget:
|
||||
TargetableUnit:
|
||||
|
||||
@@ -99,8 +99,8 @@ MIG:
|
||||
AttackPlane:
|
||||
PrimaryWeapon: Maverick
|
||||
SecondaryWeapon: Maverick
|
||||
PrimaryLocalOffset: -15,0,-10,-12,0,6
|
||||
SecondaryLocalOffset: 15,0,10,12,0,6
|
||||
PrimaryLocalOffset: -15,0,0,0,-10, -12,0,0,0,6
|
||||
SecondaryLocalOffset: 15,0,0,0,10, 12,0,0,0,6
|
||||
FacingTolerance: 20
|
||||
Plane:
|
||||
InitialFacing: 192
|
||||
|
||||
@@ -32,7 +32,7 @@ SS:
|
||||
UncloakSound: subshow1.aud
|
||||
AttackFrontal:
|
||||
PrimaryWeapon: TorpTube
|
||||
PrimaryLocalOffset: -4,0,0,4,0,0
|
||||
PrimaryLocalOffset: -4,0,0,0,0, 4,0,0,0,0
|
||||
FireDelay: 2
|
||||
Selectable:
|
||||
Bounds: 38,38
|
||||
@@ -115,7 +115,7 @@ DD:
|
||||
PrimaryWeapon: Stinger
|
||||
SecondaryWeapon: DepthCharge
|
||||
PrimaryOffset: 0,-8,0,-3
|
||||
PrimaryLocalOffset: -4,0,-20,4,0,20
|
||||
PrimaryLocalOffset: -4,0,0,0,-20, 4,0,0,0,20
|
||||
Selectable:
|
||||
Bounds: 38,38
|
||||
RenderUnitTurreted:
|
||||
@@ -156,8 +156,8 @@ CA:
|
||||
SecondaryWeapon: 8Inch
|
||||
PrimaryOffset: 0,17,0,-2
|
||||
SecondaryOffset: 0,-17,0,-2
|
||||
PrimaryLocalOffset: -4,-5,0,4,-5,0
|
||||
SecondaryLocalOffset: -4,-5,0,4,-5,0
|
||||
PrimaryLocalOffset: -4,-5,0,0,0, 4,-5,0,0,0
|
||||
SecondaryLocalOffset: -4,-5,0,0,0, 4,-5,0,0,0
|
||||
Recoil: 4
|
||||
Selectable:
|
||||
Bounds: 44,44
|
||||
|
||||
@@ -381,7 +381,7 @@ PBOX:
|
||||
Range: 6
|
||||
AttackTurreted:
|
||||
PrimaryWeapon: Vulcan
|
||||
PrimaryLocalOffset: 0,-11,0
|
||||
PrimaryLocalOffset: 0,-11,0,0,0
|
||||
AutoTarget:
|
||||
IronCurtainable:
|
||||
RenderRangeCircle:
|
||||
@@ -414,7 +414,7 @@ HBOX:
|
||||
Range: 6
|
||||
AttackTurreted:
|
||||
PrimaryWeapon: Vulcan
|
||||
PrimaryLocalOffset: 0,-11,0
|
||||
PrimaryLocalOffset: 0,-11,0,0,0
|
||||
AutoTarget:
|
||||
IronCurtainable:
|
||||
RenderRangeCircle:
|
||||
@@ -484,7 +484,7 @@ FTUR:
|
||||
AttackTurreted:
|
||||
PrimaryWeapon: FireballLauncher
|
||||
PrimaryOffset: 0,0,0,-2
|
||||
PrimaryLocalOffset: 0,-12,0
|
||||
PrimaryLocalOffset: 0,-12,0,0,0
|
||||
AutoTarget:
|
||||
IronCurtainable:
|
||||
RenderRangeCircle:
|
||||
|
||||
@@ -153,8 +153,8 @@ V2RL:
|
||||
AttackTurreted:
|
||||
PrimaryWeapon: 120mm
|
||||
SecondaryWeapon: MammothTusk
|
||||
PrimaryLocalOffset: -4,-5,0,4,-5,0
|
||||
SecondaryLocalOffset: -7,2,25,7,2,-25
|
||||
PrimaryLocalOffset: -4,-5,0,0,0, 4,-5,0,0,0
|
||||
SecondaryLocalOffset: -7,2,0,0,25, 7,2,0,0,-25
|
||||
Recoil: 4
|
||||
RenderUnitTurreted:
|
||||
AutoTarget:
|
||||
|
||||
Reference in New Issue
Block a user