Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andanteyk committed Jun 5, 2021
2 parents ee5ef28 + 081ff1f commit 107916e
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 19 deletions.
34 changes: 23 additions & 11 deletions ElectronicObserver/Data/ShipData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@ private int CalculateAntiSubmarinePower(int engagementForm = 1)

int depthChargeCount = 0;
int depthChargeProjectorCount = 0;
int otherDepthChargeCount = 0;
int sonarCount = 0; // ソナーと大型ソナーの合算
int largeSonarCount = 0;

Expand All @@ -1146,27 +1147,33 @@ private int CalculateAntiSubmarinePower(int engagementForm = 1)
sonarCount++;
break;
case EquipmentTypes.DepthCharge:
if (slot.IsDepthCharge)
depthChargeCount++;
else if (slot.IsDepthChargeProjector)
depthChargeProjectorCount++;
break;
if (slot.IsDepthCharge)
depthChargeCount++;
else if (slot.IsDepthChargeProjector)
depthChargeProjectorCount++;
else
otherDepthChargeCount++;
break;
case EquipmentTypes.SonarLarge:
largeSonarCount++;
sonarCount++;
break;
}
}

double projector_sonar = depthChargeProjectorCount > 0 && sonarCount > 0 ? 1.15 : 1;
double charge_projector = depthChargeCount > 0 && depthChargeProjectorCount > 0 ? 1.1 : 1;
double charge_sonar = (!(projector_sonar > 1 && charge_projector > 1 && largeSonarCount > 0) && depthChargeCount > 0 && sonarCount > 0) ? 0.15 : 0;
double synergy = 1.0;
if (sonarCount > 0 && depthChargeProjectorCount > 0 && depthChargeCount > 0)
synergy = 1.4375;
else if (sonarCount > 0 && (depthChargeCount + depthChargeProjectorCount + otherDepthChargeCount) > 0)
synergy = 1.15;
else if (depthChargeProjectorCount > 0 && depthChargeCount > 0)
synergy = 1.1;

basepower *= projector_sonar * (charge_projector + charge_sonar);
basepower *= synergy;


//キャップ
basepower = Math.Floor(CapDamage(basepower, 170));
//キャップ
basepower = Math.Floor(CapDamage(basepower, 170));

return (int)(basepower * GetAmmoDamageRate());
}
Expand Down Expand Up @@ -1365,6 +1372,10 @@ public bool CanAttackSubmarine
case ShipTypes.AmphibiousAssaultShip:
return AllSlotInstanceMaster.Any(eq => eq != null && eq.IsAntiSubmarineAircraft);

case ShipTypes.AircraftCarrier:
return ShipID == 646 && // 加賀改二護
AllSlotInstanceMaster.Any(eq => eq != null && eq.IsAntiSubmarineAircraft);

default:
return false;
}
Expand Down Expand Up @@ -1406,6 +1417,7 @@ public bool CanOpeningASW
case 529: // 大鷹改二
case 381: // 神鷹改
case 536: // 神鷹改二
case 646: // 加賀改二護
return true;

case 554: // 日向改二
Expand Down
31 changes: 30 additions & 1 deletion ElectronicObserver/Resource/Record/RecordBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ElectronicObserver.Resource.Record
{
Expand Down Expand Up @@ -47,12 +48,40 @@ public virtual bool Load(string path)

ClearRecord();

bool ignoreError = false;

string line;
sr.ReadLine(); //ヘッダを読み飛ばす

while ((line = sr.ReadLine()) != null)
{
LoadLine(line);
try
{
LoadLine(line);

}
catch (Exception ex)
{
if (ignoreError)
continue;

Utility.ErrorReporter.SendErrorReport(ex, $"レコード {Path.GetFileName(path)} の破損を検出しました。");

switch (MessageBox.Show($"レコード {Path.GetFileName(path)} で破損データを検出しました。\r\n\r\n[中止]: 読み込みを中止します。\r\n[再試行]: 読み込みを続行します。(再び破損がみられた場合は再確認します)\r\n[無視]: 読み込みを続行します。(再確認しません。重くなる場合があります)",
"レコード破損検出", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1))
{
case DialogResult.Abort:
throw;

case DialogResult.Retry:
// do nothing
break;

case DialogResult.Ignore:
ignoreError = true;
break;
}
}
}

}
Expand Down
4 changes: 4 additions & 0 deletions ElectronicObserver/Utility/Data/Calculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,10 @@ public static int GetTPDamage(FleetData fleet)
case ShipTypes.FleetOiler:
tp += 15;
break;

case ShipTypes.SubmarineAircraftCarrier:
tp += 1;
break;
}
}

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 => "4.6.7";
public static string VersionEnglish => "4.6.8";



/// <summary>
/// 更新日時
/// </summary>
public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2021/05/04 22:30:00");
public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2021/06/05 19:30:00");



Expand Down
8 changes: 7 additions & 1 deletion ElectronicObserver/Window/FormInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,20 @@ private void CheckExpedition(int missionID, int fleetID)
{
var fleet = KCDatabase.Instance.Fleet[fleetID];
var result = MissionClearCondition.Check(missionID, fleet);
var mission = KCDatabase.Instance.Mission[missionID];

if (!result.IsSuceeded)
{
var mission = KCDatabase.Instance.Mission[missionID];
MessageBox.Show(
$"#{fleet.FleetID} {fleet.Name} の遠征 {mission.DisplayID}:{mission.Name} は、失敗する可能性があります。\r\n\r\n{string.Join("\r\n", result.FailureReason)}\r\n\r\n(この警告は 設定→動作 から無効化できます。)",
"遠征失敗警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
if (fleet.MembersInstance.Any(s => s?.FuelRate < 1 || s?.AmmoRate < 1))
{
MessageBox.Show(
$"#{fleet.FleetID} {fleet.Name} の遠征 {mission.DisplayID}:{mission.Name} は、失敗する可能性があります。\r\n\r\n未補給\r\n\r\n(この警告は 設定→動作 から無効化できます。)",
"遠征失敗警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}


Expand Down
8 changes: 5 additions & 3 deletions ElectronicObserver/Window/FormShipGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,9 +1404,9 @@ private void MenuMember_Exclude_Click(object sender, EventArgs e)



private static readonly string ShipCSVHeaderUser = "固有ID,艦種,艦名,Lv,Exp,next,改装まで,耐久現在,耐久最大,Cond,燃料,弾薬,装備1,装備2,装備3,装備4,装備5,補強装備,入渠,火力,火力改修,火力合計,雷装,雷装改修,雷装合計,対空,対空改修,対空合計,装甲,装甲改修,装甲合計,対潜,対潜合計,回避,回避合計,索敵,索敵合計,運,運改修,運合計,射程,速力,ロック,出撃先,航空威力,砲撃威力,空撃威力,対潜威力,雷撃威力,夜戦威力";
private static readonly string ShipCSVHeaderUser = "固有ID,艦種,艦名,Lv,Exp,next,改装まで,耐久現在,耐久最大,Cond,燃料,弾薬,装備1,装備2,装備3,装備4,装備5,補強装備,入渠,火力,火力改修,火力合計,雷装,雷装改修,雷装合計,対空,対空改修,対空合計,装甲,装甲改修,装甲合計,対潜,対潜合計,回避,回避合計,索敵,索敵合計,運,運改修,運合計,射程,速力,ロック,出撃先,母港ソートID,航空威力,砲撃威力,空撃威力,対潜威力,雷撃威力,夜戦威力";

private static readonly string ShipCSVHeaderData = "固有ID,艦種,艦名,艦船ID,Lv,Exp,next,改装まで,耐久現在,耐久最大,Cond,燃料,弾薬,装備1,装備2,装備3,装備4,装備5,補強装備,装備ID1,装備ID2,装備ID3,装備ID4,装備ID5,補強装備ID,艦載機1,艦載機2,艦載機3,艦載機4,艦載機5,入渠,入渠燃料,入渠鋼材,火力,火力改修,火力合計,雷装,雷装改修,雷装合計,対空,対空改修,対空合計,装甲,装甲改修,装甲合計,対潜,対潜合計,回避,回避合計,索敵,索敵合計,運,運改修,運合計,射程,速力,ロック,出撃先,航空威力,砲撃威力,空撃威力,対潜威力,雷撃威力,夜戦威力";
private static readonly string ShipCSVHeaderData = "固有ID,艦種,艦名,艦船ID,Lv,Exp,next,改装まで,耐久現在,耐久最大,Cond,燃料,弾薬,装備1,装備2,装備3,装備4,装備5,補強装備,装備ID1,装備ID2,装備ID3,装備ID4,装備ID5,補強装備ID,艦載機1,艦載機2,艦載機3,艦載機4,艦載機5,入渠,入渠燃料,入渠鋼材,火力,火力改修,火力合計,雷装,雷装改修,雷装合計,対空,対空改修,対空合計,装甲,装甲改修,装甲合計,対潜,対潜合計,回避,回避合計,索敵,索敵合計,運,運改修,運合計,射程,速力,ロック,出撃先,母港ソートID,航空威力,砲撃威力,空撃威力,対潜威力,雷撃威力,夜戦威力";


private void MenuMember_CSVOutput_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -1499,6 +1499,7 @@ private void MenuMember_CSVOutput_Click(object sender, EventArgs e)
Constants.GetSpeed(ship.Speed),
ship.IsLocked ? "●" : ship.IsLockedByEquipment ? "■" : "-",
ship.SallyArea,
ship.MasterShip.SortID,
ship.AirBattlePower,
ship.ShellingPower,
ship.AircraftPower,
Expand Down Expand Up @@ -1570,7 +1571,8 @@ private void MenuMember_CSVOutput_Click(object sender, EventArgs e)
ship.Speed,
ship.IsLocked ? 1 : ship.IsLockedByEquipment ? 2 : 0,
ship.SallyArea,
ship.AirBattlePower,
ship.MasterShip.SortID,
ship.AirBattlePower,
ship.ShellingPower,
ship.AircraftPower,
ship.AntiSubmarinePower,
Expand Down

0 comments on commit 107916e

Please sign in to comment.