Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andanteyk committed Mar 14, 2018
2 parents 1b38247 + 7905f08 commit e329979
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 17 deletions.
7 changes: 7 additions & 0 deletions ElectronicObserver/Data/AdmiralData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ public int AdmiralID
/// </summary>
public int PracticeLose => (int)RawData.api_pt_lose;

/// <summary>
/// 甲種勲章保有数
/// </summary>
public int Medals
{
get { return (int)RawData.api_medals; }
}


/// <summary>
Expand Down
6 changes: 4 additions & 2 deletions ElectronicObserver/Data/Battle/BattleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,12 @@ private void BattleFinished()
{
var initialHPs = BattleDay.Initial.FriendInitialHPs.TakeWhile(hp => hp >= 0);
var damage = initialHPs.Zip(BattleDay.ResultHPs.Take(initialHPs.Count()), (initial, result) => initial - result).Sum();
var airraid = ((BattleBaseAirRaid)BattleDay).BaseAirRaid;

Utility.Logger.Add(2,
string.Format("{0}-{1}-{2} で基地に空襲を受けました。( 被ダメージ合計: {3}, {4} )",
Compass.MapAreaID, Compass.MapInfoID, Compass.Destination, damage, Constants.GetAirRaidDamage(Compass.AirRaidDamageKind)));
string.Format("{0}-{1}-{2} で基地に空襲を受けました。( {3}, 被ダメージ合計: {4}, {5} )",
Compass.MapAreaID, Compass.MapInfoID, Compass.Destination,
Constants.GetAirSuperiority(airraid.IsAvailable ? airraid.AirSuperiority : -1), damage, Constants.GetAirRaidDamage(Compass.AirRaidDamageKind)));
}
else
{
Expand Down
11 changes: 8 additions & 3 deletions ElectronicObserver/Data/Battle/Detail/BattleDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,14 @@ public override string ToString()

StringBuilder builder = new StringBuilder();

// 航空戦・支援攻撃時 AttackerIndex = BattleIndex.Invalid 、それで AttackerIndex.Side = BattleSides.FriendMain になる
// DefenderIndex.Side で判断すれば航空戦も正確に識別できるが表示が変になるので、最終的には AttackerIndex.Side で判断した
builder.AppendFormat(AttackerIndex.IsFriend ? "{0} → {1}\r\n" : "{1} ← {0}\r\n", GetAttackerName(), GetDefenderName());

if (Battle.IsPractice)
builder.AppendFormat("{0}{1} → {2}{3}",
Attacker == null ? "" : AttackerIndex.IsFriend ? "自軍 " : "敵軍 ", GetAttackerName(),
DefenderIndex.IsFriend ? "自軍 " : "敵軍 ", GetDefenderName()
).AppendLine();
else
builder.AppendFormat("{0} → {1}", GetAttackerName(), GetDefenderName()).AppendLine();


if (AttackType >= 0)
Expand Down
14 changes: 7 additions & 7 deletions ElectronicObserver/Data/Battle/Phase/PhaseNightInitial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ public ShipData FlareFriendInstance
if (index < 0)
return null;

if (ActiveFriendFleet == 1)
return FriendFleet.MembersInstance[index];
else
if (IsFriendEscort)
return FriendFleet.MembersInstance[index - 6];
else
return FriendFleet.MembersInstance[index];

}
}
Expand All @@ -136,10 +136,10 @@ public ShipDataMaster FlareEnemyInstance
if (index < 0)
return null;

if (EnemyFleetID == 1)
return EnemyMembersInstance[index];
else
if (IsEnemyEscort)
return EnemyMembersInstance[index - 6];
else
return EnemyMembersInstance[index];
}
}

Expand All @@ -152,7 +152,7 @@ public int SearchlightIndexFriend
get
{
var ships = FriendFleet.MembersWithoutEscaped;
var hps = IsEscort ? Battle.Initial.FriendInitialHPsEscort : Battle.Initial.FriendInitialHPs;
var hps = IsFriendEscort ? Battle.Initial.FriendInitialHPsEscort : Battle.Initial.FriendInitialHPs;
int index = -1;

for (int i = 0; i < ships.Count; i++)
Expand Down
6 changes: 3 additions & 3 deletions ElectronicObserver/Utility/SoftwareInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ public static class SoftwareInformation
/// <summary>
/// バージョン(日本語, ソフトウェア名を含みます)
/// </summary>
public static string VersionJapanese => SoftwareNameJapanese + "三一型甲";
public static string VersionJapanese => SoftwareNameJapanese + "三一型改";


/// <summary>
/// バージョン(英語)
/// </summary>
public static string VersionEnglish => "3.1.0.1";
public static string VersionEnglish => "3.1.1";



/// <summary>
/// 更新日時
/// </summary>
public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2018/02/26 20:00:00");
public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2018/03/14 08:00:00");



Expand Down
22 changes: 22 additions & 0 deletions ElectronicObserver/Window/FormHeadquarters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,28 @@ void Updated(string apiname, dynamic data)
//Admiral
FlowPanelAdmiral.SuspendLayout();
AdmiralName.Text = string.Format("{0} {1}", db.Admiral.AdmiralName, Constants.GetAdmiralRank(db.Admiral.Rank));
{
StringBuilder tooltip = new StringBuilder();

var sortieCount = db.Admiral.SortieWin + db.Admiral.SortieLose;
tooltip.AppendFormat("出撃回数: {0} / 出撃勝利: {1} ({2:p2}) / 出撃敗北: {3}\r\n",
sortieCount, db.Admiral.SortieWin, db.Admiral.SortieWin / Math.Max(sortieCount, 1.0), db.Admiral.SortieLose);

tooltip.AppendFormat("出撃あたりの平均獲得Exp: {0:n2} / 勝利時 {1:n2}\r\n",
db.Admiral.Exp / Math.Max(sortieCount, 1.0),
db.Admiral.Exp / Math.Max(db.Admiral.SortieWin, 1.0));

tooltip.AppendFormat("遠征回数: {0} / 遠征成功: {1} ({2:p2}) / 遠征失敗: {3}\r\n",
db.Admiral.MissionCount, db.Admiral.MissionSuccess, db.Admiral.MissionSuccess / Math.Max(db.Admiral.MissionCount, 1.0), db.Admiral.MissionCount - db.Admiral.MissionSuccess);

var practiceCount = db.Admiral.PracticeWin + db.Admiral.PracticeLose;
tooltip.AppendFormat("演習回数: {0} / 演習勝利: {1} ({2:p2}) / 演習敗北: {3}\r\n",
practiceCount, db.Admiral.PracticeWin, db.Admiral.PracticeWin / Math.Max(practiceCount, 1.0), db.Admiral.PracticeLose);

tooltip.AppendFormat("甲種勲章保有数: {0}\r\n", db.Admiral.Medals);

ToolTipInfo.SetToolTip(AdmiralName, tooltip.ToString());
}
AdmiralComment.Text = db.Admiral.Comment;
FlowPanelAdmiral.ResumeLayout();

Expand Down
8 changes: 7 additions & 1 deletion ElectronicObserver/Window/FormInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,15 @@ void Updated(string apiname, dynamic data)
{
var str = CheckGimmickUpdated(data);
if (!string.IsNullOrWhiteSpace(str))
{
TextInformation.Text = str;

if (data.api_destruction_battle())
{
str = CheckGimmickUpdated(data.api_destruction_battle);
if (!string.IsNullOrWhiteSpace(str))
TextInformation.Text = str;
}

}
break;

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

*このリンクの更新は遅れる可能性があります。最新版は[こちら](http://electronicobserver.blog.fc2.com/)で確認してください。*

[ver. 3.1.0.1 (2018/02/26)](http://bit.ly/2EVj4gg)
[ver. 3.1.1 (2018/03/14)](http://bit.ly/2HzhD43)

[更新内容・履歴はこちらで確認できます。](https://github.com/andanteyk/ElectronicObserver/wiki/ChangeLog)

Expand Down

0 comments on commit e329979

Please sign in to comment.