forked from silfumus/ElectronicObserver
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add great success to expedition check
- Loading branch information
1 parent
be8e1dd
commit 5d8a609
Showing
4 changed files
with
102 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
ElectronicObserver.Avalonia/ExpeditionCalculator/Extensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace ElectronicObserver.Avalonia.ExpeditionCalculator; | ||
|
||
public static class Extensions | ||
{ | ||
public static double GreatSuccessRate(this FleetInfoViewModel fleetInfo, Expedition model) => model.GreatSuccessType switch | ||
{ | ||
GreatSuccessType.Regular => RegularGreatSuccessRate(fleetInfo), | ||
GreatSuccessType.Drum => DrumGreatSuccessRate(model, fleetInfo), | ||
GreatSuccessType.Level => LevelGreatSuccessRate(fleetInfo), | ||
|
||
_ => 0, | ||
}; | ||
|
||
private static double RegularGreatSuccessRate(FleetInfoViewModel fleetInfo) => fleetInfo.AllSparkled switch | ||
{ | ||
false => 0, | ||
_ => fleetInfo.SparkleCount * 0.15 + 0.21 | ||
}; | ||
|
||
private static double DrumGreatSuccessRate(Expedition model, FleetInfoViewModel fleetInfo) | ||
=> fleetInfo.SparkleCount * 0.15 + DrumBonus(model, fleetInfo); | ||
|
||
private static double DrumBonus(Expedition model, FleetInfoViewModel fleetInfo) | ||
=> (model.Id, fleetInfo.DrumCount) switch | ||
{ | ||
(21, >= 4) => 0.41, | ||
(24, >= 2) => 0.41, | ||
(37, >= 5) => 0.41, | ||
(38, >= 10) => 0.41, | ||
(40, >= 4) => 0.41, | ||
(44, >= 8) => 0.41, | ||
(142, >= 6) => 0.41, | ||
|
||
_ => 0.06, | ||
}; | ||
|
||
private static double LevelGreatSuccessRate(FleetInfoViewModel fleetInfo) | ||
=> fleetInfo.SparkleCount * 0.15 + 0.16 | ||
+ Math.Sqrt(fleetInfo.FlagshipLevel) / 100 | ||
+ fleetInfo.FlagshipLevel / 1000.0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters