示例#1
0
            public void Update(FleetData fleet)
            {
                KCDatabase db = KCDatabase.Instance;

                if (fleet == null)
                {
                    return;
                }



                Name.Text = fleet.Name;
                {
                    int levelSum  = fleet.MembersInstance.Sum(s => s != null ? s.Level : 0);
                    int fueltotal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)(s.MasterShip.Fuel * (s.IsMarried ? 0.85 : 1.00)));
                    int ammototal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)(s.MasterShip.Ammo * (s.IsMarried ? 0.85 : 1.00)));
                    int speed     = fleet.MembersWithoutEscaped.Min(s => s == null ? 10 : s.MasterShip.Speed);
                    ToolTipInfo.SetToolTip(Name, string.Format(
                                               "Lv合計: {0} / 平均: {1:0.00}\r\n{2}艦隊\r\nドラム缶搭載: {3}個 ({4}艦)\r\n大発動艇搭載: {5}個\r\n総積載: 燃 {6} / 弾 {7}\r\n(1戦当たり 燃 {8} / 弾 {9})",
                                               levelSum,
                                               (double)levelSum / Math.Max(fleet.Members.Count(id => id != -1), 1),
                                               Constants.GetSpeed(speed),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 30)),
                                               fleet.MembersInstance.Count(s => s == null ? false : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 30) > 0),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 24)),
                                               fueltotal,
                                               ammototal,
                                               (int)(fueltotal * 0.2),
                                               (int)(ammototal * 0.2)
                                               ));
                }


                State = FleetData.UpdateFleetState(fleet, StateMain, ToolTipInfo, State, ref Timer);


                //制空戦力計算
                {
                    int airSuperiority = fleet.GetAirSuperiority();
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip(AirSuperiority,
                                           string.Format("確保: {0}\r\n優勢: {1}\r\n均衡: {2}\r\n劣勢: {3}\r\n",
                                                         (int)(airSuperiority / 3.0),
                                                         (int)(airSuperiority / 1.5),
                                                         (int)(airSuperiority * 1.5),
                                                         (int)(airSuperiority * 3.0)));
                }


                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                ToolTipInfo.SetToolTip(SearchingAbility,
                                       string.Format("(旧)2-5式: {0}\r\n2-5式(秋): {1}\r\n2-5新秋簡易式: {2}\r\n",
                                                     fleet.GetSearchingAbilityString(0),
                                                     fleet.GetSearchingAbilityString(1),
                                                     fleet.GetSearchingAbilityString(2)));
            }
示例#2
0
            public void Update(FleetData fleet)
            {
                KCDatabase db = KCDatabase.Instance;

                if (fleet == null)
                {
                    return;
                }



                Name.Text = fleet.Name;
                {
                    int levelSum  = fleet.MembersInstance.Sum(s => s != null ? s.Level : 0);
                    int fueltotal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)(s.MasterShip.Fuel * (s.IsMarried ? 0.85 : 1.00)));
                    int ammototal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)(s.MasterShip.Ammo * (s.IsMarried ? 0.85 : 1.00)));
                    int speed     = fleet.MembersWithoutEscaped.Min(s => s == null ? 10 : s.MasterShip.Speed);
                    ToolTipInfo.SetToolTip(Name, string.Format(
                                               GeneralRes.FleetTooltip,
                                               levelSum,
                                               (double)levelSum / Math.Max(fleet.Members.Count(id => id != -1), 1),
                                               Constants.GetSpeed(speed),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 30)),
                                               fleet.MembersInstance.Count(s => s == null ? false : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 30) > 0),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 24)),
                                               fueltotal,
                                               ammototal,
                                               (int)(fueltotal * 0.2),
                                               (int)(ammototal * 0.2)
                                               ));
                }


                State = FleetData.UpdateFleetState(fleet, StateMain, ToolTipInfo, State, ref Timer);


                //制空戦力計算
                {
                    int airSuperiority = fleet.GetAirSuperiority();
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip(AirSuperiority,
                                           string.Format(GeneralRes.ASTooltip,
                                                         (int)(airSuperiority / 3.0),
                                                         (int)(airSuperiority / 1.5),
                                                         (int)(airSuperiority * 1.5),
                                                         (int)(airSuperiority * 3.0)));
                }


                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                ToolTipInfo.SetToolTip(SearchingAbility,
                                       string.Format(GeneralRes.LoSTooltip,
                                                     fleet.GetSearchingAbilityString(0),
                                                     fleet.GetSearchingAbilityString(1),
                                                     fleet.GetSearchingAbilityString(2)));
            }
示例#3
0
			public TableFleetControl( FormFleet parent ) {

				#region Initialize

				Name = new Label();
				Name.Text = "[" + parent.FleetID.ToString() + "]";
				Name.Anchor = AnchorStyles.Left;
				Name.ForeColor = parent.MainFontColor;
                Name.BackColor = parent.BackColor;
				Name.Padding = new Padding( 0, 1, 0, 1 );
				Name.Margin = new Padding( 2, 0, 2, 0 );
				Name.AutoSize = true;
				//Name.Visible = false;

				StateMain = new ImageLabel();
				StateMain.Anchor = AnchorStyles.Left;
				StateMain.ForeColor = parent.MainFontColor;
                StateMain.BackColor = parent.BackColor;
				StateMain.ImageList = ResourceManager.Instance.Icons;
				StateMain.Padding = new Padding( 2, 2, 2, 2 );
				StateMain.Margin = new Padding( 2, 0, 2, 0 );
				StateMain.AutoSize = true;

				AirSuperiority = new ImageLabel();
				AirSuperiority.Anchor = AnchorStyles.Left;
				AirSuperiority.ForeColor = parent.MainFontColor;
                AirSuperiority.BackColor = parent.BackColor;
				AirSuperiority.ImageList = ResourceManager.Instance.Equipments;
				AirSuperiority.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedFighter;
				AirSuperiority.Padding = new Padding( 2, 2, 2, 2 );
				AirSuperiority.Margin = new Padding( 2, 0, 2, 0 );
				AirSuperiority.AutoSize = true;

				SearchingAbility = new ImageLabel();
				SearchingAbility.Anchor = AnchorStyles.Left;
				SearchingAbility.ForeColor = parent.MainFontColor;
                SearchingAbility.BackColor = parent.BackColor;
				SearchingAbility.ImageList = ResourceManager.Instance.Equipments;
				SearchingAbility.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedRecon;
				SearchingAbility.Padding = new Padding( 2, 2, 2, 2 );
				SearchingAbility.Margin = new Padding( 2, 0, 2, 0 );
				SearchingAbility.AutoSize = true;

				ConfigurationChanged( parent );

				ToolTipInfo = parent.ToolTipInfo;
				State = FleetData.FleetStates.NoShip;
				Timer = DateTime.Now;

				#endregion

			}
示例#4
0
            public TableFleetControl(FormFleet parent)
            {
                #region Initialize

                Name           = new Label();
                Name.Text      = "[" + parent.FleetID.ToString() + "]";
                Name.Anchor    = AnchorStyles.Left;
                Name.ForeColor = parent.MainFontColor;
                Name.BackColor = parent.BackColor;
                Name.Padding   = new Padding(0, 1, 0, 1);
                Name.Margin    = new Padding(2, 0, 2, 0);
                Name.AutoSize  = true;
                //Name.Visible = false;

                StateMain           = new ImageLabel();
                StateMain.Anchor    = AnchorStyles.Left;
                StateMain.ForeColor = parent.MainFontColor;
                StateMain.BackColor = parent.BackColor;
                StateMain.ImageList = ResourceManager.Instance.Icons;
                StateMain.Padding   = new Padding(2, 2, 2, 2);
                StateMain.Margin    = new Padding(2, 0, 2, 0);
                StateMain.AutoSize  = true;

                AirSuperiority            = new ImageLabel();
                AirSuperiority.Anchor     = AnchorStyles.Left;
                AirSuperiority.ForeColor  = parent.MainFontColor;
                AirSuperiority.BackColor  = parent.BackColor;
                AirSuperiority.ImageList  = ResourceManager.Instance.Equipments;
                AirSuperiority.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedFighter;
                AirSuperiority.Padding    = new Padding(2, 2, 2, 2);
                AirSuperiority.Margin     = new Padding(2, 0, 2, 0);
                AirSuperiority.AutoSize   = true;

                SearchingAbility            = new ImageLabel();
                SearchingAbility.Anchor     = AnchorStyles.Left;
                SearchingAbility.ForeColor  = parent.MainFontColor;
                SearchingAbility.BackColor  = parent.BackColor;
                SearchingAbility.ImageList  = ResourceManager.Instance.Equipments;
                SearchingAbility.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedRecon;
                SearchingAbility.Padding    = new Padding(2, 2, 2, 2);
                SearchingAbility.Margin     = new Padding(2, 0, 2, 0);
                SearchingAbility.AutoSize   = true;

                ConfigurationChanged(parent);

                ToolTipInfo = parent.ToolTipInfo;
                State       = FleetData.FleetStates.NoShip;
                Timer       = DateTime.Now;

                #endregion
            }
示例#5
0
            public void Update( FleetData fleet )
            {
                KCDatabase db = KCDatabase.Instance;

                if ( fleet == null ) return;

                Name.Text = fleet.Name;
                {
                    int levelSum = fleet.MembersInstance.Sum( s => s != null ? s.Level : 0 );

                    int fueltotal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.FuelMax * ( s.IsMarried ? 0.85 : 1.00 ) ) );
                    int ammototal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.AmmoMax * ( s.IsMarried ? 0.85 : 1.00 ) ) );

                    int fuelunit = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.MasterShip.Fuel * 0.2 * ( s.IsMarried ? 0.85 : 1.00 ) ) );
                    int ammounit = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.MasterShip.Ammo * 0.2 * ( s.IsMarried ? 0.85 : 1.00 ) ) );

                    int speed = fleet.MembersWithoutEscaped.Min( s => s == null ? 10 : s.MasterShip.Speed );

                    var slots = fleet.MembersWithoutEscaped
                        .Where( s => s != null )
                        .SelectMany( s => s.SlotInstance )
                        .Where( e => e != null );
                    var daihatsu = slots.Where( e => e.EquipmentID == 68 );
                    var daihatsu_tank = slots.Where( e => e.EquipmentID == 166 );
                    var landattacker = slots.Where( e => e.EquipmentID == 167 );
                    double expeditionBonus = Math.Min( daihatsu.Count() * 0.05 + daihatsu_tank.Count() * 0.02 + landattacker.Count() * 0.01, 0.20 );

                    ToolTipInfo.SetToolTip( Name, string.Format(
                        "Lv合計: {0} / 平均: {1:0.00}\r\n{2}艦隊\r\nドラム缶搭載: {3}個 ({4}艦)\r\n大発動艇搭載: {5}個 ({6}艦, +{7:p1})\r\n総積載: 燃 {8} / 弾 {9}\r\n(1戦当たり 燃 {10} / 弾 {11})",
                        levelSum,
                        (double)levelSum / Math.Max( fleet.Members.Count( id => id != -1 ), 1 ),
                        Constants.GetSpeed( speed ),
                        fleet.MembersInstance.Sum( s => s == null ? 0 : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 30 ) ),
                        fleet.MembersInstance.Count( s => s == null ? false : s.SlotInstanceMaster.Any( q => q == null ? false : q.CategoryType == 30 ) ),
                        daihatsu.Count() + daihatsu_tank.Count() + landattacker.Count(),
                        fleet.MembersInstance.Count( s => s == null ? false : s.SlotInstanceMaster.Any( q => q == null ? false : q.CategoryType == 24 || q.CategoryType == 46 ) ),
                        expeditionBonus + 0.01 * expeditionBonus * ( daihatsu.Sum( e => e.Level ) + daihatsu_tank.Sum( e => e.Level ) + landattacker.Sum( e => e.Level ) ) / Math.Max( daihatsu.Count() + daihatsu_tank.Count() + landattacker.Count(), 1 ),
                        fueltotal,
                        ammototal,
                        fuelunit,
                        ammounit
                        ) );

                }

                State = FleetData.UpdateFleetState( fleet, StateMain, ToolTipInfo, State, ref Timer );

                var config = Utility.Configuration.Config.FormFleetPlus.FleetsInfoIcon[FleetID - 1];

                //制空戦力計算
                {
                    int airSuperiority = fleet.GetAirSuperiority();
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip( AirSuperiority,
                        string.Format( "確保: {0}\r\n優勢: {1}\r\n均衡: {2}\r\n劣勢: {3}\r\n",
                        (int)( airSuperiority / 3.0 ),
                        (int)( airSuperiority / 1.5 ),
                        (int)( airSuperiority * 1.5 - 1 ),
                        (int)( airSuperiority * 3.0 - 1 ) ) );
                    AirSuperiority.Visible = config[0];
                }

                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                {
                    StringBuilder sb = new StringBuilder();
                    double probStart = fleet.GetContactProbability();
                    var probSelect = fleet.GetContactSelectionProbability();

                    sb.AppendFormat( "(旧)2-5式: {0}\r\n2-5式(秋): {1}\r\n2-5新秋簡易式: {2}\r\n判定式(33): {3}\r\n\r\n触接開始率: \r\n 確保 {4:p1} / 優勢 {5:p1}\r\n",
                        fleet.GetSearchingAbilityString( 0 ),
                        fleet.GetSearchingAbilityString( 1 ),
                        fleet.GetSearchingAbilityString( 2 ),
                        fleet.GetSearchingAbilityString( 3 ),
                        probStart,
                        probStart * 0.6 );

                    if ( probSelect.Count > 0 ) {
                        sb.AppendLine( "触接選択率: " );

                        foreach ( var p in probSelect.OrderBy( p => p.Key ) ) {
                            sb.AppendFormat( " 命中{0} : {1:p1}\r\n", p.Key, p.Value );
                        }
                    }

                    ToolTipInfo.SetToolTip( SearchingAbility, sb.ToString() );
                }
                SearchingAbility.Visible = config[1];

                int drumTotal = fleet.MembersInstance.Sum( s => s?.SlotInstanceMaster.Count( q => q?.CategoryType == 30 ) ?? 0 );
                int drumShipTotal = fleet.MembersInstance.Count( s => s?.SlotInstanceMaster.Any( q => q?.CategoryType == 30 ) ?? false );
                DrumCanister.Text = $"{drumTotal}/{drumShipTotal}";
                DrumCanister.Visible = config[2];

                int landingCraftTotal = fleet.MembersInstance.Sum(s => s?.SlotInstanceMaster.Count(q => q?.CategoryType == 24) ?? 0);
                LandingCraft.Text = $"{landingCraftTotal}";
                LandingCraft.Visible = config[3];

                if ( ConditionSparkle.Visible = config[4] ) {
                    var sparkleShipCount = fleet.MembersInstance.Count(s => s?.Condition > 50);
                    if ( sparkleShipCount == 6 ) {
                        // 全艦キラ
                        var minCond = fleet.MembersInstance.Min(s => s.Condition);
                        ConditionSparkle.Text = $"{Math.Ceiling((minCond - 49.0) / 3.0)}";
                        ConditionSparkle.ForeColor = Color.Black;
                    } else if ( sparkleShipCount >= 4 ) {
                        // 4隻以上キラ
                        var minCond = fleet.MembersInstance.Where(s => s?.Condition > 50).Min(s => s.Condition);
                        ConditionSparkle.Text = $"{Math.Ceiling((minCond - 49.0) / 3.0)}";
                        ConditionSparkle.ForeColor = Color.Red;
                    } else {
                        // キラ3隻以下
                        ConditionSparkle.Text = "0";
                        ConditionSparkle.ForeColor = Color.Red;
                }
                }
            }
示例#6
0
 public void ResetState()
 {
     State = FleetData.FleetStates.NoShip;
 }
示例#7
0
            public void Update( FleetData fleet )
            {
                KCDatabase db = KCDatabase.Instance;

                if ( fleet == null ) return;

                Name.Text = fleet.Name;
                {
                    int levelSum = fleet.MembersInstance.Sum( s => s != null ? s.Level : 0 );

                    int fueltotal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.FuelMax * ( s.IsMarried ? 0.85 : 1.00 ) ) );
                    int ammototal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.AmmoMax * ( s.IsMarried ? 0.85 : 1.00 ) ) );

                    int fuelunit = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.MasterShip.Fuel * 0.2 * ( s.IsMarried ? 0.85 : 1.00 ) ) );
                    int ammounit = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.MasterShip.Ammo * 0.2 * ( s.IsMarried ? 0.85 : 1.00 ) ) );

                    int speed = fleet.MembersWithoutEscaped.Min( s => s == null ? 10 : s.MasterShip.Speed );
                    ToolTipInfo.SetToolTip( Name, string.Format(
                        "Lv合計: {0} / 平均: {1:0.00}\r\n{2}艦隊\r\nドラム缶搭載: {3}個 ({4}艦)\r\n大発動艇搭載: {5}個\r\n総積載: 燃 {6} / 弾 {7}\r\n(1戦当たり 燃 {8} / 弾 {9})",
                        levelSum,
                        (double)levelSum / Math.Max( fleet.Members.Count( id => id != -1 ), 1 ),
                        Constants.GetSpeed( speed ),
                        fleet.MembersInstance.Sum( s => s == null ? 0 : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 30 ) ),
                        fleet.MembersInstance.Count( s => s == null ? false : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 30 ) > 0 ),
                        fleet.MembersInstance.Sum( s => s == null ? 0 : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 24 ) ),
                        fueltotal,
                        ammototal,
                        fuelunit,
                        ammounit
                        ) );

                }

                State = FleetData.UpdateFleetState( fleet, StateMain, ToolTipInfo, State, ref Timer );

                //制空戦力計算
                {
                    int airSuperiority = fleet.GetAirSuperiority();
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip( AirSuperiority,
                        string.Format( "確保: {0}\r\n優勢: {1}\r\n均衡: {2}\r\n劣勢: {3}\r\n",
                        (int)( airSuperiority / 3.0 ),
                        (int)( airSuperiority / 1.5 ),
                        (int)( airSuperiority * 1.5 - 1 ),
                        (int)( airSuperiority * 3.0 - 1 ) ) );
                }

                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                ToolTipInfo.SetToolTip( SearchingAbility,
                    string.Format( "(旧)2-5式: {0}\r\n2-5式(秋): {1}\r\n2-5新秋簡易式: {2}\r\n",
                    fleet.GetSearchingAbilityString( 0 ),
                    fleet.GetSearchingAbilityString( 1 ),
                    fleet.GetSearchingAbilityString( 2 ) ) );
            }
 public void ResetState()
 {
     State = FleetData.FleetStates.NoShip;
 }
            public void Update(FleetData fleet)
            {
                KCDatabase db = KCDatabase.Instance;

                if (fleet == null)
                {
                    return;
                }



                Name.Text = fleet.Name;
                {
                    int levelSum = fleet.MembersInstance.Sum(s => s != null ? s.Level : 0);

                    int fueltotal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.FuelMax * (s.IsMarried ? 0.85 : 1.00)));
                    int ammototal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.AmmoMax * (s.IsMarried ? 0.85 : 1.00)));

                    int fuelunit = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.MasterShip.Fuel * 0.2 * (s.IsMarried ? 0.85 : 1.00)));
                    int ammounit = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.MasterShip.Ammo * 0.2 * (s.IsMarried ? 0.85 : 1.00)));

                    int speed = fleet.MembersWithoutEscaped.Min(s => s == null ? 10 : s.MasterShip.Speed);

                    double expeditionBonus = Calculator.GetExpeditionBonus(fleet);
                    int    tp = Calculator.GetTPDamage(fleet);

                    ToolTipInfo.SetToolTip(Name, string.Format(
                                               "Lv合計: {0} / 平均: {1:0.00}\r\n{2}艦隊\r\nドラム缶搭載: {3}個 ({4}艦)\r\n大発動艇搭載: {5}個 ({6}艦, +{7:p1})\r\n輸送量(TP): S {8} / A {9}\r\n総積載: 燃 {10} / 弾 {11}\r\n(1戦当たり 燃 {12} / 弾 {13})",
                                               levelSum,
                                               (double)levelSum / Math.Max(fleet.Members.Count(id => id != -1), 1),
                                               Constants.GetSpeed(speed),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 30)),
                                               fleet.MembersInstance.Count(s => s == null ? false : s.SlotInstanceMaster.Any(q => q == null ? false : q.CategoryType == 30)),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 24 || q.CategoryType == 46)),
                                               fleet.MembersInstance.Count(s => s == null ? false : s.SlotInstanceMaster.Any(q => q == null ? false : q.CategoryType == 24 || q.CategoryType == 46)),
                                               expeditionBonus,
                                               tp,
                                               (int)(tp * 0.7),
                                               fueltotal,
                                               ammototal,
                                               fuelunit,
                                               ammounit
                                               ));
                }


                State = FleetData.UpdateFleetState(fleet, StateMain, ToolTipInfo, State, ref Timer);


                //制空戦力計算
                {
                    int  airSuperiority = fleet.GetAirSuperiority();
                    bool includeLevel   = Utility.Configuration.Config.FormFleet.AirSuperiorityMethod == 1;
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip(AirSuperiority,
                                           string.Format("確保: {0}\r\n優勢: {1}\r\n均衡: {2}\r\n劣勢: {3}\r\n({4}: {5})\r\n",
                                                         (int)(airSuperiority / 3.0),
                                                         (int)(airSuperiority / 1.5),
                                                         Math.Max((int)(airSuperiority * 1.5 - 1), 0),
                                                         Math.Max((int)(airSuperiority * 3.0 - 1), 0),
                                                         includeLevel ? "熟練度なし" : "熟練度あり",
                                                         includeLevel ? Calculator.GetAirSuperiorityIgnoreLevel(fleet) : Calculator.GetAirSuperiority(fleet)));
                }


                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                {
                    StringBuilder sb         = new StringBuilder();
                    double        probStart  = fleet.GetContactProbability();
                    var           probSelect = fleet.GetContactSelectionProbability();

                    sb.AppendFormat("(旧)2-5式: {0}\r\n2-5式(秋): {1}\r\n2-5新秋簡易式: {2}\r\n判定式(33): {3}\r\n\r\n触接開始率: \r\n 確保 {4:p1} / 優勢 {5:p1}\r\n",
                                    fleet.GetSearchingAbilityString(0),
                                    fleet.GetSearchingAbilityString(1),
                                    fleet.GetSearchingAbilityString(2),
                                    fleet.GetSearchingAbilityString(3),
                                    probStart,
                                    probStart * 0.6);

                    if (probSelect.Count > 0)
                    {
                        sb.AppendLine("触接選択率: ");

                        foreach (var p in probSelect.OrderBy(p => p.Key))
                        {
                            sb.AppendFormat(" 命中{0} : {1:p1}\r\n", p.Key, p.Value);
                        }
                    }

                    ToolTipInfo.SetToolTip(SearchingAbility, sb.ToString());
                }
            }
示例#10
0
            public void Update( FleetData fleet )
            {
                KCDatabase db = KCDatabase.Instance;

                if ( fleet == null ) return;

                Name.Text = fleet.Name;
                {
                    int levelSum = fleet.MembersInstance.Sum( s => s != null ? s.Level : 0 );
                    int fueltotal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)( s.MasterShip.Fuel * ( s.IsMarried ? 0.85 : 1.00 ) ) );
                    int ammototal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)( s.MasterShip.Ammo * ( s.IsMarried ? 0.85 : 1.00 ) ) );
                    int speed = fleet.MembersWithoutEscaped.Min( s => s == null ? 10 : s.MasterShip.Speed );
                    ToolTipInfo.SetToolTip(Name, string.Format(
                        GeneralRes.FleetTooltip,
                        levelSum,
                        (double)levelSum / Math.Max( fleet.Members.Count( id => id != -1 ), 1 ),
                        Constants.GetSpeed( speed ),
                        fleet.MembersInstance.Sum( s => s == null ? 0 : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 30 ) ),
                        fleet.MembersInstance.Count( s => s == null ? false : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 30 ) > 0 ),
                        fleet.MembersInstance.Sum( s => s == null ? 0 : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 24 ) ),
                        fueltotal,
                        ammototal,
                        (int)( fueltotal * 0.2 ),
                        (int)( ammototal * 0.2 )
                        ) );

                }

                State = FleetData.UpdateFleetState( fleet, StateMain, ToolTipInfo, State, ref Timer );

                //制空戦力計算
                {
                    int airSuperiority = fleet.GetAirSuperiority();
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip( AirSuperiority,
                        string.Format( GeneralRes.ASTooltip,
                        (int)( airSuperiority / 3.0 ),
                        (int)( airSuperiority / 1.5 ),
                        (int)( airSuperiority * 1.5 ),
                        (int)( airSuperiority * 3.0 ) ) );
                }

                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                ToolTipInfo.SetToolTip( SearchingAbility,
                    string.Format( GeneralRes.LoSTooltip,
                    fleet.GetSearchingAbilityString( 0 ),
                    fleet.GetSearchingAbilityString( 1 ),
                    fleet.GetSearchingAbilityString( 2 ) ) );
            }
示例#11
0
            public void Update(FleetData fleet)
            {
                KCDatabase db = KCDatabase.Instance;

                if (fleet == null)
                {
                    return;
                }



                Name.Text = fleet.Name;
                {
                    int levelSum = fleet.MembersInstance.Sum(s => s != null ? s.Level : 0);

                    int fueltotal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.FuelMax * (s.IsMarried ? 0.85 : 1.00)));
                    int ammototal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.AmmoMax * (s.IsMarried ? 0.85 : 1.00)));

                    int fuelunit = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.MasterShip.Fuel * 0.2 * (s.IsMarried ? 0.85 : 1.00)));
                    int ammounit = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.MasterShip.Ammo * 0.2 * (s.IsMarried ? 0.85 : 1.00)));

                    int speed = fleet.MembersWithoutEscaped.Min(s => s == null ? 10 : s.MasterShip.Speed);

                    var slots = fleet.MembersWithoutEscaped
                                .Where(s => s != null)
                                .SelectMany(s => s.SlotInstance)
                                .Where(e => e != null);
                    var    daihatsu        = slots.Where(e => e.EquipmentID == 68);
                    var    daihatsu_tank   = slots.Where(e => e.EquipmentID == 166);
                    var    landattacker    = slots.Where(e => e.EquipmentID == 167);
                    double expeditionBonus = Math.Min(daihatsu.Count() * 0.05 + daihatsu_tank.Count() * 0.02 + landattacker.Count() * 0.01, 0.20);

                    ToolTipInfo.SetToolTip(Name, string.Format(
                                               "Lv合計: {0} / 平均: {1:0.00}\r\n{2}艦隊\r\nドラム缶搭載: {3}個 ({4}艦)\r\n大発動艇搭載: {5}個 ({6}艦, +{7:p1})\r\n総積載: 燃 {8} / 弾 {9}\r\n(1戦当たり 燃 {10} / 弾 {11})",
                                               levelSum,
                                               (double)levelSum / Math.Max(fleet.Members.Count(id => id != -1), 1),
                                               Constants.GetSpeed(speed),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 30)),
                                               fleet.MembersInstance.Count(s => s == null ? false : s.SlotInstanceMaster.Any(q => q == null ? false : q.CategoryType == 30)),
                                               daihatsu.Count() + daihatsu_tank.Count() + landattacker.Count(),
                                               fleet.MembersInstance.Count(s => s == null ? false : s.SlotInstanceMaster.Any(q => q == null ? false : q.CategoryType == 24 || q.CategoryType == 46)),
                                               expeditionBonus + 0.01 * expeditionBonus * (daihatsu.Sum(e => e.Level) + daihatsu_tank.Sum(e => e.Level) + landattacker.Sum(e => e.Level)) / Math.Max(daihatsu.Count() + daihatsu_tank.Count() + landattacker.Count(), 1),
                                               fueltotal,
                                               ammototal,
                                               fuelunit,
                                               ammounit
                                               ));
                }


                State = FleetData.UpdateFleetState(fleet, StateMain, ToolTipInfo, State, ref Timer);


                //制空戦力計算
                {
                    int airSuperiority = fleet.GetAirSuperiority();
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip(AirSuperiority,
                                           string.Format("確保: {0}\r\n優勢: {1}\r\n均衡: {2}\r\n劣勢: {3}\r\n",
                                                         (int)(airSuperiority / 3.0),
                                                         (int)(airSuperiority / 1.5),
                                                         (int)(airSuperiority * 1.5 - 1),
                                                         (int)(airSuperiority * 3.0 - 1)));
                }


                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                {
                    StringBuilder sb         = new StringBuilder();
                    double        probStart  = fleet.GetContactProbability();
                    var           probSelect = fleet.GetContactSelectionProbability();

                    sb.AppendFormat("(旧)2-5式: {0}\r\n2-5式(秋): {1}\r\n2-5新秋簡易式: {2}\r\n判定式(33): {3}\r\n\r\n触接開始率: \r\n 確保 {4:p1} / 優勢 {5:p1}\r\n",
                                    fleet.GetSearchingAbilityString(0),
                                    fleet.GetSearchingAbilityString(1),
                                    fleet.GetSearchingAbilityString(2),
                                    fleet.GetSearchingAbilityString(3),
                                    probStart,
                                    probStart * 0.6);

                    if (probSelect.Count > 0)
                    {
                        sb.AppendLine("触接選択率: ");

                        foreach (var p in probSelect.OrderBy(p => p.Key))
                        {
                            sb.AppendFormat(" 命中{0} : {1:p1}\r\n", p.Key, p.Value);
                        }
                    }

                    ToolTipInfo.SetToolTip(SearchingAbility, sb.ToString());
                }
            }
示例#12
0
            public void Update( FleetData fleet )
            {
                KCDatabase db = KCDatabase.Instance;

                if ( fleet == null ) return;

                Name.Text = fleet.Name;
                {
                    int levelSum = fleet.MembersInstance.Sum( s => s != null ? s.Level : 0 );

                    int fueltotal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.FuelMax * ( s.IsMarried ? 0.85 : 1.00 ) ) );
                    int ammototal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.AmmoMax * ( s.IsMarried ? 0.85 : 1.00 ) ) );

                    int fuelunit = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.MasterShip.Fuel * 0.2 * ( s.IsMarried ? 0.85 : 1.00 ) ) );
                    int ammounit = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.MasterShip.Ammo * 0.2 * ( s.IsMarried ? 0.85 : 1.00 ) ) );

                    int speed = fleet.MembersWithoutEscaped.Min( s => s == null ? 10 : s.MasterShip.Speed );
                    ToolTipInfo.SetToolTip( Name, string.Format(
                        "Lv合計: {0} / 平均: {1:0.00}\r\n{2}艦隊\r\nドラム缶搭載: {3}個 ({4}艦)\r\n大発動艇搭載: {5}個\r\n総積載: 燃 {6} / 弾 {7}\r\n(1戦当たり 燃 {8} / 弾 {9})",
                        levelSum,
                        (double)levelSum / Math.Max( fleet.Members.Count( id => id != -1 ), 1 ),
                        Constants.GetSpeed( speed ),
                        fleet.MembersInstance.Sum( s => s == null ? 0 : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 30 ) ),
                        fleet.MembersInstance.Count( s => s == null ? false : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 30 ) > 0 ),
                        fleet.MembersInstance.Sum( s => s == null ? 0 : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 24 ) ),
                        fueltotal,
                        ammototal,
                        fuelunit,
                        ammounit
                        ) );

                }

                State = FleetData.UpdateFleetState( fleet, StateMain, ToolTipInfo, State, ref Timer );

                //制空戦力計算
                {
                    int airSuperiority = fleet.GetAirSuperiority();
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip( AirSuperiority,
                        string.Format( "確保: {0}\r\n優勢: {1}\r\n均衡: {2}\r\n劣勢: {3}\r\n",
                        (int)( airSuperiority / 3.0 ),
                        (int)( airSuperiority / 1.5 ),
                        (int)( airSuperiority * 1.5 - 1 ),
                        (int)( airSuperiority * 3.0 - 1 ) ) );
                }

                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                {
                    StringBuilder sb = new StringBuilder();
                    double probStart = fleet.GetContactProbability();
                    var probSelect = fleet.GetContactSelectionProbability();

                    sb.AppendFormat("(旧)2-5式: {0}\r\n2-5式(秋): {1}\r\n2-5新秋簡易式: {2}\r\n\r\n触接開始率: \r\n 確保 {3:p1} / 優勢 {4:p1}\r\n",
                        fleet.GetSearchingAbilityString( 0 ),
                        fleet.GetSearchingAbilityString( 1 ),
                        fleet.GetSearchingAbilityString( 2 ),
                        probStart,
                        probStart * 0.6 );

                    if ( probSelect.Count > 0 ) {
                        sb.AppendLine( "触接選択率: " );

                        foreach ( var p in probSelect.OrderBy( p => p.Key ) ) {
                            sb.AppendFormat( " 命中{0} : {1:p1}\r\n", p.Key, p.Value );
                        }
                    }

                    ToolTipInfo.SetToolTip( SearchingAbility, sb.ToString() );
                }
            }
示例#13
0
            public void Update(FleetData fleet)
            {
                KCDatabase db = KCDatabase.Instance;

                if (fleet == null)
                {
                    return;
                }



                Name.Text = fleet.Name;
                {
                    int levelSum = fleet.MembersInstance.Sum(s => s != null ? s.Level : 0);

                    int fueltotal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.FuelMax * (s.IsMarried ? 0.85 : 1.00)));
                    int ammototal = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.AmmoMax * (s.IsMarried ? 0.85 : 1.00)));

                    int fuelunit = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.MasterShip.Fuel * 0.2 * (s.IsMarried ? 0.85 : 1.00)));
                    int ammounit = fleet.MembersInstance.Sum(s => s == null ? 0 : (int)Math.Floor(s.MasterShip.Ammo * 0.2 * (s.IsMarried ? 0.85 : 1.00)));

                    int speed = fleet.MembersWithoutEscaped.Min(s => s == null ? 10 : s.MasterShip.Speed);
                    ToolTipInfo.SetToolTip(Name, string.Format(
                                               GeneralRes.FleetTooltip,
                                               levelSum,
                                               (double)levelSum / Math.Max(fleet.Members.Count(id => id != -1), 1),
                                               Constants.GetSpeed(speed),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 30)),
                                               fleet.MembersInstance.Count(s => s == null ? false : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 30) > 0),
                                               fleet.MembersInstance.Sum(s => s == null ? 0 : s.SlotInstanceMaster.Count(q => q == null ? false : q.CategoryType == 24)),
                                               fueltotal,
                                               ammototal,
                                               fuelunit,
                                               ammounit
                                               ));
                }


                State = FleetData.UpdateFleetState(fleet, StateMain, ToolTipInfo, State, ref Timer);


                //制空戦力計算
                {
                    int airSuperiority = fleet.GetAirSuperiority();
                    AirSuperiority.Text = airSuperiority.ToString();
                    ToolTipInfo.SetToolTip(AirSuperiority,
                                           string.Format(GeneralRes.ASTooltip,
                                                         (int)(airSuperiority / 3.0),
                                                         (int)(airSuperiority / 1.5),
                                                         (int)(airSuperiority * 1.5 - 1),
                                                         (int)(airSuperiority * 3.0 - 1)));
                }


                //索敵能力計算
                SearchingAbility.Text = fleet.GetSearchingAbilityString();
                {
                    StringBuilder sb         = new StringBuilder();
                    double        probStart  = fleet.GetContactProbability();
                    var           probSelect = fleet.GetContactSelectionProbability();
                    //GeneralRes.LoSTooltip
                    sb.AppendFormat("(旧)2-5式: {0}\r\n2-5式(秋): {1}\r\n2-5新秋簡易式: {2}\r\n判定式(33): {3}\r\n\r\n触接開始率: \r\n 確保 {4:p1} / 優勢 {5:p1}\r\n",
                                    fleet.GetSearchingAbilityString(0),
                                    fleet.GetSearchingAbilityString(1),
                                    fleet.GetSearchingAbilityString(2),
                                    fleet.GetSearchingAbilityString(3),
                                    probStart,
                                    probStart * 0.6);

                    if (probSelect.Count > 0)
                    {
                        sb.AppendLine("触接選択率: ");

                        foreach (var p in probSelect.OrderBy(p => p.Key))
                        {
                            sb.AppendFormat(" 命中{0} : {1:p1}\r\n", p.Key, p.Value);
                        }
                    }

                    ToolTipInfo.SetToolTip(SearchingAbility, sb.ToString());
                }
            }
示例#14
0
			public void Update( FleetData fleet ) {

				KCDatabase db = KCDatabase.Instance;

				if ( fleet == null ) return;



				Name.Text = fleet.Name;
				{
					int levelSum = fleet.MembersInstance.Sum( s => s != null ? s.Level : 0 );

					int fueltotal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.FuelMax * ( s.IsMarried ? 0.85 : 1.00 ) ) );
					int ammototal = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.AmmoMax * ( s.IsMarried ? 0.85 : 1.00 ) ) );

					int fuelunit = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.MasterShip.Fuel * 0.2 * ( s.IsMarried ? 0.85 : 1.00 ) ) );
					int ammounit = fleet.MembersInstance.Sum( s => s == null ? 0 : (int)Math.Floor( s.MasterShip.Ammo * 0.2 * ( s.IsMarried ? 0.85 : 1.00 ) ) );

					int speed = fleet.MembersWithoutEscaped.Min( s => s == null ? 10 : s.MasterShip.Speed );

					var slots = fleet.MembersWithoutEscaped
						.Where( s => s != null )
						.SelectMany( s => s.SlotInstance )
						.Where( e => e != null );
					var daihatsu = slots.Where( e => e.EquipmentID == 68 );
					var daihatsu_tank = slots.Where( e => e.EquipmentID == 166 );
					var landattacker = slots.Where( e => e.EquipmentID == 167 );
					double expeditionBonus = Math.Min( daihatsu.Count() * 0.05 + daihatsu_tank.Count() * 0.02 + landattacker.Count() * 0.01, 0.20 );

					ToolTipInfo.SetToolTip( Name, string.Format(
						GeneralRes.FleetTooltip,
						levelSum,
						(double)levelSum / Math.Max( fleet.Members.Count( id => id != -1 ), 1 ),
						Constants.GetSpeed( speed ),
						fleet.MembersInstance.Sum( s => s == null ? 0 : s.SlotInstanceMaster.Count( q => q == null ? false : q.CategoryType == 30 ) ),
						fleet.MembersInstance.Count( s => s == null ? false : s.SlotInstanceMaster.Any( q => q == null ? false : q.CategoryType == 30 ) ),
						daihatsu.Count() + daihatsu_tank.Count() + landattacker.Count(),
						fleet.MembersInstance.Count( s => s == null ? false : s.SlotInstanceMaster.Any( q => q == null ? false : q.CategoryType == 24 || q.CategoryType == 46 ) ),
						expeditionBonus + 0.01 * expeditionBonus * ( daihatsu.Sum( e => e.Level ) + daihatsu_tank.Sum( e => e.Level ) + landattacker.Sum( e => e.Level ) ) / Math.Max( daihatsu.Count() + daihatsu_tank.Count() + landattacker.Count(), 1 ),
						fueltotal,
						ammototal,
						fuelunit,
						ammounit
						) );

				}


				State = FleetData.UpdateFleetState( fleet, StateMain, ToolTipInfo, State, ref Timer );


				//制空戦力計算
				{
					int airSuperiority = fleet.GetAirSuperiority();
					AirSuperiority.Text = airSuperiority.ToString();
					ToolTipInfo.SetToolTip( AirSuperiority,
						string.Format( GeneralRes.ASTooltip,
						(int)( airSuperiority / 3.0 ),
						(int)( airSuperiority / 1.5 ),
						(int)( airSuperiority * 1.5 - 1 ),
						(int)( airSuperiority * 3.0 - 1 ) ) );
				}


				//索敵能力計算
				SearchingAbility.Text = fleet.GetSearchingAbilityString();
				{
					StringBuilder sb = new StringBuilder();
					double probStart = fleet.GetContactProbability();
					var probSelect = fleet.GetContactSelectionProbability();

					sb.AppendFormat( GeneralRes.LoSTooltip,
						fleet.GetSearchingAbilityString( 0 ),
						fleet.GetSearchingAbilityString( 1 ),
						fleet.GetSearchingAbilityString( 2 ),
						fleet.GetSearchingAbilityString( 3 ),
						probStart,
						probStart * 0.6 );

					if ( probSelect.Count > 0 ) {
						sb.AppendLine( GeneralRes.SelectionRate );

						foreach ( var p in probSelect.OrderBy( p => p.Key ) ) {
							sb.AppendFormat( "  " + EncycloRes.Accuracy + "+{0} : {1:p1}\r\n", p.Key, p.Value );
						}
					}

					ToolTipInfo.SetToolTip( SearchingAbility, sb.ToString() );
				}
			}