Hill Training: ExactSelf trigger + TileAffinityMatches FieldCard fix
- AbilitySystem: add TileAffinityMatchesCondition case for FieldCard subject so activation conditions check the tile the unit is currently standing on (previously only handled Coord subjects; triggered abilities pass FieldCard) - AbilityBuilder: add "ExactSelf" to OwnershipValues dropdown for trigger events so designers can restrict triggers to only this specific unit instance - AbilityBuilder help section: add Trigger Ownership table documenting all ownership values including ExactSelf with clear explanation of instance-level scope 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:
@@ -873,6 +873,17 @@
|
|||||||
@foreach (var t in TriggerTypesList)
|
@foreach (var t in TriggerTypesList)
|
||||||
{ <li><code>@t</code></li> }
|
{ <li><code>@t</code></li> }
|
||||||
</ul>
|
</ul>
|
||||||
|
<p class="mb-1"><strong>Trigger Ownership</strong> controls whose actions fire the trigger:</p>
|
||||||
|
<table class="table table-sm mb-3">
|
||||||
|
<thead><tr><th>Value</th><th>Meaning</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td><code>Any</code></td><td>Any unit's action fires the trigger</td></tr>
|
||||||
|
<tr><td><code>Owner</code></td><td>Any unit owned by the same player fires the trigger</td></tr>
|
||||||
|
<tr><td><code>Ally</code></td><td>Alias for Owner (same-player units)</td></tr>
|
||||||
|
<tr><td><code>Enemy</code></td><td>Only opponent units fire the trigger</td></tr>
|
||||||
|
<tr><td><code>ExactSelf</code></td><td><strong>Only this specific unit instance</strong> fires the trigger — use this to react to your own movement/actions, not teammates'</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1008,7 +1019,7 @@
|
|||||||
private static readonly string[] StatValues = ["Damage", "Defense", "Health", "MP"];
|
private static readonly string[] StatValues = ["Damage", "Defense", "Health", "MP"];
|
||||||
private static readonly string[] PositionValues = ["Top", "Bottom"];
|
private static readonly string[] PositionValues = ["Top", "Bottom"];
|
||||||
private static readonly string[] PlayerValues = ["Owner", "Opponent", "Both", "Any"];
|
private static readonly string[] PlayerValues = ["Owner", "Opponent", "Both", "Any"];
|
||||||
private static readonly string[] OwnershipValues = ["Any", "Owner", "Ally", "Enemy"];
|
private static readonly string[] OwnershipValues = ["Any", "Owner", "Ally", "Enemy", "ExactSelf"];
|
||||||
private static readonly string[] UnitTypeValues = ["Unit", "Spirit", "ArchSpirit", "SpiritToken"];
|
private static readonly string[] UnitTypeValues = ["Unit", "Spirit", "ArchSpirit", "SpiritToken"];
|
||||||
private static readonly string[] TriggerCardTypeValues = ["Spirit", "ArchSpirit", "Ruin", "Repentance", "Instinct", "Terramorpha"];
|
private static readonly string[] TriggerCardTypeValues = ["Spirit", "ArchSpirit", "Ruin", "Repentance", "Instinct", "Terramorpha"];
|
||||||
private static readonly string[] TriggerDamageTypeValues= ["Any", "HP", "Defense"];
|
private static readonly string[] TriggerDamageTypeValues= ["Any", "HP", "Defense"];
|
||||||
|
|||||||
@@ -1626,6 +1626,12 @@ public static class AbilitySystem
|
|||||||
return tile is not null
|
return tile is not null
|
||||||
&& AffinitySystem.Resolve(tile.Base1, tile.Base2) == tamc.Affinity;
|
&& AffinitySystem.Resolve(tile.Base1, tile.Base2) == tamc.Affinity;
|
||||||
}
|
}
|
||||||
|
case TileAffinityMatchesCondition tamc when subject is FieldCard fc && fc.Position.HasValue:
|
||||||
|
{
|
||||||
|
var tile = ctx.State.Board?.GetTile(fc.Position.Value);
|
||||||
|
return tile is not null
|
||||||
|
&& AffinitySystem.Resolve(tile.Base1, tile.Base2) == tamc.Affinity;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user