Compare commits
11 Commits
simulation
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d6eabf4990 | |||
| beed3cfded | |||
| 7757ff9895 | |||
| 2d2d6d2250 | |||
| ab65724a96 | |||
| 7713f3b7ec | |||
| b0fdabbe67 | |||
| b6d03afe56 | |||
| 6609d911fc | |||
| e147856b57 | |||
| 1388182ebe |
@@ -28,11 +28,6 @@
|
|||||||
<span class="bi bi-tools-nav-menu" aria-hidden="true"></span> Gear
|
<span class="bi bi-tools-nav-menu" aria-hidden="true"></span> Gear
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-item px-3">
|
|
||||||
<NavLink class="nav-link" href="simulation">
|
|
||||||
<span class="bi bi-graph-up-nav-menu" aria-hidden="true"></span> Simulation
|
|
||||||
</NavLink>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (groupedNotes == null)
|
@if (groupedNotes == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
@page "/gear"
|
|
||||||
@inject DocsService DocsService
|
|
||||||
|
|
||||||
<PageTitle>Gear & Equipment</PageTitle>
|
|
||||||
|
|
||||||
<div class="section-header d-flex align-items-center mb-4">
|
|
||||||
<h1 class="mb-0">Gear & Equipment</h1>
|
|
||||||
<div class="ms-3 flex-grow-1 border-bottom opacity-25"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (gearNotes == null)
|
|
||||||
{
|
|
||||||
<div class="d-flex justify-content-center py-5">
|
|
||||||
<div class="spinner-border text-success" role="status">
|
|
||||||
<span class="visually-hidden">Loading...</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<div class="grid-container">
|
|
||||||
<TelerikGrid Data="@gearNotes" Pageable="true" PageSize="50" Sortable="true" FilterMode="@GridFilterMode.FilterRow"
|
|
||||||
Height="calc(100vh - 250px)">
|
|
||||||
<GridColumns>
|
|
||||||
<GridColumn Field="@(nameof(NoteInfo.Title))" Title="Item Name" Width="200px">
|
|
||||||
<Template>
|
|
||||||
<NavLink href="@($"docs/{(context as NoteInfo)!.Slug}")" class="fw-bold">@((context as NoteInfo)!.Title)</NavLink>
|
|
||||||
</Template>
|
|
||||||
</GridColumn>
|
|
||||||
<GridColumn Field="@(nameof(NoteInfo.Cost))" Title="Cost" Width="90px" />
|
|
||||||
<GridColumn Field="@(nameof(NoteInfo.GearCategory))" Title="Category" Width="140px"/>
|
|
||||||
<GridColumn Field="@(nameof(NoteInfo.Effect))" Title="Effect"/>
|
|
||||||
<GridColumn Field="@(nameof(NoteInfo.Location))" Title="Acquisition" Width="150px"/>
|
|
||||||
</GridColumns>
|
|
||||||
</TelerikGrid>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<NoteInfo>? gearNotes;
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
var index = await DocsService.GetIndexAsync();
|
|
||||||
gearNotes = index.Notes
|
|
||||||
.Where(n => string.Equals(n.Category, "Gear", StringComparison.OrdinalIgnoreCase))
|
|
||||||
.OrderBy(n => n.Title)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,299 +0,0 @@
|
|||||||
@page "/simulation"
|
|
||||||
@inject GameSimulationService SimService
|
|
||||||
|
|
||||||
<PageTitle>Ecology Simulation</PageTitle>
|
|
||||||
|
|
||||||
<div class="section-header d-flex align-items-center mb-4">
|
|
||||||
<h1 class="mb-0">Ecology Simulation</h1>
|
|
||||||
<div class="ms-3 flex-grow-1 border-bottom opacity-25"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (!SimService.Data.IsInitialized)
|
|
||||||
{
|
|
||||||
<div class="text-center py-5">
|
|
||||||
<p class="lead mb-4">Simulate 20 turns of predator, prey, and flora ecology across the valley.</p>
|
|
||||||
<button class="btn btn-primary btn-lg" @onclick="StartSimulation">Run Simulation</button>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<div class="simulation-layout">
|
|
||||||
<div class="sim-controls d-flex align-items-center justify-content-between mb-3 flex-wrap gap-2">
|
|
||||||
<div class="d-flex align-items-center gap-2">
|
|
||||||
<button class="btn btn-outline-light btn-sm" @onclick="PrevTurn" disabled="@(SimService.Data.CurrentTurn <= 0)">
|
|
||||||
◀ Prev
|
|
||||||
</button>
|
|
||||||
<span class="turn-label">
|
|
||||||
@if (SimService.Data.CurrentTurn == 0)
|
|
||||||
{
|
|
||||||
<span>Initial Setup</span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<span>After Turn <strong>@SimService.Data.CurrentTurn</strong> / 20</span>
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
<button class="btn btn-outline-light btn-sm" @onclick="NextTurn" disabled="@(SimService.Data.CurrentTurn >= 20)">
|
|
||||||
Next ▶
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="d-flex align-items-center gap-2 flex-wrap">
|
|
||||||
@if (CurrentEvent != null)
|
|
||||||
{
|
|
||||||
@foreach (var act in CurrentEvent.Activations)
|
|
||||||
{
|
|
||||||
<span class="event-badge badge bg-@BadgeClass(act.MeepleType)">
|
|
||||||
@act.MeepleType in @act.RegionType
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<button class="btn btn-secondary btn-sm" @onclick="RandomizeEvents">↻ Randomize Events</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="sim-map-container">
|
|
||||||
<svg viewBox="0 0 700 461" class="sim-svg">
|
|
||||||
<defs>
|
|
||||||
<radialGradient id="sg-Grass" cx="50%" cy="50%" r="50%">
|
|
||||||
<stop offset="0%" stop-color="#4caf50" stop-opacity="0.3"/>
|
|
||||||
<stop offset="100%" stop-color="#4caf50" stop-opacity="0"/>
|
|
||||||
</radialGradient>
|
|
||||||
<radialGradient id="sg-Forest" cx="50%" cy="50%" r="50%">
|
|
||||||
<stop offset="0%" stop-color="#2e7d32" stop-opacity="0.3"/>
|
|
||||||
<stop offset="100%" stop-color="#2e7d32" stop-opacity="0"/>
|
|
||||||
</radialGradient>
|
|
||||||
<radialGradient id="sg-Mountain" cx="50%" cy="50%" r="50%">
|
|
||||||
<stop offset="0%" stop-color="#78909c" stop-opacity="0.3"/>
|
|
||||||
<stop offset="100%" stop-color="#78909c" stop-opacity="0"/>
|
|
||||||
</radialGradient>
|
|
||||||
<radialGradient id="sg-Water" cx="50%" cy="50%" r="50%">
|
|
||||||
<stop offset="0%" stop-color="#42a5f5" stop-opacity="0.3"/>
|
|
||||||
<stop offset="100%" stop-color="#42a5f5" stop-opacity="0"/>
|
|
||||||
</radialGradient>
|
|
||||||
<radialGradient id="sg-Wasteland" cx="50%" cy="50%" r="50%">
|
|
||||||
<stop offset="0%" stop-color="#8d6e63" stop-opacity="0.3"/>
|
|
||||||
<stop offset="100%" stop-color="#8d6e63" stop-opacity="0"/>
|
|
||||||
</radialGradient>
|
|
||||||
</defs>
|
|
||||||
|
|
||||||
<image href="docs/Map.png" width="700" height="461" preserveAspectRatio="xMidYMid meet"/>
|
|
||||||
|
|
||||||
@{
|
|
||||||
var currentRegions = SimService.GetCurrentState();
|
|
||||||
var prevRegions = SimService.GetPreviousState();
|
|
||||||
var prevLookup = prevRegions.ToDictionary(r => r.Name);
|
|
||||||
var activatedRegionNames = new HashSet<string>();
|
|
||||||
if (CurrentEvent != null)
|
|
||||||
{
|
|
||||||
var activatedTerrain = CurrentEvent.Activations.Select(a => a.RegionType).ToHashSet();
|
|
||||||
activatedRegionNames = currentRegions
|
|
||||||
.Where(r => activatedTerrain.Contains(r.Terrain))
|
|
||||||
.Select(r => r.Name)
|
|
||||||
.ToHashSet();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@foreach (var line in GetConnectionLines(currentRegions))
|
|
||||||
{
|
|
||||||
<line x1="@line.X1" y1="@line.Y1" x2="@line.X2" y2="@line.Y2"
|
|
||||||
stroke="rgba(255,255,255,0.12)" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
}
|
|
||||||
|
|
||||||
@foreach (var region in currentRegions)
|
|
||||||
{
|
|
||||||
var isActivated = activatedRegionNames.Contains(region.Name);
|
|
||||||
var terrainColor = GetTerrainColor(region.Terrain);
|
|
||||||
var labelX = region.X + 24;
|
|
||||||
var prev = prevLookup.GetValueOrDefault(region.Name);
|
|
||||||
var dp = prev != null ? region.PredatorMeeples - prev.PredatorMeeples : 0;
|
|
||||||
var dr = prev != null ? region.PreyMeeples - prev.PreyMeeples : 0;
|
|
||||||
var df = prev != null ? region.FloraMeeples - prev.FloraMeeples : 0;
|
|
||||||
var hasDelta = dp != 0 || dr != 0 || df != 0;
|
|
||||||
<g class="sim-region @(isActivated ? "sim-active" : "")">
|
|
||||||
<circle cx="@region.X" cy="@region.Y" r="34" fill="url(#sg-@region.Terrain)"/>
|
|
||||||
<circle cx="@region.X" cy="@region.Y" r="18"
|
|
||||||
fill="@(terrainColor)cc"
|
|
||||||
stroke="@(isActivated ? "#ffd700" : "rgba(255,255,255,0.5)")"
|
|
||||||
stroke-width="@(isActivated ? 3 : 2)"/>
|
|
||||||
<text x="@labelX" y="@(region.Y + 4)" fill="rgba(255,255,255,0.9)"
|
|
||||||
font-family="system-ui,sans-serif" font-size="11" font-weight="600">
|
|
||||||
@region.Name
|
|
||||||
</text>
|
|
||||||
<text x="@labelX" y="@(region.Y + 20)" fill="rgba(255,255,255,0.7)"
|
|
||||||
font-family="system-ui,sans-serif" font-size="10">
|
|
||||||
P:@region.PredatorMeeples R:@region.PreyMeeples F:@region.FloraMeeples
|
|
||||||
</text>
|
|
||||||
@if (hasDelta && SimService.Data.CurrentTurn > 0)
|
|
||||||
{
|
|
||||||
var dy = region.Y + 34;
|
|
||||||
var parts = new List<string>();
|
|
||||||
if (dp != 0) parts.Add($"<tspan fill=\"{(dp > 0 ? "#4caf50" : "#e76f51")}\">{(dp > 0 ? "+" : "")}{dp}P</tspan>");
|
|
||||||
if (dr != 0) parts.Add($"<tspan fill=\"{(dr > 0 ? "#4caf50" : "#e76f51")}\">{(dr > 0 ? "+" : "")}{dr}R</tspan>");
|
|
||||||
if (df != 0) parts.Add($"<tspan fill=\"{(df > 0 ? "#4caf50" : "#e76f51")}\">{(df > 0 ? "+" : "")}{df}F</tspan>");
|
|
||||||
var deltaHtml = $"<text x=\"{labelX}\" y=\"{dy}\" font-family=\"system-ui,sans-serif\" font-size=\"9\">{string.Join(" ", parts)}</text>";
|
|
||||||
@((MarkupString)deltaHtml)
|
|
||||||
}
|
|
||||||
</g>
|
|
||||||
}
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (CurrentEvent != null && CurrentEvent.Details.Count > 0)
|
|
||||||
{
|
|
||||||
<div class="sim-details mt-3">
|
|
||||||
<h5 class="text-muted mb-2">Turn @CurrentEvent.TurnNumber Details</h5>
|
|
||||||
<div class="sim-details-scroll">
|
|
||||||
@foreach (var detail in CurrentEvent.Details)
|
|
||||||
{
|
|
||||||
<div class="sim-detail-item">@detail</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div class="sim-totals mt-3 d-flex gap-4 justify-content-center">
|
|
||||||
@{
|
|
||||||
var totals = SimService.GetCurrentState();
|
|
||||||
}
|
|
||||||
<div class="total-pred"><span class="total-dot" style="background:#e76f51"></span> Predators: @totals.Sum(r => r.PredatorMeeples)</div>
|
|
||||||
<div class="total-prey"><span class="total-dot" style="background:#e9c46a"></span> Prey: @totals.Sum(r => r.PreyMeeples)</div>
|
|
||||||
<div class="total-flora"><span class="total-dot" style="background:#4caf50"></span> Flora: @totals.Sum(r => r.FloraMeeples)</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="sim-chart mt-3">
|
|
||||||
<h5 class="text-muted mb-2">Population Trend</h5>
|
|
||||||
<svg viewBox="0 0 720 160" class="sim-chart-svg">
|
|
||||||
@{
|
|
||||||
var history = SimService.GetPopulationHistory();
|
|
||||||
var maxPop = Math.Max(history.Max(h => h.predators + h.prey + h.flora), 10);
|
|
||||||
var chartW = 700d;
|
|
||||||
var chartH = 120d;
|
|
||||||
var chartY = 20d;
|
|
||||||
var stepX = history.Length > 1 ? chartW / (history.Length - 1) : chartW;
|
|
||||||
|
|
||||||
string MakePath(Func<int, int> getVal, string color)
|
|
||||||
{
|
|
||||||
var pts = history.Select((h, i) =>
|
|
||||||
{
|
|
||||||
var x = i * stepX;
|
|
||||||
var y = chartY + chartH - (getVal(i) / (double)maxPop) * chartH;
|
|
||||||
return $"{x:F1},{y:F1}";
|
|
||||||
});
|
|
||||||
var d = "M" + string.Join(" L", pts);
|
|
||||||
return $"<path d=\"{d}\" fill=\"none\" stroke=\"{color}\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Y axis labels
|
|
||||||
@((MarkupString)$"<text x=\"0\" y=\"{chartY + 10}\" fill=\"rgba(255,255,255,0.3)\" font-size=\"9\">{maxPop}</text>")
|
|
||||||
@((MarkupString)$"<text x=\"0\" y=\"{chartY + chartH}\" fill=\"rgba(255,255,255,0.3)\" font-size=\"9\">0</text>")
|
|
||||||
|
|
||||||
// Grid lines
|
|
||||||
<line x1="0" y1="@(chartY + chartH)" x2="@chartW" y2="@(chartY + chartH)" stroke="rgba(255,255,255,0.06)" stroke-width="1"/>
|
|
||||||
<line x1="0" y1="@chartY" x2="@chartW" y2="@chartY" stroke="rgba(255,255,255,0.06)" stroke-width="1"/>
|
|
||||||
|
|
||||||
// Current turn marker
|
|
||||||
var markerX = SimService.Data.CurrentTurn * stepX;
|
|
||||||
<line x1="@markerX" y1="@chartY" x2="@markerX" y2="@(chartY + chartH)" stroke="rgba(255,255,255,0.25)" stroke-width="1" stroke-dasharray="3,3"/>
|
|
||||||
|
|
||||||
@((MarkupString)MakePath(i => history[i].predators, "#e76f51"))
|
|
||||||
@((MarkupString)MakePath(i => history[i].prey, "#e9c46a"))
|
|
||||||
@((MarkupString)MakePath(i => history[i].flora, "#4caf50"))
|
|
||||||
|
|
||||||
// Turn markers on x-axis
|
|
||||||
@for (int i = 0; i < history.Length; i += 5)
|
|
||||||
{
|
|
||||||
var x = i * stepX;
|
|
||||||
@((MarkupString)$"<text x=\"{x}\" y=\"{chartY + chartH + 14}\" fill=\"rgba(255,255,255,0.25)\" font-size=\"8\" text-anchor=\"middle\">{i}</text>")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</svg>
|
|
||||||
<div class="sim-chart-legend d-flex gap-3 justify-content-center mt-1">
|
|
||||||
<span class="small"><span class="total-dot" style="background:#e76f51"></span> Predators</span>
|
|
||||||
<span class="small"><span class="total-dot" style="background:#e9c46a"></span> Prey</span>
|
|
||||||
<span class="small"><span class="total-dot" style="background:#4caf50"></span> Flora</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private TurnEvent? CurrentEvent => SimService.Data.CurrentTurn > 0 && SimService.Data.CurrentTurn <= SimService.Data.Events.Count
|
|
||||||
? SimService.Data.Events[SimService.Data.CurrentTurn - 1]
|
|
||||||
: null;
|
|
||||||
|
|
||||||
private static string BadgeClass(string meepleType) => meepleType switch
|
|
||||||
{
|
|
||||||
"Predator" => "danger",
|
|
||||||
"Prey" => "warning",
|
|
||||||
"Flora" => "success",
|
|
||||||
_ => "secondary"
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
|
||||||
SimService.RunSimulation();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartSimulation()
|
|
||||||
{
|
|
||||||
SimService.RunSimulation();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PrevTurn()
|
|
||||||
{
|
|
||||||
if (SimService.Data.CurrentTurn > 0)
|
|
||||||
SimService.Data.CurrentTurn--;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NextTurn()
|
|
||||||
{
|
|
||||||
if (SimService.Data.CurrentTurn < 20)
|
|
||||||
SimService.Data.CurrentTurn++;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RandomizeEvents()
|
|
||||||
{
|
|
||||||
SimService.RandomizeEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetTerrainColor(string terrain)
|
|
||||||
{
|
|
||||||
return terrain switch
|
|
||||||
{
|
|
||||||
"Grass" => "#4caf50",
|
|
||||||
"Forest" => "#2e7d32",
|
|
||||||
"Mountain" => "#78909c",
|
|
||||||
"Water" => "#42a5f5",
|
|
||||||
"Wasteland" => "#8d6e63",
|
|
||||||
_ => "#888"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private record ConnectionLine(int X1, int Y1, int X2, int Y2);
|
|
||||||
|
|
||||||
private List<ConnectionLine> GetConnectionLines(List<RegionState> regions)
|
|
||||||
{
|
|
||||||
var lookup = regions.ToDictionary(r => r.Name);
|
|
||||||
var lines = new List<ConnectionLine>();
|
|
||||||
var drawn = new HashSet<string>();
|
|
||||||
|
|
||||||
foreach (var region in regions)
|
|
||||||
{
|
|
||||||
foreach (var conn in region.Connections)
|
|
||||||
{
|
|
||||||
var key = string.Compare(region.Name, conn, StringComparison.OrdinalIgnoreCase) < 0
|
|
||||||
? $"{region.Name}|{conn}"
|
|
||||||
: $"{conn}|{region.Name}";
|
|
||||||
|
|
||||||
if (!drawn.Add(key)) continue;
|
|
||||||
if (!lookup.TryGetValue(conn, out var target)) continue;
|
|
||||||
|
|
||||||
lines.Add(new ConnectionLine(region.X, region.Y, target.X, target.Y));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return lines;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+1
-2
@@ -9,8 +9,7 @@ builder.RootComponents.Add<HeadOutlet>("head::after");
|
|||||||
|
|
||||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||||
builder.Services.AddScoped<DocsService>();
|
builder.Services.AddScoped<DocsService>();
|
||||||
builder.Services.AddSingleton<GameSimulationService>();
|
|
||||||
|
|
||||||
builder.Services.AddTelerikBlazor();
|
//builder.Services.AddTelerikBlazor();
|
||||||
|
|
||||||
await builder.Build().RunAsync();
|
await builder.Build().RunAsync();
|
||||||
@@ -1,355 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Web.Services;
|
|
||||||
|
|
||||||
public class RegionState
|
|
||||||
{
|
|
||||||
public string Name { get; set; } = "";
|
|
||||||
public string Slug { get; set; } = "";
|
|
||||||
public string Terrain { get; set; } = "";
|
|
||||||
public int X { get; set; }
|
|
||||||
public int Y { get; set; }
|
|
||||||
public List<string> Connections { get; set; } = new();
|
|
||||||
public int PredatorMeeples { get; set; }
|
|
||||||
public int PreyMeeples { get; set; }
|
|
||||||
public int FloraMeeples { get; set; }
|
|
||||||
|
|
||||||
public RegionState Clone()
|
|
||||||
{
|
|
||||||
return new RegionState
|
|
||||||
{
|
|
||||||
Name = Name,
|
|
||||||
Slug = Slug,
|
|
||||||
Terrain = Terrain,
|
|
||||||
X = X,
|
|
||||||
Y = Y,
|
|
||||||
Connections = new List<string>(Connections),
|
|
||||||
PredatorMeeples = PredatorMeeples,
|
|
||||||
PreyMeeples = PreyMeeples,
|
|
||||||
FloraMeeples = FloraMeeples
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TerrainActivation
|
|
||||||
{
|
|
||||||
public string MeepleType { get; set; } = "";
|
|
||||||
public string RegionType { get; set; } = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TurnEvent
|
|
||||||
{
|
|
||||||
public int TurnNumber { get; set; }
|
|
||||||
public List<TerrainActivation> Activations { get; set; } = new();
|
|
||||||
public List<string> Details { get; set; } = new();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SimulationData
|
|
||||||
{
|
|
||||||
public List<RegionState> Regions { get; set; } = new();
|
|
||||||
public List<RegionState> InitialRegions { get; set; } = new();
|
|
||||||
public List<TurnEvent> Events { get; set; } = new();
|
|
||||||
public List<List<RegionState>> Timeline { get; set; } = new();
|
|
||||||
public int CurrentTurn { get; set; }
|
|
||||||
public bool IsInitialized { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class GameSimulationService
|
|
||||||
{
|
|
||||||
private readonly Random _rng = new();
|
|
||||||
|
|
||||||
public SimulationData Data { get; private set; } = new();
|
|
||||||
|
|
||||||
public void RunSimulation()
|
|
||||||
{
|
|
||||||
Data = new SimulationData();
|
|
||||||
var regions = CreateRegions();
|
|
||||||
Data.Regions = regions;
|
|
||||||
AddInitialFlora();
|
|
||||||
AddRandomMeepleCombos();
|
|
||||||
Data.InitialRegions = Data.Regions.Select(r => r.Clone()).ToList();
|
|
||||||
GenerateAndApplyEvents();
|
|
||||||
Data.IsInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RandomizeEvents()
|
|
||||||
{
|
|
||||||
var initialRegions = Data.InitialRegions;
|
|
||||||
Data = new SimulationData();
|
|
||||||
Data.Regions = initialRegions.Select(r => r.Clone()).ToList();
|
|
||||||
Data.InitialRegions = initialRegions;
|
|
||||||
GenerateAndApplyEvents();
|
|
||||||
Data.IsInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<RegionState> GetCurrentState()
|
|
||||||
{
|
|
||||||
return Data.Timeline[Data.CurrentTurn].Select(r => r.Clone()).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TurnEvent? GetCurrentEvent()
|
|
||||||
{
|
|
||||||
return Data.CurrentTurn > 0
|
|
||||||
? Data.Events.ElementAtOrDefault(Data.CurrentTurn - 1)
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<RegionState> GetPreviousState()
|
|
||||||
{
|
|
||||||
var prev = Data.CurrentTurn > 0 ? Data.CurrentTurn - 1 : 0;
|
|
||||||
return Data.Timeline[prev].Select(r => r.Clone()).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public (int predators, int prey, int flora)[] GetPopulationHistory()
|
|
||||||
{
|
|
||||||
return Data.Timeline.Select(t => (
|
|
||||||
t.Sum(r => r.PredatorMeeples),
|
|
||||||
t.Sum(r => r.PreyMeeples),
|
|
||||||
t.Sum(r => r.FloraMeeples)
|
|
||||||
)).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void GenerateAndApplyEvents()
|
|
||||||
{
|
|
||||||
Data.Timeline.Add(Data.Regions.Select(r => r.Clone()).ToList());
|
|
||||||
|
|
||||||
for (int turn = 1; turn <= 20; turn++)
|
|
||||||
{
|
|
||||||
var turnEvent = GenerateTurnEvent(turn);
|
|
||||||
ApplyTurnEvent(turnEvent);
|
|
||||||
Data.Events.Add(turnEvent);
|
|
||||||
Data.Timeline.Add(Data.Regions.Select(r => r.Clone()).ToList());
|
|
||||||
}
|
|
||||||
|
|
||||||
Data.CurrentTurn = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private TurnEvent GenerateTurnEvent(int turnNumber)
|
|
||||||
{
|
|
||||||
string[] meepleTypes = { "Predator", "Prey", "Flora" };
|
|
||||||
string[] regionTypes = { "Grass", "Forest", "Mountain", "Water", "Wasteland" };
|
|
||||||
var numTypes = _rng.Next(1, 4);
|
|
||||||
var selectedTypes = regionTypes.OrderBy(_ => _rng.Next()).Take(numTypes).ToList();
|
|
||||||
|
|
||||||
var activations = selectedTypes.Select(rt => new TerrainActivation
|
|
||||||
{
|
|
||||||
RegionType = rt,
|
|
||||||
MeepleType = meepleTypes[_rng.Next(3)]
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
return new TurnEvent
|
|
||||||
{
|
|
||||||
TurnNumber = turnNumber,
|
|
||||||
Activations = activations,
|
|
||||||
Details = new List<string>()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ApplyTurnEvent(TurnEvent turnEvent)
|
|
||||||
{
|
|
||||||
var details = new List<string>();
|
|
||||||
|
|
||||||
foreach (var activation in turnEvent.Activations)
|
|
||||||
{
|
|
||||||
foreach (var region in Data.Regions.Where(r => r.Terrain == activation.RegionType))
|
|
||||||
{
|
|
||||||
switch (activation.MeepleType)
|
|
||||||
{
|
|
||||||
case "Flora":
|
|
||||||
region.FloraMeeples++;
|
|
||||||
details.Add($"{region.Name}: +1 Flora");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Predator":
|
|
||||||
ApplyPredatorActivation(region, details);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Prey":
|
|
||||||
ApplyPreyActivation(region, details);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
turnEvent.Details = details;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ApplyPredatorActivation(RegionState region, List<string> details)
|
|
||||||
{
|
|
||||||
if (region.PredatorMeeples <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (region.PreyMeeples > 0)
|
|
||||||
{
|
|
||||||
int eaten = Math.Min(region.PredatorMeeples, region.PreyMeeples);
|
|
||||||
region.PreyMeeples -= eaten;
|
|
||||||
region.PredatorMeeples += eaten;
|
|
||||||
details.Add($"{region.Name}: Predators ate {eaten} prey, now {region.PredatorMeeples}P / {region.PreyMeeples}R");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var target = FindBestTravelTarget(region, r => r.PreyMeeples);
|
|
||||||
if (target != null)
|
|
||||||
{
|
|
||||||
int traveling = region.PredatorMeeples;
|
|
||||||
target.PredatorMeeples += traveling;
|
|
||||||
region.PredatorMeeples = 0;
|
|
||||||
details.Add($"{region.Name}: {traveling} predators traveled to {target.Name}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ApplyPreyActivation(RegionState region, List<string> details)
|
|
||||||
{
|
|
||||||
if (region.PreyMeeples <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (region.FloraMeeples > 0)
|
|
||||||
{
|
|
||||||
int consumed = Math.Min(region.PreyMeeples, region.FloraMeeples);
|
|
||||||
region.FloraMeeples -= consumed;
|
|
||||||
region.PreyMeeples += consumed;
|
|
||||||
details.Add($"{region.Name}: Prey consumed {consumed} flora, now {region.PreyMeeples}R / {region.FloraMeeples}F");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var target = FindBestTravelTarget(region, r => r.FloraMeeples);
|
|
||||||
if (target != null)
|
|
||||||
{
|
|
||||||
int traveling = region.PreyMeeples;
|
|
||||||
target.PreyMeeples += traveling;
|
|
||||||
region.PreyMeeples = 0;
|
|
||||||
details.Add($"{region.Name}: {traveling} prey traveled to {target.Name}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private RegionState? FindBestTravelTarget(RegionState region, Func<RegionState, int> resourceCount)
|
|
||||||
{
|
|
||||||
var direct = region.Connections
|
|
||||||
.Select(name => Data.Regions.FirstOrDefault(r => r.Name == name))
|
|
||||||
.OfType<RegionState>()
|
|
||||||
.Where(r => resourceCount(r) > 0)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
if (direct.Count > 0)
|
|
||||||
{
|
|
||||||
return direct.OrderByDescending(r => resourceCount(r)).First();
|
|
||||||
}
|
|
||||||
|
|
||||||
// BFS to find nearest region with resource, return first step along path
|
|
||||||
var visited = new HashSet<string> { region.Name };
|
|
||||||
var prev = new Dictionary<string, string>();
|
|
||||||
var queue = new Queue<string>();
|
|
||||||
|
|
||||||
foreach (var conn in region.Connections)
|
|
||||||
{
|
|
||||||
if (!visited.Contains(conn))
|
|
||||||
{
|
|
||||||
visited.Add(conn);
|
|
||||||
prev[conn] = region.Name;
|
|
||||||
queue.Enqueue(conn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (queue.Count > 0)
|
|
||||||
{
|
|
||||||
var currentName = queue.Dequeue();
|
|
||||||
var current = Data.Regions.FirstOrDefault(r => r.Name == currentName);
|
|
||||||
if (current == null) continue;
|
|
||||||
|
|
||||||
if (resourceCount(current) > 0)
|
|
||||||
{
|
|
||||||
// Walk back to find the first step from the origin region
|
|
||||||
var step = currentName;
|
|
||||||
while (prev[step] != region.Name)
|
|
||||||
step = prev[step];
|
|
||||||
return Data.Regions.FirstOrDefault(r => r.Name == step);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var conn in current.Connections)
|
|
||||||
{
|
|
||||||
if (!visited.Contains(conn))
|
|
||||||
{
|
|
||||||
visited.Add(conn);
|
|
||||||
prev[conn] = currentName;
|
|
||||||
queue.Enqueue(conn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddInitialFlora()
|
|
||||||
{
|
|
||||||
var excluded = new HashSet<string>
|
|
||||||
{
|
|
||||||
"Grass 1", "Grass 2", "Wasteland 1",
|
|
||||||
"Mountain 1", "Mountain 2", "Mountain 3", "Mountain 4", "Mountain 5"
|
|
||||||
};
|
|
||||||
|
|
||||||
foreach (var region in Data.Regions)
|
|
||||||
{
|
|
||||||
if (!excluded.Contains(region.Name))
|
|
||||||
{
|
|
||||||
region.FloraMeeples = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddRandomMeepleCombos()
|
|
||||||
{
|
|
||||||
var combos = new List<(int pred, int prey, int flora)>();
|
|
||||||
for (int total = 1; total <= 3; total++)
|
|
||||||
{
|
|
||||||
for (int p = 0; p <= total; p++)
|
|
||||||
{
|
|
||||||
for (int r = 0; r <= total - p; r++)
|
|
||||||
{
|
|
||||||
int f = total - p - r;
|
|
||||||
combos.Add((p, r, f));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var shuffled = combos.OrderBy(_ => _rng.Next()).ToList();
|
|
||||||
for (int i = 0; i < Data.Regions.Count; i++)
|
|
||||||
{
|
|
||||||
var (p, r, f) = shuffled[i % shuffled.Count];
|
|
||||||
Data.Regions[i].PredatorMeeples = p;
|
|
||||||
Data.Regions[i].PreyMeeples = r;
|
|
||||||
Data.Regions[i].FloraMeeples = f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<RegionState> CreateRegions()
|
|
||||||
{
|
|
||||||
return new List<RegionState>
|
|
||||||
{
|
|
||||||
new() { Name = "Grass 1", Slug = "grass-1", Terrain = "Grass", X = 15, Y = 260, Connections = new() { "Mountain 1", "Water 2", "Forest 1" } },
|
|
||||||
new() { Name = "Grass 2", Slug = "grass-2", Terrain = "Grass", X = 150, Y = 400, Connections = new() { "Forest 1", "Forest 2" } },
|
|
||||||
new() { Name = "Grass 3", Slug = "grass-3", Terrain = "Grass", X = 300, Y = 230, Connections = new() { "Water 2", "Mountain 2", "Mountain 3" } },
|
|
||||||
new() { Name = "Grass 4", Slug = "grass-4", Terrain = "Grass", X = 510, Y = 30, Connections = new() { "Mountain 4", "Wasteland 1" } },
|
|
||||||
new() { Name = "Grass 5", Slug = "grass-5", Terrain = "Grass", X = 550, Y = 290, Connections = new() { "Mountain 5", "Water 5", "Wasteland 1", "Forest 4" } },
|
|
||||||
new() { Name = "Forest 1", Slug = "forest-1", Terrain = "Forest", X = 60, Y = 330, Connections = new() { "Grass 1", "Grass 2", "Water 1", "Forest 2" } },
|
|
||||||
new() { Name = "Forest 2", Slug = "forest-2", Terrain = "Forest", X = 250, Y = 370, Connections = new() { "Grass 2", "Water 2", "Forest 1" } },
|
|
||||||
new() { Name = "Forest 3", Slug = "forest-3", Terrain = "Forest", X = 150, Y = 125, Connections = new() { "Water 2", "Water 3" } },
|
|
||||||
new() { Name = "Forest 4", Slug = "forest-4", Terrain = "Forest", X = 420, Y = 100, Connections = new() { "Grass 4", "Wasteland 1", "Grass 5" } },
|
|
||||||
new() { Name = "Forest 5", Slug = "forest-5", Terrain = "Forest", X = 470, Y = 410, Connections = new() { "Water 5" } },
|
|
||||||
new() { Name = "Mountain 1", Slug = "mountain-1", Terrain = "Mountain", X = 20, Y = 120, Connections = new() { "Grass 1", "Water 3", "Forest 3" } },
|
|
||||||
new() { Name = "Mountain 2", Slug = "mountain-2", Terrain = "Mountain", X = 260, Y = 110, Connections = new() { "Water 3", "Forest 3" } },
|
|
||||||
new() { Name = "Mountain 3", Slug = "mountain-3", Terrain = "Mountain", X = 380, Y = 180, Connections = new() { "Mountain 5", "Forest 4", "Grass 3" } },
|
|
||||||
new() { Name = "Mountain 4", Slug = "mountain-4", Terrain = "Mountain", X = 370, Y = 30, Connections = new() { "Forest 4", "Grass 4" } },
|
|
||||||
new() { Name = "Mountain 5", Slug = "mountain-5", Terrain = "Mountain", X = 430, Y = 330, Connections = new() { "Grass 5", "Mountain 3" } },
|
|
||||||
new() { Name = "Water 1", Slug = "water-1", Terrain = "Water", X = 30, Y = 410, Connections = new() { "Forest 1" } },
|
|
||||||
new() { Name = "Water 2", Slug = "water-2", Terrain = "Water", X = 140, Y = 260, Connections = new() { "Forest 1", "Forest 2", "Grass 1", "Forest 3", "Grass 3" } },
|
|
||||||
new() { Name = "Water 3", Slug = "water-3", Terrain = "Water", X = 50, Y = 50, Connections = new() { "Mountain 1", "Mountain 2", "Forest 3" } },
|
|
||||||
new() { Name = "Water 4", Slug = "water-4", Terrain = "Water", X = 640, Y = 110, Connections = new() { "Grass 4", "Wasteland 1" } },
|
|
||||||
new() { Name = "Water 5", Slug = "water-5", Terrain = "Water", X = 600, Y = 400, Connections = new() { "Grass 5", "Forest 5" } },
|
|
||||||
new() { Name = "Wasteland 1", Slug = "wasteland-1", Terrain = "Wasteland", X = 560, Y = 120, Connections = new() { "Forest 4", "Grass 4", "Grass 5", "Water 4" } }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+4
-5
@@ -8,14 +8,13 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Markdig" Version="0.40.0" />
|
<PackageReference Include="Markdig" Version="0.40.0"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.9" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.9"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.9" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.9" PrivateAssets="all"/>
|
||||||
<PackageReference Include="Telerik.UI.for.Blazor" Version="14.0.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="SyncDocsNotes" BeforeTargets="BeforeBuild">
|
<Target Name="SyncDocsNotes" BeforeTargets="BeforeBuild">
|
||||||
<Exec Command="dotnet run --project "$(MSBuildProjectDirectory)\..\Console\Console.csproj"" />
|
<Exec Command="dotnet run --project "$(MSBuildProjectDirectory)\..\Console\Console.csproj""/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -9,6 +9,4 @@
|
|||||||
@using Web
|
@using Web
|
||||||
@using Web.Layout
|
@using Web.Layout
|
||||||
@using Web.Models
|
@using Web.Models
|
||||||
@using Telerik.Blazor
|
|
||||||
@using Telerik.Blazor.Components
|
|
||||||
@using Web.Services
|
@using Web.Services
|
||||||
@@ -196,10 +196,6 @@ code {
|
|||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-file-text' viewBox='0 0 16 16'%3E%3Cpath d='M5 4a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5zm-.5 2.5A.5.5 0 0 1 5 6h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zM5 8a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5zm0 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1H5z'/%3E%3Cpath d='M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-file-text' viewBox='0 0 16 16'%3E%3Cpath d='M5 4a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5zm-.5 2.5A.5.5 0 0 1 5 6h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zM5 8a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5zm0 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1H5z'/%3E%3Cpath d='M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
.bi-graph-up-nav-menu {
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-graph-up' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M0 0h1v15h15v1H0V0Zm14.817 3.113a.5.5 0 0 1 .07.704l-4.5 5.5a.5.5 0 0 1-.74.037L7.06 6.767l-3.656 5.027a.5.5 0 0 1-.808-.588l4-5.5a.5.5 0 0 1 .758-.06l2.609 2.61 4.15-5.073a.5.5 0 0 1 .704-.07Z'/%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero-section {
|
.hero-section {
|
||||||
background: linear-gradient(135deg, var(--bg-sidebar) 0%, var(--bg-dark) 100%);
|
background: linear-gradient(135deg, var(--bg-sidebar) 0%, var(--bg-dark) 100%);
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
@@ -680,143 +676,3 @@ table.frontmatter td.fm-key {
|
|||||||
padding: 3rem !important;
|
padding: 3rem !important;
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Simulation Page */
|
|
||||||
.simulation-layout {
|
|
||||||
max-width: 900px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-controls {
|
|
||||||
background: var(--bg-sidebar);
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 0.75rem 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.turn-label {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
color: var(--text-main);
|
|
||||||
min-width: 100px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-outline-light {
|
|
||||||
color: var(--text-main);
|
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-outline-light:hover {
|
|
||||||
background: var(--primary);
|
|
||||||
border-color: var(--primary);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-outline-light:disabled {
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.event-badge {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
padding: 0.35em 0.75em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-map-container {
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
overflow: hidden;
|
|
||||||
background: #0f100d;
|
|
||||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-svg {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-region {
|
|
||||||
transition: opacity 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-active circle:last-child {
|
|
||||||
animation: pulse-glow 1.5s ease-in-out infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes pulse-glow {
|
|
||||||
0%, 100% { stroke-opacity: 1; }
|
|
||||||
50% { stroke-opacity: 0.4; }
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-details {
|
|
||||||
background: var(--bg-sidebar);
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 1rem 1.25rem;
|
|
||||||
max-height: 180px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-details-scroll {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.25rem;
|
|
||||||
overflow-y: auto;
|
|
||||||
max-height: 120px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-detail-item {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: var(--text-muted);
|
|
||||||
padding: 0.2rem 0;
|
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.04);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-detail-item:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-totals {
|
|
||||||
font-size: 0.9rem;
|
|
||||||
color: var(--text-main);
|
|
||||||
}
|
|
||||||
|
|
||||||
.total-dot {
|
|
||||||
display: inline-block;
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
border-radius: 50%;
|
|
||||||
margin-right: 6px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-danger {
|
|
||||||
background-color: #e76f51 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-warning {
|
|
||||||
background-color: #e9c46a !important;
|
|
||||||
color: #000 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-success {
|
|
||||||
background-color: #4caf50 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Simulation Chart */
|
|
||||||
.sim-chart {
|
|
||||||
background: var(--bg-sidebar);
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 1rem 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-chart-svg {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sim-chart-legend {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: var(--text-muted);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@
|
|||||||
{
|
{
|
||||||
"slug": "forest-regions",
|
"slug": "forest-regions",
|
||||||
"title": "Forest Regions",
|
"title": "Forest Regions",
|
||||||
"category": "Region Type"
|
"category": "RegionType"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"slug": "gauzeblade",
|
"slug": "gauzeblade",
|
||||||
@@ -222,10 +222,6 @@
|
|||||||
"slug": "injury-cards",
|
"slug": "injury-cards",
|
||||||
"title": "Injury Cards"
|
"title": "Injury Cards"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"slug": "level-up",
|
|
||||||
"title": "Level Up"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"slug": "losing-the-game",
|
"slug": "losing-the-game",
|
||||||
"title": "Losing the Game"
|
"title": "Losing the Game"
|
||||||
@@ -259,11 +255,6 @@
|
|||||||
"title": "Mountain 5",
|
"title": "Mountain 5",
|
||||||
"category": "Region"
|
"category": "Region"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"slug": "mountain-regions",
|
|
||||||
"title": "Mountain Regions",
|
|
||||||
"category": "Region Type"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"slug": "mountain",
|
"slug": "mountain",
|
||||||
"title": "Mountain",
|
"title": "Mountain",
|
||||||
@@ -494,8 +485,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"slug": "water-regions",
|
"slug": "water-regions",
|
||||||
"title": "Water Regions",
|
"title": "Water Regions"
|
||||||
"category": "Region Type"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"slug": "weather",
|
"slug": "weather",
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
category: Region Type
|
category: RegionType
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
Spend exp up to current amount in a stat + 1 to get an extra stat in it.
|
|
||||||
|
|
||||||
Spend 4 exp to go veteran (probably)
|
|
||||||
|
|
||||||
Can store a max of 4 exp.
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
category: Region Type
|
|
||||||
---
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
[[Forest Regions]]
|
[[Forest Regions]]
|
||||||
[[Water Regions]]
|
[[Water Regions]]
|
||||||
[[Grass Regions]]
|
[[Grass Regions]]
|
||||||
[[Mountain Regions]]
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
category: Region Type
|
|
||||||
---
|
|
||||||
|
|||||||
Vendored
+12
-11
@@ -13,12 +13,12 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "markdown",
|
"type": "markdown",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Notes/Level Up.md",
|
"file": "Notes/Region Types.md",
|
||||||
"mode": "source",
|
"mode": "source",
|
||||||
"source": false
|
"source": false
|
||||||
},
|
},
|
||||||
"icon": "lucide-file",
|
"icon": "lucide-file",
|
||||||
"title": "Level Up"
|
"title": "Region Types"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -74,7 +74,8 @@
|
|||||||
"title": "Bookmarks"
|
"title": "Bookmarks"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"currentTab": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "horizontal",
|
"direction": "horizontal",
|
||||||
@@ -185,16 +186,10 @@
|
|||||||
},
|
},
|
||||||
"active": "a4348c23136fecb0",
|
"active": "a4348c23136fecb0",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Notes/Mountain Regions.md",
|
|
||||||
"Notes/Level Up.md",
|
|
||||||
"Tasks/Add Crisis Logic.md",
|
|
||||||
"Overview.md",
|
|
||||||
"Tasks/Sub out all the starter Event Cards.md",
|
|
||||||
"Tasks/Stub out all the starter Terrain Cards.md",
|
|
||||||
"Tasks/_Tasks.base",
|
|
||||||
"Notes/Region Types.md",
|
|
||||||
"Tasks/Simulate the game state.md",
|
"Tasks/Simulate the game state.md",
|
||||||
"Notes/Terrain Deck.md",
|
"Notes/Terrain Deck.md",
|
||||||
|
"Notes/Region Types.md",
|
||||||
|
"Mountain Regions.md",
|
||||||
"Notes/Activate Prey Ecology.md",
|
"Notes/Activate Prey Ecology.md",
|
||||||
"Notes/Activate Flora Ecology.md",
|
"Notes/Activate Flora Ecology.md",
|
||||||
"Notes/End Turn.md",
|
"Notes/End Turn.md",
|
||||||
@@ -203,9 +198,11 @@
|
|||||||
"Notes/Water Regions.md",
|
"Notes/Water Regions.md",
|
||||||
"Rules.md",
|
"Rules.md",
|
||||||
"Notes/Grass Regions.md",
|
"Notes/Grass Regions.md",
|
||||||
|
"Tasks/_Tasks.base",
|
||||||
"Untitled",
|
"Untitled",
|
||||||
"Notes/Supply.md",
|
"Notes/Supply.md",
|
||||||
"Images/Pasted image 20260609163414.png",
|
"Images/Pasted image 20260609163414.png",
|
||||||
|
"Overview.md",
|
||||||
"Tasks/Generate overview page.md",
|
"Tasks/Generate overview page.md",
|
||||||
"Notes/Event Type.md",
|
"Notes/Event Type.md",
|
||||||
"Notes/Turn Start.md",
|
"Notes/Turn Start.md",
|
||||||
@@ -215,6 +212,8 @@
|
|||||||
"Notes/Companion Cards.md",
|
"Notes/Companion Cards.md",
|
||||||
"Notes/Sun.md",
|
"Notes/Sun.md",
|
||||||
"Notes/Mountain.md",
|
"Notes/Mountain.md",
|
||||||
|
"Notes/Crest.md",
|
||||||
|
"Notes/Terrain Cards.md",
|
||||||
"Images/Pasted image 20260609163839.png",
|
"Images/Pasted image 20260609163839.png",
|
||||||
"Images/Pasted image 20260609163625.png",
|
"Images/Pasted image 20260609163625.png",
|
||||||
"Images/Pasted image 20260609211711.png",
|
"Images/Pasted image 20260609211711.png",
|
||||||
@@ -222,10 +221,12 @@
|
|||||||
"Images/Pasted image 20260609170252.png",
|
"Images/Pasted image 20260609170252.png",
|
||||||
"Images/Pasted image 20260609170321.png",
|
"Images/Pasted image 20260609170321.png",
|
||||||
"Images/Market Example.png",
|
"Images/Market Example.png",
|
||||||
|
"Notes/Trader.md",
|
||||||
"Bases/_Roles.base",
|
"Bases/_Roles.base",
|
||||||
"Bases/Regions.base",
|
"Bases/Regions.base",
|
||||||
"Images/Map.png",
|
"Images/Map.png",
|
||||||
"_Tasks.base",
|
"_Tasks.base",
|
||||||
|
"_Overview.md",
|
||||||
"Bases/_Gear.base",
|
"Bases/_Gear.base",
|
||||||
"Tasks",
|
"Tasks",
|
||||||
"Bases/Terrain.base",
|
"Bases/Terrain.base",
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
Spend exp up to current amount in a stat + 1 to get an extra stat in it.
|
|
||||||
|
|
||||||
Spend 4 exp to go veteran (probably)
|
|
||||||
|
|
||||||
Can store a max of 4 exp.
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
category: Region Type
|
|
||||||
---
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
category: Task
|
|
||||||
status: TODO
|
|
||||||
---
|
|
||||||
Would be funny to simulate a game state where all the crisis occur, and there is no players to help stop them
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
category: Task
|
category: Task
|
||||||
status: Done
|
status:
|
||||||
---
|
---
|
||||||
At the start of a game, we have 1 flora added to each region, except [[Grass 1]], [[Grass 2]], and [[Wasteland 1]]. Let's also assume we exclude [[Mountain 1]], [[Mountain 2]], [[Mountain 3]], [[Mountain 4]], [[Mountain 5]].
|
At the start of a game, we have 1 flora added to each region, except [[Grass 1]], [[Grass 2]], and [[Wasteland 1]]. Let's also assume we exclude [[Mountain 1]], [[Mountain 2]], [[Mountain 3]], [[Mountain 4]], [[Mountain 5]].
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
category: Task
|
|
||||||
status: Working On
|
|
||||||
---
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
category: Task
|
|
||||||
status: Working On
|
|
||||||
---
|
|
||||||
@@ -132,21 +132,17 @@ views:
|
|||||||
- TODO
|
- TODO
|
||||||
- Working On
|
- Working On
|
||||||
- Done
|
- Done
|
||||||
|
- Uncategorized
|
||||||
cardOrders:
|
cardOrders:
|
||||||
file.file: {}
|
file.file: {}
|
||||||
note.status:
|
note.status:
|
||||||
Working On:
|
Working On: []
|
||||||
- Stub out all the starter Terrain Cards.md
|
|
||||||
- Sub out all the starter Event Cards.md
|
|
||||||
Done:
|
Done:
|
||||||
- Tasks/Generate a Markdown Website.md
|
- Tasks/Generate a Markdown Website.md
|
||||||
- Tasks/Generate a map of regions and how they connect.md
|
- Tasks/Generate a map of regions and how they connect.md
|
||||||
- Tasks/Generate a csharp script to do what you did.md
|
- Tasks/Generate a csharp script to do what you did.md
|
||||||
- Tasks/Generate overview page.md
|
- Tasks/Generate overview page.md
|
||||||
- Tasks/Simulate the game state.md
|
|
||||||
Uncategorized: []
|
Uncategorized: []
|
||||||
TODO:
|
|
||||||
- Add Crisis Logic.md
|
|
||||||
columnColors:
|
columnColors:
|
||||||
file.file: {}
|
file.file: {}
|
||||||
note.status: {}
|
note.status: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user