Exemple #1
0
        // 「ハイパーモード」コマンド
        private void HyperModeCommand()
        {
            //// MOD START MARGE
            //// If MainWidth <> 15 Then
            //if (GUI.NewGUIMode)
            //{
            //    // MOD END MARGE
            //    Status.ClearUnitStatus();
            //}

            GUI.LockGUI();
            var uname = GeneralLib.LIndex(SelectedUnit.FeatureData("ハイパーモード"), 2);
            var fname = SelectedUnit.FeatureName("ハイパーモード");

            if (Map.IsStatusView)
            {
                // ユニットステータスコマンドの場合
                if (!SelectedUnit.IsFeatureAvailable("ハイパーモード"))
                {
                    uname = GeneralLib.LIndex(SelectedUnit.FeatureData("ノーマルモード"), 1);
                }

                // ハイパーモードを発動
                SelectedUnit.Transform(uname);

                // ユニットリストの表示を更新
                Event.MakeUnitList(smode: "");

                // ステータスウィンドウの表示を更新
                Status.DisplayUnitStatus(SelectedUnit.CurrentForm());

                // コマンドを終了
                GUI.UnlockGUI();
                CommandState = "ユニット選択";
                return;
            }

            // ハイパーモードを発動可能かどうかチェック
            {
                var withBlock1 = SelectedUnit.OtherForm(uname);
                if (!withBlock1.IsAbleToEnter(SelectedUnit.x, SelectedUnit.y) && !string.IsNullOrEmpty(Map.MapFileName))
                {
                    GUI.Confirm("この地形では変形できません", "", GuiConfirmOption.Ok);
                    GUI.UnlockGUI();
                    CancelCommand();
                    return;
                }
            }

            // ダイアログでメッセージを表示させるため追加パイロットをあらかじめ作成
            AddAdditionalPilotIfNotExist(uname, SelectedUnit);

            {
                // BGMを変更
                if (SelectedUnit.IsFeatureAvailable("ハイパーモードBGM"))
                {
                    var loopTo11 = SelectedUnit.CountFeature();
                    for (var i = 1; i <= loopTo11; i++)
                    {
                        var fdata = SelectedUnit.Feature(i).Data;
                        if (SelectedUnit.Feature(i).Name == "ハイパーモードBGM" &&
                            (GeneralLib.LIndex(fdata, 1) ?? "") == uname)
                        {
                            var BGM = Sound.SearchMidiFile(Strings.Mid(fdata, Strings.InStr(fdata, " ") + 1));
                            if (Strings.Len(BGM) > 0)
                            {
                                Sound.ChangeBGM(BGM);
                                GUI.Sleep(500);
                            }
                            break;
                        }
                    }
                }

                // メッセージを表示
                SelectedUnit.PilotMassageIfDefined(new string[]
                {
                    "ハイパーモード(" + SelectedUnit.Name + "=>" + uname + ")",
                    "ハイパーモード(" + uname + ")",
                    "ハイパーモード(" + fname + ")"
                });

                // アニメ表示
                SelectedUnit.PlayAnimation(new string[] {
                    "ハイパーモード(" + SelectedUnit.Name + "=>" + uname + ")",
                    "ハイパーモード(" + uname + ")",
                    "ハイパーモード(" + fname + ")",
                    "ハイパーモード",
                });
            }

            // ハイパーモード発動
            SelectedUnit.Transform(uname);

            // ハイパーモード・ノーマルモードの自動発動をチェック
            SelectedUnit.CurrentForm().CheckAutoHyperMode();
            SelectedUnit.CurrentForm().CheckAutoNormalMode();
            SelectedUnit = Map.MapDataForUnit[SelectedUnit.x, SelectedUnit.y];

            // 変形イベント
            {
                var withBlock4 = SelectedUnit.CurrentForm();
                Event.HandleEvent("変形", withBlock4.MainPilot().ID, withBlock4.Name);
            }

            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                Status.ClearUnitStatus();
                GUI.RedrawScreen();
                CommandState = "ユニット選択";
                GUI.UnlockGUI();
                return;
            }

            SRC.IsCanceled = false;

            // カーソル自動移動
            if (SelectedUnit.Status == "出撃")
            {
                if (SRC.AutoMoveCursor)
                {
                    GUI.MoveCursorPos("ユニット選択", SelectedUnit);
                }

                Status.DisplayUnitStatus(SelectedUnit);
            }

            CommandState = "ユニット選択";
            GUI.UnlockGUI();
        }