dump the actor the unit tried to retiliate against to syncreport
This commit is contained in:
@@ -37,6 +37,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public UnitStance stance;
|
public UnitStance stance;
|
||||||
[Sync] public int stanceNumber { get { return (int)stance; } }
|
[Sync] public int stanceNumber { get { return (int)stance; } }
|
||||||
public UnitStance predictedStance; /* NOT SYNCED: do not refer to this anywhere other than UI code */
|
public UnitStance predictedStance; /* NOT SYNCED: do not refer to this anywhere other than UI code */
|
||||||
|
[Sync] public int AggressorID;
|
||||||
|
|
||||||
public AutoTarget(Actor self, AutoTargetInfo info)
|
public AutoTarget(Actor self, AutoTargetInfo info)
|
||||||
{
|
{
|
||||||
@@ -68,6 +69,8 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
if (e.Damage < 0) return; // don't retaliate against healers
|
if (e.Damage < 0) return; // don't retaliate against healers
|
||||||
|
|
||||||
|
AggressorID = (int)e.Attacker.ActorID;
|
||||||
|
|
||||||
attack.AttackTarget(Target.FromActor(e.Attacker), false, Info.AllowMovement && stance != UnitStance.Defend);
|
attack.AttackTarget(Target.FromActor(e.Attacker), false, Info.AllowMovement && stance != UnitStance.Defend);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,4 +137,16 @@ namespace OpenRA.Mods.RA
|
|||||||
[Desc("Will not get automatically targeted by enemy (like walls)")]
|
[Desc("Will not get automatically targeted by enemy (like walls)")]
|
||||||
class AutoTargetIgnoreInfo : TraitInfo<AutoTargetIgnore> { }
|
class AutoTargetIgnoreInfo : TraitInfo<AutoTargetIgnore> { }
|
||||||
class AutoTargetIgnore { }
|
class AutoTargetIgnore { }
|
||||||
|
|
||||||
|
public class DebugRetiliateAgainstAggressorInfo : ITraitInfo, Requires<AutoTargetInfo>
|
||||||
|
{
|
||||||
|
public object Create(ActorInitializer init) { return new DebugRetiliateAgainstAggressor(init.self); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DebugRetiliateAgainstAggressor : ISync
|
||||||
|
{
|
||||||
|
readonly AutoTarget a;
|
||||||
|
public DebugRetiliateAgainstAggressor(Actor self){ a = self.Trait<AutoTarget>(); }
|
||||||
|
[Sync] public int Aggressor { get { return a.AggressorID; } }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user