public void Press() { if (moveOrItem == false) //if false then its move so { if ((theMove.isAttackMagic()) || (theMove.isAttackSpecial()) || (theMove.isAttck())) //if its Attack then { BattleManager.instance.activeBattlers[BattleManager.instance.currentTurn].currentMP -= theMove.moveMpCost; //subtract moveMpCost from the currentMP BattleManager.instance.activeBattlers[BattleManager.instance.currentTurn].currentSP -= theMove.moveSpCost; //subtract moveSpCost from the currentSP BattleManager.instance.PlayerAction(theMove, theItem, activeBattlerTarget, true); //call the PlayerAction method } else if ((theMove.isSelfMagic()) || (theMove.isSelfSpecial())) //if its Self then { float mpCost = (float)(BattleManager.instance.activeBattlers[BattleManager.instance.currentTurn].maxMP * (theMove.moveMpCost / 100.0)); //the moveMpCost percent from the maxMP float spCost = (float)(BattleManager.instance.activeBattlers[BattleManager.instance.currentTurn].maxSP * (theMove.moveSpCost / 100.0)); //the moveSpCost percent from the maxSP BattleManager.instance.activeBattlers[BattleManager.instance.currentTurn].currentMP -= Mathf.RoundToInt(mpCost); //subtract mpCost from the currentMP BattleManager.instance.activeBattlers[BattleManager.instance.currentTurn].currentSP -= Mathf.RoundToInt(spCost); //subtract spCost from the currentSP BattleManager.instance.PlayerAction(theMove, theItem, activeBattlerTarget, false); //call the PlayerAction method } } else//else then its item so { GameManager.instance.totalItems[theItem.itemIndex].ItemAmount--;//subtract 1 from the ItemAmount BattleManager.instance.PlayerAction(theMove, theItem, activeBattlerTarget, false);//call the PlayerAction method } }
public void Press() { if (theMove.isAttackSpecial()) //if the move is AttackSpecial { BattleManager.instance.OpenTargetMenu(theMove, 2); //open the target select menu } else if (theMove.isSelfSpecial()) //if the move is SelfSpecial { BattleManager.instance.OpenSelfMenu(theMove, null, 2, false); //open the self target select menu } }