Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ElectronicObserver.Core/Properties/EventConstants.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,7 @@
<data name="Spring2025" xml:space="preserve">
<value>Spring 25</value>
</data>
<data name="Summer2026" xml:space="preserve">
<value>Summer 26</value>
</data>
</root>
3 changes: 3 additions & 0 deletions ElectronicObserver.Core/Properties/EventConstants.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,7 @@
<data name="Spring2025" xml:space="preserve">
<value>25春</value>
</data>
<data name="Summer2026" xml:space="preserve">
<value>26夏</value>
</data>
</root>
5 changes: 4 additions & 1 deletion ElectronicObserver.Core/Properties/EventConstants.zh-TW.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -126,4 +126,7 @@
<data name="Spring2025" xml:space="preserve">
<value>25春</value>
</data>
<data name="Summer2026" xml:space="preserve">
<value>26夏</value>
</data>
</root>
14 changes: 14 additions & 0 deletions ElectronicObserver.Core/Types/EquipmentId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,4 +575,18 @@ public enum EquipmentId
MainGunSmall_12_7cmTwinHighangleGunMountKaiSan = 572,
RadarSmall_PrototypeType23RadarKaiSan = 573,
RadarSmall_SCRadarKai_CalibratedLateModel = 574,
AAGun_25mmTwinAutocannon_SkilledGunnerSquad = 575,
LandingCraft_DaihatsuLandingCraft_R35_FrenchTroops = 576,
Torpedo_61cmQuadruple_OxygenTorpedoMountModel5KaiSan = 577,
CarrierBasedBomber_SB2U2 = 578,
MainGunSmall_13_8cmSingleGunMountModèle1927 = 579,
Torpedo_55cmTripleTorpedoMountModèle1924 = 580,
Torpedo_55cmFivetubesCompositeArrangementTorpedoMountsModèle1932 = 581,
MainGunMedium_20_3cm50TwinGunMountModèle1931 = 582,
MainGunMedium_20_3cm50TwinGunMountKai_SHSImprovedShells = 583,
MainGunSmall_Bofors12cmSinglebarrelDualpurposeGun = 584,
CarrierBasedRecon_PL101_Reconnaissance = 585,
CarrierBasedBomber_PL101_Bomber = 586,
CarrierBasedBomber_V156F_SB2UExportModel = 587,
CarrierBasedFighter_G36A_F4FExportModel = 588
}
81 changes: 58 additions & 23 deletions ElectronicObserver.Core/Types/Extensions/TpGaugeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ public static class TpGaugeExtensions
{
TpGauge.Spring25E2P1 or TpGauge.Spring25E5P1 => 60,
TpGauge.Fall25E2P2 => 61,
TpGauge.Summer26E5P2 => 62,
_ => 0,
};

public static int GetGaugeMapId(this TpGauge gauge) => gauge switch
{
TpGauge.Spring25E2P1 or TpGauge.Fall25E2P2 => 2,
TpGauge.Spring25E5P1 => 5,
TpGauge.Summer26E5P2 => 5,
_ => 0,
};

public static int GetGaugeIndex(this TpGauge gauge) => gauge switch
{
TpGauge.Spring25E2P1 or TpGauge.Spring25E5P1 => 1,
TpGauge.Fall25E2P2 => 2,
TpGauge.Summer26E5P2 => 2,
_ => 0,
};

Expand All @@ -40,6 +43,7 @@ public static class TpGaugeExtensions
{
60 => Properties.EventConstants.Spring2025,
61 => Properties.EventConstants.Fall2025,
62 => Properties.EventConstants.Summer2026,
_ => "",
};

Expand All @@ -53,6 +57,7 @@ public static class TpGaugeExtensions
TpGauge.Spring25E2P1 => GetSpring25E2TankGaugeDamage(fleets) + GetKinuBonus(fleets),
TpGauge.Spring25E5P1 => GetSpring25E5TankGaugeDamage(fleets) + GetKinuBonus(fleets),
TpGauge.Fall25E2P2 => GetFall25E2TankGaugeDamage(fleets) + GetKinuBonus(fleets),
TpGauge.Summer26E5P2 => GetSummer26E5TankGaugeDamage(fleets) + GetKinuBonus(fleets),
_ => 0,
};

Expand Down Expand Up @@ -229,38 +234,40 @@ private static double GetSpring25E5LandingEquipmentTpDamage(IShipData ship)
private static double GetFall25E2LandingEquipmentTpDamage(IShipData ship)
=> ship.AllSlotInstanceMaster
.OfType<IEquipmentDataMaster>()
.Sum(eq => eq.EquipmentId switch
{
EquipmentId.LandingCraft_TokuDaihatsuLandingCraft_Type1GunTank => 21,
EquipmentId.LandingCraft_TokuDaihatsuLandingCraft_PanzerIIITypeJ => 23,
EquipmentId.LandingCraft_M4A1DD => 20,
.Sum(GetFall25E2LandingEquipmentTpDamage);

EquipmentId.SpecialAmphibiousTank_SpecialType2AmphibiousTank => 12.5,
EquipmentId.SpecialAmphibiousTank_SpecialType4AmphibiousTankKai => 13.5,
private static double GetFall25E2LandingEquipmentTpDamage(IEquipmentDataMaster eq) => eq.EquipmentId switch
{
EquipmentId.LandingCraft_TokuDaihatsuLandingCraft_Type1GunTank => 21,
EquipmentId.LandingCraft_TokuDaihatsuLandingCraft_PanzerIIITypeJ => 23,
EquipmentId.LandingCraft_M4A1DD => 20,

EquipmentId.LandingCraft_TokuDaihatsu_ChiHaKai => 19,
EquipmentId.LandingCraft_TokuDaihatsuLC_11thTankRegiment => 19,
EquipmentId.LandingCraft_TokuDaihatsu_ChiHa => 17,
EquipmentId.SpecialAmphibiousTank_SpecialType2AmphibiousTank => 12.5,
EquipmentId.SpecialAmphibiousTank_SpecialType4AmphibiousTankKai => 13.5,

EquipmentId.SpecialAmphibiousTank_SpecialType4AmphibiousTank => 11.5,
EquipmentId.LandingCraft_TokuDaihatsu_ChiHaKai => 19,
EquipmentId.LandingCraft_TokuDaihatsuLC_11thTankRegiment => 19,
EquipmentId.LandingCraft_TokuDaihatsu_ChiHa => 17,

EquipmentId.LandingCraft_TokuDaihatsuLandingCraft_PanzerIII_NorthAfricanCorps => 19,
EquipmentId.LandingCraft_DaihatsuLandingCraft_PanzerIINorthAfricanSpecification => 16,
EquipmentId.SpecialAmphibiousTank_SpecialType4AmphibiousTank => 11.5,

EquipmentId.LandingCraft_DaihatsuLC_Type89Tank_LandingForce => 14,
EquipmentId.LandingCraft_TokuDaihatsuLandingCraft_PanzerIII_NorthAfricanCorps => 19,
EquipmentId.LandingCraft_DaihatsuLandingCraft_PanzerIINorthAfricanSpecification => 16,

EquipmentId.ArmyInfantry_ArmyInfantryCorps_ChiHaKai => 14,
EquipmentId.LandingCraft_DaihatsuLC_Type89Tank_LandingForce => 14,

EquipmentId.ArmyInfantry_Type97MediumTankNewTurret_ChiHaKai => 9,
EquipmentId.ArmyInfantry_Type97MediumTank_ChiHa => 7,
EquipmentId.ArmyInfantry_ArmyInfantryCorps_ChiHaKai => 14,

EquipmentId.ArmyInfantry_ArmyInfantryUnit => 5,
EquipmentId.ArmyInfantry_Type97MediumTankNewTurret_ChiHaKai => 9,
EquipmentId.ArmyInfantry_Type97MediumTank_ChiHa => 7,

_ when eq.CategoryType is EquipmentTypes.LandingCraft => 6,
_ when eq.CategoryType is EquipmentTypes.Ration => 0.75,
_ when eq.CategoryType is EquipmentTypes.TransportContainer => 3.75,
_ => 0,
});
EquipmentId.ArmyInfantry_ArmyInfantryUnit => 5,

_ when eq.CategoryType is EquipmentTypes.LandingCraft => 6,
_ when eq.CategoryType is EquipmentTypes.Ration => 0.75,
_ when eq.CategoryType is EquipmentTypes.TransportContainer => 3.75,
_ => 0,
};

private static int GetFall25E2TankGaugeDamage(List<IFleetData> fleets)
=> fleets.Sum(GetFall25E2TankGaugeDamage);
Expand All @@ -274,6 +281,34 @@ private static int GetFall25E2TankGaugeDamage(IFleetData fleet)
.Where(s => s.HPRate > 0.25)
.Sum(ship => GetFall25E2LandingEquipmentTpDamage(ship) + GetShipTpDamage(ship) * 0.75);
}

/// <summary>
/// Summer 2026 E5 reuses values from last event E2
/// </summary>
/// <param name="ship"></param>
/// <returns></returns>
private static double GetSummer26E5LandingEquipmentTpDamage(IShipData ship)
=> ship.AllSlotInstanceMaster
.OfType<IEquipmentDataMaster>()
.Sum(eq => eq.EquipmentId switch
{
EquipmentId.LandingCraft_DaihatsuLandingCraft_R35_FrenchTroops => 24,
_ => GetFall25E2LandingEquipmentTpDamage(eq),
});

private static int GetSummer26E5TankGaugeDamage(List<IFleetData> fleets)
=> fleets.Sum(GetSummer26E5TankGaugeDamage);

private static int GetSummer26E5TankGaugeDamage(IFleetData fleet)
{
if (fleet.MembersWithoutEscaped is null) return 0;

return (int)fleet.MembersWithoutEscaped
.OfType<IShipData>()
.Where(s => s.HPRate > 0.25)
.Sum(ship => GetSummer26E5LandingEquipmentTpDamage(ship) + GetShipTpDamage(ship) * 0.75);
}

private static string GetMapName(IKCDatabase db, int areaId, int mapId)
{
if (db.MapInfo[areaId * 10 + mapId] is not { } mapData) return $"{areaId}-{mapId}";
Expand Down
1 change: 1 addition & 0 deletions ElectronicObserver.Core/Types/TpGauge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ public enum TpGauge
Spring25E2P1 = 2,
Spring25E5P1 = 3,
Fall25E2P2 = 4,
Summer26E5P2 = 5,
}
Loading