diff --git a/HeavenlyWind.Base/ProductInfo.cs b/HeavenlyWind.Base/ProductInfo.cs index 3967a39f..4cdf2c5b 100644 --- a/HeavenlyWind.Base/ProductInfo.cs +++ b/HeavenlyWind.Base/ProductInfo.cs @@ -7,11 +7,11 @@ public static class ProductInfo public const string AppName = "いんてりじぇんと連装砲くん"; public const string ProductName = "Intelligent Naval Gun"; - public const string AssemblyVersionString = "0.1.15.2"; + public const string AssemblyVersionString = "0.1.15.3"; public static string Version => AssemblyVersionString; public static string ReleaseCodeName => "Braindrive"; - public static string ReleaseDate => "2017.02.12"; + public static string ReleaseDate => "2017.02.18"; public const string UserAgent = "ING/" + AssemblyVersionString; diff --git a/HeavenlyWind.Game/Models/Battle/Phases/ShellingPhase.cs b/HeavenlyWind.Game/Models/Battle/Phases/ShellingPhase.cs index 81a93560..0605442e 100644 --- a/HeavenlyWind.Game/Models/Battle/Phases/ShellingPhase.cs +++ b/HeavenlyWind.Game/Models/Battle/Phases/ShellingPhase.cs @@ -61,16 +61,38 @@ internal protected override void Process() var rDamage = rDamages[j]; + var rDefenderIndex = rDefenders[j] - 1; + var rAttackerIndex = rAttackers[i] - 1; + + BattleParticipantSnapshot rDefender, rAttacker; + if (!rIsEnemy) { - Stage.Enemy[rDefenders[j] - 1].Current -= rDamage; - Stage.Friend[rAttackers[i] - 1].DamageGivenToOpponent += rDamage; + if (rDefenderIndex < 6) + rDefender = Stage.EnemyMain[rDefenderIndex]; + else + rDefender = Stage.EnemyEscort[rDefenderIndex - 6]; + + if (rAttackerIndex < 6) + rAttacker = Stage.FriendMain[rAttackerIndex]; + else + rAttacker = Stage.FriendEscort[rAttackerIndex - 6]; } else { - Stage.Friend[rDefenders[j] - 1].Current -= rDamage; - Stage.Enemy[rAttackers[i] - 1].DamageGivenToOpponent += rDamage; + if (rDefenderIndex < 6) + rDefender = Stage.FriendMain[rDefenderIndex]; + else + rDefender = Stage.FriendEscort[rDefenderIndex - 6]; + + if (rAttackerIndex < 6) + rAttacker = Stage.EnemyMain[rAttackerIndex]; + else + rAttacker = Stage.EnemyEscort[rAttackerIndex - 6]; } + + rDefender.Current -= rDamage; + rAttacker.DamageGivenToOpponent += rDamage; } } } diff --git a/HeavenlyWind/Controls/EquipmentIcon.cs b/HeavenlyWind/Controls/EquipmentIcon.cs index a09c1439..d59d1759 100644 --- a/HeavenlyWind/Controls/EquipmentIcon.cs +++ b/HeavenlyWind/Controls/EquipmentIcon.cs @@ -39,7 +39,7 @@ static EquipmentIcon() DataStore.Updated += rpName => { if (rpName == "equipment_icon") - LoadTemplates(); + DispatcherUtil.UIDispatcher.InvokeAsync(LoadTemplates); }; } static void CreateDefaultTemplate() @@ -59,28 +59,31 @@ static void LoadTemplates() { byte[] rContent; if (!DataStore.TryGet("equipment_icon", out rContent)) - r_Templates = new Dictionary(); - else { - var rReader = new JsonTextReader(new StreamReader(new MemoryStream(rContent))); - var rData = JObject.Load(rReader); + if (r_Templates == null) + r_Templates = new Dictionary(); - var rSharedResources = new ResourceDictionary(); + return; + } - foreach (var rResource in ((JObject)rData["shared"]).Properties()) - rSharedResources.Add(rResource.Name, XamlReader.Parse((string)rResource.Value)); + var rReader = new JsonTextReader(new StreamReader(new MemoryStream(rContent))); + var rData = JObject.Load(rReader); - r_Templates = ((JObject)rData["type"]).Properties().ToDictionary( - r => int.Parse(r.Name), - r => - { - var rXaml = "" + (string)r.Value + ""; - var rResult = (ControlTemplate)XamlReader.Parse(rXaml); - rResult.Resources = rSharedResources; + var rSharedResources = new ResourceDictionary(); - return rResult; - }); - } + foreach (var rResource in ((JObject)rData["shared"]).Properties()) + rSharedResources.Add(rResource.Name, XamlReader.Parse((string)rResource.Value)); + + r_Templates = ((JObject)rData["type"]).Properties().ToDictionary( + r => int.Parse(r.Name), + r => + { + var rXaml = "" + (string)r.Value + ""; + var rResult = (ControlTemplate)XamlReader.Parse(rXaml); + rResult.Resources = rSharedResources; + + return rResult; + }); } public override void OnApplyTemplate() diff --git a/HeavenlyWind/Services/UpdateService.cs b/HeavenlyWind/Services/UpdateService.cs index 3daeef34..e38c5b2e 100644 --- a/HeavenlyWind/Services/UpdateService.cs +++ b/HeavenlyWind/Services/UpdateService.cs @@ -177,6 +177,9 @@ IEnumerable GetOfficialDataStoreItem() if (DataStore.TryGet("anti_air_cut_in", DataStoreRetrieveOption.ExcludeContent, out rItem)) yield return rItem; + + if (DataStore.TryGet("equipment_icon", DataStoreRetrieveOption.ExcludeContent, out rItem)) + yield return rItem; } void ProcessFiles(CheckForUpdateResult rpResult) { diff --git a/HeavenlyWind/Views/Preferences/VersionInfo.xaml b/HeavenlyWind/Views/Preferences/VersionInfo.xaml index f8892b73..cf05241d 100644 --- a/HeavenlyWind/Views/Preferences/VersionInfo.xaml +++ b/HeavenlyWind/Views/Preferences/VersionInfo.xaml @@ -37,7 +37,7 @@ - Traditional Chinese localization (~ 0.1.14): + Traditional Chinese localization: Vik1n9