示例#1
0
        protected override void OnEnd()
        {
            base.OnEnd();

            if (TattleBox != null)
            {
                BattleObjManager.Instance.RemoveBattleObject(TattleBox);

                TattleBox = null;
            }

            TattledEntity = null;
        }
        protected override void OnEnd()
        {
            base.OnEnd();

            if (TattleBox != null)
            {
                User.BManager.battleObjManager.RemoveBattleObject(TattleBox);

                TattleBox = null;
            }

            TattledEntity = null;

            if (TattleUI != null)
            {
                User.BManager.battleUIManager.RemoveUIElement(TattleUI);
                TattleUI = null;
            }
        }
        protected override void SequenceSuccessBranch()
        {
            switch (SequenceStep)
            {
            case 0:
                if (CommandEnabled == true)
                {
                    ShowCommandRankVFX(HighestCommandRank, EntitiesAffected[0].Position);
                }

                //Create the tattle box and add it so it updates
                TattleBox = new TattleRenderObj(Camera.Instance.SpriteToUIPos(EntitiesAffected[0].Position));
                User.BManager.battleObjManager.AddBattleObject(TattleBox);

                string entityName = EntitiesAffected[0].Name;

                //Check if the enemy is in the Tattle database
                bool inDatabase = TattleDatabase.HasTattleDescription(entityName);

                //Add the Tattle information to the player's Tattles if the enemy isn't in the database
                if (inDatabase == false)
                {
                    TattleDatabase.AddTattleLogEntry(entityName, TattledEntity.GetTattleLogEntry());
                    TattleDatabase.AddTattleDescriptionEntry(entityName, TattledEntity.GetTattleDescription());

                    //Mark the enemies to show their HP
                    BattleEntity[] entities = User.BManager.GetEntities(Enumerations.EntityTypes.Enemy, null);
                    for (int i = 0; i < entities.Length; i++)
                    {
                        if (entities[i].Name == entityName)
                        {
                            entities[i].AddShowHPProperty();
                        }
                    }
                }

                //Start moving the tattle box down
                TattleBox.Start(WindowMoveTime);

                CurSequenceAction = new WaitSeqAction(WindowMoveTime);

                break;

            case 1:
                //Open the tattle box to show the BattleEntity tattled
                TattleBox.Open(WindowOpenCloseTime);

                CurSequenceAction = new WaitSeqAction(WindowOpenCloseTime);
                break;

            case 2:
                //NOTE: Show dialogue bubble coming from Goombario/Goombella along with the enemy's Tattle log entry (with image and stats)
                string tattleDescription = TattledEntity.GetTattleDescription();

                string tattle = "Tattle Description:\n" + tattleDescription;

                //Log it
                Debug.Log(tattle);

                //Create the dialogue bubble
                DialogueManager.Instance.CreateBubble(tattleDescription, User);
                CurSequenceAction = new WaitForDialogueSeqAction(DialogueManager.Instance.CurDialogueBubble);
                break;

            case 3:
                //Close the tattle box
                TattleBox.Close(WindowOpenCloseTime);

                CurSequenceAction = new WaitSeqAction(WindowOpenCloseTime);
                break;

            case 4:
                //Move the tattle box offscreen
                TattleBox.End(WindowMoveTime);

                CurSequenceAction = new WaitSeqAction(WindowMoveTime);
                break;

            case 5:
                //Remove the tattle box
                User.BManager.battleObjManager.RemoveBattleObject(TattleBox);
                TattleBox = null;

                CurSequenceAction = new WaitSeqAction(0d);
                ChangeSequenceBranch(SequenceBranch.End);
                break;

            default:
                PrintInvalidSequence();
                break;
            }
        }