Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 800146768e | |||
| 3064703b7c |
@@ -3,16 +3,11 @@
|
||||
<div class="sidebar">
|
||||
<NavMenu/>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<main>
|
||||
<article class="content px-4">
|
||||
<TelerikRootComponent>
|
||||
@Body
|
||||
</TelerikRootComponent>
|
||||
</article>
|
||||
</main>
|
||||
<footer class="footer">
|
||||
<p>This website is not associated with <a href="https://earthbornegames.com/" target="_blank" rel="noopener noreferrer">Earthborne Games</a>.</p>
|
||||
</footer>
|
||||
</div>
|
||||
<main>
|
||||
<article class="content px-4">
|
||||
<TelerikRootComponent>
|
||||
@Body
|
||||
</TelerikRootComponent>
|
||||
</article>
|
||||
</main>
|
||||
</div>
|
||||
@@ -8,13 +8,6 @@ main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background-color: var(--bg-sidebar);
|
||||
border-right: 1px solid var(--border-color);
|
||||
@@ -44,14 +37,6 @@ main {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-muted, #888);
|
||||
border-top: 1px solid var(--border-color, #ddd);
|
||||
}
|
||||
|
||||
@media (max-width: 640.98px) {
|
||||
.top-row {
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
|
||||
<div class="hero-section text-center">
|
||||
<div class="hero-content py-5">
|
||||
<h1 class="display-4 mb-3">Slop Game Reference - Earthborne Trailblazer</h1>
|
||||
<p class="lead mb-4">AI generated website for reference notes on playing Earthborne Trailblazer.</p>
|
||||
<h1 class="display-4 mb-3">Earthborne Trailblazer</h1>
|
||||
<p class="lead mb-4">Your essential companion guide for navigating the Valley and mastering your craft.</p>
|
||||
<div class="hero-actions">
|
||||
<NavLink href="overview" class="btn btn-primary btn-lg px-4">Begin Journey</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="simulation-layout" tabindex="0" @onkeydown="HandleKeyDown" @ref="layoutDiv">
|
||||
<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)">
|
||||
@@ -99,7 +99,7 @@ else
|
||||
stroke="rgba(255,255,255,0.12)" stroke-width="2" stroke-linecap="round"/>
|
||||
}
|
||||
|
||||
@foreach (var region in currentRegions)
|
||||
@foreach (var region in currentRegions)
|
||||
{
|
||||
var isActivated = activatedRegionNames.Contains(region.Name);
|
||||
var terrainColor = GetTerrainColor(region.Terrain);
|
||||
@@ -109,57 +109,12 @@ else
|
||||
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;
|
||||
|
||||
// Meeple dot counts (max 3 visible per type)
|
||||
var pdots = Math.Min(region.PredatorMeeples, 3);
|
||||
var rdots = Math.Min(region.PreyMeeples, 3);
|
||||
var fdots = Math.Min(region.FloraMeeples, 3);
|
||||
var dotR = 3;
|
||||
var dotGap = 7;
|
||||
|
||||
<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)"/>
|
||||
|
||||
@* Predator dots (red, top row) *@
|
||||
@for (int d = 0; d < pdots; d++)
|
||||
{
|
||||
var dx = region.X + (d - (pdots - 1) * 0.5) * dotGap;
|
||||
var dy = region.Y - 7;
|
||||
<circle cx="@dx" cy="@dy" r="@dotR" fill="#e76f51" stroke="rgba(0,0,0,0.4)" stroke-width="0.5"/>
|
||||
}
|
||||
@if (region.PredatorMeeples > 3)
|
||||
{
|
||||
@((MarkupString)$"<text x=\"{region.X + 2 * dotGap + 2}\" y=\"{region.Y - 4}\" fill=\"#e76f51\" font-size=\"7\" font-weight=\"600\">+{region.PredatorMeeples - 3}</text>")
|
||||
}
|
||||
|
||||
@* Prey dots (yellow, middle row) *@
|
||||
@for (int d = 0; d < rdots; d++)
|
||||
{
|
||||
var dx = region.X + (d - (rdots - 1) * 0.5) * dotGap;
|
||||
var dy = region.Y;
|
||||
<circle cx="@dx" cy="@dy" r="@dotR" fill="#e9c46a" stroke="rgba(0,0,0,0.4)" stroke-width="0.5"/>
|
||||
}
|
||||
@if (region.PreyMeeples > 3)
|
||||
{
|
||||
@((MarkupString)$"<text x=\"{region.X + 2 * dotGap + 2}\" y=\"{region.Y + 3}\" fill=\"#e9c46a\" font-size=\"7\" font-weight=\"600\">+{region.PreyMeeples - 3}</text>")
|
||||
}
|
||||
|
||||
@* Flora dots (green, bottom row) *@
|
||||
@for (int d = 0; d < fdots; d++)
|
||||
{
|
||||
var dx = region.X + (d - (fdots - 1) * 0.5) * dotGap;
|
||||
var dy = region.Y + 7;
|
||||
<circle cx="@dx" cy="@dy" r="@dotR" fill="#4caf50" stroke="rgba(0,0,0,0.4)" stroke-width="0.5"/>
|
||||
}
|
||||
@if (region.FloraMeeples > 3)
|
||||
{
|
||||
@((MarkupString)$"<text x=\"{region.X + 2 * dotGap + 2}\" y=\"{region.Y + 10}\" fill=\"#4caf50\" font-size=\"7\" font-weight=\"600\">+{region.FloraMeeples - 3}</text>")
|
||||
}
|
||||
|
||||
<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
|
||||
@@ -263,7 +218,6 @@ else
|
||||
|
||||
|
||||
@code {
|
||||
private ElementReference layoutDiv;
|
||||
private TurnEvent? CurrentEvent => SimService.Data.CurrentTurn > 0 && SimService.Data.CurrentTurn <= SimService.Data.Events.Count
|
||||
? SimService.Data.Events[SimService.Data.CurrentTurn - 1]
|
||||
: null;
|
||||
@@ -298,18 +252,6 @@ else
|
||||
SimService.Data.CurrentTurn++;
|
||||
}
|
||||
|
||||
private void HandleKeyDown(KeyboardEventArgs e)
|
||||
{
|
||||
if (e.Key == "ArrowLeft") PrevTurn();
|
||||
else if (e.Key == "ArrowRight") NextTurn();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
await layoutDiv.FocusAsync();
|
||||
}
|
||||
|
||||
private void RandomizeEvents()
|
||||
{
|
||||
SimService.RandomizeEvents();
|
||||
|
||||
@@ -76,7 +76,12 @@ public class GameSimulationService
|
||||
|
||||
public void RandomizeEvents()
|
||||
{
|
||||
RunSimulation();
|
||||
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()
|
||||
@@ -176,25 +181,22 @@ public class GameSimulationService
|
||||
if (region.PredatorMeeples <= 0)
|
||||
return;
|
||||
|
||||
int total = region.PredatorMeeples;
|
||||
int canEat = Math.Min(total, region.PreyMeeples);
|
||||
int mustTravel = total - canEat;
|
||||
|
||||
if (canEat > 0)
|
||||
if (region.PreyMeeples > 0)
|
||||
{
|
||||
region.PreyMeeples -= canEat;
|
||||
region.PredatorMeeples += canEat;
|
||||
details.Add($"{region.Name}: {canEat} predators ate prey, +{canEat} new predators");
|
||||
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");
|
||||
}
|
||||
|
||||
if (mustTravel > 0)
|
||||
else
|
||||
{
|
||||
var target = FindBestTravelTarget(region, r => r.PreyMeeples);
|
||||
if (target != null)
|
||||
{
|
||||
region.PredatorMeeples -= mustTravel;
|
||||
target.PredatorMeeples += mustTravel;
|
||||
details.Add($"{region.Name}: {mustTravel} predators traveled to {target.Name}");
|
||||
int traveling = region.PredatorMeeples;
|
||||
target.PredatorMeeples += traveling;
|
||||
region.PredatorMeeples = 0;
|
||||
details.Add($"{region.Name}: {traveling} predators traveled to {target.Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,25 +206,22 @@ public class GameSimulationService
|
||||
if (region.PreyMeeples <= 0)
|
||||
return;
|
||||
|
||||
int total = region.PreyMeeples;
|
||||
int canEat = Math.Min(total, region.FloraMeeples);
|
||||
int mustTravel = total - canEat;
|
||||
|
||||
if (canEat > 0)
|
||||
if (region.FloraMeeples > 0)
|
||||
{
|
||||
region.FloraMeeples -= canEat;
|
||||
region.PreyMeeples += canEat;
|
||||
details.Add($"{region.Name}: {canEat} prey ate flora, +{canEat} new prey");
|
||||
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");
|
||||
}
|
||||
|
||||
if (mustTravel > 0)
|
||||
else
|
||||
{
|
||||
var target = FindBestTravelTarget(region, r => r.FloraMeeples);
|
||||
if (target != null)
|
||||
{
|
||||
region.PreyMeeples -= mustTravel;
|
||||
target.PreyMeeples += mustTravel;
|
||||
details.Add($"{region.Name}: {mustTravel} prey traveled to {target.Name}");
|
||||
int traveling = region.PreyMeeples;
|
||||
target.PreyMeeples += traveling;
|
||||
region.PreyMeeples = 0;
|
||||
details.Add($"{region.Name}: {traveling} prey traveled to {target.Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,23 +314,14 @@ public class GameSimulationService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var excluded = new HashSet<string>
|
||||
{
|
||||
"Grass 1", "Grass 2", "Wasteland 1",
|
||||
"Mountain 1", "Mountain 2", "Mountain 3", "Mountain 4", "Mountain 5"
|
||||
};
|
||||
|
||||
var shuffled = combos.OrderBy(_ => _rng.Next()).ToList();
|
||||
for (int i = 0; i < Data.Regions.Count; i++)
|
||||
{
|
||||
if (!excluded.Contains(Data.Regions[i].Name))
|
||||
{
|
||||
var (p, r, f) = shuffled[i % shuffled.Count];
|
||||
Data.Regions[i].PredatorMeeples = p;
|
||||
Data.Regions[i].PreyMeeples = r;
|
||||
Data.Regions[i].FloraMeeples += f;
|
||||
}
|
||||
var (p, r, f) = shuffled[i % shuffled.Count];
|
||||
Data.Regions[i].PredatorMeeples = p;
|
||||
Data.Regions[i].PreyMeeples = r;
|
||||
Data.Regions[i].FloraMeeples = f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -259,6 +259,11 @@
|
||||
"title": "Mountain 5",
|
||||
"category": "Region"
|
||||
},
|
||||
{
|
||||
"slug": "mountain-regions",
|
||||
"title": "Mountain Regions",
|
||||
"category": "Region Type"
|
||||
},
|
||||
{
|
||||
"slug": "mountain",
|
||||
"title": "Mountain",
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"navigationFallback": {
|
||||
"rewrite": "/index.html",
|
||||
"exclude": ["/css/*", "/lib/*", "/_framework/*", "/_content/*", "/sample-data/*"]
|
||||
}
|
||||
}
|
||||
Vendored
+3
-3
@@ -13,12 +13,12 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Notes/Card Library.md",
|
||||
"file": "Notes/Level Up.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "Card Library"
|
||||
"title": "Level Up"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -185,8 +185,8 @@
|
||||
},
|
||||
"active": "a4348c23136fecb0",
|
||||
"lastOpenFiles": [
|
||||
"Notes/Level Up.md",
|
||||
"Notes/Mountain Regions.md",
|
||||
"Notes/Level Up.md",
|
||||
"Tasks/Add Crisis Logic.md",
|
||||
"Overview.md",
|
||||
"Tasks/Sub out all the starter Event Cards.md",
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
category: Region Type
|
||||
---
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
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
|
||||
status:
|
||||
status: Done
|
||||
---
|
||||
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]].
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: Task
|
||||
status: Working On
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: Task
|
||||
status: Working On
|
||||
---
|
||||
@@ -132,17 +132,21 @@ views:
|
||||
- TODO
|
||||
- Working On
|
||||
- Done
|
||||
- Uncategorized
|
||||
cardOrders:
|
||||
file.file: {}
|
||||
note.status:
|
||||
Working On: []
|
||||
Working On:
|
||||
- Stub out all the starter Terrain Cards.md
|
||||
- Sub out all the starter Event Cards.md
|
||||
Done:
|
||||
- Tasks/Generate a Markdown Website.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 overview page.md
|
||||
- Tasks/Simulate the game state.md
|
||||
Uncategorized: []
|
||||
TODO:
|
||||
- Add Crisis Logic.md
|
||||
columnColors:
|
||||
file.file: {}
|
||||
note.status: {}
|
||||
|
||||
Reference in New Issue
Block a user