예제 #1
0
        // 「ジャンプ」コマンドを終了
        private void FinishJumpCommand()
        {
            // MOD END MARGE
            int ret;

            GUI.LockGUI();
            {
                var u = SelectedUnit;
                PrevUnitX    = u.x;
                PrevUnitY    = u.y;
                PrevUnitArea = u.Area;
                PrevUnitEN   = u.EN;

                // ジャンプ後に着艦or合体する場合はプレイヤーに確認を取る
                if (!ConfirmMoveFinish(u))
                {
                    return;
                }

                // メッセージを表示
                if (u.IsMessageDefined("ジャンプ(" + u.FeatureName("ジャンプ") + ")"))
                {
                    GUI.OpenMessageForm(u1: null, u2: null);
                    u.PilotMessage("ジャンプ(" + u.FeatureName("ジャンプ") + ")", msg_mode: "");
                    GUI.CloseMessageForm();
                }
                else if (u.IsMessageDefined("ジャンプ"))
                {
                    GUI.OpenMessageForm(u1: null, u2: null);
                    u.PilotMessage("ジャンプ", msg_mode: "");
                    GUI.CloseMessageForm();
                }

                // アニメ表示
                if (u.IsAnimationDefined("ジャンプ", u.FeatureName("ジャンプ")))
                {
                    u.PlayAnimation("ジャンプ", u.FeatureName("ジャンプ"));
                }
                else if (u.IsSpecialEffectDefined("ジャンプ", u.FeatureName("ジャンプ")))
                {
                    u.SpecialEffect("ジャンプ", u.FeatureName("ジャンプ"));
                }
                else
                {
                    Sound.PlayWave("Swing.wav");
                }

                // ENを消費
                if (GeneralLib.LLength(u.FeatureData("ジャンプ")) == 2)
                {
                    u.EN = PrevUnitEN - Conversions.ToInteger(GeneralLib.LIndex(u.FeatureData("ジャンプ"), 2));
                }

                // ユニットを移動
                u.Move(SelectedX, SelectedY, true, false, true);
                GUI.RedrawScreen();

                // 移動後に着艦または合体した?
                if (!ReferenceEquals(Map.MapDataForUnit[SelectedX, SelectedY], SelectedUnit))
                {
                    if (Map.MapDataForUnit[SelectedX, SelectedY].IsFeatureAvailable("母艦") && !u.IsFeatureAvailable("母艦") && u.CountPilot() > 0)
                    {
                        // 着艦メッセージ表示
                        if (u.IsMessageDefined("着艦(" + u.Name + ")"))
                        {
                            GUI.OpenMessageForm(u1: null, u2: null);
                            u.PilotMessage("着艦(" + u.Name + ")", msg_mode: "");
                            GUI.CloseMessageForm();
                        }
                        else if (u.IsMessageDefined("着艦"))
                        {
                            GUI.OpenMessageForm(u1: null, u2: null);
                            u.PilotMessage("着艦", msg_mode: "");
                            GUI.CloseMessageForm();
                        }

                        u.SpecialEffect("着艦", u.Name);

                        // 収納イベント
                        SelectedTarget = Map.MapDataForUnit[SelectedX, SelectedY];
                        Event.HandleEvent("収納", u.MainPilot().ID);
                    }
                    else
                    {
                        // 合体後のユニットを選択
                        SelectedUnit = Map.MapDataForUnit[SelectedX, SelectedY];

                        // 合体イベント
                        Event.HandleEvent("合体", SelectedUnit.MainPilot().ID, SelectedUnit.Name);
                    }

                    // 移動後の収納・合体イベントでステージが終了することがあるので
                    if (SRC.IsScenarioFinished)
                    {
                        SRC.IsScenarioFinished = false;
                        GUI.UnlockGUI();
                        return;
                    }

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

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

                    // 持続期間が「移動」のスペシャルパワー効果を削除
                    SelectedUnit.RemoveSpecialPowerInEffect("移動");
                    Status.DisplayUnitStatus(Map.MapDataForUnit[SelectedX, SelectedY]);
                    GUI.RedrawScreen();
                    CommandState = "ユニット選択";
                    GUI.UnlockGUI();
                    return;
                }
                // ADD START MARGE
                SelectedUnitMoveCost = 100;
                // ADD END MARGE
            }

            CommandState = "移動後コマンド選択";
            GUI.UnlockGUI();
            ProceedCommand();
        }
예제 #2
0
        // 「移動」コマンドを終了
        private void FinishMoveCommand()
        {
            LogDebug();

            GUI.LockGUI();

            var u = SelectedUnit;

            PrevUnitX    = u.x;
            PrevUnitY    = u.y;
            PrevUnitArea = u.Area;
            PrevUnitEN   = u.EN;

            // 移動後に着艦or合体する場合はプレイヤーに確認を取る
            if (!ConfirmMoveFinish(u))
            {
                return;
            }

            // ユニットを移動
            u.Move(SelectedX, SelectedY);

            // 移動後に着艦または合体した?
            if (!ReferenceEquals(Map.MapDataForUnit[u.x, u.y], SelectedUnit))
            {
                if (Map.MapDataForUnit[u.x, u.y].IsFeatureAvailable("母艦") && !u.IsFeatureAvailable("母艦") && u.CountPilot() > 0)
                {
                    // 着艦メッセージ表示
                    if (u.IsMessageDefined("着艦(" + u.Name + ")"))
                    {
                        GUI.OpenMessageForm(u1: null, u2: null);
                        u.PilotMessage("着艦(" + u.Name + ")", msg_mode: "");
                        GUI.CloseMessageForm();
                    }
                    else if (u.IsMessageDefined("着艦"))
                    {
                        GUI.OpenMessageForm(u1: null, u2: null);
                        u.PilotMessage("着艦", msg_mode: "");
                        GUI.CloseMessageForm();
                    }
                    u.SpecialEffect("着艦", u.Name);

                    // 収納イベント
                    SelectedTarget = Map.MapDataForUnit[u.x, u.y];
                    Event.HandleEvent("収納", u.MainPilot().ID);
                }
                else
                {
                    // 合体後のユニットを選択
                    SelectedUnit = Map.MapDataForUnit[u.x, u.y];

                    // 合体イベント
                    Event.HandleEvent("合体", SelectedUnit.MainPilot().ID, SelectedUnit.Name);
                }

                // 移動後の収納・合体イベントでステージが終了することがあるので
                if (SRC.IsScenarioFinished)
                {
                    SRC.IsScenarioFinished = false;
                    GUI.UnlockGUI();
                    return;
                }

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

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

                // 持続期間が「移動」のスペシャルパワー効果を削除
                SelectedUnit.RemoveSpecialPowerInEffect("移動");
                Status.DisplayUnitStatus(SelectedUnit);
                GUI.RedrawScreen();
                CommandState = "ユニット選択";
                GUI.UnlockGUI();
                return;
            }

            if (SelectedUnitMoveCost > 0)
            {
                // 行動数を減らす
                WaitCommand();
                return;
            }

            SelectedUnitMoveCost = Map.TotalMoveCost[u.x, u.y];

            CommandState = "移動後コマンド選択";
            GUI.UnlockGUI();
            ProceedCommand();
        }
예제 #3
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();
            //}
        }