コード例 #1
0
        public sealed override void OnActionStarted()
        {
            base.OnActionStarted();

            //Subtract Star Power if the Special Move costs SP (Focus, Star Beam, and Peach Beam are Special Moves that doesn't cost SP)
            //The BattleEntity must have SP, and enough of it, at this point, as the action is not selectable from the menu otherwise
            if (CostsSP == true)
            {
                //Subtract Star Power
                MarioStats    marioStats = User.BattleStats as MarioStats;
                StarPowerBase starPower  = marioStats.GetStarPowerFromType(SPType);
                starPower.LoseStarPower(SPCost);
            }
        }
コード例 #2
0
        /// <summary>
        /// What happens when the MoveAction starts.
        /// This is called immediately before starting the Sequence.
        /// </summary>
        public virtual void OnActionStarted()
        {
            //Subtract FP if the move costs FP. The BattleEntity must have enough FP
            //at this point, as the action is not selectable from the menu if it doesn't have enough
            if (CostsFP == true)
            {
                User.LoseFP((int)MoveProperties.ResourceCost);
            }

            //Subtract SP if the move costs SP. The BattleEntity must have enough SP at this point since the move can't be selected otherwise
            if (CostsSP == true)
            {
                MarioStats mStats = User.BattleStats as MarioStats;
                if (mStats != null)
                {
                    StarPowerBase starPower = null;

                    if (MoveProperties.ResourceType == MoveResourceTypes.SSSP)
                    {
                        starPower = mStats.GetStarPowerFromType(StarPowerGlobals.StarPowerTypes.StarSpirit);
                    }
                    else if (MoveProperties.ResourceType == MoveResourceTypes.CSSP)
                    {
                        starPower = mStats.GetStarPowerFromType(StarPowerGlobals.StarPowerTypes.CrystalStar);
                    }

                    //Decrease SP
                    if (starPower != null)
                    {
                        starPower.LoseStarPower(MoveProperties.ResourceCost);
                    }
                }
            }

            //If it's not an item move, remove the dip item turns property
            //This ensures that no item turns remain if the entity was using Double/Triple Dip but did something else via Confusion
            if (User.EntityProperties.HasAdditionalProperty(AdditionalProperty.DipItemTurns) == true)
            {
                User.EntityProperties.RemoveAdditionalProperty(AdditionalProperty.DipItemTurns);
            }
        }