Currently, casting is done through two means: IModifierOwner.TryCast and IStatusEffectModifierOwner.TryCast.
But both of these methods skip the user as a caster to some degree.
Instead, the unit should call its event list List<IEffect> _onCastEffects when casting, as well as the other checks.
Just like we do for example how _whenAttackedEffects trigger when the unit gets attacked.
The cast should also check if we can cast (LegalAction), and if we can cast that modifier ModifierController.CanCastModifier.
The method should be directly implemented in the Unit class in ModiBuff.Units.
A unit test or two should be made to check that it works correctly, mention @Chillu1 for help with this.
Currently, casting is done through two means:
IModifierOwner.TryCast
andIStatusEffectModifierOwner.TryCast
.But both of these methods skip the user as a caster to some degree. Instead, the unit should call its event list
List<IEffect> _onCastEffects
when casting, as well as the other checks. Just like we do for example how_whenAttackedEffects
trigger when the unit gets attacked.The cast should also check if we can cast (LegalAction), and if we can cast that modifier
ModifierController.CanCastModifier
.The method should be directly implemented in the
Unit
class in ModiBuff.Units.A unit test or two should be made to check that it works correctly, mention @Chillu1 for help with this.