From 6cedc424edb5355a807f8c028f58def5896301b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 21 Mar 2013 17:36:10 +0100 Subject: [PATCH 1/3] dump the actor the unit tried to retiliate against to syncreport --- OpenRA.Mods.RA/AutoTarget.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/OpenRA.Mods.RA/AutoTarget.cs b/OpenRA.Mods.RA/AutoTarget.cs index 5b0a380807..552473e420 100644 --- a/OpenRA.Mods.RA/AutoTarget.cs +++ b/OpenRA.Mods.RA/AutoTarget.cs @@ -37,6 +37,7 @@ namespace OpenRA.Mods.RA public UnitStance stance; [Sync] public int stanceNumber { get { return (int)stance; } } 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) { @@ -68,6 +69,8 @@ namespace OpenRA.Mods.RA 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); } @@ -134,4 +137,16 @@ namespace OpenRA.Mods.RA [Desc("Will not get automatically targeted by enemy (like walls)")] class AutoTargetIgnoreInfo : TraitInfo { } class AutoTargetIgnore { } + + public class DebugRetiliateAgainstAggressorInfo : ITraitInfo, Requires + { + public object Create(ActorInitializer init) { return new DebugRetiliateAgainstAggressor(init.self); } + } + + public class DebugRetiliateAgainstAggressor : ISync + { + readonly AutoTarget a; + public DebugRetiliateAgainstAggressor(Actor self){ a = self.Trait(); } + [Sync] public int Aggressor { get { return a.AggressorID; } } + } } From 43bb75c1357b822e2aca4322739eef59d9515c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 21 Mar 2013 18:13:18 +0100 Subject: [PATCH 2/3] sync carpet bombing --- OpenRA.Mods.RA/CarpetBomb.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.RA/CarpetBomb.cs b/OpenRA.Mods.RA/CarpetBomb.cs index a6162d66c7..e452477dc5 100644 --- a/OpenRA.Mods.RA/CarpetBomb.cs +++ b/OpenRA.Mods.RA/CarpetBomb.cs @@ -21,10 +21,10 @@ namespace OpenRA.Mods.RA public readonly int Range = 3; } - class CarpetBomb : ITick // todo: maybe integrate this better with the normal weapons system? + class CarpetBomb : ITick, ISync // todo: maybe integrate this better with the normal weapons system? { - CPos Target; - int dropDelay; + [Sync] CPos Target; + [Sync] int dropDelay; public void SetTarget(CPos targetCell) { Target = targetCell; } From 6307e51991cc7b0ed6291a6e31f4313a31213a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 21 Mar 2013 19:04:30 +0100 Subject: [PATCH 3/3] put NextAutoTargetScanTime into syncreport.log --- OpenRA.Mods.RA/AutoTarget.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/AutoTarget.cs b/OpenRA.Mods.RA/AutoTarget.cs index 552473e420..0d5fd4aada 100644 --- a/OpenRA.Mods.RA/AutoTarget.cs +++ b/OpenRA.Mods.RA/AutoTarget.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA readonly AutoTargetInfo Info; readonly AttackBase attack; - [Sync] int nextScanTime = 0; + [Sync] public int nextScanTime = 0; public UnitStance stance; [Sync] public int stanceNumber { get { return (int)stance; } } public UnitStance predictedStance; /* NOT SYNCED: do not refer to this anywhere other than UI code */ @@ -149,4 +149,16 @@ namespace OpenRA.Mods.RA public DebugRetiliateAgainstAggressor(Actor self){ a = self.Trait(); } [Sync] public int Aggressor { get { return a.AggressorID; } } } + + public class DebugNextAutoTargetScanTimeInfo : ITraitInfo, Requires + { + public object Create(ActorInitializer init) { return new DebugNextAutoTargetScanTime(init.self); } + } + + public class DebugNextAutoTargetScanTime : ISync + { + readonly AutoTarget a; + public DebugNextAutoTargetScanTime(Actor self){ a = self.Trait(); } + [Sync] public int NextAutoTargetScanTime { get { return a.nextScanTime; } } + } }