Add boardShape to client rules editor + ability builder help docs

- rules_editor_dialog.gd: add add_option helper, boardShape OptionButton
  in BOARD section (Default/Rectangle/Cross/Triangular/RadialStar/HexRing),
  and OptionButton branch in _on_confirm
- lobby_room_screen.gd: add boardShape to both rules display dicts
- AbilityBuilder.razor: add help docs for OnUnitSentToDiscard CausedBy field
- GameDbContextModelSnapshot.cs: reflect AddBoardShapeOverride migration

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-26 15:01:36 -04:00
co-authored by Claude Happy
parent 766ba336ec
commit 8b0490687e
4 changed files with 55 additions and 0 deletions
@@ -932,6 +932,35 @@
</tbody>
</table>
<h6 class="fw-semibold text-primary">Trigger-Specific Fields</h6>
<p class="mb-1">Some trigger types expose extra filtering fields beyond <code>Ownership</code> and <code>UnitType</code>.</p>
<p class="mb-1"><strong>OnUnitSentToDiscard — <code>CausedBy</code></strong></p>
<p class="mb-1">Fires whenever a unit is sent to the discard pile from the battlefield. This includes:</p>
<ul class="mb-2">
<li>Combat — the attacker kills the target (or counterattack kills the attacker)</li>
<li>Ability — a <em>KillUnit</em> or <em>SendToDiscard</em> ability effect resolves</li>
</ul>
<p class="mb-1">The optional <code>CausedBy</code> field narrows the trigger to units killed by a specific owner class:</p>
<table class="table table-sm table-bordered mb-2">
<thead class="table-dark"><tr><th>CausedBy value</th><th>Fires when the killer is…</th></tr></thead>
<tbody>
<tr><td>(empty)</td><td>Any killer — trigger fires regardless of who caused the discard</td></tr>
<tr><td><code>ExactSelf</code></td><td><strong>This specific unit instance</strong> — the unit that owns this ability was the one that dealt the killing blow (Bloodlust pattern)</td></tr>
<tr><td><code>Owner</code></td><td>Any unit controlled by the same player as this unit</td></tr>
<tr><td><code>Enemy</code></td><td>Any opponent-controlled unit caused the discard</td></tr>
<tr><td><code>Any</code></td><td>Same as empty — any killer</td></tr>
</tbody>
</table>
<p class="mb-1 text-muted fst-italic">Note: <code>Ownership</code> still filters the <em>unit being discarded</em>; <code>CausedBy</code> filters the <em>killer</em>. Use <code>Ownership: Any, CausedBy: ExactSelf</code> to react whenever this unit kills anything.</p>
<p class="mb-1 mt-2"><strong>Bloodlust example</strong> — "When this spirit sends another spirit to the discard, gain +1 attack":</p>
<pre class="bg-light border rounded p-2 small mb-1">{"$type":"OnUnitSentToDiscard","UnitType":"Spirit","Ownership":"Any","CausedBy":"ExactSelf"}</pre>
<p class="mb-1">Action: Scope <code>Battlefield</code>, Ownership <code>ExactSelf</code>, Effect <code>ModifyStat</code> — Stat <code>Damage</code>, Amt +1, Duration <code>PermanentInMatch</code> (or <code>UntilEndOfTurn</code> for temporary buff).</p>
<p class="mb-1 mt-2"><strong>OnUnitDeath vs OnUnitSentToDiscard</strong></p>
<p class="mb-3 text-muted">Use <code>OnUnitDeath</code> to react to any unit being killed (e.g. opponent's unit dies anywhere). Use <code>OnUnitSentToDiscard</code> when you specifically want the <em>killer identity</em> via <code>CausedBy</code>, or when you need to distinguish combat-killed units from sacrificed/returned units (sacrificed units fire <code>OnSpiritSacrificed</code>, not <code>OnUnitSentToDiscard</code>).</p>
</div>
</div>
<div class="offcanvas-backdrop fade show" @onclick="() => _showHelp = false" style="z-index:1040"></div>