Exemplo n.º 1
0
 /// <summary>
 /// The phase during the ability activation. This is usually where hit boxes or status effects are spawned.
 /// </summary>
 /// <param name="args"></param>
 protected void ActivePhase(params object[] args)
 {
     onActivate?.Invoke();
     CurrentAbilityPhase = AbilityPhase.ACTIVE;
     Activate(args);
     _currentTimer = RoutineBehaviour.Instance.StartNewTimedAction(context => RecoverPhase(args), TimedActionCountType.SCALEDTIME, abilityData.timeActive);
 }
Exemplo n.º 2
0
 /// <summary>
 /// The phase before an the ability is activated. This is where the character is building up
 /// to the ability's activation
 /// </summary>
 /// <param name="args"></param>
 protected void StartUpPhase(params object[] args)
 {
     _inUse = true;
     onBegin?.Invoke();
     CurrentAbilityPhase = AbilityPhase.STARTUP;
     Start(args);
     _currentTimer = RoutineBehaviour.Instance.StartNewTimedAction(context => ActivePhase(args), TimedActionCountType.SCALEDTIME, abilityData.startUpTime);
 }
Exemplo n.º 3
0
        /// <summary>
        /// The phase after the ability activation. This is usually where the character is winding back into idle
        /// after activating the ability
        /// </summary>
        /// <param name="args"></param>
        protected void RecoverPhase(params object[] args)
        {
            CurrentAbilityPhase = AbilityPhase.RECOVER;

            if (MaxActivationAmountReached)
            {
                _currentTimer = RoutineBehaviour.Instance.StartNewTimedAction(arguments => EndAbility(), TimedActionCountType.SCALEDTIME, abilityData.recoverTime);
            }
            else
            {
                _currentTimer = RoutineBehaviour.Instance.StartNewTimedAction(arguments => { _inUse = false; Deactivate(); }, TimedActionCountType.SCALEDTIME, abilityData.recoverTime);
            }
        }