Add dynamic muzzle LaunchEffect facing plumbing
This commit is contained in:
@@ -25,6 +25,7 @@ namespace OpenRA.GameRules
|
||||
public int[] InaccuracyModifiers;
|
||||
public int[] RangeModifiers;
|
||||
public int Facing;
|
||||
public Func<int> CurrentMuzzleFacing;
|
||||
public WPos Source;
|
||||
public Func<WPos> CurrentSource;
|
||||
public Actor SourceActor;
|
||||
|
||||
@@ -277,6 +277,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
Func<WPos> muzzlePosition = () => self.CenterPosition + MuzzleOffset(self, barrel);
|
||||
var legacyFacing = MuzzleOrientation(self, barrel).Yaw.Angle / 4;
|
||||
Func<int> legacyMuzzleFacing = () => MuzzleOrientation(self, barrel).Yaw.Angle / 4;
|
||||
|
||||
var passiveTarget = Weapon.TargetActorCenter ? target.CenterPosition : target.Positions.PositionClosestTo(muzzlePosition());
|
||||
var initialOffset = Weapon.FirstBurstTargetOffset;
|
||||
@@ -299,6 +300,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
Weapon = Weapon,
|
||||
Facing = legacyFacing,
|
||||
CurrentMuzzleFacing = legacyMuzzleFacing,
|
||||
|
||||
DamageModifiers = damageModifiers.ToArray(),
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
Weapon = wep,
|
||||
Facing = self.World.SharedRandom.Next(-1, 255),
|
||||
CurrentMuzzleFacing = () => 0,
|
||||
|
||||
DamageModifiers = self.TraitsImplementing<IFirepowerModifier>()
|
||||
.Select(a => a.GetFirepowerModifier()).ToArray(),
|
||||
|
||||
@@ -137,6 +137,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
{
|
||||
Weapon = self.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()],
|
||||
Facing = 0,
|
||||
CurrentMuzzleFacing = () => 0,
|
||||
|
||||
DamageModifiers = self.TraitsImplementing<IFirepowerModifier>()
|
||||
.Select(a => a.GetFirepowerModifier()).ToArray(),
|
||||
|
||||
Reference in New Issue
Block a user