Example #1
0
        // 属性 aname に対して有効属性を持つか?
        public bool Effective(string aname)
        {
            bool   EffectiveRet = default;
            string c;
            int    i;
            int    slen;

            // 全属性に有効な場合
            if (GeneralLib.InStrNotNest(strEffective, "全") > 0)
            {
                EffectiveRet = true;
                return(EffectiveRet);
            }

            if (Strings.Len(aname) == 0)
            {
                if (GeneralLib.InStrNotNest(strEffective, "物") > 0)
                {
                    EffectiveRet = true;
                }

                return(EffectiveRet);
            }

            i    = 1;
            slen = Strings.Len(strEffective);
            while (i <= slen)
            {
                // 属性をひとまとめずつ取得
                c = GeneralLib.GetClassBundle(strEffective, ref i);
                switch (c ?? "")
                {
                case "物":
                {
                    if (GeneralLib.InStrNotNest(aname, "魔") == 0 && GeneralLib.InStrNotNest(aname, "精") == 0)
                    {
                        EffectiveRet = true;
                        break;
                    }

                    break;
                }

                default:
                {
                    if (GeneralLib.InStrNotNest(aname, c) > 0)
                    {
                        EffectiveRet = true;
                        break;
                    }

                    break;
                }
                }

                i = (i + 1);
            }

            return(EffectiveRet);
        }
Example #2
0
        // ユニット u のシチュエーション msg_situation におけるメッセージを選択
        public string SelectMessage(ref string msg_situation, [Optional, DefaultParameterValue(null)] ref Unit u)
        {
            string SelectMessageRet = default;

            string[] situations;
            string[] sub_situations;
            short[]  list0;
            short    list0_num;

            short[] tlist;
            short   tlist_num;

            short[] list;
            short   list_num;
            short   j, i, k;
            bool    found;
            var     t = default(Unit);
            short   w, tw;

            // 配列領域確保
            list0 = new short[301];
            tlist = new short[101];
            list  = new short[201];

            // シチュエーションを設定
            switch (msg_situation ?? "")
            {
            case "格闘":
            case "射撃":
            {
                situations    = new string[3];
                situations[2] = "攻撃";
                break;
            }

            case "格闘(命中)":
            case "射撃(命中)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(命中)";
                break;
            }

            case "格闘(回避)":
            case "射撃(回避)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(回避)";
                break;
            }

            case "格闘(とどめ)":
            case "射撃(とどめ)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(とどめ)";
                break;
            }

            case "格闘(クリティカル)":
            case "射撃(クリティカル)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(クリティカル)";
                break;
            }

            case "格闘(反撃)":
            case "射撃(反撃)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(反撃)";
                break;
            }

            case "格闘(命中)(反撃)":
            case "射撃(命中)(反撃)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(命中)(反撃)";
                break;
            }

            case "格闘(回避)(反撃)":
            case "射撃(回避)(反撃)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(回避)(反撃)";
                break;
            }

            case "格闘(とどめ)(反撃)":
            case "射撃(とどめ)(反撃)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(とどめ)(反撃)";
                break;
            }

            case "格闘(クリティカル)(反撃)":
            case "射撃(クリティカル)(反撃)":
            {
                situations    = new string[3];
                situations[2] = "攻撃(クリティカル)(反撃)";
                break;
            }

            default:
            {
                situations = new string[2];
                break;
            }
            }

            situations[1] = msg_situation;

            // メッセージの候補リスト第一次審査
            list0_num = 0;
            var loopTo = intMessageNum;

            for (i = 1; i <= loopTo; i++)
            {
                var loopTo1 = (short)Information.UBound(situations);
                for (j = 1; j <= loopTo1; j++)
                {
                    if ((Strings.Left(strSituation[i], Strings.Len(situations[j])) ?? "") == (situations[j] ?? ""))
                    {
                        list0_num = (short)(list0_num + 1);
                        if (list0_num > Information.UBound(list0))
                        {
                            Array.Resize(ref list0, list0_num + 1);
                        }

                        list0[list0_num] = i;
                        break;
                    }
                }
            }

            if (list0_num == 0)
            {
                return(SelectMessageRet);
            }

            // 最初に相手限定のシチュエーションのみで検索
            if (u is null)
            {
                goto SkipMessagesWithTarget;
            }

            if (ReferenceEquals(u, Commands.SelectedUnit))
            {
                t = Commands.SelectedTarget;
            }
            else if (ReferenceEquals(u, Commands.SelectedTarget))
            {
                t = Commands.SelectedUnit;
            }

            if (t is null)
            {
                goto SkipMessagesWithTarget;
            }

            // 相手限定メッセージのリストを作成
            tlist_num = 0;
            var loopTo2 = list0_num;

            for (i = 1; i <= loopTo2; i++)
            {
                if (Strings.InStr(strSituation[list0[i]], "(対") > 0)
                {
                    tlist_num = (short)(tlist_num + 1);
                    if (tlist_num > Information.UBound(tlist))
                    {
                        Array.Resize(ref tlist, tlist_num + 1);
                    }

                    tlist[tlist_num] = list0[i];
                }
            }

            if (tlist_num == 0)
            {
                // 相手限定メッセージがない
                goto SkipMessagesWithTarget;
            }

            // 自分自身にアビリティを使う場合は必ず「(対自分)」を優先
            if (ReferenceEquals(t, u))
            {
                list_num = 0;
                var loopTo3 = tlist_num;
                for (i = 1; i <= loopTo3; i++)
                {
                    var loopTo4 = (short)Information.UBound(situations);
                    for (j = 1; j <= loopTo4; j++)
                    {
                        if ((strSituation[tlist[i]] ?? "") == (situations[j] + "(対自分)" ?? ""))
                        {
                            list_num = (short)(list_num + 1);
                            if (list_num > Information.UBound(list))
                            {
                                Array.Resize(ref list, list_num + 1);
                            }

                            list[list_num] = tlist[i];
                            break;
                        }
                    }
                }

                if (list_num > 0)
                {
                    SelectMessageRet = strMessage[list[GeneralLib.Dice(list_num)]];
                    return(SelectMessageRet);
                }
            }

            string wclass, ch;

            {
                var withBlock = t;
                if (withBlock.Status != "出撃")
                {
                    goto SkipMessagesWithTarget;
                }

                sub_situations = new string[9];
                // 対パイロット名称
                sub_situations[1] = "(対" + withBlock.MainPilot().Name + ")";
                // 対パイロット愛称
                sub_situations[2] = "(対" + withBlock.MainPilot().get_Nickname(false) + ")";
                // 対ユニット名称
                sub_situations[3] = "(対" + withBlock.Name + ")";
                // 対ユニット愛称
                sub_situations[4] = "(対" + withBlock.Nickname + ")";
                // 対ユニットクラス
                sub_situations[5] = "(対" + withBlock.Class0 + ")";
                // 対ユニットサイズ
                sub_situations[6] = "(対" + withBlock.Size + ")";
                // 対地形名
                sub_situations[7] = "(対" + Map.TerrainName(withBlock.x, withBlock.y) + ")";
                // 対エリア
                sub_situations[8] = "(対" + withBlock.Area + ")";

                // 対メッセージクラス
                string argfname = "メッセージクラス";
                if (withBlock.IsFeatureAvailable(ref argfname))
                {
                    Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                    object argIndex1 = "メッセージクラス";
                    sub_situations[Information.UBound(sub_situations)] = "(対" + withBlock.FeatureData(ref argIndex1) + ")";
                }

                // 対性別
                switch (withBlock.MainPilot().Sex ?? "")
                {
                case "男性":
                {
                    Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                    sub_situations[Information.UBound(sub_situations)] = "(対男性)";
                    break;
                }

                case "女性":
                {
                    Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                    sub_situations[Information.UBound(sub_situations)] = "(対女性)";
                    break;
                }
                }

                // 対特殊能力
                {
                    var withBlock1 = withBlock.MainPilot();
                    var loopTo5    = withBlock1.CountSkill();
                    for (i = 1; i <= loopTo5; i++)
                    {
                        Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                        string localSkillName0()
                        {
                            object argIndex1 = i; var ret = withBlock1.SkillName0(ref argIndex1); return(ret);
                        }

                        sub_situations[Information.UBound(sub_situations)] = "(対" + localSkillName0() + ")";
                        if (sub_situations[Information.UBound(sub_situations)] == "(対非表示)")
                        {
                            string localSkill()
                            {
                                object argIndex1 = i; var ret = withBlock1.Skill(ref argIndex1); return(ret);
                            }

                            sub_situations[Information.UBound(sub_situations)] = "(対" + localSkill() + ")";
                        }
                    }
                }

                var loopTo6 = withBlock.CountFeature();
                for (i = 1; i <= loopTo6; i++)
                {
                    Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                    string localFeatureName0()
                    {
                        object argIndex1 = i; var ret = withBlock.FeatureName0(ref argIndex1); return(ret);
                    }

                    sub_situations[Information.UBound(sub_situations)] = "(対" + localFeatureName0() + ")";
                    if (sub_situations[Information.UBound(sub_situations)] == "(対)")
                    {
                        string localFeature()
                        {
                            object argIndex1 = i; var ret = withBlock.Feature(ref argIndex1); return(ret);
                        }

                        sub_situations[Information.UBound(sub_situations)] = "(対" + localFeature() + ")";
                    }
                }

                // 対弱点
                if (Strings.Len(withBlock.strWeakness) > 0)
                {
                    var loopTo7 = (short)Strings.Len(withBlock.strWeakness);
                    for (i = 1; i <= loopTo7; i++)
                    {
                        Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                        sub_situations[Information.UBound(sub_situations)] = "(対弱点=" + GeneralLib.GetClassBundle(ref withBlock.strWeakness, ref i) + ")";
                    }
                }

                // 対有効
                if (Strings.Len(withBlock.strEffective) > 0)
                {
                    var loopTo8 = (short)Strings.Len(withBlock.strEffective);
                    for (i = 1; i <= loopTo8; i++)
                    {
                        Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                        sub_situations[Information.UBound(sub_situations)] = "(対有効=" + GeneralLib.GetClassBundle(ref withBlock.strEffective, ref i) + ")";
                    }
                }

                // 対ザコ
                if (Strings.InStr(withBlock.MainPilot().Name, "(ザコ)") > 0 & (u.MainPilot().Technique > withBlock.MainPilot().Technique | u.HP > withBlock.HP / 2))
                {
                    Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                    sub_situations[Information.UBound(sub_situations)] = "(対ザコ)";
                }

                // 対強敵
                if (withBlock.BossRank >= 0 | Strings.InStr(withBlock.MainPilot().Name, "(ザコ)") == 0 & u.MainPilot().Technique <= withBlock.MainPilot().Technique)
                {
                    Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                    sub_situations[Information.UBound(sub_situations)] = "(対強敵)";
                }

                // 自分が使用する武器をチェック
                w = 0;
                if (ReferenceEquals(Commands.SelectedUnit, u))
                {
                    if (0 < Commands.SelectedWeapon & Commands.SelectedWeapon <= u.CountWeapon())
                    {
                        w = Commands.SelectedWeapon;
                    }
                }
                else if (ReferenceEquals(Commands.SelectedTarget, u))
                {
                    if (0 < Commands.SelectedTWeapon & Commands.SelectedTWeapon <= u.CountWeapon())
                    {
                        w = Commands.SelectedTWeapon;
                    }
                }

                if (w > 0)
                {
                    // 対瀕死
                    if (withBlock.HP <= u.Damage(w, ref t, u.Party == "味方"))
                    {
                        Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                        sub_situations[Information.UBound(sub_situations)] = "(対瀕死)";
                    }

                    switch (u.HitProbability(w, ref t, u.Party == "味方"))
                    {
                    case var @case when @case < 50:
                    {
                        // 対高回避率
                        Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                        sub_situations[Information.UBound(sub_situations)] = "(対高回避率)";
                        break;
                    }

                    case var case1 when case1 >= 100:
                    {
                        // 対低回避率
                        Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                        sub_situations[Information.UBound(sub_situations)] = "(対低回避率)";
                        break;
                    }
                    }
                }

                // 相手が使用する武器をチェック
                tw = 0;
                if (ReferenceEquals(Commands.SelectedUnit, t))
                {
                    if (0 < Commands.SelectedWeapon & Commands.SelectedWeapon <= withBlock.CountWeapon())
                    {
                        tw = Commands.SelectedWeapon;
                    }
                }
                else if (ReferenceEquals(Commands.SelectedTarget, t))
                {
                    if (0 < Commands.SelectedTWeapon & Commands.SelectedTWeapon <= withBlock.CountWeapon())
                    {
                        tw = Commands.SelectedTWeapon;
                    }
                }

                if (tw > 0)
                {
                    // 対武器名
                    Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                    sub_situations[Information.UBound(sub_situations)] = "(対" + withBlock.Weapon(tw).Name + ")";

                    // 対武器属性
                    wclass = withBlock.WeaponClass(tw);
                    var loopTo9 = (short)Strings.Len(wclass);
                    for (i = 1; i <= loopTo9; i++)
                    {
                        ch = GeneralLib.GetClassBundle(ref wclass, ref i);
                        switch (ch ?? "")
                        {
                        case var case2 when 0.ToString() <= case2 && case2 <= 127.ToString():
                        {
                            break;
                        }

                        default:
                        {
                            Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                            sub_situations[Information.UBound(sub_situations)] = "(対" + ch + "属性)";
                            break;
                        }
                        }
                    }

                    switch (withBlock.HitProbability(tw, ref u, withBlock.Party == "味方"))
                    {
                    case var case3 when case3 > 75:
                    {
                        // 対高命中率
                        Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                        sub_situations[Information.UBound(sub_situations)] = "(対高命中率)";
                        break;
                    }

                    case var case4 when case4 < 25:
                    {
                        // 対低命中率
                        Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                        sub_situations[Information.UBound(sub_situations)] = "(対低命中率)";
                        break;
                    }
                    }
                }
            }

            // 定義されている相手限定メッセージのうち、状況に合ったメッセージを抜き出す
            list_num = 0;
            var loopTo10 = tlist_num;

            for (i = 1; i <= loopTo10; i++)
            {
                found = false;
                var loopTo11 = (short)Information.UBound(situations);
                for (j = 1; j <= loopTo11; j++)
                {
                    var loopTo12 = (short)Information.UBound(sub_situations);
                    for (k = 1; k <= loopTo12; k++)
                    {
                        if ((strSituation[tlist[i]] ?? "") == (situations[j] + sub_situations[k] ?? ""))
                        {
                            found = true;
                            break;
                        }
                    }

                    if (found)
                    {
                        break;
                    }
                }

                if (found)
                {
                    list_num = (short)(list_num + 1);
                    if (list_num > Information.UBound(list))
                    {
                        Array.Resize(ref list, list_num + 1);
                    }

                    list[list_num] = tlist[i];
                }
            }

            // 状況に合った相手限定メッセージが一つでもあれば、その中からメッセージを選択
            if (list_num > 0)
            {
                SelectMessageRet = strMessage[list[GeneralLib.Dice(list_num)]];
                if (GeneralLib.Dice(2) == 1 | Strings.InStr(msg_situation, "(とどめ)") > 0 | msg_situation == "挑発" | msg_situation == "脱力" | msg_situation == "魅惑" | msg_situation == "威圧" | (u.Party ?? "") == (t.Party ?? ""))
                {
                    return(SelectMessageRet);
                }
            }

SkipMessagesWithTarget:
            ;


            // 次にサブシチュエーションなしとユニット限定のサブシチュエーションで検索
            if (u is object)
            {
                sub_situations    = new string[4];
                sub_situations[1] = "(" + u.Name + ")";
                sub_situations[2] = "(" + u.Nickname0 + ")";
                sub_situations[3] = "(" + u.Class0 + ")";
                switch (msg_situation ?? "")
                {
                case "格闘":
                case "射撃":
                case "格闘(反撃)":
                case "射撃(反撃)":
                {
                    if (ReferenceEquals(Commands.SelectedUnit, u))
                    {
                        // 自分が使用する武器をチェック
                        if (0 < Commands.SelectedWeapon & Commands.SelectedWeapon <= u.CountWeapon())
                        {
                            Array.Resize(ref sub_situations, 5);
                            sub_situations[4] = "(" + u.WeaponNickname(Commands.SelectedWeapon) + ")";
                        }
                    }

                    break;
                }
                }

                string argfname1 = "メッセージクラス";
                if (u.IsFeatureAvailable(ref argfname1))
                {
                    Array.Resize(ref sub_situations, Information.UBound(sub_situations) + 1 + 1);
                    object argIndex2 = "メッセージクラス";
                    sub_situations[Information.UBound(sub_situations)] = "(" + u.FeatureData(ref argIndex2) + ")";
                }
            }
            else
            {
                sub_situations = new string[1];
            }

            // 上で見つかったメッセージリストの中からシチュエーションに合ったメッセージを抜き出す
            list_num = 0;
            var loopTo13 = list0_num;

            for (i = 1; i <= loopTo13; i++)
            {
                found = false;
                var loopTo14 = (short)Information.UBound(situations);
                for (j = 1; j <= loopTo14; j++)
                {
                    if ((strSituation[list0[i]] ?? "") == (situations[j] ?? ""))
                    {
                        found = true;
                        break;
                    }

                    var loopTo15 = (short)Information.UBound(sub_situations);
                    for (k = 1; k <= loopTo15; k++)
                    {
                        if ((strSituation[list0[i]] ?? "") == (situations[j] + sub_situations[k] ?? ""))
                        {
                            found = true;
                            break;
                        }
                    }

                    if (found)
                    {
                        break;
                    }
                }

                if (found)
                {
                    list_num = (short)(list_num + 1);
                    if (list_num > Information.UBound(list))
                    {
                        Array.Resize(ref list, list_num + 1);
                    }

                    list[list_num] = list0[i];
                }
            }

            // シチュエーションに合ったメッセージが見つかれば、その中からメッセージを選択
            if (list_num > 0)
            {
                SelectMessageRet = strMessage[list[GeneralLib.Dice(list_num)]];
            }

            return(SelectMessageRet);
        }
Example #3
0
        // 「アビリティ一覧」コマンド
        private void AbilityListCommand()
        {
            LogDebug();

            GUI.LockGUI();
            while (true)
            {
                var currentAbility = GUI.AbilityListBox(SelectedUnit, new UnitAbilityList(AbilityListMode.List, SelectedUnit), Expression.Term("アビリティ", SelectedUnit) + "一覧", "一覧");
                if (currentAbility == null)
                {
                    SelectedAbility = 0;
                    // キャンセル
                    if (SRC.AutoMoveCursor)
                    {
                        GUI.RestoreCursorPos();
                    }

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

                SelectedAbility = currentAbility.AbilityNo();
                // 指定されたアビリティの属性一覧を作成
                {
                    var list   = new List <string>();
                    var i      = 0;
                    var u      = SelectedUnit;
                    var aclass = currentAbility.Data.Class;
                    while (i <= Strings.Len(aclass))
                    {
                        i = (i + 1);
                        var buf    = GeneralLib.GetClassBundle(aclass, ref i);
                        var atype  = "";
                        var alevel = "";

                        // 非表示?
                        if (buf == "|")
                        {
                            break;
                        }

                        // M属性
                        if (Strings.Mid(aclass, i, 1) == "M")
                        {
                            i   = (i + 1);
                            buf = buf + Strings.Mid(aclass, i, 1);
                        }

                        // レベル指定
                        if (Strings.Mid(aclass, i + 1, 1) == "L")
                        {
                            i = (i + 2);
                            var c = Strings.Mid(aclass, i, 1);
                            while (Information.IsNumeric(c) || c == "." || c == "-")
                            {
                                alevel = alevel + c;
                                i      = (i + 1);
                                c      = Strings.Mid(aclass, i, 1);
                            }

                            i = (i - 1);
                        }

                        // 属性の名称
                        atype = Help.AttributeName(SelectedUnit, buf);
                        if (Strings.Len(atype) > 0)
                        {
                            if (Strings.Len(alevel) > 0)
                            {
                                list.Add(GeneralLib.RightPaddedString(buf + "L" + alevel, 8) + atype + "レベル" + alevel);
                            }
                            else
                            {
                                list.Add(GeneralLib.RightPaddedString(buf, 8) + atype);
                            }
                        }
                    }

                    if (!Map.IsStatusView)
                    {
                        list.Add("射程範囲");
                    }

                    if (list.Count > 0)
                    {
                        GUI.TopItem = 1;
                        while (true)
                        {
                            if (list.Count == 1 && list[0] == "射程範囲")
                            {
                                i = 1;
                            }
                            else
                            {
                                i = GUI.ListBox(new ListBoxArgs
                                {
                                    lb_caption = "アビリティ属性一覧",
                                    Items      = list.Select(x => new ListBoxItem(x)).ToList(),
                                    lb_info    = "属性    効果",
                                    lb_mode    = "連続表示",
                                });
                            }

                            if (i == 0)
                            {
                                // キャンセル
                                break;
                            }
                            else if (list[i - 1] == "射程範囲")
                            {
                                GUI.CloseListBox();

                                // 武器の射程を求めておく
                                var min_range = currentAbility.AbilityMinRange();
                                var max_range = currentAbility.AbilityMaxRange();
                                // 射程範囲表示
                                if ((max_range == 1 || currentAbility.IsAbilityClassifiedAs("P")) && !currentAbility.IsAbilityClassifiedAs("Q"))
                                {
                                    Map.AreaInReachable(SelectedUnit, max_range, u.Party + "の敵");
                                }
                                else if (currentAbility.IsAbilityClassifiedAs("M直"))
                                {
                                    Map.AreaInCross(u.x, u.y, min_range, max_range);
                                }
                                else if (currentAbility.IsAbilityClassifiedAs("M拡"))
                                {
                                    Map.AreaInWideCross(u.x, u.y, min_range, max_range);
                                }
                                else if (currentAbility.IsAbilityClassifiedAs("M扇"))
                                {
                                    Map.AreaInSectorCross(u.x, u.y, min_range, max_range, (int)currentAbility.AbilityLevel("M扇"));
                                }
                                else if (currentAbility.IsAbilityClassifiedAs("M全") || currentAbility.IsAbilityClassifiedAs("M線"))
                                {
                                    Map.AreaInRange(u.x, u.y, max_range, min_range, "すべて");
                                }
                                else if (currentAbility.IsAbilityClassifiedAs("M投"))
                                {
                                    max_range = ((int)(max_range + currentAbility.AbilityLevel("M投")));
                                    min_range = ((int)(min_range - currentAbility.AbilityLevel("M投")));
                                    min_range = GeneralLib.MaxLng(min_range, 1);
                                    Map.AreaInRange(u.x, u.y, max_range, min_range, "すべて");
                                }
                                else if (currentAbility.IsAbilityClassifiedAs("M移"))
                                {
                                    Map.AreaInMoveAction(SelectedUnit, max_range);
                                }
                                else
                                {
                                    Map.AreaInRange(u.x, u.y, max_range, min_range, u.Party + "の敵");
                                }

                                GUI.Center(u.x, u.y);
                                GUI.MaskScreen();

                                // 先行入力されていたクリックイベントを解消
                                GUI.DoEvents();
                                WaitClickMode     = true;
                                GUI.IsFormClicked = false;

                                // クリックされるまで待つ
                                while (!GUI.IsFormClicked)
                                {
                                    GUI.Sleep(25);
                                    if (GUI.IsRButtonPressed(true))
                                    {
                                        break;
                                    }
                                }

                                GUI.RedrawScreen();
                                if (list.Count == 1)
                                {
                                    break;
                                }
                            }
                            else
                            {
                                // 指定された属性の解説を表示
                                GUI.CloseListBox();
                                Help.AttributeHelp(SelectedUnit, GeneralLib.LIndex(list[i - 1], 1), currentAbility.AbilityNo(), true);
                            }
                        }
                    }
                }
            }
        }
Example #4
0
        // 属性 aname に対して無効化属性を持つか?
        public bool Immune(string aname)
        {
            bool   ImmuneRet = default;
            string c;
            int    i;
            int    slen;

            // 全属性に有効な場合
            if (GeneralLib.InStrNotNest(strImmune, "全") > 0)
            {
                ImmuneRet = true;
                return(ImmuneRet);
            }

            // 無属性は物理攻撃に分類される
            if (Strings.Len(aname) == 0)
            {
                if (GeneralLib.InStrNotNest(strImmune, "物") > 0)
                {
                    ImmuneRet = true;
                }

                return(ImmuneRet);
            }

            // 属性に該当するかを判定
            i    = 1;
            slen = Strings.Len(strImmune);
            while (i <= slen)
            {
                // 属性をひとまとめずつ取得
                c = GeneralLib.GetClassBundle(strImmune, ref i);
                switch (c ?? "")
                {
                case "物":
                {
                    if (GeneralLib.InStrNotNest(aname, "魔") == 0 && GeneralLib.InStrNotNest(aname, "精") == 0)
                    {
                        ImmuneRet = true;
                        break;
                    }

                    break;
                }

                case "魔":
                {
                    // 魔法武器以外の魔属性なら特性が有効
                    if (GeneralLib.InStrNotNest(aname, "魔") > 0 && GeneralLib.InStrNotNest(aname, "魔武") == 0 && GeneralLib.InStrNotNest(aname, "魔突") == 0 && GeneralLib.InStrNotNest(aname, "魔接") == 0 && GeneralLib.InStrNotNest(aname, "魔銃") == 0 && GeneralLib.InStrNotNest(aname, "魔実") == 0)
                    {
                        ImmuneRet = true;
                        break;
                    }

                    break;
                }

                default:
                {
                    if (GeneralLib.InStrNotNest(aname, c) > 0)
                    {
                        ImmuneRet = true;
                        break;
                    }

                    break;
                }
                }

                i = (i + 1);
            }

            return(ImmuneRet);
        }
Example #5
0
        // 属性の該当判定
        // aclass1 が防御属性、aclass2 が武器属性
        public bool IsAttributeClassified(string aclass1, string aclass2)
        {
            bool   IsAttributeClassifiedRet = default;
            string attr;
            int    alen, i;
            var    with_not = default(bool);

            if (Strings.Len(aclass1) == 0)
            {
                IsAttributeClassifiedRet = true;
                return(IsAttributeClassifiedRet);
            }

            if (aclass1 == "全")
            {
                IsAttributeClassifiedRet = true;
                return(IsAttributeClassifiedRet);
            }

            // 無属性の攻撃は物理攻撃に分類される
            if (Strings.Len(aclass2) == 0)
            {
                if (GeneralLib.InStrNotNest(aclass1, "物") > 0)
                {
                    IsAttributeClassifiedRet = true;
                }

                if (GeneralLib.InStrNotNest(aclass1, "!") > 0)
                {
                    IsAttributeClassifiedRet = !IsAttributeClassifiedRet;
                }

                goto EndOfFunction;
            }

            i    = 1;
            alen = Strings.Len(aclass1);
            while (i <= alen)
            {
                attr = GeneralLib.GetClassBundle(aclass1, ref i);
                switch (attr ?? "")
                {
                case "物":
                {
                    if (GeneralLib.InStrNotNest(aclass2, "魔") == 0 && GeneralLib.InStrNotNest(aclass2, "精") == 0)
                    {
                        IsAttributeClassifiedRet = true;
                        break;
                    }

                    break;
                }

                case "魔":
                {
                    // 魔法武器以外の魔属性なら特性が有効
                    if (GeneralLib.InStrNotNest(aclass2, "魔") > 0)
                    {
                        if (GeneralLib.InStrNotNest(aclass2, "魔武") == 0 && GeneralLib.InStrNotNest(aclass2, "魔突") == 0 && GeneralLib.InStrNotNest(aclass2, "魔接") == 0 && GeneralLib.InStrNotNest(aclass2, "魔銃") == 0 && GeneralLib.InStrNotNest(aclass2, "魔実") == 0)
                        {
                            IsAttributeClassifiedRet = true;
                        }
                        else if (with_not)
                        {
                            IsAttributeClassifiedRet = true;
                        }

                        break;
                    }

                    break;
                }

                case "!":
                {
                    with_not = true;
                    break;
                }

                default:
                {
                    if (GeneralLib.InStrNotNest(aclass2, attr) > 0)
                    {
                        IsAttributeClassifiedRet = true;
                        break;
                    }

                    break;
                }
                }

                i = (i + 1);
            }

EndOfFunction:
            ;
            if (with_not)
            {
                IsAttributeClassifiedRet = !IsAttributeClassifiedRet;
            }

            return(IsAttributeClassifiedRet);
        }