Pack logic cleanup
This commit is contained in:
47
SVSim.Database/Models/Config/PackRateConfig.cs
Normal file
47
SVSim.Database/Models/Config/PackRateConfig.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Tunables for pack-opening RNG. Defaults reproduce the original Shadowverse Classic rates
|
||||
/// exactly so the cutover from hardcoded magic numbers is zero-behavior-change.
|
||||
/// </summary>
|
||||
[Owned]
|
||||
public class PackRateConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Per-card-slot probability of upgrading any drawn card to its foil/animated twin.
|
||||
/// Applied AFTER rarity selection — independent of rarity, slot position, and pack category.
|
||||
/// Default 0.08 (8%). Cards without a foil twin in master data keep the non-foil silently.
|
||||
/// </summary>
|
||||
public double AnimatedRate { get; set; } = 0.08;
|
||||
|
||||
/// <summary>
|
||||
/// Global default rarity weights, used for any slot that has no entry in
|
||||
/// <see cref="PerSlot"/>. Defaults match SV Classic main-slot. Weights sum to 0.9994;
|
||||
/// the 0.06% slack absorbs into Bronze via the PickRarity catch-all band.
|
||||
/// </summary>
|
||||
public SlotRarityWeights Default { get; set; } = new()
|
||||
{
|
||||
Bronze = 0.6744, Silver = 0.25, Gold = 0.06, Legendary = 0.015,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Per-slot overrides (1-based slot index) applied to all packs. A missing slot falls back
|
||||
/// to <see cref="Default"/>. Each entry is a FULL OVERRIDE, not a delta — if you change
|
||||
/// <see cref="Default"/>, existing PerSlot entries do NOT auto-recompute. The slot-8 default
|
||||
/// expresses the SV Classic "Silver-or-better guarantee" as data (Bronze=0) instead of a
|
||||
/// separate code path.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Per-slot overrides keyed by 1-based slot index (stored as a list for EF Core 8 json
|
||||
/// compatibility — Dictionary<string,T> of complex owned types is not supported).
|
||||
/// Look up by <see cref="SlotRarityWeights.Slot"/>. A missing slot falls back to
|
||||
/// <see cref="Default"/>. Slot-8 entry expresses the SV Classic "Silver-or-better
|
||||
/// guarantee" as data (Bronze=0).
|
||||
/// </summary>
|
||||
public List<SlotRarityWeights> PerSlot { get; set; } =
|
||||
[
|
||||
new() { Slot = "8", Bronze = 0, Silver = 0.7692, Gold = 0.1846, Legendary = 0.0462 },
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user