Add CurrentSource parameter to ProjectileArgs.
This commit is contained in:
@@ -24,6 +24,7 @@ namespace OpenRA.GameRules
|
|||||||
public int[] RangeModifiers;
|
public int[] RangeModifiers;
|
||||||
public int Facing;
|
public int Facing;
|
||||||
public WPos Source;
|
public WPos Source;
|
||||||
|
public Func<WPos> CurrentSource;
|
||||||
public Actor SourceActor;
|
public Actor SourceActor;
|
||||||
public WPos PassiveTarget;
|
public WPos PassiveTarget;
|
||||||
public Target GuidedTarget;
|
public Target GuidedTarget;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
var barrel = Barrels[Burst % Barrels.Length];
|
var barrel = Barrels[Burst % Barrels.Length];
|
||||||
var muzzlePosition = self.CenterPosition + MuzzleOffset(self, barrel);
|
Func<WPos> muzzlePosition = () => self.CenterPosition + MuzzleOffset(self, barrel);
|
||||||
var legacyFacing = MuzzleOrientation(self, barrel).Yaw.Angle / 4;
|
var legacyFacing = MuzzleOrientation(self, barrel).Yaw.Angle / 4;
|
||||||
|
|
||||||
var args = new ProjectileArgs
|
var args = new ProjectileArgs
|
||||||
@@ -204,7 +204,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
RangeModifiers = self.TraitsImplementing<IRangeModifier>()
|
RangeModifiers = self.TraitsImplementing<IRangeModifier>()
|
||||||
.Select(a => a.GetRangeModifier()).ToArray(),
|
.Select(a => a.GetRangeModifier()).ToArray(),
|
||||||
|
|
||||||
Source = muzzlePosition,
|
Source = muzzlePosition(),
|
||||||
|
CurrentSource = muzzlePosition,
|
||||||
SourceActor = self,
|
SourceActor = self,
|
||||||
PassiveTarget = target.CenterPosition,
|
PassiveTarget = target.CenterPosition,
|
||||||
GuidedTarget = target
|
GuidedTarget = target
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
.Select(a => a.GetRangeModifier()).ToArray(),
|
.Select(a => a.GetRangeModifier()).ToArray(),
|
||||||
|
|
||||||
Source = self.CenterPosition,
|
Source = self.CenterPosition,
|
||||||
|
CurrentSource = () => self.CenterPosition,
|
||||||
SourceActor = self,
|
SourceActor = self,
|
||||||
PassiveTarget = self.CenterPosition + new WVec(range, 0, 0).Rotate(rotation)
|
PassiveTarget = self.CenterPosition + new WVec(range, 0, 0).Rotate(rotation)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ namespace OpenRA.Mods.D2k.Traits
|
|||||||
.Select(a => a.GetInaccuracyModifier()).ToArray(),
|
.Select(a => a.GetInaccuracyModifier()).ToArray(),
|
||||||
|
|
||||||
Source = self.CenterPosition,
|
Source = self.CenterPosition,
|
||||||
|
CurrentSource = () => self.CenterPosition,
|
||||||
SourceActor = self,
|
SourceActor = self,
|
||||||
PassiveTarget = self.World.Map.CenterOfCell(cell.Value)
|
PassiveTarget = self.World.Map.CenterOfCell(cell.Value)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user