From f51275ccc024477ec92e3f36d22b569114fea1fd Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 4 Nov 2025 16:42:16 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20made=20dead=20fighters=20shrink?= =?UTF-8?q?=20to=20telegraph=20to=20the=20player=20that=20they=20are=20dea?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CSharp/Common/Fight/AllFightersVisual.cs | 2 +- scripts/CSharp/Common/Fight/FighterVisual.cs | 22 +++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/scripts/CSharp/Common/Fight/AllFightersVisual.cs b/scripts/CSharp/Common/Fight/AllFightersVisual.cs index e24f218..d015d2b 100644 --- a/scripts/CSharp/Common/Fight/AllFightersVisual.cs +++ b/scripts/CSharp/Common/Fight/AllFightersVisual.cs @@ -59,7 +59,7 @@ public partial class AllFightersVisual : Node if (from == FightHappening.FightState.ActionAnim) { - _fighterVisuals.Values.ForEach(fv => fv.UpdateHealthBar()); + _fighterVisuals.Values.ForEach(fv => fv.UpdateVisuals()); } } diff --git a/scripts/CSharp/Common/Fight/FighterVisual.cs b/scripts/CSharp/Common/Fight/FighterVisual.cs index b5924df..4b0bb60 100644 --- a/scripts/CSharp/Common/Fight/FighterVisual.cs +++ b/scripts/CSharp/Common/Fight/FighterVisual.cs @@ -7,7 +7,6 @@ using Godot.Collections; namespace Babushka.scripts.CSharp.Common.Fight; - public partial class FighterVisual : Node2D { #region Shortcuts @@ -28,22 +27,21 @@ public partial class FighterVisual : Node2D public void Initialize(FightWorld.Fighter fighter) { _boundFighter = fighter; - UpdateMirrorState(); - UpdateHealthBar(); + UpdateVisuals(); } - /// - /// fighter visuals should always look to the right in the scene. - /// This function flips the sprites horizontally, when the fighter is an enemy. - /// - private void UpdateMirrorState() + public void UpdateVisuals() { - _visualParent.Scale = new Vector2(_boundFighter.IsInFormation(HappeningData.enemyFighterFormation) ? -1 : 1, 1); - } + // fighter visuals should always look to the right in the scene. + // This function flips the sprites horizontally, when the fighter is an enemy. + _visualParent.Scale = new Vector2( + _boundFighter.IsInFormation(HappeningData.enemyFighterFormation) ? -1 : 1, + _boundFighter.IsDead() ? .3f : 1); - public void UpdateHealthBar() - { healthBarVisual.UpdateHealth(_boundFighter.GetHealth(), _boundFighter.maxHealth); + + //if (_boundFighter.IsDead()) + // _visualParent.Scale = new Vector2(1.4f, 0.3f); } public void SetTargetSelectionActive(bool value) -- 2.36.3 From edbd4a182b35ceb17d9d504ed72014702ed55279 Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 11 Nov 2025 10:19:37 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8Removed=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/CSharp/Common/Fight/FighterVisual.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/CSharp/Common/Fight/FighterVisual.cs b/scripts/CSharp/Common/Fight/FighterVisual.cs index 4b0bb60..04d1002 100644 --- a/scripts/CSharp/Common/Fight/FighterVisual.cs +++ b/scripts/CSharp/Common/Fight/FighterVisual.cs @@ -39,9 +39,6 @@ public partial class FighterVisual : Node2D _boundFighter.IsDead() ? .3f : 1); healthBarVisual.UpdateHealth(_boundFighter.GetHealth(), _boundFighter.maxHealth); - - //if (_boundFighter.IsDead()) - // _visualParent.Scale = new Vector2(1.4f, 0.3f); } public void SetTargetSelectionActive(bool value) -- 2.36.3