From c0206b18b0121679d8a6d3d37b87be5ce5212981 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 20 Dec 2015 16:35:19 +0100 Subject: [PATCH 1/2] Fix DamagedWithoutFoundation causing more damage than it should Tick caused extra damage in addition to the damage in AddedToWorld, which lead the actor to have less health than damageThreshold. --- OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs b/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs index 6d65f91085..5035746d5e 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs @@ -64,6 +64,8 @@ namespace OpenRA.Mods.D2k.Traits var delta = health.HP - damageThreshold; if (delta > 0) health.InflictDamage(self, self.World.WorldActor, delta, null, false); + + damageTicks = info.WeaponInfo.ReloadDelay; } public void Tick(Actor self) From fa260ddee1ae0db527a49f7a5a2cb8874ae22298 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 20 Dec 2015 16:35:43 +0100 Subject: [PATCH 2/2] Document fields in DamagedWithoutFoundationInfo --- .../Traits/Buildings/DamagedWithoutFoundation.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs b/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs index 5035746d5e..039f9048bb 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs @@ -19,9 +19,13 @@ namespace OpenRA.Mods.D2k.Traits [Desc("Reduces health points over time when the actor is placed on unsafe terrain.")] class DamagedWithoutFoundationInfo : ITraitInfo, IRulesetLoaded, Requires { - [WeaponReference] + [WeaponReference, Desc("The weapon to use for causing damage.")] public readonly string Weapon = "weathering"; + + [Desc("Terrain types on which no damage is caused.")] public readonly HashSet SafeTerrain = new HashSet { "Concrete" }; + + [Desc("The percentage of health the actor should keep.")] public readonly int DamageThreshold = 50; public WeaponInfo WeaponInfo { get; private set; }