protected override void SequenceMainBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                //Wait a few seconds for now (spinning will occur once rotation is in)
                //Increase defense by the amount
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.PlayerBattleAnimations.GuardName);
                EntityUsing.RaiseDefense(DefenseBoost);

                //Tell the BattleEntity to decrease its Defense at the start of the next turn
                EntityUsing.TurnStartEvent -= DecreaseDefenseBoost;
                EntityUsing.TurnStartEvent += DecreaseDefenseBoost;

                //Show the Battle Event
                BattleManager.Instance.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.Message,
                                                                           new BattleManager.BattleState[] { BattleManager.BattleState.Turn, BattleManager.BattleState.TurnEnd },
                                                                           new MessageBattleEvent("Defense will be boosted\nthis turn!", MessageDur));

                Debug.Log($"Raised Defense for {EntityUsing.Name} after using the Defend action!");

                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                //Go in front of the entity
                //bool approachFromLeft = User.BattlePosition.X < EntityUsed.BattlePosition.X;
                Vector2 position = BattleManagerUtils.GetPositionInFront(EntityUsed, false);
                User.AnimManager.PlayAnimation(AnimationGlobals.RunningName);

                CurSequenceAction = new MoveToSeqAction(User, position, WalkDur);
                break;

            case 1:
                User.AnimManager.PlayAnimation(AnimationGlobals.GulpitBattleAnimations.SpitRockName);

                //Show the used entity going inside its mouth; make invisible for now
                EntityUsed.TintColor = Color.Transparent;

                EntityUsed.Layer = User.Layer + .0001f;
                AddSideSeqAction(new MoveToSeqAction(EntityUsed, User.Position + new Vector2(-18, -3), User.AnimManager.GetCurrentAnim <Animation>().CurFrame.Duration));

                CurSequenceAction = new WaitForAnimationSeqAction(User, AnimationGlobals.GulpitBattleAnimations.SpitRockName);
                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
Esempio n. 3
0
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                Vector2 frontPos = BattleManagerUtils.GetPositionInFront(User.BManager.GetFrontmostBattleEntity(CurTarget.EntityType, null), User.EntityType != EntityTypes.Enemy);
                frontPos.Y = User.Position.Y;

                User.AnimManager.PlayAnimation(AnimationGlobals.RunningName);
                CurSequenceAction = new MoveToSeqAction(User, frontPos, WalkDuration);

                break;

            case 1:

                User.AnimManager.PlayAnimation(AnimationGlobals.JumpStartName);
                CurSequenceAction = new WaitForAnimationSeqAction(User, AnimationGlobals.JumpStartName);
                ChangeSequenceBranch(SequenceBranch.Main);

                //Store the jump distance
                XDiffOverTwo = UtilityGlobals.DifferenceDivided(CurTarget.Position.X, User.Position.X, 2f);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        /// <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;
            }
        }
Esempio n. 5
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;
            }
        }
        protected override void SequenceFailedBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                //Play the wink animation, add the heart (and particles at a later time), and play the sound
                User.AnimManager.PlayAnimation(AnimationGlobals.GoombellaBattleAnimations.WinkName, true);

                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.GoombellaBattleAnimations.WinkName);
                break;

            case 1:
                //Wait a little bit
                CurSequenceAction = new WaitSeqAction(WaitDur);
                break;

            case 2:
                //Deal 0 damage to show the move wasn't effective
                AttemptDamage(0, EntitiesAffected[0], Action.DamageProperties, true);

                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
Esempio n. 7
0
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                Vector2 frontPos = BattleManager.Instance.GetPositionInFront(BattleManager.Instance.GetFrontmostBattleEntity(CurTarget.EntityType, null), User.EntityType != EntityTypes.Enemy);
                frontPos.Y = User.Position.Y;

                User.AnimManager.PlayAnimation(AnimationGlobals.RunningName);
                CurSequenceAction = new MoveToSeqAction(frontPos, WalkDuration);

                break;

            case 1:

                User.AnimManager.PlayAnimation(AnimationGlobals.JumpStartName);
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.JumpStartName);
                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
Esempio n. 8
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;
            }
        }
        protected override void SequenceSuccessBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                //Play the wink animation, add the heart (and particles at a later time), play the sound, and show the Command Rank result
                User.AnimManager.PlayAnimation(AnimationGlobals.GoombellaBattleAnimations.WinkName, true);

                if (HighestCommandRank != ActionCommand.CommandRank.None)
                {
                    ShowCommandRankVFX(HighestCommandRank, EntitiesAffected[0].Position);
                }

                BattleObjManager.Instance.AddBattleObject(HeartVFX);
                EntitiesAffected[0].AnimManager.PlayAnimation(AnimationGlobals.PlayerBattleAnimations.StarSpecialName);

                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.GoombellaBattleAnimations.WinkName);
                break;

            case 1:
                //Wait a little bit
                CurSequenceAction = new WaitSeqAction(WaitDur);
                break;

            case 2:
                //Subtract the used turn count by one to give another turn
                //This shouldn't work if the entity is immobile in some way (Ex. Stop, Frozen, etc.), so check for it first
                if (EntitiesAffected[0].MaxTurns > 0)
                {
                    EntitiesAffected[0].SetTurnsUsed(EntitiesAffected[0].TurnsUsed - 1);
                }

                MessageBattleEvent msgEvent = new MessageBattleEvent(SuccessMessage, 2000d);

                //Show the message
                BattleManager.Instance.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.Message,
                                                                           new BattleManager.BattleState[] { BattleManager.BattleState.Turn }, msgEvent);

                CurSequenceAction = new WaitForBattleEventSeqAction(msgEvent);
                break;

            case 3:
                EntitiesAffected[0].AnimManager.PlayAnimation(EntitiesAffected[0].GetIdleAnim());
                HeartVFX.FadeOut();
                CurSequenceAction = new WaitSeqAction(0d);

                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
Esempio n. 10
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;
            }
        }
Esempio n. 11
0
        protected override void SequenceMainBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                EntitiesAffected[0].AnimManager.PlayAnimation(AnimationGlobals.MarioBattleAnimations.StoneCapPutOnName);
                CurSequenceAction = new WaitForAnimationSeqAction(EntitiesAffected[0].AnimManager.GetAnimation(AnimationGlobals.MarioBattleAnimations.StoneCapPutOnName));
                break;

            default:
                base.SequenceMainBranch();
                break;
            }
        }
Esempio n. 12
0
        protected override void SequenceFailedBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.GoombellaBattleAnimations.TattleFailName);
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.GoombellaBattleAnimations.TattleFailName);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceMissBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.JumpMissName, true);
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.JumpMissName);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceSuccessBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(SlamAnimName, true);
                AttemptDamage(BaseDamage * DamageMod, EntitiesAffected, Action.DamageProperties, false);
                CurSequenceAction = new WaitForAnimationSeqAction(SlamAnimName);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
Esempio n. 15
0
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.KoopatrolBattleAnimations.SummonKoopatrolName);

                CurSequenceAction = new WaitForAnimationSeqAction(User, AnimationGlobals.KoopatrolBattleAnimations.SummonKoopatrolName);
                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
Esempio n. 16
0
        protected override void SequenceMissBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.JumpMissName, true);
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.JumpMissName);
                ChangeSequenceBranch(SequenceBranch.End);

                //Set the sequence step so it doesn't perform the jump back part of the end sequence
                SequenceStep = 1;
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.GoombellaBattleAnimations.TattleStartName);
                CurSequenceAction = new WaitForAnimationSeqAction(User, AnimationGlobals.GoombellaBattleAnimations.TattleStartName);
                break;

            case 1:
                CurSequenceAction = new WaitSeqAction(WaitTime);
                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.ShelledBattleAnimations.EnterShellName);

                //Kooper, Koops, Koopa Troopas, Buzzy Beetles, and etc. always use Shell Toss in place
                Vector2 front = User.BattlePosition;

                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.ShelledBattleAnimations.EnterShellName);
                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
Esempio n. 19
0
        protected override void SequenceMainBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.GulpitBattleAnimations.LickName);
                CurSequenceAction = new WaitForAnimationSeqAction(User, AnimationGlobals.GulpitBattleAnimations.LickName);
                break;

            case 1:
                //Deal damage and end
                AttemptDamage(BaseDamage, EntitiesAffected[0], Action.DamageProperties, false);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.RunningName);
                CurSequenceAction = new MoveToSeqAction(BattleManager.Instance.GetPositionInFront(EntitiesAffected[0]), WalkDuration);
                break;

            case 1:
                User.AnimManager.PlayAnimation(PickupAnimName, true);
                CurSequenceAction = new WaitForAnimationSeqAction(PickupAnimName);
                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.RunningName);
                CurSequenceAction = new MoveToSeqAction(User, BattleManagerUtils.GetPositionInFront(User, User.EntityType != Enumerations.EntityTypes.Player), WalkDuration);
                break;

            case 1:
                User.AnimManager.PlayAnimation(PickupAnimName, true);
                CurSequenceAction = new WaitForAnimationSeqAction(User, PickupAnimName);
                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceStartBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.DuplighostBattleAnimations.DisguiseStartName);
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.DuplighostBattleAnimations.DisguiseStartName);
                break;

            case 1:
                User.AnimManager.PlayAnimation(AnimationGlobals.DuplighostBattleAnimations.DisguiseName);

                ChangeSequenceBranch(SequenceBranch.Main);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }
        protected override void SequenceEndBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                User.AnimManager.PlayAnimation(AnimationGlobals.ShelledBattleAnimations.ExitShellName, true);
                CurSequenceAction = new WaitForAnimationSeqAction(AnimationGlobals.ShelledBattleAnimations.ExitShellName);
                break;

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

            case 2:
                User.AnimManager.PlayAnimation(User.GetIdleAnim(), true);
                EndSequence();
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }