spells work! changed the layer to enemy

This commit is contained in:
Ian Woods 2026-07-14 21:37:41 -07:00
parent 7cf15dcaa6
commit ca958376a4
4 changed files with 20 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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++)
{

View file

@ -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<EnemyHealth>() != null}");
}
bool hitAny = false;
for (int i = 0; i < count; i++)
{