Pack logic cleanup
This commit is contained in:
10
SVSim.Database/Models/Config/ChallengeConfig.cs
Normal file
10
SVSim.Database/Models/Config/ChallengeConfig.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models.Config;
|
||||
|
||||
[Owned]
|
||||
public class ChallengeConfig
|
||||
{
|
||||
public bool UseTwoPickPremiumCard { get; set; }
|
||||
public long TwoPickSleeveId { get; set; }
|
||||
}
|
||||
12
SVSim.Database/Models/Config/DefaultGrantsConfig.cs
Normal file
12
SVSim.Database/Models/Config/DefaultGrantsConfig.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models.Config;
|
||||
|
||||
/// <summary>Per-viewer-registration default currency grants.</summary>
|
||||
[Owned]
|
||||
public class DefaultGrantsConfig
|
||||
{
|
||||
public ulong Crystals { get; set; } = 50000;
|
||||
public ulong Rupees { get; set; } = 50000;
|
||||
public ulong Ether { get; set; } = 50000;
|
||||
}
|
||||
17
SVSim.Database/Models/Config/DefaultLoadoutConfig.cs
Normal file
17
SVSim.Database/Models/Config/DefaultLoadoutConfig.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Default cosmetic loadout ids for a newly-registered viewer. These used to be FK columns;
|
||||
/// they're now untyped longs in the jsonb tree. Validation would live in a future config-editing
|
||||
/// UI (see project-wide TODO(config-validation)).
|
||||
/// </summary>
|
||||
[Owned]
|
||||
public class DefaultLoadoutConfig
|
||||
{
|
||||
public int DegreeId { get; set; } = 300003;
|
||||
public int EmblemId { get; set; } = 100000000;
|
||||
public int MyPageBackgroundId { get; set; } = 100000000;
|
||||
public int SleeveId { get; set; } = 3000011;
|
||||
}
|
||||
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 },
|
||||
];
|
||||
}
|
||||
9
SVSim.Database/Models/Config/PlayerConfig.cs
Normal file
9
SVSim.Database/Models/Config/PlayerConfig.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models.Config;
|
||||
|
||||
[Owned]
|
||||
public class PlayerConfig
|
||||
{
|
||||
public int MaxFriends { get; set; } = 20;
|
||||
}
|
||||
15
SVSim.Database/Models/Config/RotationConfig.cs
Normal file
15
SVSim.Database/Models/Config/RotationConfig.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Time-varying season/rotation state, populated by GlobalsImporter from prod captures.
|
||||
/// </summary>
|
||||
[Owned]
|
||||
public class RotationConfig
|
||||
{
|
||||
public string TsRotationId { get; set; } = "";
|
||||
public bool IsBattlePassPeriod { get; set; }
|
||||
public bool IsBeginnerMission { get; set; }
|
||||
public int CardSetIdForResourceDlView { get; set; }
|
||||
}
|
||||
23
SVSim.Database/Models/Config/SlotRarityWeights.cs
Normal file
23
SVSim.Database/Models/Config/SlotRarityWeights.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Per-rarity weights for a single pack slot. Sum should be ≤ 1.0;
|
||||
/// remainder absorbs into Bronze via the PickRarity catch-all band.
|
||||
/// <para>
|
||||
/// <see cref="Slot"/> is the 1-based slot index as a string (e.g. "8") and is used as the
|
||||
/// lookup key in <see cref="PackRateConfig.PerSlot"/>. It is empty/null for the global
|
||||
/// <see cref="PackRateConfig.Default"/> entry, which has no slot affiliation.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[Owned]
|
||||
public class SlotRarityWeights
|
||||
{
|
||||
/// <summary>1-based slot index (as a string) for entries in PerSlot. Null/empty for the Default entry.</summary>
|
||||
public string? Slot { get; set; }
|
||||
public double Bronze { get; set; }
|
||||
public double Silver { get; set; }
|
||||
public double Gold { get; set; }
|
||||
public double Legendary { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user