コード例 #1
0
        protected override void SequenceFailedBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                if (SecondPart == false)
                {
                    base.SequenceFailedBranch();
                }
                else
                {
                    User.AnimManager.PlayAnimation(AnimationGlobals.MarioBattleAnimations.TornadoJumpFailName);
                    CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.MarioBattleAnimations.TornadoJumpFailName);
                }
                break;

            case 1:
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, JumpHeight), JumpDuration);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #2
0
        /// <summary>
        /// The interruption that occurs when jumping on a Spiked entity
        /// </summary>
        protected void SpikedEntityInterruption()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.SpikedTipHurtName, true);

                Vector2 pos = BattleManager.Instance.GetPositionInFront(CurTarget) + new Vector2(-50, -JumpHeight);
                CurSequenceAction = new MoveToSeqAction(pos, WalkDuration / 4d);
                break;

            case 1:
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.SpikedTipHurtName);
                break;

            case 2:
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, JumpHeight), JumpDuration / 2f);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #3
0
        /// <summary>
        /// The base interruption handler
        /// </summary>
        protected void BaseInterruptionHandler()
        {
            float moveX = -20f;
            float moveY = 70f;

            double time = 500d;

            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.HurtName, true);

                Vector2 pos = User.Position + new Vector2(moveX, -moveY);
                CurSequenceAction = new MoveToSeqAction(pos, time / 2d);
                break;

            case 1:
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.HurtName);
                break;

            case 2:
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, moveY), time);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #4
0
        protected override void SequenceSuccessBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                if (SecondPart == false)
                {
                    base.SequenceSuccessBranch();

                    //Stop targeting the current targets. If it's a Winged entity, it won't be airborne anymore and thus
                    //won't take damage from the second part of the attack
                    for (int i = 0; i < CurTargets.Length; i++)
                    {
                        CurTargets[i].StopTarget();
                    }

                    SecondPart = true;
                    ChangeSequenceBranch(SequenceBranch.Main);
                }
                else
                {
                    CurSequenceAction = new WaitSeqAction(WaitTime);
                }
                break;

            case 1:
                int        aerialDamage     = BaseDamage;
                DamageData aerialDamageInfo = Action.DamageProperties;

                //Make sure the action used for this sequence is Tornado Jump
                //If not, default to base damage and base targets
                if (TJAction != null)
                {
                    aerialDamage     = TJAction.AerialDamage.Damage;
                    aerialDamageInfo = TJAction.AerialDamage;
                }
                else
                {
                    Debug.LogWarning($"{Action.Name} is not of type {nameof(TornadoJump)} in {nameof(TornadoJumpSequence)}!");
                }

                AttemptDamage(aerialDamage, CurTargets, aerialDamageInfo, true);

                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, JumpHeight), JumpDuration);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #5
0
        /// <summary>
        /// The interruption that occurs when jumping on a Spiked entity
        /// </summary>
        protected void SpikedEntityInterruption()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.SpikedTipHurtName, true);

                Vector2 offset = new Vector2(-50, -JumpHeight);
                if (User.EntityType != EntityTypes.Player)
                {
                    offset.X = -offset.X;
                }

                Vector2 pos = BattleManager.Instance.GetPositionInFront(CurTarget, User.EntityType != EntityTypes.Player) + offset;
                CurSequenceAction = new MoveToSeqAction(pos, WalkDuration / 4d);
                break;

            case 1:
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.SpikedTipHurtName);
                break;

            case 2:
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, User.BattlePosition.Y - User.Position.Y), JumpDuration / 2f, Interpolation.InterpolationTypes.Linear, Interpolation.InterpolationTypes.QuadIn);
                break;

            case 3:
                //Do the same bounce as the end sequence, except keep playing the same animation
                Vector2 endPos  = BattleManager.Instance.GetPositionInFront(CurTarget, User.EntityType == EntityTypes.Player);
                Vector2 moveAmt = new Vector2(UtilityGlobals.DifferenceDivided(endPos.X, User.Position.X, 2f), -(JumpHeight / 2f));

                CurSequenceAction = new MoveAmountSeqAction(moveAmt, JumpDuration / 2f, Interpolation.InterpolationTypes.Linear, Interpolation.InterpolationTypes.QuadOut);
                break;

            case 4:
                endPos = BattleManager.Instance.GetPositionInFront(CurTarget, User.EntityType == EntityTypes.Player);

                moveAmt = new Vector2(UtilityGlobals.DifferenceDivided(endPos.X, User.Position.X, 2f), (JumpHeight / 2f));

                CurSequenceAction = new MoveAmountSeqAction(moveAmt, JumpDuration / 2f, Interpolation.InterpolationTypes.Linear, Interpolation.InterpolationTypes.QuadIn);

                ChangeSequenceBranch(SequenceBranch.End);

                SequenceStep = 1;
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #6
0
        protected override void SequenceMainBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(User.GetIdleAnim());
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, -JumpHeight), JumpDuration);
                break;

            case 1:
                StartActionCommandInput();
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, JumpHeight), JumpDuration);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #7
0
        protected override void SequenceSuccessBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.JumpLandName);
                CurSequenceAction = new WaitSeqAction(JumpLandDuration);
                break;

            case 1:
                User.AnimManager.PlayAnimation(AnimationGlobals.JumpRisingName);
                InteractionResult[] interactions = AttemptDamage(DamageDealt, CurTarget, Action.DamageProperties, false);

                //Show VFX for the highest command rank
                if (interactions[0] != null && interactions[0].WasVictimHit == true && interactions[0].WasAttackerHit == false)
                {
                    ShowCommandRankVFX(HighestCommandRank, CurTarget.Position);

                    //Set Stylish data
                    SetStylishData(200d, 600d, 0);
                }

                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, -JumpHeight), JumpDuration, Interpolation.InterpolationTypes.Linear, Interpolation.InterpolationTypes.QuadOut);
                break;

            case 2:
                User.AnimManager.PlayAnimation(AnimationGlobals.JumpFallingName);
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, JumpHeight), JumpDuration, Interpolation.InterpolationTypes.Linear, Interpolation.InterpolationTypes.QuadIn);
                break;

            case 3:
                AttemptDamage(DamageDealt, CurTarget, Action.DamageProperties, false);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #8
0
        protected override void SequenceEndBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                //Do a little bounce at the end
                Vector2 endPos  = BattleManagerUtils.GetPositionInFront(CurTarget, User.EntityType == EntityTypes.Player);
                Vector2 moveAmt = new Vector2(UtilityGlobals.DifferenceDivided(endPos.X, User.Position.X, 2f), -(JumpHeight / 2f));

                User.AnimManager.PlayAnimation(AnimationGlobals.JumpRisingName);
                CurSequenceAction = new MoveAmountSeqAction(User, moveAmt, JumpDuration / 2f, Interpolation.InterpolationTypes.Linear, Interpolation.InterpolationTypes.QuadOut);
                break;

            case 1:
                float moveDiffY = User.Position.Y - User.BattlePosition.Y;

                endPos = BattleManagerUtils.GetPositionInFront(CurTarget, User.EntityType == EntityTypes.Player);

                moveAmt = new Vector2(UtilityGlobals.DifferenceDivided(endPos.X, User.Position.X, 2f), /*(JumpHeight / 2f)*/ -moveDiffY);

                User.AnimManager.PlayAnimation(AnimationGlobals.JumpFallingName);
                CurSequenceAction = new MoveAmountSeqAction(User, moveAmt, JumpDuration / 2f, Interpolation.InterpolationTypes.Linear, Interpolation.InterpolationTypes.QuadIn);
                break;

            case 2:
                User.AnimManager.PlayAnimation(AnimationGlobals.RunningName);
                CurSequenceAction = new MoveToSeqAction(User, User.BattlePosition, WalkDuration);
                break;

            case 3:
                User.AnimManager.PlayAnimation(User.GetIdleAnim());
                EndSequence();
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #9
0
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                //Move to the opponent
                CurSequenceAction = new MoveToSeqAction(BattleManager.Instance.GetPositionInFront(EntitiesAffected[0], User.EntityType != Enumerations.EntityTypes.Enemy), MoveTime);
                break;

            case 1:
                //Jump up to their height
                CurSequenceAction = new MoveToSeqAction(EntitiesAffected[0].BattlePosition + new Vector2(0f, 10f), JumpTime);
                break;

            case 2:
                //Fall down and latch
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, -10f), JumpTime);
                break;

            case 3:
                //Override defensive actions as the latching shouldn't be guardable
                DamageData damageData = Action.DamageProperties;
                damageData.ContactType       = Enumerations.ContactTypes.Latch;
                damageData.Damage            = 0;
                damageData.DefensiveOverride = Enumerations.DefensiveActionTypes.Guard | Enumerations.DefensiveActionTypes.Superguard;

                //Deal 0 damage
                //If we go to the Main branch, then we can start the action command
                //Otherwise an interruption or miss occurred, so handle that in those branches
                AttemptDamage(0, EntitiesAffected[0], damageData, true);
                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #10
0
        protected override void SequenceSuccessBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                AttemptDamage(DamageDealt, CurTarget, Action.DamageProperties, false);
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, -JumpHeight), JumpDuration);
                break;

            case 1:
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, JumpHeight), JumpDuration);
                break;

            case 2:
                AttemptDamage(DamageDealt, CurTarget, Action.DamageProperties, false);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
コード例 #11
0
        protected override void SequenceMainBranch()
        {
            switch (SequenceStep)
            {
            //Perform the dive kick movement
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.ParagoombaBattleAnimations.DiveKickName);

                //Move up a bit before swooping down
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, -25f), 350d);
                break;

            case 1:
                //Move back down
                CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, 25f), 350d);
                break;

            case 2:
                //Swoop in
                CurSequenceAction = new MoveToSeqAction(new Vector2(EntitiesAffected[0].Position.X, User.Position.Y - 10), 500d);

                //Here's likely where you'd check for an action command's input if this were to have one - it'd be like Jump
                break;

            case 3:
                //Damage
                AttemptDamage(BaseDamage, EntitiesAffected, Action.DamageProperties, false);

                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }