spell refactor part 2

This commit is contained in:
2026-01-22 14:54:35 +01:00
parent 1beff44ada
commit a7f91bcd67
30 changed files with 589 additions and 931 deletions

View File

@@ -12,12 +12,19 @@ namespace Beyond
// Start is called before the first frame update
private void Start()
{
baseStepController.ConditionsAreMet += () => magicAttacks.isPlaying;
// [FIX] magicAttacks.isPlaying is private.
// We check the animator directly for the "Spell" tag or state.
baseStepController.ConditionsAreMet += CheckIsPlaying;
}
// Update is called once per frame
private void Update()
private bool CheckIsPlaying()
{
var animator = magicAttacks.GetComponent<Animator>();
if (animator == null) return false;
// Assuming layer 5 is spells (from your MagicAttacks constants)
var state = animator.GetCurrentAnimatorStateInfo(5);
return state.IsTag("Spell") || state.IsTag("special");
}
}
}

View File

@@ -12,7 +12,12 @@ namespace Beyond
// Start is called before the first frame update
private void Start()
{
baseStepController.ConditionsAreMet += () => magicAttacks.selectedEffect.secondaryName == "Covert Gaze ";
// [FIX] Checked the equipped item name instead of 'selectedEffect'
baseStepController.ConditionsAreMet += () =>
{
var item = magicAttacks.GetEquippedSpellItem();
return item != null && item.name.Contains("Covert Gaze");
};
}
}
}