Adding vibe mana curve

This commit is contained in:
2026-06-25 10:05:49 -04:00
parent 68872f0dac
commit 00e7184b3b
3 changed files with 88 additions and 8 deletions
+7 -7
View File
@@ -154,7 +154,7 @@ public static class DocDatabase
{
Title = "Lifeblood",
Category = "Faction",
Content = "Concepts:\n- Wide Boards\n- Overpower",
Content = "Concepts:\r\n- Wide Boards\r\n- Overpower",
Frontmatter = new()
{
{ "category", "Faction" },
@@ -164,7 +164,7 @@ public static class DocDatabase
{
Title = "Phasetide",
Category = "Faction",
Content = "Concepts:\n- Healing\n-",
Content = "Concepts:\r\n- Healing\r\n-",
Frontmatter = new()
{
{ "category", "Faction" },
@@ -174,7 +174,7 @@ public static class DocDatabase
{
Title = "Silence",
Category = "Faction",
Content = "Concepts:\n- Activatable Agents\n-",
Content = "Concepts:\r\n- Activatable Agents\r\n-",
Frontmatter = new()
{
{ "category", "Faction" },
@@ -184,7 +184,7 @@ public static class DocDatabase
{
Title = "Singularity",
Category = "Faction",
Content = "Concepts:\n- Discard",
Content = "Concepts:\r\n- Discard",
Frontmatter = new()
{
{ "category", "Faction" },
@@ -194,7 +194,7 @@ public static class DocDatabase
{
Title = "Splintergleam",
Category = "Faction",
Content = "# Self Damage\n\nCan hurt it's own units for power. Has [[Bleed]] to make reoccurring damage on units very easy.\n\n# Core Damage \n\nCan hurt both cores easily. Has [[Breakdown]] to take advantage of having an injured core for more damage.",
Content = "# Self Damage\r\n\r\nCan hurt it's own units for power. Has [[Bleed]] to make reoccurring damage on units very easy.\r\n\r\n# Core Damage \r\n\r\nCan hurt both cores easily. Has [[Breakdown]] to take advantage of having an injured core for more damage.",
Frontmatter = new()
{
{ "category", "Faction" },
@@ -204,7 +204,7 @@ public static class DocDatabase
{
Title = "Sungrace",
Category = "Faction",
Content = "# Energy Reserves\n\nCare about always having banked energy. Spells can refund themselves when using [[Energy Reserves]], or get stronger is you [[Overflow]] your energy reserve.\n\nConcepts:\n- Ramp\n- Using and Replenishing Reserved Energy\n-",
Content = "# Energy Reserves\r\n\r\nCare about always having banked energy. Spells can refund themselves when using [[Energy Reserves]], or get stronger is you [[Overflow]] your energy reserve.\r\n\r\nConcepts:\r\n- Ramp\r\n- Using and Replenishing Reserved Energy\r\n-",
Frontmatter = new()
{
{ "category", "Faction" },
@@ -479,7 +479,7 @@ public static class DocDatabase
{
Title = "Onboarding Track",
Category = "Pass",
Content = "| Tier | Reward |\n| ---- | -------------------------------- |\n| 1 | Sprouts Record |\n| 2 | 120 Core Charges |\n| 3 | Burn Precon |\n| 4 | 120 Core Charges, 25 Flux |\n| 5 | Profile Pictures |\n| 6 | Emotes |\n| 7 | 120 Core Charges |\n| 8 | Profile Pictures |\n| 9 | 60 Core Charges, 50 Flux |\n| 10 | 240 Core Charges, 1 Draft Ticket |\n\n| Core Charges | Flux |\n| ------------ | ---- |\n| 660 | 75 |",
Content = "| Tier | Reward |\r\n| ---- | -------------------------------- |\r\n| 1 | Sprouts Record |\r\n| 2 | 120 Core Charges |\r\n| 3 | Burn Precon |\r\n| 4 | 120 Core Charges, 25 Flux |\r\n| 5 | Profile Pictures |\r\n| 6 | Emotes |\r\n| 7 | 120 Core Charges |\r\n| 8 | Profile Pictures |\r\n| 9 | 60 Core Charges, 50 Flux |\r\n| 10 | 240 Core Charges, 1 Draft Ticket |\r\n\r\n| Core Charges | Flux |\r\n| ------------ | ---- |\r\n| 660 | 75 |",
Frontmatter = new()
{
{ "expPer", "30" },
+36
View File
@@ -38,6 +38,22 @@
<small class="text-danger ms-2 d-block d-md-inline">@deck.ValidationMessage</small>
}
</div>
@{
var distribution = GetManaDistribution();
var maxCount = distribution.Max(x => x.Count);
}
<div class="mana-curve">
@foreach (var entry in distribution)
{
var height = maxCount > 0 ? (entry.Count * 100 / maxCount) : 0;
<div class="mana-bar-container">
<div class="mana-bar-label">@entry.Count</div>
<div class="mana-bar" style="height: @($"{Math.Max(height, 5)}%")"></div>
<div class="mana-cost">@(entry.Cost >= 10 ? "10+" : entry.Cost.ToString())</div>
</div>
}
</div>
</header>
@if (deck.Keycards.Count > 0)
@@ -274,6 +290,26 @@
selectedCard = null;
}
private List<(int Cost, int Count)> GetManaDistribution()
{
if (deck == null) return [];
var counts = new Dictionary<int, int>();
for (int i = 0; i <= 10; i++) counts[i] = 0;
foreach (var cardName in deck.Cards)
{
var card = LookupCard(cardName);
if (card?.Cost != null)
{
var cost = card.Cost.Value;
if (cost >= 10) cost = 10;
counts[cost]++;
}
}
return counts.OrderBy(x => x.Key).Select(x => (x.Key, x.Value)).ToList();
}
private RenderFragment RenderDescription(string description)
{
return builder =>
+45 -1
View File
@@ -59,7 +59,51 @@
.deck-card-count {
font-size: 0.85rem;
color: var(--text-muted);
margin: 0;
margin: 0 0 1.5rem;
}
.mana-curve {
display: flex;
align-items: flex-end;
gap: 0.5rem;
height: 80px;
margin-top: 1rem;
padding: 0 0.5rem;
}
.mana-bar-container {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
justify-content: flex-end;
}
.mana-bar-label {
font-size: 0.7rem;
color: var(--text-muted);
margin-bottom: 0.2rem;
}
.mana-bar {
width: 100%;
background: var(--accent);
border-radius: 4px 4px 0 0;
min-height: 4px;
transition: height 0.3s ease;
}
.mana-cost {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-secondary);
margin-top: 0.4rem;
background: var(--bg-elevated);
width: 100%;
text-align: center;
border-radius: 4px;
padding: 0.1rem 0;
}
.deck-section {