Beispiel #1
0
        // 「待機」コマンド
        // 他のコマンドの終了処理にも使われる
        private void WaitCommand(bool WithoutAction = false)
        {
            LogDebug();

            // コマンド終了時はターゲットを解除
            SelectedTarget = null;

            // ユニットにパイロットが乗っていない?
            if (SelectedUnit.CountPilot() == 0)
            {
                CommandState = "ユニット選択";
                GUI.RedrawScreen();
                Status.ClearUnitStatus();
                return;
            }

            if (!WithoutAction)
            {
                // 残り行動数を減少させる
                SelectedUnit.UseAction();

                // 持続期間が「移動」のスペシャルパワー効果を削除
                if (Strings.InStr(CommandState, "移動後") > 0)
                {
                    SelectedUnit.RemoveSpecialPowerInEffect("移動");
                }
            }

            CommandState = "ユニット選択";

            // アップデート
            SelectedUnit.Update();
            SRC.PList.UpdateSupportMod(SelectedUnit);

            // ユニットが既に出撃していない?
            if (SelectedUnit.Status != "出撃")
            {
                GUI.RedrawScreen();
                Status.ClearUnitStatus();
                return;
            }

            GUI.LockGUI();
            GUI.RedrawScreen();
            var p = SelectedUnit.Pilots.First();

            // 接触イベント
            foreach (var unit in Map.AdjacentUnit(SelectedUnit))
            {
                SelectedTarget = unit;
                Event.HandleEvent("接触", SelectedUnit.MainPilot().ID, SelectedTarget.MainPilot().ID);
                SelectedTarget = null;
                if (SRC.IsScenarioFinished)
                {
                    SRC.IsScenarioFinished = false;
                    return;
                }

                if (SelectedUnit.Status != "出撃")
                {
                    GUI.RedrawScreen();
                    Status.ClearUnitStatus();
                    GUI.UnlockGUI();
                    return;
                }
            }

            // 進入イベント
            Event.HandleEvent("進入", SelectedUnit.MainPilot().ID, "" + SelectedUnit.x, "" + SelectedUnit.y);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                return;
            }

            if (SelectedUnit.CountPilot() == 0)
            {
                GUI.RedrawScreen();
                Status.ClearUnitStatus();
                GUI.UnlockGUI();
                return;
            }

            // 行動終了イベント
            Event.HandleEvent("行動終了", SelectedUnit.MainPilot().ID);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                return;
            }

            if (SelectedUnit.CountPilot() == 0)
            {
                GUI.RedrawScreen();
                Status.ClearUnitStatus();
                GUI.UnlockGUI();
                return;
            }

            if (p.Unit is object)
            {
                SelectedUnit = p.Unit;
            }

            if (SelectedUnit.Action > 0 && SelectedUnit.CountPilot() > 0)
            {
                // カーソル自動移動
                if (SRC.AutoMoveCursor)
                {
                    GUI.MoveCursorPos("ユニット選択", SelectedUnit);
                }
            }

            // ハイパーモード・ノーマルモードの自動発動をチェック
            SelectedUnit.CurrentForm().CheckAutoHyperMode();
            SelectedUnit.CurrentForm().CheckAutoNormalMode();
            if (GUI.IsPictureVisible || GUI.IsCursorVisible)
            {
                GUI.RedrawScreen();
            }

            GUI.UnlockGUI();

            //// ステータスウィンドウの表示内容を更新
            //if (SelectedUnit.Status == "出撃" && GUI.MainWidth == 15)
            //{
            //    Status.DisplayUnitStatus(SelectedUnit);
            //}
            //else
            //{
            //    Status.ClearUnitStatus();
            //}
        }