From ca958376a478ffc668ef41504df9175b3556a07f Mon Sep 17 00:00:00 2001 From: Ian Woods Date: Tue, 14 Jul 2026 21:37:41 -0700 Subject: [PATCH] spells work! changed the layer to enemy --- .../Definitions/BuilderSpells/FireballSpell.asset | 4 ++-- .../Definitions/BuilderSpells/SlowAreaSpell.asset | 8 ++++---- .../Gameplay/BuilderSpells/FireballSpellDefinition.cs | 4 ++++ .../Gameplay/BuilderSpells/SlowAreaSpellDefinition.cs | 10 ++++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Assets/_Project/Definitions/BuilderSpells/FireballSpell.asset b/Assets/_Project/Definitions/BuilderSpells/FireballSpell.asset index 31db12b..f813362 100644 --- a/Assets/_Project/Definitions/BuilderSpells/FireballSpell.asset +++ b/Assets/_Project/Definitions/BuilderSpells/FireballSpell.asset @@ -17,8 +17,8 @@ MonoBehaviour: Icon: {fileID: 0} Cooldown: 5 TargetType: 0 - Radius: 0 + Radius: 3 enemyLayerMask: serializedVersion: 2 - m_Bits: 0 + m_Bits: 128 Damage: 50 diff --git a/Assets/_Project/Definitions/BuilderSpells/SlowAreaSpell.asset b/Assets/_Project/Definitions/BuilderSpells/SlowAreaSpell.asset index 9df48bc..d45c506 100644 --- a/Assets/_Project/Definitions/BuilderSpells/SlowAreaSpell.asset +++ b/Assets/_Project/Definitions/BuilderSpells/SlowAreaSpell.asset @@ -12,14 +12,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 249c65067c3bac80693255e594d844c7, type: 3} m_Name: SlowAreaSpell m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.BuilderSpells.SlowAreaSpellDefinition - DisplayName: - Description: + DisplayName: Slow Area + Description: Slows enemies in an area Icon: {fileID: 0} Cooldown: 5 TargetType: 0 - Radius: 0 + Radius: 5 enemyLayerMask: serializedVersion: 2 - m_Bits: 0 + m_Bits: 128 SlowFactor: 0.5 EffectDuration: 3 diff --git a/Assets/_Project/Scripts/Gameplay/BuilderSpells/FireballSpellDefinition.cs b/Assets/_Project/Scripts/Gameplay/BuilderSpells/FireballSpellDefinition.cs index b21e70c..e7facd7 100644 --- a/Assets/_Project/Scripts/Gameplay/BuilderSpells/FireballSpellDefinition.cs +++ b/Assets/_Project/Scripts/Gameplay/BuilderSpells/FireballSpellDefinition.cs @@ -31,6 +31,10 @@ namespace TD.Gameplay.BuilderSpells int count = Physics.OverlapSphereNonAlloc( targetPoint, Mathf.Max(Radius, 0.01f), s_overlapBuffer, enemyLayerMask); + // TEMP DEBUG — remove once cast resolution is confirmed working. + Debug.Log($"[FireballSpellDefinition] ServerCast at {targetPoint}, radius " + + $"{Mathf.Max(Radius, 0.01f):0.##}, found {count} colliders."); + bool hitAny = false; for (int i = 0; i < count; i++) { diff --git a/Assets/_Project/Scripts/Gameplay/BuilderSpells/SlowAreaSpellDefinition.cs b/Assets/_Project/Scripts/Gameplay/BuilderSpells/SlowAreaSpellDefinition.cs index 4bee6bd..4a640df 100644 --- a/Assets/_Project/Scripts/Gameplay/BuilderSpells/SlowAreaSpellDefinition.cs +++ b/Assets/_Project/Scripts/Gameplay/BuilderSpells/SlowAreaSpellDefinition.cs @@ -36,6 +36,16 @@ namespace TD.Gameplay.BuilderSpells int count = Physics.OverlapSphereNonAlloc( targetPoint, Mathf.Max(Radius, 0.01f), s_overlapBuffer, enemyLayerMask); + // TEMP DEBUG — remove once cast resolution is confirmed working. + Debug.Log($"[SlowAreaSpellDefinition] ServerCast at {targetPoint}, radius " + + $"{Mathf.Max(Radius, 0.01f):0.##}, found {count} colliders."); + for (int i = 0; i < count; i++) + { + var c = s_overlapBuffer[i]; + Debug.Log($" hit[{i}]: '{c.name}' layer={LayerMask.LayerToName(c.gameObject.layer)} " + + $"hasEnemyHealth={c.GetComponent() != null}"); + } + bool hitAny = false; for (int i = 0; i < count; i++) {