public virtual void HandleFlipped()
        {
            if (Flipped == false)
            {
                Entity.AddIntAdditionalProperty(Enumerations.AdditionalProperty.Immobile, 1);

                //Flipped Koopas are immune to Fright
                Entity.AddRemoveStatusImmunity(Enumerations.StatusTypes.Fright, true);

                //Lower defense by an amount when flipped
                Entity.LowerDefense(DefenseLoss);
            }

            Flipped = true;

            //Don't play this animation if dead
            if (Entity.IsDead == false)
            {
                Entity.BManager.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.Damage - 2,
                                                                    new BattleGlobals.BattleState[] { BattleGlobals.BattleState.Turn, BattleGlobals.BattleState.TurnEnd },
                                                                    new PlayAnimBattleEvent(Entity, Entity.GetIdleAnim(), false));
            }

            //Getting hit again while flipped refreshes the flip timer
            ElapsedFlippedTurns = 0;

            //Handle being flipped
            Entity.TurnStartEvent -= OnFlippedTurnStart;
            Entity.TurnStartEvent += OnFlippedTurnStart;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Makes a BattleEntity untargetable and adds it to the untargetable list.
        /// </summary>
        /// <param name="entity">The BattleEntity to make untargetable.</param>
        private void UntargetEntity(BattleEntity entity)
        {
            if (entity == null)
            {
                return;
            }

            entity.AddIntAdditionalProperty(Enumerations.AdditionalProperty.Untargetable, 1);
            UntargetableEntities.Add(entity);
        }