From 5fdd60e3014e80015b4e8788afeb4e1a0c3e63f6 Mon Sep 17 00:00:00 2001
From: coyotte508
Date: Sat, 3 Oct 2026 22:59:07 +0200
Subject: [PATCH] Clarify government exclusivity and Draft research rules
---
web-client/src/ResearchTree.svelte | 60 ++++++++++++++++++++++++------
web-client/src/research.css | 39 +++++++++++++++++++
web-client/src/research.ts | 5 ++-
3 files changed, 92 insertions(+), 12 deletions(-)
diff --git a/web-client/src/ResearchTree.svelte b/web-client/src/ResearchTree.svelte
index 37c42e84..028f4f15 100644
--- a/web-client/src/ResearchTree.svelte
+++ b/web-client/src/ResearchTree.svelte
@@ -66,6 +66,23 @@
captives: Link,
};
let advances = $derived([...($session.view?.advances ?? [])].sort((a, b) => a.order - b.order));
+ const governmentGroups = ['Democracy', 'Autocracy', 'Theocracy'];
+ const currentGovernment = $derived(
+ advances.find((a) => a.owned && governmentGroups.includes(a.group))?.group,
+ );
+ function governmentLocked(group: string) {
+ return (
+ !!currentGovernment &&
+ governmentGroups.includes(group) &&
+ group !== currentGovernment &&
+ !advances.some((a) => a.group === group && a.action)
+ );
+ }
+ function unavailableReason(advance: AdvanceView) {
+ return !advance.owned && governmentLocked(advance.group)
+ ? `Your government is ${currentGovernment}. Switch to ${advance.group} at the end of an age for 1 mood token + 1 culture token. You must meet its prerequisite; your government advances are replaced with the same number from the new government.`
+ : actionReason(advance.reason);
+ }
const availableAdvances = $derived(
advances.filter((a) => (researchedOnly ? a.owned : !$session.availableOnly || !!a.action)),
);
@@ -100,7 +117,8 @@
groups.filter(
(group) =>
(category === 'All' || group === category) &&
- availableAdvances.some((a) => a.group === group && matches(a)),
+ (availableAdvances.some((a) => a.group === group && matches(a)) ||
+ (category === group && governmentLocked(group) && !researchedOnly)),
),
);
const selectedAction = $derived(choice ? selected?.action : selectedPayment?.action);
@@ -215,8 +233,27 @@
/>
{/if}
{#each visibleGroups as group}{@const GroupIcon = groupIcons[group] ?? BookOpen}
-
- {group}
+ {@const lockedGovernment = governmentLocked(group)}
+
+
+ {group}
+ {#if group === currentGovernment} Current government
+ {:else if lockedGovernment} {/if}
+
+ {#if governmentGroups.includes(group)}
+ {#if lockedGovernment}
+ Only one government at a time.
+ Switch at end of age ·
+ {:else if !currentGovernment}Only one government at a time. You can switch at the end of an age.{/if}
+
{/if}
+ {#if lockedGovernment && statusFilter === 'available'} setStatusFilter('all')}>Show advances {/if}
{#each availableAdvances.filter((a) => a.group === group) as advance, index}{@const presentation =
researchPresentation(advance)}{@const Icon = presentation.icon}{@const parent = advances.find(
(a) => a.id === advance.required,
@@ -242,11 +279,13 @@
>{#if advance.owned} {:else if !advance.action && (actionReason(advance.reason) || (parent && !parent.owned))} {:else if !advance.action && (lockedGovernment || actionReason(advance.reason) || (parent && !parent.owned))} {/if}
@@ -295,7 +334,7 @@
title={`View ${parent.name}`}
onclick={() => showAdvance(parent.id)}>Needs {parent.name}
- {:else}{actionReason(advance.reason)}{/if}{/if}
{#each advances.filter((a) => a.required === advance.id && a.group !== advance.group) as unlocked}
@@ -352,8 +391,7 @@
? 'Ships sail through connected sea tiles. Navigation adds a clockwise or counterclockwise shortcut around the edge to the next sea area. Unexplored regions must be explored before sailing farther.'
: selected.description}
- {#if actionReason(selected.reason) && !selected.owned}{actionReason(selected.reason)} {/if}
+ {#if unavailableReason(selected) && !selected.owned}{unavailableReason(selected)} {/if}
{#if $session.error}{$session.error}
{/if}
@@ -373,7 +411,7 @@
{/if}
selectedAction && controller.submit(selectedAction)}
>
diff --git a/web-client/src/research.css b/web-client/src/research.css
index f7730608..1d87d9ec 100644
--- a/web-client/src/research.css
+++ b/web-client/src/research.css
@@ -104,6 +104,45 @@
font-weight: 600;
margin-bottom: 13px;
}
+.government-label {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ margin-left: auto;
+ color: var(--muted);
+ font-size: 10px;
+ font-weight: 400;
+}
+.government-rule {
+ display: grid;
+ gap: 4px;
+ margin: -3px 0 13px;
+ color: var(--muted);
+ font-size: 11px;
+ line-height: 1.5;
+}
+.government-rule:empty {
+ display: none;
+}
+.government-switch {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 5px;
+}
+.government-locked .research-node {
+ border-style: dashed;
+ background: var(--paper2);
+}
+.government-locked .research-pick,
+.government-locked .research-effects {
+ opacity: 0.7;
+}
+.government-locked .research-pick:hover,
+.government-locked .research-pick:focus-visible,
+.government-locked .research-node.selected .research-pick {
+ opacity: 1;
+}
.research-advance-link {
padding: 0;
font: inherit;
diff --git a/web-client/src/research.ts b/web-client/src/research.ts
index f9083ef7..94ca3dc0 100644
--- a/web-client/src/research.ts
+++ b/web-client/src/research.ts
@@ -99,7 +99,10 @@ const advances = {
Anvil,
'Before a land battle, pay 1 ore for +2 combat value each round, or +1 if the enemy has Steel Weapons. With Metallurgy, pay no ore against enemies without Steel Weapons.',
],
- Draft: [Users, 'Each Recruit action: pay 1 mood token instead of resources for one infantry unit.'],
+ Draft: [
+ Users,
+ 'Each Recruit action: pay 1 mood token instead of resources for only 1 infantry. Additional infantry use normal costs.',
+ ],
Myths: [
Sun,
'When an event would lower your cities’ mood, pay 1 mood token per city you want to protect. Does not apply to Pirates.',