//Replace action in Special Action and AvailableActions public override void AddOrReplaceSpecialAction(BaseBattleAction Action) { if (Stats.SpecialAction != null) { AvailableActions.Remove(Stats.SpecialAction); } Stats.SpecialAction = Action; AvailableActions.Add(Stats.SpecialAction); }
//When action selected from menu, set the action void setAction(BaseBattleAction Action) { BattleStateMachine BSM = GameObject.Find("BattleStateMachine").GetComponent <BattleStateMachine>(); //Set ThisTurn Action BSM.ThisTurn.Actor = BSM.CurrentChar; BSM.ThisTurn.Atk_Name = BSM.CurrentChar.Stats.Name; BSM.ThisTurn.Action = Action; //Choose Target BSM.CurrentChar.TurnState = BaseCharStateMachine.CharTurnState.CHOOSETARGET; }
public void TakeCostOfAction(BaseBattleAction Action) { if (Action.CostsHP == true) { Debug.Log("Cost taken for " + Action.ActName); Stats.HP.Current -= Action.ActCost; } else { Stats.SP.Current -= Action.ActCost; } }
public bool IsActionPossible(BaseBattleAction Action) { //Check if move is possible. If it is not, Do not add. if (Action.MustBeDown == true) { //Get Possible Targets if (BSM.ThisTurn.Action != null) { GetTargets(); } else { Debug.Log("There be dragons"); } if (Action.IsDownActionPossible(PossibleTargets) == false) { return(false); } } if (Action.IsCostOfActionPossible(this) == false) { Debug.Log(Action.ActName + " is not possible. (Cost)"); return(false); } //Check if Action can get character disqualified if (Action.Illegal == true && DQ_Strikes >= 2) { Debug.Log(Action.ActName + " is not possible. (Illegal)"); return(false); } //Is action a finisher? if (Action.Finisher == true && Momentum.Current != Momentum.Base) { Debug.Log(Action.ActName + " is not possible. (Finisher)"); return(false); } Debug.Log(Action.ActName + " is possible."); return(true); }
//Adds or replaces character's special action. //Enemy version also replaces in available actions public abstract void AddOrReplaceSpecialAction(BaseBattleAction Action);
public override void AddOrReplaceSpecialAction(BaseBattleAction Action) { Stats.SpecialAction = Action; }