Skip to content

Commit

Permalink
2015夏イベに多分対応した
Browse files Browse the repository at this point in the history
選択難易度表示を追加
  • Loading branch information
veigr committed Aug 12, 2015
1 parent fd14bdd commit 4ecf259
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 73 deletions.
6 changes: 3 additions & 3 deletions EventMapHpViewer/EventMapHpViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>mkdir $(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\Plugins
xcopy /Y $(TargetDir)*.* $(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)
move $(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\$(TargetName).* $(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\Plugins</PostBuildEvent>
<PostBuildEvent>mkdir "$(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\Plugins"
xcopy /Y "$(TargetDir)*.*" "$(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)"
move "$(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\$(TargetName).*" "$(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\Plugins"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 1 addition & 1 deletion EventMapHpViewer/MapHpViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace EventMapHpViewer
[ExportMetadata("Guid", "101436F4-9308-4892-A88A-19EFBDF2ED5F")]
[ExportMetadata("Title", "MapHPViewer")]
[ExportMetadata("Description", "Map HPを表示します。")]
[ExportMetadata("Version", "2.3.0")]
[ExportMetadata("Version", "2.4.0")]
[ExportMetadata("Author", "@veigr")]
public class MapHpViewer : IPlugin, ITool
{
Expand Down
90 changes: 42 additions & 48 deletions EventMapHpViewer/Models/Maps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ public int RemainingCount

if (this.Eventmap == null) return 1; //ゲージ無し通常海域

var shipMaster = KanColleClient.Current.Master.Ships;
try
{
var lastBossHp = shipMaster[EventBossDictionary[this.Eventmap.SelectedRank][this.Id].Last()].HP;
var normalBossHp = shipMaster[EventBossDictionary[this.Eventmap.SelectedRank][this.Id].First()].HP;
var lastBossHp = EventBossHpDictionary[this.Eventmap.SelectedRank][this.Id].Last();
var normalBossHp = EventBossHpDictionary[this.Eventmap.SelectedRank][this.Id].First();
if (this.Current <= lastBossHp) return 1; //最後の1回
return (int)Math.Ceiling((double)(this.Current - lastBossHp) / normalBossHp) + 1; //イベント海域
}
Expand All @@ -72,71 +71,48 @@ public int RemainingCount
}
}

public static readonly IReadOnlyDictionary<int, IReadOnlyDictionary<int, int[]>> EventBossDictionary
public static readonly IReadOnlyDictionary<int, IReadOnlyDictionary<int, int[]>> EventBossHpDictionary
= new Dictionary<int, IReadOnlyDictionary<int, int[]>>
{
{ //難易度未選択
0, new Dictionary<int, int[]>
{
{ 271, new[] { 566 } },
{ 272, new[] { 581, 582 } },
{ 273, new[] { 585 } },
{ 274, new[] { 583, 584 } },
{ 275, new[] { 586 } },
{ 276, new[] { 557 } },

{ 281, new[] { 595 } },
{ 282, new[] { 597, 598 } },
{ 283, new[] { 557 } },
{ 284, new[] { 599, 600 } },
}
},
{ //丙
1, new Dictionary<int, int[]>
{
{ 291, new[] { 570, 571 } },
{ 292, new[] { 528, 565 } },
{ 293, new[] { 601 } },
{ 294, new[] { 586 } },
{ 295, new[] { 603 } },
{ 301, new[] { 566 } },
{ 302, new[] { 545 } },
{ 303, new[] { 558 } },
{ 304, new[] { 605, 607 } },
{ 305, new[] { 609, 611 } },
{ 306, new[] { 603 } },
{ 311, new[] { 150 } },
{ 312, new[] { 210 } },
{ 313, new[] { 350 } },
{ 314, new[] { 500 } },
{ 315, new[] { 400 } },
{ 316, new[] { 350 } },
{ 317, new[] { 255 } },
}
},
{ //乙
2, new Dictionary<int, int[]>
{
{ 291, new[] { 571 } },
{ 292, new[] { 528, 565 } },
{ 293, new[] { 601, 602 } },
{ 294, new[] { 586 } },
{ 295, new[] { 604 } },
{ 301, new[] { 566 } },
{ 302, new[] { 545 } },
{ 303, new[] { 558 } },
{ 304, new[] { 606, 608 } },
{ 305, new[] { 609, 611 } },
{ 306, new[] { 603 } },
{ 311, new[] { 150, 190 } },
{ 312, new[] { 210 } },
{ 313, new[] { 350 } },
{ 314, new[] { 500 } },
{ 315, new[] { 400 } },
{ 316, new[] { 350 } },
{ 317, new[] { 255 } },
}
},
{ //甲
3, new Dictionary<int, int[]>
{
{ 291, new[] { 571, 572 } },
{ 292, new[] { 579, 565 } },
{ 293, new[] { 602 } },
{ 294, new[] { 586 } },
{ 295, new[] { 604 } },
{ 301, new[] { 566 } },
{ 302, new[] { 545 } },
{ 303, new[] { 558 } },
{ 304, new[] { 606, 608 } },
{ 305, new[] { 610, 612 } },
{ 306, new[] { 604 } },
{ 311, new[] { 150, 190 } },
{ 312, new[] { 270 } },
{ 313, new[] { 350 } },
{ 314, new[] { 500 } },
{ 315, new[] { 400 } },
{ 316, new[] { 350 } },
{ 317, new[] { 255 } },
}
},
};
Expand All @@ -148,5 +124,23 @@ public class Eventmap
public int MaxMapHp { get; set; }
public int State { get; set; }
public int SelectedRank { get; set; }

public string SelectedRankText
{
get
{
switch (this.SelectedRank)
{
case 1:
return "丙";
case 2:
return "乙";
case 3:
return "甲";
default:
return "";
}
}
}
}
}
2 changes: 1 addition & 1 deletion EventMapHpViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.0.0")]
[assembly: AssemblyVersion("2.4.0.0")]
21 changes: 19 additions & 2 deletions EventMapHpViewer/SampleData/ToolViewModelSampleData.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<viewModels:ToolViewModel.Maps>
<viewModels:MapViewModel Current="1000"
Max="9999"
RemainingCount="10"
RemainingCount="9"
MapNumber="30-5"
AreaName="イベント海域"
Name="サーモン海域北方"
Expand Down Expand Up @@ -44,7 +44,24 @@
</viewModels:MapViewModel>
<viewModels:MapViewModel Current="333"
Max="444"
RemainingCount="10"
SelectedRank="甲"
SelectedRankVisibility="Visible"
RemainingCount="7"
MapNumber="30-5"
AreaName="イベント海域"
Name="未対応海域"
IsCleared="False"
IsRankSelected="True"
IsSupported="True">
<viewModels:MapViewModel.GaugeColor>
<SolidColorBrush Color="#40C820"/>
</viewModels:MapViewModel.GaugeColor>
</viewModels:MapViewModel>
<viewModels:MapViewModel Current="333"
Max="444"
SelectedRank="乙"
SelectedRankVisibility="Visible"
RemainingCount="7"
MapNumber="30-5"
AreaName="イベント海域"
Name="未対応海域"
Expand Down
29 changes: 20 additions & 9 deletions EventMapHpViewer/ToolView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<Grid Margin="0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="MapNumber"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Rank"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="MapName"/>
<ColumnDefinition/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Count"/>
Expand All @@ -119,18 +120,28 @@
</TextBlock>

<TextBlock Grid.Column="1"
Grid.Row="0"
Grid.RowSpan="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="3,0,5,0"
Visibility="{Binding SelectedRankVisibility}"
Text="{Binding SelectedRank}"
Style="{DynamicResource EmphaticTextStyleKey}"/>

<TextBlock Grid.Column="2"
Grid.Row="0"
Text="{Binding AreaName}"
Style="{DynamicResource DefaultTextStyleKey}"
Margin="3,0,5,0"/>

<TextBlock Grid.Column="1"
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="{Binding Name}"
Style="{DynamicResource DefaultTextStyleKey}"
Margin="3,0,5,0"/>

<TextBlock Grid.Column="2"
<TextBlock Grid.Column="3"
Grid.Row="0"
HorizontalAlignment="Center"
VerticalAlignment="Bottom">
Expand All @@ -140,7 +151,7 @@
<Run Text="{Binding Max}"/>
</TextBlock>

<ProgressBar Grid.Column="2"
<ProgressBar Grid.Column="3"
Grid.Row="1"
Height="10"
VerticalAlignment="Top"
Expand All @@ -162,20 +173,22 @@
</ProgressBar.Template>
</ProgressBar>

<TextBlock Grid.Column="3"
<TextBlock Grid.Column="4"
Grid.Row="0"
Grid.RowSpan="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="3,0,7,0"
Visibility="{Binding IsSupported, Converter={StaticResource TrueToVisibleConverter}}">
<Run Text="後"/>
<Run Text="後"
Style="{DynamicResource DefaultTextElementStyleKey}"/>
<Run Text="{Binding RemainingCount}"
Style="{DynamicResource EmphaticTextElementStyleKey}"/>
<Run Text="回"/>
<Run Text="回"
Style="{DynamicResource DefaultTextElementStyleKey}"/>
</TextBlock>

<TextBlock Grid.Column="3"
<TextBlock Grid.Column="4"
Grid.Row="0"
Grid.RowSpan="2"
HorizontalAlignment="Right"
Expand Down Expand Up @@ -209,8 +222,6 @@
Margin="5,15">
※出撃(海域選択)画面を開いた際に更新されます。<LineBreak/>
※イベントマップのHPは、ボス旗艦のHPを削ると連動して減少します。<LineBreak/>
<LineBreak/>
■対応イベント: 2014夏~2015春
</TextBlock>
</Grid>

Expand Down
24 changes: 23 additions & 1 deletion EventMapHpViewer/ViewModels/MapViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows.Media;
using System.Windows;
using System.Windows.Media;
using EventMapHpViewer.Models;
using Livet;

Expand Down Expand Up @@ -97,6 +98,26 @@ public int Max
#endregion


#region SelectedRank変更通知プロパティ
private string _SelectedRank;

public string SelectedRank
{
get
{ return this._SelectedRank; }
set
{
if (this._SelectedRank == value)
return;
this._SelectedRank = value;
this.RaisePropertyChanged();
}
}
#endregion

public Visibility SelectedRankVisibility
=> string.IsNullOrEmpty(this.SelectedRank) ? Visibility.Collapsed : Visibility.Visible;

#region RemainingCount変更通知プロパティ
private string _RemainingCount;

Expand Down Expand Up @@ -194,6 +215,7 @@ public MapViewModel(MapData info)
this.AreaName = info.AreaName;
this.Current = info.Current;
this.Max = info.Max;
this.SelectedRank = info.Eventmap?.SelectedRankText ?? "";
this.RemainingCount = info.RemainingCount.ToString();
this.IsCleared = info.IsCleared == 1;
var color = info.RemainingCount < 2
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ KanColleViewer で、攻略中マップのHPと最低必要撃破回数を一覧
* 通常海域では、必要なボス撃破回数と現時点での残り撃破回数を表示します


### 対応イベント

* 2015春
* 2015冬
* 2014秋
* 2014夏


### インストール

* `EventMapHpViewer.dll` を KanColleViewer の `Plugins` ディレクトリに放り込んで下さい。
Expand Down

0 comments on commit 4ecf259

Please sign in to comment.