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
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public override bool CanTrigger()
if (flagship is null) return false;

if (!IsKongouClassThirdRemodel(flagship.MasterShip.ShipId)) return false;
if (flagship.HPRate <= 0.5) return false;
if (flagship.HPRate <= 0.25) return false;

IShipData? helper = ships[1];
if (helper is null) return false;
if (helper.HPRate <= 0.5) return false;
if (helper.HPRate <= 0.25) return false;

return IsValidPair(flagship.MasterShip.ShipId, helper.MasterShip.ShipId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public override double GetTriggerRate()
IShipData? helper = ships[1];
if (helper is null) return 0;

double rate = Math.Sqrt(flagship.Level) + Math.Sqrt(helper.Level) + 1.2 * (Math.Sqrt(flagship.LuckTotal) + Math.Sqrt(helper.Level));
double rate = Math.Sqrt(flagship.Level) + Math.Sqrt(helper.Level) + 1.2 * (Math.Sqrt(flagship.LuckTotal) + Math.Sqrt(helper.LuckTotal));

return (rate + 30) / 100;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,9 @@ public override double GetTriggerRate()
IShipData? helper = ships[1];
if (helper is null) return 0;

double rate = Math.Sqrt(flagship.Level) + Math.Sqrt(helper.Level) + 1.2 * (Math.Sqrt(flagship.LuckTotal) + Math.Sqrt(helper.Level));
double rate = Math.Sqrt(flagship.Level) + Math.Sqrt(helper.Level) + 1.2 * (Math.Sqrt(flagship.LuckTotal) + Math.Sqrt(helper.LuckTotal));

int deuxGunBonus = 0;

if (flagship.HasDeuxGun())
{
deuxGunBonus += 5;
}

if (helper.HasDeuxGun())
{
deuxGunBonus += 5;
}

return (rate + 30 + deuxGunBonus) / 100;
return (rate + 30) / 100;
}

public override List<SpecialAttackHit> GetAttacks()
Expand Down
42 changes: 30 additions & 12 deletions ElectronicObserver/Utility/Data/FleetSpecialAttacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,36 @@ public static class FleetSpecialAttacks
{
public static List<SpecialAttack> GetSpecialAttacks(this IFleetData fleet)
{
List<SpecialAttack> attacks =
[
new NelsonSpecialAttack(fleet),
new NagatoSpecialAttack(fleet),
new ColoradoSpecialAttack(fleet),
new Yamato123SpecialAttack(fleet),
new Yamato12SpecialAttack(fleet),
new KongouSpecialAttack(fleet),
new SubmarineSpecialAttack(fleet),
new RichelieuSpecialAttack(fleet),
new QueenElizabethSpecialAttack(fleet),
];
List<SpecialAttack> attacks;

if (fleet.FleetType is FleetType.Single || fleet.FleetID == 1)
{
attacks = [
new NelsonSpecialAttack(fleet),
new NagatoSpecialAttack(fleet),
new ColoradoSpecialAttack(fleet),
new Yamato123SpecialAttack(fleet),
new Yamato12SpecialAttack(fleet),
new RichelieuSpecialAttack(fleet),
new QueenElizabethSpecialAttack(fleet),
];

if (fleet.FleetType is FleetType.Single)
{
attacks.Add(new KongouSpecialAttack(fleet));
}
}
else
{
attacks = [
new KongouSpecialAttack(fleet),
];
}

if (fleet.FleetType is FleetType.Single)
{
attacks.Add(new SubmarineSpecialAttack(fleet));
}

return attacks
.Where(attack => attack.CanTrigger())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public void KongouSpecialAttackTest1()
new ShipDataMock(Db.MasterShips[ShipId.HieiKaiNiC]),
});

Assert.Empty(fleet.GetSpecialAttacks());
Assert.False(specialAttack.CanTrigger());
Assert.True(specialAttack.CanTrigger());
}

[Fact(DisplayName = "Can trigger - Flagship shouha")]
Expand Down Expand Up @@ -77,8 +76,7 @@ public void KongouSpecialAttackTest6()
},
});

Assert.Empty(fleet.GetSpecialAttacks());
Assert.False(specialAttack.CanTrigger());
Assert.True(specialAttack.CanTrigger());
}

[Fact(DisplayName = "Can trigger - Helper shouha")]
Expand Down
Loading