diff --git a/source/Grabacr07.KanColleViewer/ViewModels/Contents/ShipViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/Contents/ShipViewModel.cs index 4448cb1d4..8e74c341a 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/Contents/ShipViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/Contents/ShipViewModel.cs @@ -29,6 +29,14 @@ public string StatsToolTip } } + public string RepairToolTip => + !((this.Ship.HP.Maximum - this.Ship.HP.Current) > 0) ? + "OK" : + string.Format(Resources.Ship_RepairDockToolTip, this.Ship.RepairTimeDock) + + ((((this.Ship.HP.Current / (double)this.Ship.HP.Maximum) > 0.5) && this.Ship.RepairTimeFacility != this.Ship.RepairTimeDock) ? + "\n" + string.Format(Resources.Ship_RepairFacilityToolTip, this.Ship.RepairTimeFacility) : + ""); + public ShipViewModel(Ship ship) { this.Ship = ship; diff --git a/source/Grabacr07.KanColleViewer/Views/Catalogs/SlotItemCatalogWindow.xaml b/source/Grabacr07.KanColleViewer/Views/Catalogs/SlotItemCatalogWindow.xaml index 69952dad3..324b515d7 100644 --- a/source/Grabacr07.KanColleViewer/Views/Catalogs/SlotItemCatalogWindow.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Catalogs/SlotItemCatalogWindow.xaml @@ -255,7 +255,7 @@ --> - + diff --git a/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml b/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml index bea88e3d9..de37f6365 100644 --- a/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml @@ -334,7 +334,8 @@ Grid.Column="4" Grid.Row="0" Margin="10,0,10,10" - Grid.RowSpan="2"> + Grid.RowSpan="2" + ToolTip="{Binding RepairToolTip, Mode=OneWay}"> diff --git a/source/Grabacr07.KanColleViewer/Views/Contents/Overview.xaml b/source/Grabacr07.KanColleViewer/Views/Contents/Overview.xaml index 3ca2712e2..362e53fdd 100644 --- a/source/Grabacr07.KanColleViewer/Views/Contents/Overview.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Contents/Overview.xaml @@ -203,7 +203,7 @@ - + diff --git a/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml b/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml index 011ee224f..93a0097a5 100644 --- a/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml +++ b/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml @@ -403,7 +403,7 @@ --> - + diff --git a/source/Grabacr07.KanColleWrapper/Models/Ship.cs b/source/Grabacr07.KanColleWrapper/Models/Ship.cs index b1fae023d..d109fa829 100644 --- a/source/Grabacr07.KanColleWrapper/Models/Ship.cs +++ b/source/Grabacr07.KanColleWrapper/Models/Ship.cs @@ -61,6 +61,12 @@ public class Ship : RawDataWrapper, IIdentifiable /// public int ExpForLevelMax => Experience.GetShipExpForSpecifiedLevel(this.Exp, 150); + public TimeSpan RepairTimeDock => + TimeSpan.FromSeconds(Math.Floor(BaseRepairTime(this.Level) * (this.HP.Maximum - this.HP.Current) * this.Info.ShipType.RepairMultiplier) + 30); + + public TimeSpan RepairTimeFacility => + (BaseRepairTime() < 1200) ? this.RepairTimeDock : TimeSpan.FromMinutes((this.HP.Maximum - this.HP.Current) * 20); + #region HP 変更通知プロパティ private LimitedValue _HP; @@ -387,6 +393,9 @@ internal void Repair() this.HP = this.HP.Update(max); } + private double BaseRepairTime(double level = 1.0) => + (Math.Min(level, 150) * ((level < 12) ? 10 : 5) + ((level < 12) ? 0 : (Math.Floor(Math.Sqrt(level - 11) * 10 + 50)))); + public override string ToString() { return $"ID = {this.Id}, Name = \"{this.Info.Name}\", ShipType = \"{this.Info.ShipType.Name}\", Level = {this.Level}"; diff --git a/source/Grabacr07.KanColleWrapper/Models/ShipType.cs b/source/Grabacr07.KanColleWrapper/Models/ShipType.cs index a811e58fc..f906e0569 100644 --- a/source/Grabacr07.KanColleWrapper/Models/ShipType.cs +++ b/source/Grabacr07.KanColleWrapper/Models/ShipType.cs @@ -34,6 +34,33 @@ public override string ToString() return $"ID = {this.Id}, Name = \"{this.Name}\""; } + public double RepairMultiplier + { + get + { + switch ((ShipTypeId)this.Id) + { + case ShipTypeId.Submarine: + return 0.5; + case ShipTypeId.HeavyCruiser: + case ShipTypeId.AerialCruiser: + case ShipTypeId.FastBattleship: + case ShipTypeId.LightAircraftCarrier: + case ShipTypeId.SubmarineTender: + return 1.5; + case ShipTypeId.Battleship: + case ShipTypeId.Superdreadnought: + case ShipTypeId.AerialBattleship: + case ShipTypeId.AircraftCarrier: + case ShipTypeId.ArmoredAircraftCarrier: + case ShipTypeId.RepairShip: + return 2; + default: + return 1; + } + } + } + #region static members public static ShipType Dummy { get; } = new ShipType(new kcsapi_mst_stype @@ -44,5 +71,114 @@ public override string ToString() }); #endregion + + public enum ShipTypeId + { + Unknown = 0, + + /// + /// 海防艦。 + /// + EscortShip = 1, + + /// + /// 駆逐艦。 + /// + Destroyer = 2, + + /// + /// 軽巡洋艦。 + /// + LightCruiser = 3, + + /// + /// 重雷装巡洋艦。 + /// + TorpedoCruiser = 4, + + /// + /// 重巡洋艦。 + /// + HeavyCruiser = 5, + + /// + /// 航空巡洋艦。 + /// + AerialCruiser = 6, + + /// + /// 軽空母。 + /// + LightAircraftCarrier = 7, + + /// + /// 高速戦艦。 + /// + FastBattleship = 8, + + /// + /// 戦艦。 + /// + Battleship = 9, + + /// + /// 航空戦艦。 + /// + AerialBattleship = 10, + + /// + /// 正規空母。 + /// + AircraftCarrier = 11, + + /// + /// 超弩級戦艦。 + /// + Superdreadnought = 12, + + /// + /// 潜水艦。 + /// + Submarine = 13, + + /// + /// 潜水空母。 + /// + AircraftCarryingSubmarine = 14, + + /// + /// 補給艦。 + /// + ReplenishmentOiler = 15, + + /// + /// 水上機母艦。 + /// + SeaplaneCarrier = 16, + + /// + /// 揚陸艦 + /// + AmphibiousAssault = 17, + + /// + /// 装甲空母 + /// + ArmoredAircraftCarrier = 18, + + /// + /// 工作艦 + /// + RepairShip = 19, + + /// + /// 潜水母艦 + /// + SubmarineTender = 20, + + TrainingCruiser = 21, + + FleetOiler = 22, + } } }