Exemplo n.º 1
0
        // 「会話」コマンドを終了
        private void FinishTalkCommand()
        {
            Pilot p;

            GUI.LockGUI();
            if (SelectedUnit.CountPilot() > 0)
            {
                p = SelectedUnit.Pilots.First();
            }
            else
            {
                p = null;
            }

            // 会話イベントを実施
            Event.HandleEvent("会話", SelectedUnit.MainPilot().ID, SelectedTarget.MainPilot().ID);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                return;
            }

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

            GUI.UnlockGUI();

            // 行動終了
            WaitCommand();
        }
Exemplo n.º 2
0
        // スペシャルパワーコマンドを終了
        private void FinishSpecialPowerCommand()
        {
            GUI.LockGUI();

            // 自爆を選択した場合は確認を取る
            {
                var spd = SRC.SPDList.Item(SelectedSpecialPower);
                if (spd.Effects.Any(x => x.strEffectType == "自爆"))
                {
                    if (GUI.Confirm("自爆させますか?", "自爆", GuiConfirmOption.OkCancel | GuiConfirmOption.Question) != GuiDialogResult.Ok)
                    {
                        CommandState = "ユニット選択";
                        GUI.UnlockGUI();
                        return;
                    }
                }
            }

            // 使用イベント
            Event.HandleEvent("使用", SelectedUnit.MainPilot().ID, SelectedSpecialPower);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                CommandState           = "ユニット選択";
                GUI.UnlockGUI();
                return;
            }

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

            // スペシャルパワーを使用
            if (WithDoubleSPConsumption)
            {
                SelectedPilot.UseSpecialPower(SelectedSpecialPower, 2d);
            }
            else
            {
                SelectedPilot.UseSpecialPower(SelectedSpecialPower);
            }

            SelectedUnit = SelectedUnit.CurrentForm();

            // ステータスウィンドウを更新
            if (SelectedTarget is object)
            {
                if (SelectedTarget.CurrentForm().Status == "出撃")
                {
                    Status.DisplayUnitStatus(SelectedTarget);
                }
            }

            // 使用後イベント
            Event.HandleEvent("使用後", SelectedUnit.MainPilot().ID, SelectedSpecialPower);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
            }

            if (SRC.IsCanceled)
            {
                SRC.IsCanceled = false;
            }

            SelectedSpecialPower = "";
            GUI.UnlockGUI();
            CommandState = "ユニット選択";
        }
Exemplo n.º 3
0
        // スペシャルパワーコマンドを開始
        private void StartSpecialPowerCommand()
        {
            GUI.LockGUI();
            SelectedCommand = "スペシャルパワー";
            {
                var u = SelectedUnit;

                // スペシャルパワーを使用可能なパイロットの一覧を作成
                var pilots    = u.PilotsHaveSpecialPower();
                var listItems = pilots.Select(p =>
                {
                    return(new ListBoxItem
                    {
                        Text = GeneralLib.RightPaddedString(p.get_Nickname(false), 17)
                               + GeneralLib.RightPaddedString($"{p.SP}/{p.MaxSP}", 8)
                               + string.Join("", Enumerable.Range(1, p.CountSpecialPower).Select(i =>
                        {
                            var sname = p.get_SpecialPower(i);
                            if (p.SP >= p.SpecialPowerCost(sname))
                            {
                                return SRC.SPDList.Item(sname).ShortName;
                            }
                            else
                            {
                                return "";
                            }
                        })),
                    });
                }).ToList();

                GUI.TopItem = 1;
                int i;
                if (pilots.Count > 1)
                {
                    // どのパイロットを使うか選択
                    if (Expression.IsOptionDefined("等身大基準"))
                    {
                        i = GUI.ListBox(new ListBoxArgs
                        {
                            Items      = listItems,
                            HasFlag    = false,
                            lb_caption = "キャラクター選択",
                            lb_info    = "キャラクター     " + Expression.Term("SP", SelectedUnit, 2) + "/Max" + Expression.Term("SP", SelectedUnit, 2),
                            lb_mode    = "連続表示,カーソル移動"
                        });
                    }
                    else
                    {
                        i = GUI.ListBox(new ListBoxArgs
                        {
                            Items      = listItems,
                            HasFlag    = false,
                            lb_caption = "パイロット選択",
                            lb_info    = "パイロット       " + Expression.Term("SP", SelectedUnit, 2) + "/Max" + Expression.Term("SP", SelectedUnit, 2),
                            lb_mode    = "連続表示,カーソル移動"
                        });
                    }
                }
                else
                {
                    // 一人しかいないので選択の必要なし
                    i = 1;
                }

                // 誰もスペシャルパワーを使えなければキャンセル
                if (i == 0)
                {
                    GUI.CloseListBox();
                    if (SRC.AutoMoveCursor)
                    {
                        GUI.RestoreCursorPos();
                    }

                    GUI.UnlockGUI();
                    CancelCommand();
                    return;
                }

                // スペシャルパワーを使うパイロットを設定
                SelectedPilot = pilots[i - 1];
                // そのパイロットのステータスを表示
                if (pilots.Count > 1)
                {
                    Status.DisplayPilotStatus(SelectedPilot);
                }
            }

            {
                var p = SelectedPilot;
                // 使用可能なスペシャルパワーの一覧を作成
                var spList = p.SpecialPowerNames.Select(sname =>
                {
                    var cost = p.SpecialPowerCost(sname);
                    var spd  = SRC.SPDList.Item(sname);

                    return(new ListBoxItem
                    {
                        Text = GeneralLib.RightPaddedString(sname, 13) + GeneralLib.LeftPaddedString("" + cost, 3) + " " + spd.Comment,
                        ListItemFlag = p.SP < cost || !p.IsSpecialPowerUseful(sname),
                    });
                }).ToList();

                // どのコマンドを使用するかを選択
                GUI.TopItem = 1;
                var i = GUI.ListBox(new ListBoxArgs
                {
                    Items      = spList,
                    HasFlag    = true,
                    lb_caption = Expression.Term("スペシャルパワー", SelectedUnit) + "選択",
                    lb_info    = "名称         消費" + Expression.Term("SP", SelectedUnit) + "(" + p.get_Nickname(false) + " " + Expression.Term("SP", SelectedUnit) + "=" + SrcFormatter.Format(p.SP) + "/" + SrcFormatter.Format(p.MaxSP) + ")",
                    lb_mode    = "カーソル移動(行きのみ)"
                });
                // キャンセル
                if (i == 0)
                {
                    Status.DisplayUnitStatus(SelectedUnit);
                    // カーソル自動移動
                    if (SRC.AutoMoveCursor)
                    {
                        GUI.MoveCursorPos("ユニット選択", SelectedUnit);
                    }

                    GUI.UnlockGUI();
                    CancelCommand();
                    return;
                }

                // 使用するスペシャルパワーを設定
                SelectedSpecialPower = SelectedPilot.get_SpecialPower(i);
            }

            // 味方スペシャルパワー実行の効果により他のパイロットが持っているスペシャルパワーを
            // 使う場合は記録しておき、後で消費SPを倍にする必要がある
            // TODO Impl 夢
            //if (SRC.SPDList.Item(SelectedSpecialPower).EffectType(1) == "味方スペシャルパワー実行")
            if (false)
            {
                //// スペシャルパワー一覧
                //list = new string[1];
                //var loopTo6 = SRC.SPDList.Count();
                //for (i = 1; i <= loopTo6; i++)
                //{
                //    {
                //        var withBlock5 = SRC.SPDList.Item(i);
                //        if (withBlock5.EffectType(1) != "味方スペシャルパワー実行" && withBlock5.intName != "非表示")
                //        {
                //            Array.Resize(list, Information.UBound(list) + 1 + 1);
                //            Array.Resize(strkey_list, Information.UBound(list) + 1);
                //            list[Information.UBound(list)] = withBlock5.Name;
                //            strkey_list[Information.UBound(list)] = withBlock5.KanaName;
                //        }
                //    }
                //}

                //GUI.ListItemFlag = new bool[Information.UBound(list) + 1];

                //// ソート
                //var loopTo7 = (Information.UBound(strkey_list) - 1);
                //for (i = 1; i <= loopTo7; i++)
                //{
                //    max_item = i;
                //    max_str = strkey_list[i];
                //    var loopTo8 = Information.UBound(strkey_list);
                //    for (j = (i + 1); j <= loopTo8; j++)
                //    {
                //        if (Strings.StrComp(strkey_list[j], max_str, (CompareMethod)1) == -1)
                //        {
                //            max_item = j;
                //            max_str = strkey_list[j];
                //        }
                //    }

                //    if (max_item != i)
                //    {
                //        buf = list[i];
                //        list[i] = list[max_item];
                //        list[max_item] = buf;
                //        buf = strkey_list[i];
                //        strkey_list[i] = max_str;
                //        strkey_list[max_item] = buf;
                //    }
                //}

                //// スペシャルパワーを使用可能なパイロットがいるかどうかを判定
                //var loopTo9 = Information.UBound(list);
                //for (i = 1; i <= loopTo9; i++)
                //{
                //    GUI.ListItemFlag[i] = true;
                //    foreach (Pilot currentP in SRC.PList)
                //    {
                //        p = currentP;
                //        if (p.Party == "味方")
                //        {
                //            if (p.Unit is object)
                //            {
                //                if (p.Unit.Status == "出撃" && !p.Unit.IsConditionSatisfied("憑依"))
                //                {
                //                    // 本当に乗っている?
                //                    found = false;
                //                    {
                //                        var withBlock6 = p.Unit;
                //                        if (ReferenceEquals(p, withBlock6.MainPilot()))
                //                        {
                //                            found = true;
                //                        }
                //                        else
                //                        {
                //                            var loopTo10 = withBlock6.CountPilot();
                //                            for (j = 2; j <= loopTo10; j++)
                //                            {
                //                                Pilot localPilot1() { object argIndex1 = j; var ret = withBlock6.Pilot(argIndex1); return ret; }

                //                                if (ReferenceEquals(p, localPilot1()))
                //                                {
                //                                    found = true;
                //                                    break;
                //                                }
                //                            }

                //                            var loopTo11 = withBlock6.CountSupport();
                //                            for (j = 1; j <= loopTo11; j++)
                //                            {
                //                                Pilot localSupport() { object argIndex1 = j; var ret = withBlock6.Support(argIndex1); return ret; }

                //                                if (ReferenceEquals(p, localSupport()))
                //                                {
                //                                    found = true;
                //                                    break;
                //                                }
                //                            }

                //                            if (ReferenceEquals(p, withBlock6.AdditionalSupport()))
                //                            {
                //                                found = true;
                //                            }
                //                        }
                //                    }

                //                    if (found)
                //                    {
                //                        if (p.IsSpecialPowerAvailable(list[i]))
                //                        {
                //                            GUI.ListItemFlag[i] = false;
                //                            break;
                //                        }
                //                    }
                //                }
                //            }
                //        }
                //    }
                //}

                //// 各スペシャルパワーが使用可能か判定
                //{
                //    var withBlock7 = SelectedPilot;
                //    var loopTo12 = Information.UBound(list);
                //    for (i = 1; i <= loopTo12; i++)
                //    {
                //        if (!GUI.ListItemFlag[i] && withBlock7.SP >= 2 * withBlock7.SpecialPowerCost(list[i]))
                //        {
                //            if (!withBlock7.IsSpecialPowerUseful(list[i]))
                //            {
                //                GUI.ListItemFlag[i] = true;
                //            }
                //        }
                //        else
                //        {
                //            GUI.ListItemFlag[i] = true;
                //        }
                //    }
                //}

                //// スペシャルパワーの解説を設定
                //GUI.ListItemComment = new string[Information.UBound(list) + 1];
                //var loopTo13 = Information.UBound(list);
                //for (i = 1; i <= loopTo13; i++)
                //{
                //    SpecialPowerData localItem4() { var tmp = list; object argIndex1 = tmp[i]; var ret = SRC.SPDList.Item(argIndex1); return ret; }

                //    GUI.ListItemComment[i] = localItem4().Comment;
                //}

                //// 検索するスペシャルパワーを選択
                //GUI.TopItem = 1;
                //ret = GUI.MultiColumnListBox(Expression.Term(argtname7, u: argu) + "検索", list, true);
                //if (ret == 0)
                //{
                //    SelectedSpecialPower = "";
                //    CancelCommand();
                //    GUI.UnlockGUI();
                //    return;
                //}

                //// スペシャルパワー使用メッセージ
                //if (SelectedUnit.IsMessageDefined(SelectedSpecialPower))
                //{
                //    GUI.OpenMessageForm(u1: null1, u2: null2);
                //    SelectedUnit.PilotMessage(SelectedSpecialPower, msg_mode: "");
                //    GUI.CloseMessageForm();
                //}

                //SelectedSpecialPower = list[ret];
                //WithDoubleSPConsumption = true;
            }
            else
            {
                WithDoubleSPConsumption = false;
            }

            var sd = SRC.SPDList.Item(SelectedSpecialPower);

            // ターゲットを選択する必要があるスペシャルパワーの場合
            switch (sd.TargetType ?? "")
            {
            case "味方":
            case "敵":
            case "任意":
            {
                // マップ上のユニットからターゲットを選択する
                GUI.OpenMessageForm(null, null);
                GUI.DisplaySysMessage(SelectedPilot.get_Nickname(false) + "は" + SelectedSpecialPower + "を使った。;" + "ターゲットを選んでください。");
                GUI.CloseMessageForm();

                // ターゲットのエリアを設定
                for (var i = 1; i <= Map.MapWidth; i++)
                {
                    for (var j = 1; j <= Map.MapHeight; j++)
                    {
                        Map.MaskData[i, j] = true;
                        var u = Map.MapDataForUnit[i, j];
                        if (u is null)
                        {
                            goto NextLoop;
                        }

                        // 陣営が合っている?
                        switch (sd.TargetType ?? "")
                        {
                        case "味方":
                        {
                            {
                                var withBlock8 = u;
                                if (withBlock8.Party != "味方" && withBlock8.Party0 != "味方" && withBlock8.Party != "NPC" && withBlock8.Party0 != "NPC")
                                {
                                    goto NextLoop;
                                }
                            }

                            break;
                        }

                        case "敵":
                        {
                            {
                                var withBlock9 = u;
                                if (withBlock9.Party == "味方" && withBlock9.Party0 == "味方" || withBlock9.Party == "NPC" && withBlock9.Party0 == "NPC")
                                {
                                    goto NextLoop;
                                }
                            }

                            break;
                        }
                        }

                        // スペシャルパワーを適用可能?
                        if (!sd.Effective(SelectedPilot, u))
                        {
                            goto NextLoop;
                        }

                        Map.MaskData[i, j] = false;
NextLoop:
                        ;
                    }
                }

                GUI.MaskScreen();
                CommandState = "ターゲット選択";
                GUI.UnlockGUI();
                return;
            }

            case "破壊味方":
            {
                // 破壊された味方ユニットの中からターゲットを選択する
                GUI.OpenMessageForm(null, null);
                GUI.DisplaySysMessage(SelectedPilot.get_Nickname(false) + "は" + SelectedSpecialPower + "を使った。;" + "復活させるユニットを選んでください。");
                GUI.CloseMessageForm();

                // 破壊された味方ユニットのリストを作成
                var units = SRC.UList.Items
                            .Where(u => u.Party0 == "味方" && u.Status == "破壊" && (u.CountPilot() > 0 || u.Data.PilotNum == 0))
                            .Select(u => new ListBoxItem
                    {
                        Text = GeneralLib.RightPaddedString(u.Nickname, 28)
                               + GeneralLib.RightPaddedString(u.MainPilot().get_Nickname(false), 18)
                               + GeneralLib.LeftPaddedString(SrcFormatter.Format(u.MainPilot().Level), 3),
                        ListItemID = u.ID,
                    }).ToList();

                GUI.TopItem = 1;
                var ret = GUI.ListBox(new ListBoxArgs
                    {
                        Items      = units,
                        lb_caption = "ユニット選択",
                        lb_info    = "ユニット名                  パイロット     レベル",
                        lb_mode    = "",
                    });

                if (ret == 0)
                {
                    GUI.UnlockGUI();
                    CancelCommand();
                    return;
                }

                SelectedTarget = SRC.UList.Item(units[ret - 1].ListItemID);
                break;
            }
            }

            // 自爆を選択した場合は確認を取る
            if (sd.IsEffectAvailable("自爆"))
            {
                var ret = GUI.Confirm("自爆させますか?", "自爆", GuiConfirmOption.OkCancel | GuiConfirmOption.Question);
                if (ret == GuiDialogResult.Ok)
                {
                    GUI.UnlockGUI();
                    return;
                }
            }

            // 使用イベント
            Event.HandleEvent("使用", SelectedUnit.MainPilot().ID, SelectedSpecialPower);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                GUI.UnlockGUI();
                return;
            }

            if (SRC.IsCanceled)
            {
                SRC.IsCanceled = false;
                GUI.UnlockGUI();
                return;
            }

            // スペシャルパワーを使用
            if (WithDoubleSPConsumption)
            {
                SelectedPilot.UseSpecialPower(SelectedSpecialPower, 2d);
            }
            else
            {
                SelectedPilot.UseSpecialPower(SelectedSpecialPower);
            }

            SelectedUnit = SelectedUnit.CurrentForm();

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

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

            // 使用後イベント
            Event.HandleEvent("使用後", SelectedUnit.MainPilot().ID, SelectedSpecialPower);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
            }

            if (SRC.IsCanceled)
            {
                SRC.IsCanceled = false;
            }

            SelectedSpecialPower = "";
            GUI.UnlockGUI();
            CommandState = "ユニット選択";
        }
Exemplo n.º 4
0
        // 「特殊能力一覧」コマンド
        private void FeatureListCommand()
        {
            LogDebug();

            GUI.LockGUI();

            // 表示する特殊能力名一覧の作成
            var list = new List <ListBoxItem <ItemKind> >();

            var currentUnit = SelectedUnit;

            // 武器・防具クラス
            if (Expression.IsOptionDefined("アイテム交換"))
            {
                if (currentUnit.IsFeatureAvailable("武器クラス") || currentUnit.IsFeatureAvailable("防具クラス"))
                {
                    list.Add(new ListBoxItem <ItemKind>("武器・防具クラス", "武器・防具クラス"));
                }
            }

            var p = SelectedUnit.MainPilot();
            // パイロット特殊能力
            var loopTo = p.CountSkill();

            for (var i = 1; i <= loopTo; i++)
            {
                string fname = "";
                switch (p.Skill(i) ?? "")
                {
                case "得意技":
                case "不得手":
                {
                    fname = p.Skill(i);
                    break;
                }

                default:
                {
                    fname = p.SkillName(i);
                    break;
                }
                }

                // 非表示の能力は除く
                if (Strings.InStr(fname, "非表示") > 0)
                {
                    continue;
                }

                // 既に表示されていればスキップ
                if (list.Any(x => x.Text == fname))
                {
                    continue;
                }

                // リストに追加
                list.Add(new ListBoxItem <ItemKind>(fname, "" + i)
                {
                    ListItemObject = ItemKind.Pilot,
                });
            }

            // 付加・強化されたパイロット用特殊能力
            foreach (var cond in currentUnit.Conditions)
            {
                // パイロット能力付加または強化?
                if (Strings.Right(cond.Name, 3) != "付加2" && Strings.Right(cond.Name, 3) != "強化2")
                {
                    continue;
                }

                var ftype = Strings.Left(cond.Name, Strings.Len(cond.Name) - 3);

                // 非表示の能力?
                switch (GeneralLib.LIndex(cond.StrData, 1) ?? "")
                {
                case "非表示":
                case "解説":
                    continue;
                }

                // 有効時間が残っている?
                if (!cond.IsEnable)
                {
                    continue;
                }

                // 表示名称
                var fname = currentUnit.MainPilot().SkillName(ftype);
                if (Strings.InStr(fname, "非表示") > 0)
                {
                    continue;
                }

                // 既に表示していればスキップ
                if (list.Any(x => x.Text == fname))
                {
                    continue;
                }

                // リストに追加
                list.Add(new ListBoxItem <ItemKind>(fname, ftype)
                {
                    ListItemObject = ItemKind.Pilot,
                });
            }

            // ユニット用特殊能力
            // 付加された特殊能力より先に固有の特殊能力を表示
            foreach (var i in Enumerable.Range(
                         currentUnit.AdditionalFeaturesNum + 1,
                         currentUnit.AllFeatures.Count - currentUnit.AdditionalFeaturesNum)
                     .AppendRange(Enumerable.Range(1, currentUnit.AdditionalFeaturesNum)))
            {
                var fd    = currentUnit.AllFeature(i);
                var fname = fd.FeatureName(currentUnit);
                // 非表示の特殊能力を排除
                if (string.IsNullOrEmpty(fname))
                {
                    continue;
                }

                // 合体の場合は合体後の形態が作成されていなければならない
                if (fd.Name == "合体" && !SRC.UList.IsDefined(GeneralLib.LIndex(fd.Data, 2)))
                {
                    continue;
                }

                // 既に表示していればスキップ
                if (list.Any(x => x.Text == fname))
                {
                    continue;
                }

                // リストに追加
                list.Add(new ListBoxItem <ItemKind>(fname, "" + i)
                {
                    ListItemObject = ItemKind.Unit,
                });
            }

            // アビリティで付加・強化されたパイロット用特殊能力
            foreach (var cond in currentUnit.Conditions)
            {
                // パイロット能力付加または強化?
                if (Strings.Right(cond.Name, 2) != "付加" && Strings.Right(cond.Name, 2) != "強化")
                {
                    continue;
                }

                var ftype = Strings.Left(cond.Name, Strings.Len(cond.Name) - 2);

                // 非表示の能力?
                if (ftype == "メッセージ")
                {
                    continue;
                }
                switch (GeneralLib.LIndex(cond.StrData, 1) ?? "")
                {
                case "非表示":
                case "解説":
                    continue;
                }

                // 有効時間が残っている?
                if (!cond.IsEnable)
                {
                    continue;
                }

                // 表示名称
                var fname = currentUnit.MainPilot().SkillName0(ftype);
                if (string.IsNullOrEmpty(fname))
                {
                    continue;
                }
                if (Strings.InStr(fname, "非表示") > 0)
                {
                    continue;
                }

                // 付加されたユニット用特殊能力として既に表示していればスキップ
                if (list.Any(x => x.Text == fname))
                {
                    continue;
                }

                fname = currentUnit.MainPilot().SkillName(ftype);
                string fname0;
                if (Strings.InStr(fname, "Lv") > 0)
                {
                    fname0 = Strings.Left(fname, Strings.InStr(fname, "Lv") - 1);
                }
                else
                {
                    fname0 = fname;
                }

                // パイロット用特殊能力として既に表示していればスキップ
                if (list.Any(x => x.Text == fname || x.Text == fname0))
                {
                    continue;
                }

                // リストに追加
                list.Add(new ListBoxItem <ItemKind>(fname, ftype)
                {
                    ListItemObject = ItemKind.Pilot,
                });
            }

            switch (list.Count)
            {
            case 0:
                break;

            case 1:
            {
                if (SRC.AutoMoveCursor)
                {
                    GUI.SaveCursorPos();
                }

                var retItem = list.First();
                if (retItem.ListItemID == "武器・防具クラス")
                {
                    Help.FeatureHelp(SelectedUnit, "武器・防具クラス", false);
                }
                else if (retItem.ListItemObject == ItemKind.Unit)
                {
                    Help.FeatureHelp(SelectedUnit, GeneralLib.StrToLng(retItem.ListItemID), GeneralLib.StrToLng(retItem.ListItemID) <= SelectedUnit.AdditionalFeaturesNum);
                }
                else
                {
                    Help.SkillHelp(SelectedUnit.MainPilot(), retItem.ListItemID);
                }

                if (SRC.AutoMoveCursor)
                {
                    GUI.RestoreCursorPos();
                }
            }
            break;

            default:
            {
                GUI.TopItem = 1;
                var ret = GUI.ListBox(new ListBoxArgs
                    {
                        lb_caption = "特殊能力一覧",
                        Items      = list.Cast <ListBoxItem>().ToList(),
                        lb_info    = "能力名",
                        lb_mode    = "表示のみ",
                    });
                if (SRC.AutoMoveCursor)
                {
                    GUI.MoveCursorPos("ダイアログ");
                }

                while (true)
                {
                    ret = GUI.ListBox(new ListBoxArgs
                        {
                            lb_caption = "特殊能力一覧",
                            Items      = list.Cast <ListBoxItem>().ToList(),
                            lb_info    = "能力名",
                            lb_mode    = "連続表示",
                        });
                    GUI.CloseListBox();
                    if (ret == 0)
                    {
                        break;
                    }

                    var retItem = list[ret - 1];
                    if (retItem.ListItemID == "武器・防具クラス")
                    {
                        Help.FeatureHelp(SelectedUnit, "武器・防具クラス", false);
                    }
                    else if (retItem.ListItemObject == ItemKind.Unit)
                    {
                        Help.FeatureHelp(SelectedUnit, GeneralLib.StrToLng(retItem.ListItemID), GeneralLib.StrToLng(retItem.ListItemID) <= SelectedUnit.AdditionalFeaturesNum);
                    }
                    else
                    {
                        Help.SkillHelp(SelectedUnit.MainPilot(), retItem.ListItemID);
                    }
                }

                if (SRC.AutoMoveCursor)
                {
                    GUI.RestoreCursorPos();
                }
                break;
            }
            }

            CommandState = "ユニット選択";
            GUI.UnlockGUI();
        }
Exemplo n.º 5
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();
        }
Exemplo n.º 6
0
        // 「チャージ」コマンド
        private void ChargeCommand()
        {
            GUI.LockGUI();
            var ret = GUI.Confirm("チャージを開始しますか?", "チャージ開始", GuiConfirmOption.OkCancel | GuiConfirmOption.Question);

            if (ret != GuiDialogResult.Ok)
            {
                CancelCommand();
                GUI.UnlockGUI();
                return;
            }

            // 使用イベント
            Event.HandleEvent("使用", SelectedUnit.MainPilot().ID, "チャージ");
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                CommandState           = "ユニット選択";
                GUI.UnlockGUI();
                return;
            }

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

            var currentUnit = SelectedUnit;

            // チャージのメッセージを表示
            if (currentUnit.IsMessageDefined("チャージ"))
            {
                GUI.OpenMessageForm(u1: null, u2: null);
                currentUnit.PilotMessage("チャージ", msg_mode: "");
                GUI.CloseMessageForm();
            }

            // アニメ表示を行う
            if (currentUnit.IsAnimationDefined("チャージ", sub_situation: ""))
            {
                currentUnit.PlayAnimation("チャージ", sub_situation: "");
            }
            else if (currentUnit.IsSpecialEffectDefined("チャージ", sub_situation: ""))
            {
                currentUnit.SpecialEffect("チャージ", sub_situation: "");
            }
            else
            {
                Sound.PlayWave("Charge.wav");
            }

            // チャージ攻撃のパートナーを探す
            // XXX 条件を満たす最初のアビリティ、武器、の順に選ばれる状態
            IList <Unit> partners = new List <Unit>();
            var          cuw      = currentUnit.Weapons
                                    .FirstOrDefault(uw => uw.IsWeaponClassifiedAs("C") && uw.IsWeaponClassifiedAs("合"));

            if (cuw != null)
            {
                partners = cuw.CombinationPartner();
            }
            var cua = currentUnit.Abilities
                      .FirstOrDefault(ua => ua.IsAbilityClassifiedAs("C") && ua.IsAbilityClassifiedAs("合"));

            if (cua != null)
            {
                partners = cua.CombinationPartner();
            }

            // ユニットの状態をチャージ中に
            currentUnit.AddCondition("チャージ", 1, cdata: "");

            // チャージ攻撃のパートナーもチャージ中にする
            foreach (var pu in partners)
            {
                pu.AddCondition("チャージ", 1, cdata: "");
            }

            // 使用後イベント
            Event.HandleEvent("使用後", SelectedUnit.MainPilot().ID, "チャージ");
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                CommandState           = "ユニット選択";
                GUI.UnlockGUI();
                return;
            }

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

            GUI.UnlockGUI();

            // 行動終了
            WaitCommand();
        }
Exemplo n.º 7
0
        // 「合体」コマンド
        private void CombineCommand(UiCommand command)
        {
            //// MOD END MARGE
            //int i, j;
            //string[] list;
            //Unit u;

            //// MOD START MARGE
            //// If MainWidth <> 15 Then
            //if (GUI.NewGUIMode)
            //{
            //    // MOD END MARGE
            //    Status.ClearUnitStatus();
            //}

            GUI.LockGUI();
            //list = new string[1];
            //GUI.ListItemFlag = new bool[1];
            var currentUnit = SelectedUnit;

            if (string.IsNullOrEmpty(Map.MapFileName))
            {
                // ユニットステータスコマンドの時
                // パーツ合体ならば……
                if (command.Label == "パーツ合体" && currentUnit.IsFeatureAvailable("パーツ合体"))
                {
                    // パーツ合体を実施
                    currentUnit.Transform(currentUnit.FeatureData("パーツ合体"));
                    Status.DisplayUnitStatus(Map.MapDataForUnit[currentUnit.x, currentUnit.y]);
                    Map.MapDataForUnit[currentUnit.x, currentUnit.y].CheckAutoHyperMode();
                    Map.MapDataForUnit[currentUnit.x, currentUnit.y].CheckAutoNormalMode();

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

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

            // 選択可能な合体パターンのリストを作成
            var combines = currentUnit.CombineFeatures(SRC);
            int i;

            // どの合体を行うかを選択
            if (combines.Count == 1)
            {
                i = 1;
            }
            else
            {
                GUI.TopItem = 1;
                i           = GUI.ListBox(new ListBoxArgs
                {
                    lb_caption = "合体後の形態",
                    lb_info    = "名前",
                    lb_mode    = "",
                    HasFlag    = false,
                    Items      = combines.Select(x => new ListBoxItem
                    {
                        Text = x.CombineName,
                    }).ToList(),
                });
                if (i == 0)
                {
                    CancelCommand();
                    GUI.UnlockGUI();
                    return;
                }
            }
            var combineunitname = combines[i - 1].ConbineUnitName;

            if (Map.IsStatusView)
            {
                // ユニットステータスコマンドの時
                SelectedUnit.Combine(combineunitname, true);

                // ハイパーモード・ノーマルモードの自動発動をチェック
                SRC.UList.CheckAutoHyperMode();
                SRC.UList.CheckAutoNormalMode();

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

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

            // 合体!
            SelectedUnit.Combine(combineunitname);

            // ハイパーモード&ノーマルモードの自動発動
            SRC.UList.CheckAutoHyperMode();
            SRC.UList.CheckAutoNormalMode();

            // 合体後のユニットを選択しておく
            SelectedUnit = Map.MapDataForUnit[SelectedUnit.x, SelectedUnit.y];

            // 行動数消費
            SelectedUnit.UseAction();

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

            Status.DisplayUnitStatus(SelectedUnit);

            // 合体イベント
            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;
            }

            // 行動終了
            WaitCommand(true);
        }
Exemplo n.º 8
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();
        }
Exemplo n.º 9
0
        // 「変身解除」コマンド
        private void CancelTransformationCommand()
        {
            //// MOD START MARGE
            //// If MainWidth <> 15 Then
            //if (GUI.NewGUIMode)
            //{
            //    // MOD END MARGE
            //    Status.ClearUnitStatus();
            //}

            GUI.LockGUI();
            {
                var u = SelectedUnit;
                if (Map.IsStatusView)
                {
                    // ユニットステータスコマンドの場合
                    u.Transform(GeneralLib.LIndex(u.FeatureData("ノーマルモード"), 1));
                    Event.MakeUnitList(smode: "");
                    Status.DisplayUnitStatus(u.CurrentForm());
                    GUI.UnlockGUI();
                    CommandState = "ユニット選択";
                    return;
                }

                string caption, info;
                if (u.IsHero())
                {
                    caption = "変身を解除しますか?";
                    info    = "変身解除";
                }
                else
                {
                    caption = "特殊モードを解除しますか?";
                    info    = "特殊モード解除";
                }

                var confirmRes = GUI.Confirm(caption, info, GuiConfirmOption.OkCancel | GuiConfirmOption.Question);
                if (confirmRes == GuiDialogResult.Cancel)
                {
                    GUI.UnlockGUI();
                    CancelCommand();
                    return;
                }

                u.Transform(GeneralLib.LIndex(u.FeatureData("ノーマルモード"), 1));
                SelectedUnit = Map.MapDataForUnit[u.x, u.y];
            }

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

            Status.DisplayUnitStatus(SelectedUnit);
            GUI.RedrawScreen();

            // 変形イベント
            Event.HandleEvent("変形", SelectedUnit.MainPilot().ID, SelectedUnit.Name);
            SRC.IsScenarioFinished = false;
            SRC.IsCanceled         = false;
            CommandState           = "ユニット選択";
            GUI.UnlockGUI();
        }
Exemplo n.º 10
0
        // 「分離」コマンド
        private void SplitCommand()
        {
            string uname, tname, fname;

            //// MOD START MARGE
            //// If MainWidth <> 15 Then
            //if (GUI.NewGUIMode)
            //{
            //    // MOD END MARGE
            //    Status.ClearUnitStatus();
            //}

            GUI.LockGUI();
            if (Map.IsStatusView)
            {
                // ユニットステータスコマンドの場合

                // 分離を実施
                {
                    var u = SelectedUnit;
                    if (u.IsFeatureAvailable("パーツ分離"))
                    {
                        tname = GeneralLib.LIndex(u.FeatureData("パーツ分離"), 2);
                        u.Transform(tname);
                    }
                    else
                    {
                        u.Split();
                    }

                    SRC.UList.CheckAutoHyperMode();
                    SRC.UList.CheckAutoNormalMode();
                    Status.DisplayUnitStatus(Map.MapDataForUnit[u.x, u.y]);
                }

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

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

            {
                var u = SelectedUnit;
                if (u.IsFeatureAvailable("パーツ分離"))
                {
                    // パーツ分離を行う場合
                    var confirmRes = GUI.Confirm("パーツを分離しますか?", "パーツ分離", GuiConfirmOption.OkCancel | GuiConfirmOption.Question);
                    if (confirmRes == GuiDialogResult.Cancel)
                    {
                        GUI.UnlockGUI();
                        CancelCommand();
                        return;
                    }

                    tname = GeneralLib.LIndex(u.FeatureData("パーツ分離"), 2);

                    if (!u.OtherForm(tname).IsAbleToEnter(u.x, u.y))
                    {
                        GUI.Confirm("この地形では分離できません", "分離", GuiConfirmOption.Ok);
                        GUI.UnlockGUI();
                        CancelCommand();
                        return;
                    }

                    // BGM変更
                    if (u.IsFeatureAvailable("分離BGM"))
                    {
                        var BGM = Sound.SearchMidiFile(u.FeatureData("分離BGM"));
                        if (Strings.Len(BGM) > 0)
                        {
                            Sound.StartBGM(u.FeatureData("分離BGM"));
                            GUI.Sleep(500);
                        }
                    }

                    fname = u.FeatureName("パーツ分離");

                    // メッセージを表示
                    SelectedUnit.PilotMassageIfDefined(new string[] {
                        "分離(" + u.Name + ")",
                        "分離(" + fname + ")",
                        "分離",
                    });

                    // アニメ表示
                    SelectedUnit.PlayAnimation(new string[] {
                        "分離(" + u.Name + ")",
                        "分離(" + fname + ")",
                        "分離",
                    });

                    // パーツ分離
                    uname = u.Name;
                    u.Transform(tname);
                    SelectedUnit = Map.MapDataForUnit[u.x, u.y];
                    Status.DisplayUnitStatus(SelectedUnit);
                }
                else
                {
                    // 通常の分離を行う場合
                    var confirmRes = GUI.Confirm("分離しますか?", "分離", GuiConfirmOption.OkCancel | GuiConfirmOption.Question);
                    if (confirmRes == GuiDialogResult.Cancel)
                    {
                        GUI.UnlockGUI();
                        CancelCommand();
                        return;
                    }

                    // BGM変更
                    if (u.IsFeatureAvailable("分離BGM"))
                    {
                        var BGM = Sound.SearchMidiFile(u.FeatureData("分離BGM"));
                        if (Strings.Len(BGM) > 0)
                        {
                            Sound.StartBGM(u.FeatureData("分離BGM"));
                            GUI.Sleep(500);
                        }
                    }

                    fname = u.FeatureName("分離");

                    // メッセージを表示
                    SelectedUnit.PilotMassageIfDefined(new string[] {
                        "分離(" + u.Name + ")",
                        "分離(" + fname + ")",
                        "分離",
                    });

                    // アニメ表示
                    SelectedUnit.PlayAnimation(new string[] {
                        "分離(" + u.Name + ")",
                        "分離(" + fname + ")",
                        "分離",
                    });

                    // 分離
                    uname = u.Name;
                    u.Split();

                    // 選択ユニットを再設定
                    SelectedUnit = SRC.UList.Item(GeneralLib.LIndex(u.FeatureData("分離"), 2));
                    Status.DisplayUnitStatus(SelectedUnit);
                }
            }

            // 分離イベント
            Event.HandleEvent("分離", SelectedUnit.MainPilot().ID, uname);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                Status.ClearUnitStatus();
                GUI.RedrawScreen();
                CommandState = "ユニット選択";
                GUI.UnlockGUI();
                return;
            }

            SRC.IsCanceled = false;

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

            // ハイパーモード&ノーマルモードの自動発動チェック
            SRC.UList.CheckAutoHyperMode();
            SRC.UList.CheckAutoNormalMode();
            CommandState = "ユニット選択";
            GUI.UnlockGUI();
            // XXX RedrawScreen 元はしてなかった気がする
            GUI.RedrawScreen();
        }
Exemplo n.º 11
0
        // マップ型「アビリティ」コマンドを終了
        private void MapAbilityCommand()
        {
            GUI.LockGUI();
            var currentUnit = SelectedUnit;
            var unitAbility = currentUnit.Ability(SelectedAbility);

            // 移動後使用後可能なアビリティか記録しておく
            var is_p_ability = unitAbility.IsAbilityClassifiedAs("P") ||
                               unitAbility.AbilityMaxRange() == 1 && !unitAbility.IsAbilityClassifiedAs("Q");

            // 目標地点を選択して初めて効果範囲が分かるタイプのマップアビリティの場合は再度プレイヤーの選択を促す必要がある
            if (CommandState == "ターゲット選択" || CommandState == "移動後ターゲット選択")
            {
                if (unitAbility.IsAbilityClassifiedAs("M投"))
                {
                    if (CommandState == "ターゲット選択")
                    {
                        CommandState = "マップ攻撃使用";
                    }
                    else
                    {
                        CommandState = "移動後マップ攻撃使用";
                    }

                    // 目標地点
                    SelectedX = GUI.PixelToMapX((int)GUI.MouseX);
                    SelectedY = GUI.PixelToMapY((int)GUI.MouseY);

                    // 効果範囲を設定
                    Map.AreaInRange(SelectedX, SelectedY, (int)unitAbility.AbilityLevel("M投"), 1, "味方");
                    GUI.MaskScreen();
                    return;
                }
                else if (unitAbility.IsAbilityClassifiedAs("M移"))
                {
                    SelectedX = GUI.PixelToMapX((int)GUI.MouseX);
                    SelectedY = GUI.PixelToMapY((int)GUI.MouseY);
                    if (Map.MapDataForUnit[SelectedX, SelectedY] is object)
                    {
                        GUI.MaskScreen();
                        return;
                    }

                    // 目標地点
                    if (CommandState == "ターゲット選択")
                    {
                        CommandState = "マップ攻撃使用";
                    }
                    else
                    {
                        CommandState = "移動後マップ攻撃使用";
                    }

                    // 効果範囲を設定
                    Map.AreaInPointToPoint(currentUnit.x, currentUnit.y, SelectedX, SelectedY);
                    GUI.MaskScreen();
                    return;
                }
                else if (unitAbility.IsAbilityClassifiedAs("M線"))
                {
                    if (CommandState == "ターゲット選択")
                    {
                        CommandState = "マップ攻撃使用";
                    }
                    else
                    {
                        CommandState = "移動後マップ攻撃使用";
                    }

                    // 目標地点
                    SelectedX = GUI.PixelToMapX((int)GUI.MouseX);
                    SelectedY = GUI.PixelToMapY((int)GUI.MouseY);

                    // 効果範囲を設定
                    Map.AreaInPointToPoint(currentUnit.x, currentUnit.y, SelectedX, SelectedY);
                    GUI.MaskScreen();
                    return;
                }
            }

            // 合体技のパートナーを設定
            IList <Unit> partners = new List <Unit>();

            {
                if (unitAbility.IsAbilityClassifiedAs("合"))
                {
                    if (unitAbility.AbilityMaxRange() == 1)
                    {
                        partners = unitAbility.CombinationPartner(SelectedTarget.x, SelectedTarget.y);
                    }
                    else
                    {
                        partners = unitAbility.CombinationPartner();
                    }
                }
                else
                {
                    SelectedPartners.Clear();
                }
            }

            // アビリティを実行
            currentUnit.ExecuteMapAbility(unitAbility, SelectedX, SelectedY);
            SelectedUnit   = currentUnit.CurrentForm();
            SelectedTarget = null;

            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                SelectedPartners.Clear();
                GUI.UnlockGUI();
                return;
            }

            if (SRC.IsCanceled)
            {
                SRC.IsCanceled = false;
                SelectedPartners.Clear();
                GUI.UnlockGUI();
                return;
            }

            // 合体技のパートナーの行動数を減らす
            if (!Expression.IsOptionDefined("合体技パートナー行動数無消費"))
            {
                foreach (var pu in partners)
                {
                    pu.CurrentForm().UseAction();
                }
            }

            SelectedPartners.Clear();

            // 再移動
            if (is_p_ability && SelectedUnit.Status == "出撃")
            {
                if (SelectedUnit.MainPilot().IsSkillAvailable("遊撃") && SelectedUnit.Speed * 2 > SelectedUnitMoveCost)
                {
                    // 進入イベント
                    if (SelectedUnitMoveCost > 0)
                    {
                        Event.HandleEvent("進入", SelectedUnit.MainPilot().ID, "" + SelectedUnit.x, "" + SelectedUnit.y);
                        if (SRC.IsScenarioFinished)
                        {
                            SRC.IsScenarioFinished = false;
                            return;
                        }
                    }

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

                    SelectedCommand = "再移動";
                    Map.AreaInSpeed(SelectedUnit);
                    if (!Expression.IsOptionDefined("大型マップ"))
                    {
                        GUI.Center(SelectedUnit.x, SelectedUnit.y);
                    }

                    GUI.MaskScreen();
                    //if (GUI.NewGUIMode)
                    //{
                    //    Application.DoEvents();
                    //    Status.ClearUnitStatus();
                    //}
                    //else
                    {
                        Status.DisplayUnitStatus(SelectedUnit);
                    }

                    CommandState = "ターゲット選択";
                    return;
                }
            }

            // 行動終了
            WaitCommand();
        }
Exemplo n.º 12
0
        // 「アビリティ」コマンドを終了
        private void FinishAbilityCommand()
        {
            //// MOD START MARGE
            //// If MainWidth <> 15 Then
            //if (GUI.NewGUIMode)
            //{
            //    // MOD END MARGE
            //    Status.ClearUnitStatus();
            //}

            GUI.LockGUI();
            var currentUnit = SelectedUnit;
            var unitAbility = currentUnit.Ability(SelectedAbility);

            // 合体技のパートナーを設定
            IList <Unit> partners = new List <Unit>();
            {
                if (unitAbility.IsAbilityClassifiedAs("合"))
                {
                    if (unitAbility.AbilityMaxRange() == 1)
                    {
                        partners = unitAbility.CombinationPartner(SelectedTarget.x, SelectedTarget.y);
                    }
                    else
                    {
                        partners = unitAbility.CombinationPartner();
                    }
                }
                else
                {
                    SelectedPartners.Clear();
                }
            }

            var aname = unitAbility.Data.Name;

            SelectedAbilityName = aname;

            // 移動後使用後可能なアビリティか記録しておく
            var is_p_ability = unitAbility.IsAbilityClassifiedAs("P") ||
                               unitAbility.AbilityMaxRange() == 1 && !unitAbility.IsAbilityClassifiedAs("Q");

            // 使用イベント
            Event.HandleEvent("使用", SelectedUnit.MainPilot().ID, aname);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                SelectedPartners.Clear();
                GUI.UnlockGUI();
                return;
            }

            if (SRC.IsCanceled)
            {
                SRC.IsCanceled = false;
                SelectedPartners.Clear();
                WaitCommand();
                return;
            }

            {
                foreach (Unit u in SRC.UList.Items)
                {
                    if (u.Status == "出撃")
                    {
                        Map.MaskData[u.x, u.y] = true;
                    }
                }

                // 合体技パートナーのハイライト表示
                foreach (var pu in partners)
                {
                    Map.MaskData[pu.x, pu.y] = false;
                }

                Map.MaskData[currentUnit.x, currentUnit.y]       = false;
                Map.MaskData[SelectedTarget.x, SelectedTarget.y] = false;
                if (!SRC.BattleAnimation)
                {
                    GUI.MaskScreen();
                }

                // アビリティを実行
                currentUnit.ExecuteAbility(unitAbility, SelectedTarget);
                SelectedUnit = currentUnit.CurrentForm();
                GUI.CloseMessageForm();
                Status.ClearUnitStatus();
            }

            // 破壊イベント
            {
                if (currentUnit.Status == "破壊")
                {
                    if (currentUnit.CountPilot() > 0)
                    {
                        Event.HandleEvent("破壊", currentUnit.MainPilot().ID);
                        if (SRC.IsScenarioFinished)
                        {
                            SRC.IsScenarioFinished = false;
                            SelectedPartners.Clear();
                            GUI.UnlockGUI();
                            return;
                        }

                        if (SRC.IsCanceled)
                        {
                            SRC.IsCanceled = false;
                            SelectedPartners.Clear();
                            GUI.UnlockGUI();
                            return;
                        }
                    }

                    WaitCommand();
                    return;
                }
            }

            // 使用後イベント
            {
                var withBlock4 = SelectedUnit;
                if (withBlock4.CountPilot() > 0)
                {
                    Event.HandleEvent("使用後", withBlock4.MainPilot().ID, aname);
                    if (SRC.IsScenarioFinished)
                    {
                        SRC.IsScenarioFinished = false;
                        SelectedPartners.Clear();
                        GUI.UnlockGUI();
                        return;
                    }

                    if (SRC.IsCanceled)
                    {
                        SRC.IsCanceled = false;
                        SelectedPartners.Clear();
                        GUI.UnlockGUI();
                        return;
                    }
                }
            }

            // 合体技のパートナーの行動数を減らす
            if (!Expression.IsOptionDefined("合体技パートナー行動数無消費"))
            {
                foreach (var pu in partners)
                {
                    pu.CurrentForm().UseAction();
                }
            }

            SelectedPartners.Clear();

            // 再移動
            if (is_p_ability && SelectedUnit.Status == "出撃")
            {
                if (SelectedUnit.MainPilot().IsSkillAvailable("遊撃") && SelectedUnit.Speed * 2 > SelectedUnitMoveCost)
                {
                    // 進入イベント
                    if (SelectedUnitMoveCost > 0)
                    {
                        Event.HandleEvent("進入", SelectedUnit.MainPilot().ID, "" + SelectedUnit.x, "" + SelectedUnit.y);
                        if (SRC.IsScenarioFinished)
                        {
                            SRC.IsScenarioFinished = false;
                            return;
                        }
                    }

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

                    SelectedCommand = "再移動";
                    Map.AreaInSpeed(SelectedUnit);
                    if (!Expression.IsOptionDefined("大型マップ"))
                    {
                        GUI.Center(SelectedUnit.x, SelectedUnit.y);
                    }

                    GUI.MaskScreen();
                    //if (GUI.NewGUIMode)
                    //{
                    //    Application.DoEvents();
                    //    Status.ClearUnitStatus();
                    //}
                    //else
                    {
                        Status.DisplayUnitStatus(SelectedUnit);
                    }

                    CommandState = "ターゲット選択";
                    return;
                }
            }

            // 行動終了
            WaitCommand();
        }
Exemplo n.º 13
0
        // 「アビリティ」コマンドを開始
        // is_item=True の場合は「アイテム」コマンドによる使い捨てアイテムのアビリティ
        private void StartAbilityCommand(bool is_item = false)
        {
            string cap;

            GUI.LockGUI();

            // 使用するアビリティを選択
            if (is_item)
            {
                cap = "アイテム選択";
            }
            else
            {
                cap = Expression.Term("アビリティ", SelectedUnit) + "選択";
            }

            UnitAbility unitAbility;

            if (CommandState == "コマンド選択")
            {
                unitAbility = GUI.AbilityListBox(SelectedUnit, new UnitAbilityList(AbilityListMode.BeforeMove, SelectedUnit), cap, "移動前", is_item);
            }
            else
            {
                unitAbility = GUI.AbilityListBox(SelectedUnit, new UnitAbilityList(AbilityListMode.AfterMove, SelectedUnit), cap, "移動後", is_item);
            }

            // キャンセル
            if (unitAbility == null)
            {
                SelectedAbility = 0;
                if (SRC.AutoMoveCursor)
                {
                    GUI.RestoreCursorPos();
                }

                CancelCommand();
                GUI.UnlockGUI();
                return;
            }
            SelectedAbility = unitAbility.AbilityNo();

            var currentUnit = SelectedUnit;

            // アビリティ専用BGMがあればそれを演奏
            if (currentUnit.IsFeatureAvailable("アビリティBGM"))
            {
                var BGM = currentUnit.Features.Where(x => x.Name == "アビリティBGM")
                          .Where(x => GeneralLib.LIndex(x.Data, 1) == unitAbility.Data.Name)
                          .Select(x => Sound.SearchMidiFile(Strings.Mid(x.Data, Strings.InStr(x.Data, " ") + 1)))
                          .FirstOrDefault();
                if (!string.IsNullOrEmpty(BGM))
                {
                    Sound.ChangeBGM(BGM);
                }
            }

            // 射程0のアビリティはその場で実行
            if (unitAbility.Data.MaxRange == 0)
            {
                SelectedTarget = SelectedUnit;

                // 変身アビリティであるか判定
                var is_transformation = unitAbility.Data.Effects.Any(x => x.EffectType == "変身");

                SelectedAbilityName = unitAbility.Data.Name;

                // 使用イベント
                Event.HandleEvent("使用", SelectedUnit.MainPilot().ID, SelectedAbilityName);
                if (SRC.IsScenarioFinished)
                {
                    SRC.IsScenarioFinished = false;
                    GUI.UnlockGUI();
                    return;
                }

                if (SRC.IsCanceled)
                {
                    SRC.IsCanceled = false;
                    WaitCommand();
                    return;
                }

                // アビリティを実行
                SelectedUnit.ExecuteAbility(unitAbility, SelectedUnit);
                SelectedUnit = SelectedUnit.CurrentForm();
                GUI.CloseMessageForm();

                // 破壊イベント
                {
                    var withBlock1 = SelectedUnit;
                    if (withBlock1.Status == "破壊")
                    {
                        if (withBlock1.CountPilot() > 0)
                        {
                            Event.HandleEvent("破壊", withBlock1.MainPilot().ID);
                            if (SRC.IsScenarioFinished)
                            {
                                SRC.IsScenarioFinished = false;
                                GUI.UnlockGUI();
                                return;
                            }

                            if (SRC.IsCanceled)
                            {
                                SRC.IsCanceled = false;
                                GUI.UnlockGUI();
                                return;
                            }
                        }

                        WaitCommand();
                        return;
                    }
                }

                // 使用後イベント
                {
                    var withBlock2 = SelectedUnit;
                    if (withBlock2.CountPilot() > 0)
                    {
                        Event.HandleEvent("使用後", withBlock2.MainPilot().ID, SelectedAbilityName);
                        if (SRC.IsScenarioFinished)
                        {
                            SRC.IsScenarioFinished = false;
                            GUI.UnlockGUI();
                            return;
                        }

                        if (SRC.IsCanceled)
                        {
                            SRC.IsCanceled = false;
                            GUI.UnlockGUI();
                            return;
                        }
                    }
                }

                // 変身アビリティの場合は行動終了しない
                if (!is_transformation || CommandState == "移動後コマンド選択")
                {
                    WaitCommand();
                }
                else
                {
                    if (SelectedUnit.Status == "出撃")
                    {
                        // カーソル自動移動
                        if (SRC.AutoMoveCursor)
                        {
                            GUI.MoveCursorPos("ユニット選択", SelectedUnit);
                        }

                        Status.DisplayUnitStatus(SelectedUnit);
                    }
                    else
                    {
                        Status.ClearUnitStatus();
                    }

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

                return;
            }

            // アビリティの射程を求めておく
            var min_range = unitAbility.AbilityMinRange();
            var max_range = unitAbility.AbilityMaxRange();

            {
                // マップ型アビリティかどうかで今後のコマンド処理の進行の仕方が異なる
                if (is_item)
                {
                    if (unitAbility.IsAbilityClassifiedAs("M"))
                    {
                        SelectedCommand = "マップアイテム";
                    }
                    else
                    {
                        SelectedCommand = "アイテム";
                    }
                }
                else
                {
                    if (unitAbility.IsAbilityClassifiedAs("M"))
                    {
                        SelectedCommand = "マップアビリティ";
                    }
                    else
                    {
                        SelectedCommand = "アビリティ";
                    }
                }


                // アビリティの効果範囲を設定
                if (unitAbility.IsAbilityClassifiedAs("M直"))
                {
                    Map.AreaInCross(currentUnit.x, currentUnit.y, min_range, max_range);
                }
                else if (unitAbility.IsAbilityClassifiedAs("M拡"))
                {
                    Map.AreaInWideCross(currentUnit.x, currentUnit.y, min_range, max_range);
                }
                else if (unitAbility.IsAbilityClassifiedAs("M扇"))
                {
                    Map.AreaInSectorCross(currentUnit.x, currentUnit.y, min_range, max_range, (int)unitAbility.AbilityLevel("M扇"));
                }
                else if (unitAbility.IsAbilityClassifiedAs("M移"))
                {
                    Map.AreaInMoveAction(SelectedUnit, max_range);
                }
                else
                {
                    Map.AreaInRange(currentUnit.x, currentUnit.y, max_range, min_range, "すべて");
                }

                // 射程1の合体技はパートナーで相手を取り囲んでいないと使用できない
                if (unitAbility.IsAbilityClassifiedAs("合") && !unitAbility.IsAbilityClassifiedAs("M") && unitAbility.Data.MaxRange == 1)
                {
                    foreach (var t in Map.AdjacentUnit(currentUnit))
                    {
                        if (currentUnit.IsAlly(t))
                        {
                            var partners = unitAbility.CombinationPartner(t.x, t.y);
                            if (partners.Count == 0)
                            {
                                Map.MaskData[t.x, t.y] = true;
                            }
                        }
                    }
                }
            }

            // ユニットがいるマスの処理
            if (!unitAbility.IsAbilityClassifiedAs("M投") &&
                !unitAbility.IsAbilityClassifiedAs("M線") &&
                !unitAbility.IsAbilityClassifiedAs("M移"))
            {
                var loopTo2 = GeneralLib.MinLng(currentUnit.x + max_range, Map.MapWidth);
                for (var i = GeneralLib.MaxLng(currentUnit.x - max_range, 1); i <= loopTo2; i++)
                {
                    var loopTo3 = GeneralLib.MinLng(currentUnit.y + max_range, Map.MapHeight);
                    for (var j = GeneralLib.MaxLng(currentUnit.y - max_range, 1); j <= loopTo3; j++)
                    {
                        if (!Map.MaskData[i, j])
                        {
                            var t = Map.MapDataForUnit[i, j];
                            if (t is object)
                            {
                                // 有効?
                                if (unitAbility.IsAbilityEffective(t))
                                {
                                    Map.MaskData[i, j] = false;
                                }
                                else
                                {
                                    Map.MaskData[i, j] = true;
                                }
                            }
                        }
                    }
                }
            }

            // 支援専用アビリティは自分には使用できない
            if (!Map.MaskData[currentUnit.x, currentUnit.y])
            {
                if (unitAbility.IsAbilityClassifiedAs("援"))
                {
                    Map.MaskData[currentUnit.x, currentUnit.y] = true;
                }
            }

            if (!Expression.IsOptionDefined("大型マップ"))
            {
                GUI.Center(currentUnit.x, currentUnit.y);
            }

            GUI.MaskScreen();

            if (CommandState == "コマンド選択")
            {
                CommandState = "ターゲット選択";
            }
            else
            {
                CommandState = "移動後ターゲット選択";
            }

            // カーソル自動移動を行う?
            if (!SRC.AutoMoveCursor)
            {
                GUI.UnlockGUI();
                return;
            }

            // 自分から最も近い味方ユニットを探す
            {
                Unit t = null;
                foreach (Unit u in SRC.UList.Items)
                {
                    if (u.Status == "出撃" && u.Party == "味方")
                    {
                        if (Map.MaskData[u.x, u.y] == false && !ReferenceEquals(u, SelectedUnit))
                        {
                            if (t is null)
                            {
                                t = u;
                            }
                            else if (Math.Pow(Math.Abs((SelectedUnit.x - u.x)), 2d) + Math.Pow(Math.Abs((SelectedUnit.y - u.y)), 2d) < Math.Pow(Math.Abs((SelectedUnit.x - t.x)), 2d) + Math.Pow(Math.Abs((SelectedUnit.y - t.y)), 2d))
                            {
                                t = u;
                            }
                        }
                    }
                }

                // 適当がユニットがなければ自分自身を選択
                if (t is null)
                {
                    t = SelectedUnit;
                }

                // カーソルを移動
                GUI.MoveCursorPos("ユニット選択", t);

                // ターゲットのステータスを表示
                if (!ReferenceEquals(SelectedUnit, t))
                {
                    Status.DisplayUnitStatus(t);
                }
            }
            GUI.UnlockGUI();
        }
Exemplo n.º 14
0
        // 「修理」コマンドを終了
        private void FinishFixCommand()
        {
            GUI.LockGUI();
            GUI.OpenMessageForm(SelectedTarget, SelectedUnit);

            var currentUnit = SelectedUnit;

            // 選択内容を変更
            Event.SelectedUnitForEvent   = SelectedUnit;
            Event.SelectedTargetForEvent = SelectedTarget;

            // 修理メッセージ&特殊効果
            if (currentUnit.IsMessageDefined("修理"))
            {
                currentUnit.PilotMessage("修理", msg_mode: "");
            }

            if (currentUnit.IsAnimationDefined("修理", currentUnit.FeatureName("修理装置")))
            {
                currentUnit.PlayAnimation("修理", currentUnit.FeatureName("修理装置"));
            }
            else
            {
                currentUnit.SpecialEffect("修理", currentUnit.FeatureName("修理装置"));
            }

            GUI.DisplaySysMessage(currentUnit.Nickname + "は" + SelectedTarget.Nickname + "に" + currentUnit.FeatureName("修理装置") + "を使った。");

            // 修理を実行
            var tmp = SelectedTarget.HP;

            switch (currentUnit.FeatureLevel("修理装置"))
            {
            case 1d:
            case -1:
            {
                SelectedTarget.RecoverHP(30d + 3d * SelectedUnit.MainPilot().SkillLevel("修理", ref_mode: ""));
                break;
            }

            case 2d:
            {
                SelectedTarget.RecoverHP(50d + 5d * SelectedUnit.MainPilot().SkillLevel("修理", ref_mode: ""));
                break;
            }

            case 3d:
            {
                SelectedTarget.RecoverHP(100d);
                break;
            }
            }

            if (Information.IsNumeric(GeneralLib.LIndex(currentUnit.FeatureData("修理装置"), 2)))
            {
                currentUnit.EN = currentUnit.EN - Conversions.ToInteger(GeneralLib.LIndex(currentUnit.FeatureData("修理装置"), 2));
            }

            GUI.DrawSysString(SelectedTarget.x, SelectedTarget.y, "+" + SrcFormatter.Format(SelectedTarget.HP - tmp));
            GUI.UpdateMessageForm(SelectedTarget, SelectedUnit);
            GUI.DisplaySysMessage(SelectedTarget.Nickname + "の" + Expression.Term("HP", SelectedTarget) + "が" + SrcFormatter.Format(SelectedTarget.HP - tmp) + "回復した。");

            // 経験値獲得
            currentUnit.GetExp(SelectedTarget, "修理", exp_mode: "");
            if (GUI.MessageWait < 10000)
            {
                GUI.Sleep(GUI.MessageWait);
            }

            GUI.CloseMessageForm();

            // 形態変化のチェック
            SelectedTarget.Update();
            SelectedTarget.CurrentForm().CheckAutoHyperMode();
            SelectedTarget.CurrentForm().CheckAutoNormalMode();

            // 行動終了
            WaitCommand();
        }
Exemplo n.º 15
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();
            //}
        }