Пример #1
0
        // 「発進」コマンドを終了
        private void FinishLaunchCommand()
        {
            GUI.LockGUI();
            {
                var launchUnit = SelectedTarget;
                // 発進コマンドの目的地にユニットがいた場合
                // XXX 着艦と合体の処理要らんの?
                if (Map.MapDataForUnit[SelectedX, SelectedY] is object)
                {
                    GuiDialogResult res;
                    if (Map.MapDataForUnit[SelectedX, SelectedY].IsFeatureAvailable("母艦") && !launchUnit.IsFeatureAvailable("母艦"))
                    {
                        res = GUI.Confirm("着艦しますか?", "着艦", GuiConfirmOption.OkCancel | GuiConfirmOption.Question);
                    }
                    else
                    {
                        res = GUI.Confirm("合体しますか?", "合体", GuiConfirmOption.OkCancel | GuiConfirmOption.Question);
                    }

                    if (res == GuiDialogResult.Cancel)
                    {
                        CancelCommand();
                        GUI.UnlockGUI();
                        return;
                    }
                }

                // メッセージの表示
                if (launchUnit.IsMessageDefined("発進(" + launchUnit.Name + ")"))
                {
                    GUI.OpenMessageForm(null, null);
                    launchUnit.PilotMessage("発進(" + launchUnit.Name + ")", "");
                    GUI.CloseMessageForm();
                }
                else if (launchUnit.IsMessageDefined("発進"))
                {
                    GUI.OpenMessageForm(null, null);
                    launchUnit.PilotMessage("発進", "");
                    GUI.CloseMessageForm();
                }

                launchUnit.SpecialEffect("発進", launchUnit.Name);
                PrevUnitArea      = launchUnit.Area;
                PrevUnitEN        = launchUnit.EN;
                launchUnit.Status = "出撃";

                // 指定した位置に発進したユニットを移動
                launchUnit.Move(SelectedX, SelectedY);
            }

            // 発進したユニットを母艦から降ろす
            {
                SelectedUnit.UnloadUnit(SelectedTarget.ID);

                // 母艦の位置には発進したユニットが表示されているので元に戻しておく
                // XXX してないよ。。。
                //Map.MapDataForUnit[withBlock1.x, withBlock1.y] = SelectedUnit;
                //GUI.PaintUnitBitmap(SelectedUnit);
            }

            SelectedUnit = SelectedTarget;
            {
                var withBlock2 = SelectedUnit;
                if ((Map.MapDataForUnit[withBlock2.x, withBlock2.y].ID ?? "") != (withBlock2.ID ?? ""))
                {
                    GUI.RedrawScreen();
                    CommandState = "ユニット選択";
                    GUI.UnlockGUI();
                    return;
                }
            }

            CommandState = "移動後コマンド選択";
            GUI.UnlockGUI();
            ProceedCommand();
        }