/// <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; }
/// <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; }
/// <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; }