Esempio n. 1
0
        /// <summary>
        /// 個別索敵値の計算(旧2-5式)
        /// </summary>
        /// <param name="oship">計算対象の船のオブジェクト</param>
        /// <param name="itemdata">装備のデータ</param>
        /// <returns>個別索敵値</returns>
        public static UnitSearchResult CalcUnitSearchOld25(ApiShip oship, Dictionary<int, SlotItem> itemdata)
        {
            //返り値:[0] 索敵装備値、[1]装備を引いたステ索敵値
            int status_search = oship.api_sakuteki[0];
            int equip_search = 0;
            var oslots = oship.GetOSlotitems(itemdata);
            var dslots = oship.GetDSlotitems(itemdata);

            foreach (int i in Enumerable.Range(0, dslots.Count))
            {
                SlotItem oequip = oslots[i];
                var equip = dslots[i];
                //索敵に関係する装備:艦戦(6), 艦爆(7), 艦攻(8), 艦偵{9}, 水上機{10} api_type[3]
                if (equip.api_type[3] >= 6 && equip.api_type[3] <= 10)
                {
                    equip_search += (equip.api_saku * 2);
                    status_search -= equip.api_saku;
                }
                //電探{11} 探照灯[24]
                else if (equip.api_type[3] == 11 || equip.api_type[3] == 24)
                {
                    equip_search += equip.api_saku;
                    status_search -= equip.api_saku;
                }
            }

            UnitSearchResult result = new UnitSearchResult
            {
                EquipSearchesPoint = equip_search,
                StatusSearches = status_search,
            };
            return result;
        }
Esempio n. 2
0
        /// <summary>
        /// 個別索敵値の計算(ほっぽアルファVer2.0.1索敵モデル)
        /// </summary>
        /// <param name="oship">船のオブジェクト</param>
        /// <param name="slotdata">装備データ</param>
        /// <returns>個別索敵値</returns>
        public static UnitSearchResult CalcUnitSearch(ApiShip oship, Dictionary<int, SlotItem> slotdata)
        {
            int status_search = oship.api_sakuteki[0];
            double pointe = 0;
            var oslots = oship.GetOSlotitems(slotdata);
            var dslots = oship.GetDSlotitems(slotdata);

            foreach (int i in Enumerable.Range(0, dslots.Count))
            {
                SlotItem oequip = oslots[i];
                var equip = dslots[i];
                //装備ポイントのある装備
                switch (equip.EquipType)
                {
                    case -1://ステータス索敵値から引く処理
                        status_search -= equip.api_saku;
                        break;
                    case 7://艦爆
                        pointe += 0.6 * (double)equip.api_saku;
                        goto case -1;
                    case 8://艦攻
                        pointe += 0.8 * (double)equip.api_saku;
                        goto case -1;
                    case 9://艦偵
                        pointe += 1.0 * (double)equip.api_saku;
                        goto case -1;
                    case 10://水偵
                        pointe += 1.2 * (double)equip.api_saku;
                        goto case -1;
                    case 11://水爆
                        pointe += 1.0 * (double)equip.api_saku;
                        goto case -1;
                    case 12://電探
                        pointe += 0.6 * (double)equip.api_saku;
                        goto case -1;
                    case 13://電探
                        goto case 12;
                    default://それ以外の索敵のある装備
                        if (equip.api_saku > 0)
                        {
                            pointe += 0.5 * (double)equip.api_saku;
                            status_search -= equip.api_saku;
                        }
                        break;
                }
            }
            //個別ポイントの計算
            double unitpoint = Math.Sqrt(status_search) + pointe;

            UnitSearchResult result = new UnitSearchResult()
            {
                UnitSearchInt = (int)unitpoint,
            };
            return result;
        }
Esempio n. 3
0
        /// <summary>
        /// 個別索敵値の計算(33式)
        /// </summary>
        /// <param name="oship">船のオブジェクト</param>
        /// <param name="itemdata">装備データ</param>
        /// <returns>Σ[係数×装備ステ]+√ステ索敵</returns>
        public static UnitSearchResult CalcUnitSearch(ApiShip oship, Dictionary<int, SlotItem> itemdata)
        {
            var oslots = oship.GetOSlotitems(itemdata);
            var dslots = oship.GetDSlotitems(itemdata);

            int status_saku = oship.api_sakuteki[0];//装備なしの索敵
            double equip_saku = 0.0;//装備索敵ポイント
            foreach(var i in Enumerable.Range(0, Math.Min(oslots.Count, dslots.Count)))
            {
                var o = oslots[i];
                var d = dslots[i];

                if (d.api_saku > 0)
                {
                    //係数
                    double ratio;
                    switch (d.EquipType)
                    {
                        case 8://艦上攻撃機
                            ratio = 0.8;
                            break;
                        case 9://艦上偵察機
                            ratio = 1.0;
                            break;
                        case 10://水上偵察機
                            ratio = 1.2;
                            break;
                        case 11://水上爆撃機
                            ratio = 1.1;
                            break;
                        default:
                            ratio = 0.6;
                            break;
                    }

                    //改修効果
                    double kaishu;
                    switch(d.EquipType)
                    {
                        case 10://水上偵察機
                            kaishu = 1.2 * Math.Sqrt(o.api_level);
                            break;
                        case 12://小型電探
                        case 13://大型電探
                            kaishu = 1.25 * Math.Sqrt(o.api_level);
                            break;
                        default:
                            kaishu = 0.0;
                            break;
                    }

                    //装備索敵の合計をプラスし、素索敵から引く
                    equip_saku += ratio * ((double)d.api_saku + kaishu);
                    status_saku -= d.api_saku;
                }
            }

            //Σ[係数×装備ステ]+√ステ索敵 : 返り値
            double unitSearch = equip_saku + Math.Sqrt(status_saku);

            UnitSearchResult result = new UnitSearchResult()
            {
                UnitSearchDouble = unitSearch,
            };
            return result;
        }
 //ApiShip→リストビューのアイテム用
 private static string[] ToListViewItem(ApiShip oship, bool assignFlag)
 {
     //Enumを基準になるように書き換え
     SortMode[] mode = (SortMode[])Enum.GetValues(typeof(SortMode));
     //列のオブジェクト
     string[] row = new string[mode.Length];
     foreach (SortMode m in mode)
     {
         int i = (int)m;
         switch(m)
         {
             //0個目
             case SortMode.ID:
                 row[i] = oship.api_id.ToString();//ID
                 break;
             case SortMode.Name:
                 row[i] = (assignFlag ? "★" : "") + oship.ShipName;//名前
                 break;
             case SortMode.Level:
                 row[i] = oship.api_lv.ToString();//レベル
                 break;
             case SortMode.ShipType:
                 row[i] = oship.ShipTypeName;//艦種
                 break;
             case SortMode.Cond:
                 row[i] = oship.api_cond.ToString();//cond値
                 break;
             //5個目完了
             case SortMode.NdockTime:
                 row[i] = TimeSpanToString(oship.api_ndock_time);//入渠時間
                 break;
             case SortMode.HP:
                 row[i] = string.Format("{0}/{1}", oship.api_nowhp, oship.api_maxhp);//HP
                 break;
             case SortMode.Exp:
                 row[i] = oship.api_exp[0].ToString("N0");//TotalExp
                 break;
             case SortMode.NdockItem:
                 row[i] = string.Join(", ", oship.api_ndock_item);//修理資材
                 break;
             case SortMode.Karyoku:
                 row[i] = oship.api_karyoku[0].ToString();//火力
                 break;
             //10個目完了
             case SortMode.Raisou:
                 row[i] = oship.api_raisou[0].ToString();//雷装
                 break;
             case SortMode.NightKaryoku:
                 row[i] = (oship.api_karyoku[0] + oship.api_raisou[0]).ToString();//夜戦火力
                 break;
             case SortMode.Taisen:
                 row[i] = oship.api_taisen[0].ToString();//対潜
                 break;
             case SortMode.Taiku:
                 row[i] = oship.api_taiku[0].ToString();//対空
                 break;
             case SortMode.Soukou:
                 row[i] = oship.api_soukou[0].ToString();//装甲
                 break;
             //15個目完了
             case SortMode.Kaihi:
                 row[i] = oship.api_kaihi[0].ToString();//回避
                 break;
             case SortMode.Tousai:
                 row[i] = oship.api_onslot.Sum().ToString();//搭載
                 break;
             case SortMode.Length:
                 row[i] = Helper.MstSlotitemLengthToString(oship.api_leng);//射程
                 break;
             case SortMode.Sakuteki:
                 row[i] = oship.api_sakuteki[0].ToString();//索敵
                 break;
             case SortMode.Luck:
                 row[i] = string.Join("/", oship.api_lucky);//運
                 break;
             //20個目完了
             case SortMode.SallyArea:
                 row[i] = oship.api_sally_area.ToString();//出撃エリア
                 break;
         }
     }
     return row;
 }
 //フィルタリング(入渠時間計算用)
 private static bool Filtering(ApiShip oship, UnitQueryFilter filter)
 {
     //入渠時間が一定以上か
     bool ndock_timeover = filter.NotShowOverThresholdHour &&
         TimeSpan.FromMilliseconds(oship.api_ndock_time).TotalHours >= filter.ThresholdHour;
     //小破以上か
     var hpcond = oship.GetHPCondition(false, false, Config.BucketHPRatio, APIGetMember.SlotItemsDictionary) & ~HPCondition.EraseFlagsMagicNumber;
     bool small_damage = filter.NotShowSmallDamage && ((int)hpcond <= (int)HPCondition.SmallDamage);
     return (!ndock_timeover) && (!small_damage);
 }