protected override void OnEnd()
        {
            base.OnEnd();
            BattleUIManager.Instance.UnsuppressMenus();

            //Handle the entity dying on its turn
            if (Entity.IsTurn == true)
            {
                //If in the middle of a sequence, end it
                if (Entity.PreviousAction != null && Entity.PreviousAction.MoveSequence.InSequence == true)
                {
                    Entity.PreviousAction.MoveSequence.EndSequence();
                }
                //Otherwise end its turn
                else
                {
                    BattleManager.Instance.TurnEnd();
                }
            }

            //If this BattleEntity is being revived, add the revival event and don't check for deaths
            Item revivalItem = null;

            //If we should override revival, don't check for a revival item
            if (OverrideRevival == false)
            {
                revivalItem = Entity.GetItemOfType(Item.ItemTypes.Revival);
            }

            if (revivalItem != null)
            {
                //NOTE: In TTYD if both Mario and his Partner die at the same time, it'll use up only one Life Shroom
                //The current behavior performs that; however, if an entity dies before another's revival event is finished,
                //the one being revived will still be removed from battle since it's still dead.
                //This will have to be revised in some way to work properly

                //Queue the revival event with the same priority as death so it occurs immediately
                BattleManager.Instance.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.Death,
                                                                           new BattleManager.BattleState[] { BattleManager.BattleState.Turn, BattleManager.BattleState.TurnEnd },
                                                                           new RevivedBattleEvent(1000d, Entity, revivalItem));
            }
            else
            {
                //Check for deaths
                BattleManager.Instance.HandleEntityDeaths();
            }
        }
Ejemplo n.º 2
0
        protected override void OnEnd()
        {
            base.OnEnd();
            Entity.BManager.battleUIManager.UnsuppressMenus();

            Entity.Rotation = 0f;

            //Handle the entity dying on its turn
            if (Entity.IsTurn == true)
            {
                //If in the middle of a sequence, end it
                if (Entity.LastAction != null && Entity.LastAction.MoveSequence.InSequence == true)
                {
                    Entity.LastAction.MoveSequence.EndSequence();
                }
                //Otherwise end its turn
                else
                {
                    Entity.BManager.TurnEnd();
                }
            }

            //If this BattleEntity is being revived, add the revival event and don't check for deaths
            Item revivalItem = null;

            //If we should override revival, don't check for a revival item
            if (OverrideRevival == false)
            {
                revivalItem = Entity.GetItemOfType(Item.ItemTypes.Revival);
            }

            if (revivalItem != null)
            {
                //Queue the revival event with the same priority as death so it occurs immediately
                Entity.BManager.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.Death,
                                                                    new BattleGlobals.BattleState[] { BattleGlobals.BattleState.Turn, BattleGlobals.BattleState.TurnEnd },
                                                                    new RevivedBattleEvent(1000d, Entity, revivalItem));
            }
            else
            {
                //Handle death
                Entity.BManager.HandleEntityDeath(Entity);
            }
        }