コード例 #1
0
    //public void Check(BattleCharacter character, Action callback)
    //{
    //    if (!_uuzGetNoDamage && character.Info.IsNoDamage())
    //    {
    //        UuzGetNoDamage(callback);
    //    }
    //    else if (!_summonGhost && character.Info.HPQueue.Count == 1) //剩一條血時觸發
    //    {
    //        _uuzGetNoDamage = true;
    //        _summonGhost = true;
    //        StartSummonGhost(callback);
    //    }
    //    else if (!_uuzLastHP && character.Info.HPQueue.Count == 0) //剩零條血時觸發
    //    {
    //        _uuzLastHP = true;
    //        UuzLastHP(callback);
    //    }
    //    else
    //    {
    //        callback();
    //    }
    //}

    private void StartSummonGhost(Action callback) //uuz 剩一條血的時候第一次召喚幽靈
    {
        if (GetGhostPosition(out Vector2Int position))
        {
            BattleCharacter character = ResourceManager.Instance.Spawn("BattleCharacter/BattleCharacter", ResourceManager.Type.Other).GetComponent <BattleCharacter>();
            int             id        = 22 + UnityEngine.Random.Range(0, 1); //隨機選擇戰士幽靈或法師幽靈
            character.Init(id, _uuz.Lv);                                     //temp
            character.SetPosition(position);
            character.GetDamageHandler += SummonGhostGetDamage;
            BattleController.Instance.AddCharacer(character, true);
            _uuz.SetNoDamage();
            _uuz.Animator.SetBool("NoDamage", true);

            Camera.main.transform.DOMove(new Vector3(position.x, position.y, Camera.main.transform.position.z), 0.5f).OnComplete(() =>
            {
                BattleUI.Instance.SetVisible(false);
                ConversationUI.Open(16001, false, () =>
                {
                    BattleUI.Instance.SetVisible(true);
                    _summonGhost = CheckState.Completed;
                    callback();
                });
            });

            BattleController.Instance.TurnStartHandler += SummonGhost;
            _startTurn = BattleController.Instance.Turn;
        }
        else
        {
            callback();
        }
    }
コード例 #2
0
 public override void Start(Action callback)
 {
     if (_allGapDead == CheckState.Satisfy)
     {
         TilePainter.Instance.Painting("Ground_1", 0, new Vector2Int(0, 4));
         BattleFieldManager.Instance.SetField(new Vector2(0, 4), 1);
         BattleCharacter character = GameObject.Find("Yukari").GetComponent <BattleCharacter>();
         BattleController.Instance.SetCharacerActive(character);
         character.SetPosition(new Vector2(0, 4));
         Vector3 cameraPosition = new Vector3(character.transform.position.x, character.transform.position.y, Camera.main.transform.position.z);
         Camera.main.transform.DOMove(cameraPosition, 1);
         character.Sprite.color = Color.clear;
         character.Sprite.DOColor(Color.white, 1).OnComplete(() =>
         {
             BattleUI.Instance.SetVisible(false);
             ConversationUI.Open(5001, false, () =>
             {
                 BattleUI.Instance.SetVisible(true);
                 _allGapDead = CheckState.Completed;
                 IsCompleted = true;
                 callback();
             });
         });
     }
     else
     {
         callback();
     }
 }
コード例 #3
0
    public void Start_1(Action callback) //剩下一條血時,召喚藍和橙
    {
        BattleUI.Instance.SetVisible(false);
        GameObject yukari   = GameObject.Find("Yukari");
        Vector3    position = new Vector3(yukari.transform.position.x, yukari.transform.position.y, Camera.main.transform.position.z);

        Camera.main.transform.DOMove(position, 0.5f).OnComplete(() =>
        {
            ConversationUI.Open(6001, false, () =>
            {
                BattleCharacter character;

                TilePainter.Instance.Painting("Ground_1", 0, new Vector2Int(1, 5));
                BattleFieldManager.Instance.SetField(new Vector2(1, 5), 1);
                character = GameObject.Find("Ran").GetComponent <BattleCharacter>();
                character.SetActive(true);
                character.SetPosition(new Vector2(1, 5));
                character.transform.DOJump(character.transform.position, 1, 1, 0.5f);

                TilePainter.Instance.Painting("Ground_1", 0, new Vector2Int(-1, 5));
                BattleFieldManager.Instance.SetField(new Vector2(-1, 5), 1);
                character = GameObject.Find("Chen").GetComponent <BattleCharacter>();
                character.SetActive(true);
                character.SetPosition(new Vector2(-1, 5));
                character.transform.DOJump(character.transform.position, 1, 1, 0.5f);

                _timer.Start(1, () =>
                {
                    BattleUI.Instance.SetVisible(true);
                    _start1 = CheckState.Completed;
                    callback();
                });
            });
        });
    }
コード例 #4
0
 public override void Start()
 {
     ExploreUI.Instance.SetVisible(false);
     ConversationUI.Open(11001, false, () =>
     {
         ProgressManager.Instance.Memo.Floor7_Flag = true;
         GameSystem.Instance.AutoSave();
         ExploreUI.Instance.SetVisible(true);
     });
 }
コード例 #5
0
 private void UuzGetNoDamage(Action callback) //uuz在無敵狀態中受到攻擊
 {
     BattleUI.Instance.SetVisible(false);
     ConversationUI.Open(14001, false, () =>
     {
         BattleUI.Instance.SetVisible(true);
         _uuzGetNoDamage = CheckState.Completed;
         callback();
     });
 }
コード例 #6
0
ファイル: Plot_7.cs プロジェクト: a710594/Touhou_Dungeon
 public override void Start()
 {
     ConversationUI.Open(10001, true, () =>
     {
         ExploreController.Instance.ArriveFloor = 7;
         TeamManager.Instance.AddMember(4, true, new Vector2Int(0, 1), 41003, 42002);
         ProgressManager.Instance.Memo.Stage_2_Flag = true;
         GameSystem.Instance.AutoSave();
         Debug.Log("妖夢入隊");
     });
 }
コード例 #7
0
    public override void Start()
    {
        if (ProgressManager.Instance.Memo.BOSS_1_Flag)
        {
            return;
        }

        ExploreUI.Instance.SetVisible(false);
        ExploreController.Instance.PlayerPause();
        ExploreController.Instance.Write();
        Camera.main.transform.DOMoveY(12, 3).OnComplete(() =>
        {
            ConversationUI.Open(3001, false, () =>
            {
                ChangeSceneUI.Instance.StartClock(() =>
                {
                    AudioSystem.Instance.Stop(true);
                    MySceneManager.Instance.ChangeScene(MySceneManager.SceneType.Battle_BOSS_1, () =>
                    {
                        Plot_4 plot_4 = new Plot_4();
                        BattleController.Instance.TurnStartHandler += plot_4.Start;
                        BattleController.Instance.SpecialInit(() =>
                        {
                            ProgressManager.Instance.Memo.BOSS_1_Flag = true;
                            AudioSystem.Instance.Stop(false);
                            MySceneManager.Instance.ChangeScene(MySceneManager.Instance.LastScene, () =>
                            {
                                ExploreController.Instance.SetFloorFromMemo();
                                ExploreUI.Instance.SetVisible(false);
                                ConversationUI.Open(9001, false, () =>
                                {
                                    ExploreUI.Instance.SetVisible(true);
                                });
                            });
                        }, () =>
                        {
                            ConversationUI.Open(8001, false, () =>
                            {
                                AudioSystem.Instance.Stop(false);
                                MySceneManager.Instance.ChangeScene(MySceneManager.SceneType.Villiage, () =>
                                {
                                    ItemManager.Instance.BagToWarehouse();
                                    TeamManager.Instance.RecoverAllMember();
                                });
                            });
                        });
                    });
                });
            });
            ConversationUI.Instance.Handler = OnConversationHandler;
        });
    }
コード例 #8
0
ファイル: Plot_2.cs プロジェクト: a710594/Touhou_Dungeon
    public override void Start()
    {
        BattleUI.Close();
        Camera.main.transform.position = new Vector3(100, 0, -10);
        ConversationUI.Open(2001, true, () =>
        {
            TeamManager.Instance.RecoverAllMember();
            ItemManager.Instance.AddItem(0, 1, ItemManager.Type.Bag);
            AudioSystem.Instance.Stop(true);
            ProgressManager.Instance.Memo.FirstFlag = true;

            AudioSystem.Instance.Play("Forest", true);
            ExploreController.Instance.GenerateFloor(1);
        });
    }
コード例 #9
0
ファイル: Plot_4.cs プロジェクト: a710594/Touhou_Dungeon
    public override void Start()
    {
        if (BattleController.Instance.Turn == 1)
        {
            BattleUI.Instance.SetVisible(false);
            ConversationUI.Open(4001, false, () =>
            {
                BattleUI.Instance.SetVisible(true);
                BattleController.Instance.TurnStartHandler -= Start;
            });
        }

        Plot_5 plot_5 = new Plot_5();

        BattleController.Instance.ShowEndHandler += plot_5.Start;
    }
コード例 #10
0
    private void UuzLastHP(Action callback) //uuz 最後一條血的對話
    {
        BattleUI.Instance.SetVisible(false);
        Vector3 position = new Vector3(_uuz.transform.position.x, _uuz.transform.position.y, Camera.main.transform.position.z);

        Camera.main.transform.DOMove(position, 0.5f).OnComplete(() =>
        {
            ConversationUI.Open(17001, false, () =>
            {
                BattleUI.Instance.SetVisible(true);
                _uuzLastHP = CheckState.Completed;
                callback();
            });
        });
        BattleController.Instance.TurnStartHandler -= SummonGhost;
    }
コード例 #11
0
    public void Start_2(Action callback) //剩下0條血的時候進行該戰鬥中最後一段對話
    {
        BattleUI.Instance.SetVisible(false);
        GameObject yukari   = GameObject.Find("Yukari");
        Vector3    position = new Vector3(yukari.transform.position.x, yukari.transform.position.y, Camera.main.transform.position.z);

        Camera.main.transform.DOMove(position, 0.5f).OnComplete(() =>
        {
            ConversationUI.Open(7001, false, () =>
            {
                BattleUI.Instance.SetVisible(true);
                _start2 = CheckState.Completed;
                callback();
            });
        });
    }
コード例 #12
0
    private void AllGhostDead(Action callback) //所有的幽靈和魔法陣死掉
    {
        BattleCharacter uuz = GameObject.Find("uuz").GetComponent <BattleCharacter>();

        uuz.Info.RemoveStasus(_noDamageId);
        uuz.Animator.SetBool("NoDamage", false);

        BattleUI.Instance.SetVisible(false);
        ConversationUI.Open(15001, false, () =>
        {
            BattleUI.Instance.SetVisible(true);
            _allDead    = CheckState.Completed;
            IsCompleted = true;
            callback();
        });
    }
コード例 #13
0
ファイル: Plot_1.cs プロジェクト: a710594/Touhou_Dungeon
 public override void Start()
 {
     AudioSystem.Instance.Stop(false);
     ConversationUI.Open(1001, true, () =>
     {
         MySceneManager.Instance.ChangeScene(MySceneManager.SceneType.FirstBattle, () =>
         {
             BattleController.Instance.InitHandler = BattleInit;
             BattleController.Instance.SpecialInit(() =>
             {
                 AudioSystem.Instance.Stop(false);
                 Plot_2 plot_2 = new Plot_2();
                 plot_2.Start();
             }, () =>
             {
                 AudioSystem.Instance.Stop(false);
                 MySceneManager.Instance.ChangeScene(MySceneManager.SceneType.Logo);
             });
         });
     });
 }
コード例 #14
0
 // Start is called before the first frame update
 void Start()
 {
     ConversationData.Load();
     ConversationUI.Open(1, true);
 }