/// <summary> /// Update the picking process /// </summary> private void updateAbility() { if (!currentAbility.cursor.isActive && character.isIdle) { cursorConfirmed = false; character.PushAction(currentAbility.Relax()); currentAbility.DestroyCursor(); currentAbility = null; return; } if (currentAbility.cursor != null && currentAbility.cursor.isActive) { currentAbility.cursor.UpdateValues(inputModule.normalizedDirection * Time.deltaTime * 5.0f, inputModule.GetAxis(NeverdawnInputAxis.VerticalRight) * Time.deltaTime); if (inputModule.GetButtonDown(NeverdawnInputButton.Left)) { currentAbility.cursor.Previous(); } if (inputModule.GetButtonDown(NeverdawnInputButton.Right)) { currentAbility.cursor.Next(); } if (inputModule.GetButtonDown(NeverdawnInputButton.Confirm)) { if (currentAbility.cursor.Confirm()) { currentAbility.ApplyCursor(); character.PushAction(currentAbility.Cast()); } } if (inputModule.GetButtonDown(NeverdawnInputButton.Cancel)) { if (currentAbility.cursor.Cancel()) { character.PushAction(currentAbility.Relax()); } } } }
/// <summary> /// Cast an ability (pick the target, if needed) /// </summary> /// <param name="abilityBase"></param> public void CastAbility(AbilityBase abilityBase) { if (character != null && abilityBase != null) { //if (GameController.state == GameState.Exploration) //{ // characterMenu.Close(); //} character.UpdateTile(); currentAbility = abilityBase; currentAbility.caster = character; currentAbility.CreateCursorForController(this); character.PushAction(currentAbility.Prepare()); if (currentAbility.cursor == null) { character.PushAction(currentAbility.Cast()); return; } } }
public void CastDOTAbility() { InitDOTAbility(); _dotAbility.Cast(); }
void CastPoisonAbility() { InitPoisonAbility(); _poisonAbility.Cast(); }
public void CastDamageAbility() { InitDealDamageAbility(); _damageAbility.Cast(); }