Fix: abilitiesJson null crash, battlefield popup, ExactSelf ability filter
Client (game_screen.gd): - Fix crash when clicking a unit with null abilitiesJson: server sends the key with a null value, so dict.get(key,default) returns null — guard both uses (_show_ability_panel and _on_hold_timer_fired) with explicit null check. - Add double-click on battlefield units to open a full CardDetailPopup showing name, affinity, stats, and ability descriptions. Popup is instantiated once in _ready() and reused; aliases movementPoints/abilities keys as expected. Server (Filters.cs / AbilitySystem.cs): - IsSelf filter now matches by CardDefinitionId (definition-level: any copy of the same card). This is the appropriate semantic for "self" as a type scope. - IsExactSelf filter added: matches by InstanceId (instance-level: only this specific unit on the battlefield). Use this to prevent duplicate-instance trigger bleed where two copies of a card both fire when only one acted. - TriggerMatches now accepts the evaluating FieldCard and forwards its InstanceId to Own() for all ownership checks. - Own() gains "ExactSelf" scope: fires only when occ.Data.SourceId matches the evaluating unit's InstanceId — eliminating the definition-level bleed bug. 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:
@@ -64,6 +64,7 @@ enum Mode {
|
|||||||
var count : int = 0
|
var count : int = 0
|
||||||
var _last_click_frame : int = -1
|
var _last_click_frame : int = -1
|
||||||
var _last_click_iid : String = ""
|
var _last_click_iid : String = ""
|
||||||
|
var _card_detail_popup : Control = null
|
||||||
# ── Affinity colors ───────────────────────────────────────────────────────────
|
# ── Affinity colors ───────────────────────────────────────────────────────────
|
||||||
|
|
||||||
const AFFINITY_COLORS : Dictionary = {
|
const AFFINITY_COLORS : Dictionary = {
|
||||||
@@ -92,7 +93,8 @@ const AFFINITY_COLORS : Dictionary = {
|
|||||||
"GatewayField": Color(0.52, 0.60, 0.22),
|
"GatewayField": Color(0.52, 0.60, 0.22),
|
||||||
}
|
}
|
||||||
|
|
||||||
const _CARD_WIDGET_SCENE := preload("res://scenes/collection/components/CardWidget.tscn")
|
const _CARD_WIDGET_SCENE := preload("res://scenes/collection/components/CardWidget.tscn")
|
||||||
|
const _CARD_DETAIL_POPUP_SCENE := preload("res://scenes/collection/components/CardDetailPopup.tscn")
|
||||||
|
|
||||||
const HI_GREEN := Color(0.20, 0.90, 0.20, 0.40)
|
const HI_GREEN := Color(0.20, 0.90, 0.20, 0.40)
|
||||||
const HI_RED := Color(1.00, 0.25, 0.25, 0.50)
|
const HI_RED := Color(1.00, 0.25, 0.25, 0.50)
|
||||||
@@ -159,6 +161,11 @@ func _ready() -> void:
|
|||||||
get_tree().change_scene_to_file("res://scenes/main/MainScreen.tscn"))
|
get_tree().change_scene_to_file("res://scenes/main/MainScreen.tscn"))
|
||||||
_hold_timer.timeout.connect(_on_hold_timer_fired)
|
_hold_timer.timeout.connect(_on_hold_timer_fired)
|
||||||
|
|
||||||
|
# Card detail popup (shared overlay — reused across multiple unit clicks).
|
||||||
|
_card_detail_popup = _CARD_DETAIL_POPUP_SCENE.instantiate()
|
||||||
|
_hud.add_child(_card_detail_popup)
|
||||||
|
_card_detail_popup.hide()
|
||||||
|
|
||||||
Game.state_updated.connect(_on_state_updated)
|
Game.state_updated.connect(_on_state_updated)
|
||||||
Game.game_over.connect(_on_game_over)
|
Game.game_over.connect(_on_game_over)
|
||||||
|
|
||||||
@@ -221,6 +228,12 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||||||
_last_mouse = mb.position
|
_last_mouse = mb.position
|
||||||
elif mb.button_index == MOUSE_BUTTON_LEFT:
|
elif mb.button_index == MOUSE_BUTTON_LEFT:
|
||||||
if mb.pressed:
|
if mb.pressed:
|
||||||
|
# Double-click on a battlefield unit → show full card detail popup.
|
||||||
|
if mb.double_click:
|
||||||
|
var dbl_unit_id := _mouse_to_unit_id(mb.position)
|
||||||
|
if not dbl_unit_id.is_empty():
|
||||||
|
_show_unit_detail_popup(dbl_unit_id)
|
||||||
|
return
|
||||||
_last_mouse = mb.position
|
_last_mouse = mb.position
|
||||||
_drag_active = false
|
_drag_active = false
|
||||||
_press_was_on_board = true # unhandled press = board area, not a UI card
|
_press_was_on_board = true # unhandled press = board area, not a UI card
|
||||||
@@ -986,7 +999,10 @@ func _show_card_picker(title: String, cards: Array, on_pick: Callable) -> void:
|
|||||||
|
|
||||||
func _show_ability_panel(unit_id: String, unit: Dictionary) -> void:
|
func _show_ability_panel(unit_id: String, unit: Dictionary) -> void:
|
||||||
_hide_ability_panel()
|
_hide_ability_panel()
|
||||||
var abil_json : String = unit.get("abilitiesJson", "")
|
# Null trap: server sends "abilitiesJson": null for units with no abilities.
|
||||||
|
# dict.get(key, default) returns null when key exists with null value.
|
||||||
|
var _raw_abil_ap = unit.get("abilitiesJson")
|
||||||
|
var abil_json : String = "" if _raw_abil_ap == null else str(_raw_abil_ap)
|
||||||
if abil_json.is_empty(): return
|
if abil_json.is_empty(): return
|
||||||
var parsed = JSON.parse_string(abil_json)
|
var parsed = JSON.parse_string(abil_json)
|
||||||
if not parsed is Array: return
|
if not parsed is Array: return
|
||||||
@@ -1038,6 +1054,18 @@ func _hide_ability_panel() -> void:
|
|||||||
_ability_panel.queue_free()
|
_ability_panel.queue_free()
|
||||||
_ability_panel = null
|
_ability_panel = null
|
||||||
|
|
||||||
|
|
||||||
|
func _show_unit_detail_popup(unit_id: String) -> void:
|
||||||
|
var unit := Game.get_unit_by_id(unit_id)
|
||||||
|
if unit.is_empty(): return
|
||||||
|
# Build a dict with the aliases card_detail_popup expects.
|
||||||
|
var data := unit.duplicate()
|
||||||
|
data["movementPoints"] = unit.get("maxMp", null)
|
||||||
|
# Null-safe abilitiesJson → abilities alias (popup reads "abilities" key).
|
||||||
|
var _raw_abil_udp = unit.get("abilitiesJson")
|
||||||
|
data["abilities"] = "" if _raw_abil_udp == null else str(_raw_abil_udp)
|
||||||
|
_card_detail_popup.show_card(data, data)
|
||||||
|
|
||||||
# ── Hand card ArchSpirit routing ──────────────────────────────────────────────
|
# ── Hand card ArchSpirit routing ──────────────────────────────────────────────
|
||||||
|
|
||||||
func _on_hand_card_clicked(iid: String, _panel: PanelContainer) -> void:
|
func _on_hand_card_clicked(iid: String, _panel: PanelContainer) -> void:
|
||||||
@@ -1291,7 +1319,8 @@ func _on_hold_timer_fired() -> void:
|
|||||||
int(unit.get("currentDefense", 0)), int(unit.get("maxDefense", 0)),
|
int(unit.get("currentDefense", 0)), int(unit.get("maxDefense", 0)),
|
||||||
int(unit.get("damage", 0))]
|
int(unit.get("damage", 0))]
|
||||||
var abil_str := ""
|
var abil_str := ""
|
||||||
var parsed = JSON.parse_string(unit.get("abilitiesJson", "[]"))
|
var _raw_abil_hud = unit.get("abilitiesJson")
|
||||||
|
var parsed = JSON.parse_string("[]" if _raw_abil_hud == null else str(_raw_abil_hud))
|
||||||
if parsed is Array:
|
if parsed is Array:
|
||||||
for ab: Dictionary in parsed:
|
for ab: Dictionary in parsed:
|
||||||
abil_str += "• %s\n" % str(ab.get("name", ""))
|
abil_str += "• %s\n" % str(ab.get("name", ""))
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public static class AbilitySystem
|
|||||||
var def = abilities[i];
|
var def = abilities[i];
|
||||||
if (def.Type != AbilityType.Triggered) continue;
|
if (def.Type != AbilityType.Triggered) continue;
|
||||||
if (def.TriggerEvent is null) continue;
|
if (def.TriggerEvent is null) continue;
|
||||||
if (!TriggerMatches(def.TriggerEvent, occurrence, state, ownerId)) continue;
|
if (!TriggerMatches(def.TriggerEvent, occurrence, state, ownerId, unit)) continue;
|
||||||
|
|
||||||
var ctx = new AbilityContext
|
var ctx = new AbilityContext
|
||||||
{
|
{
|
||||||
@@ -1387,7 +1387,10 @@ public static class AbilitySystem
|
|||||||
_ => false,
|
_ => false,
|
||||||
},
|
},
|
||||||
TierIsFilter tif => card.Tier == tif.Tier,
|
TierIsFilter tif => card.Tier == tif.Tier,
|
||||||
IsSelfFilter => ctx.Source is not null && card.InstanceId == ctx.Source.InstanceId,
|
// IsSelf: definition-level match (any instance of the same card definition).
|
||||||
|
IsSelfFilter => ctx.Source is not null && card.CardDefinitionId == ctx.Source.CardDefinitionId,
|
||||||
|
// IsExactSelf: instance-level match (only this specific unit on the battlefield).
|
||||||
|
IsExactSelfFilter => ctx.Source is not null && card.InstanceId == ctx.Source.InstanceId,
|
||||||
HealthBelowFilter hbf => (card.CurrentHealth ?? 0) < hbf.N,
|
HealthBelowFilter hbf => (card.CurrentHealth ?? 0) < hbf.N,
|
||||||
HealthAboveFilter haf => (card.CurrentHealth ?? 0) > haf.N,
|
HealthAboveFilter haf => (card.CurrentHealth ?? 0) > haf.N,
|
||||||
_ => true,
|
_ => true,
|
||||||
@@ -1395,91 +1398,109 @@ public static class AbilitySystem
|
|||||||
|
|
||||||
// ── Trigger matching ──────────────────────────────────────────────────────
|
// ── Trigger matching ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
/// <param name="evaluatingUnit">
|
||||||
|
/// The specific battlefield unit whose trigger is being evaluated.
|
||||||
|
/// Required for the "ExactSelf" ownership scope — fire only when this unit
|
||||||
|
/// is the source of the event (occ.Data.SourceId == evaluatingUnit.InstanceId).
|
||||||
|
/// </param>
|
||||||
private static bool TriggerMatches(
|
private static bool TriggerMatches(
|
||||||
TriggerEvent trigger, TriggerOccurrence occurrence, GameState state, string ownerId)
|
TriggerEvent trigger, TriggerOccurrence occurrence, GameState state, string ownerId,
|
||||||
=> trigger switch
|
FieldCard? evaluatingUnit = null)
|
||||||
|
{
|
||||||
|
var uid = evaluatingUnit?.InstanceId;
|
||||||
|
return trigger switch
|
||||||
{
|
{
|
||||||
OnTurnStartTrigger t =>
|
OnTurnStartTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.TurnStart
|
occurrence.Kind == TriggerEventKind.TurnStart
|
||||||
&& Own(t.Player, occurrence, ownerId, state),
|
&& Own(t.Player, occurrence, ownerId, state, uid),
|
||||||
OnTurnEndTrigger t =>
|
OnTurnEndTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.TurnEnd
|
occurrence.Kind == TriggerEventKind.TurnEnd
|
||||||
&& Own(t.Player, occurrence, ownerId, state),
|
&& Own(t.Player, occurrence, ownerId, state, uid),
|
||||||
OnUnitDeathTrigger t =>
|
OnUnitDeathTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.UnitDeath
|
occurrence.Kind == TriggerEventKind.UnitDeath
|
||||||
&& UnitType(t.UnitType, occurrence.UnitType)
|
&& UnitType(t.UnitType, occurrence.UnitType)
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnDamageDealtTrigger =>
|
OnDamageDealtTrigger =>
|
||||||
occurrence.Kind == TriggerEventKind.DamageDealt,
|
occurrence.Kind == TriggerEventKind.DamageDealt,
|
||||||
OnUnitEnterBattlefieldTrigger t =>
|
OnUnitEnterBattlefieldTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.UnitEnterBattlefield
|
occurrence.Kind == TriggerEventKind.UnitEnterBattlefield
|
||||||
&& UnitType(t.UnitType, occurrence.UnitType)
|
&& UnitType(t.UnitType, occurrence.UnitType)
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnUnitLeaveBattlefieldTrigger t =>
|
OnUnitLeaveBattlefieldTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.UnitLeaveBattlefield
|
occurrence.Kind == TriggerEventKind.UnitLeaveBattlefield
|
||||||
&& UnitType(t.UnitType, occurrence.UnitType)
|
&& UnitType(t.UnitType, occurrence.UnitType)
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnSPGainedTrigger t =>
|
OnSPGainedTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.SPGained
|
occurrence.Kind == TriggerEventKind.SPGained
|
||||||
&& Own(t.Player, occurrence, ownerId, state),
|
&& Own(t.Player, occurrence, ownerId, state, uid),
|
||||||
OnSPSpentTrigger t =>
|
OnSPSpentTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.SPSpent
|
occurrence.Kind == TriggerEventKind.SPSpent
|
||||||
&& Own(t.Player, occurrence, ownerId, state),
|
&& Own(t.Player, occurrence, ownerId, state, uid),
|
||||||
OnSTGainedTrigger t =>
|
OnSTGainedTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.STGained
|
occurrence.Kind == TriggerEventKind.STGained
|
||||||
&& Own(t.Player, occurrence, ownerId, state),
|
&& Own(t.Player, occurrence, ownerId, state, uid),
|
||||||
OnSTSpentTrigger t =>
|
OnSTSpentTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.STSpent
|
occurrence.Kind == TriggerEventKind.STSpent
|
||||||
&& Own(t.Player, occurrence, ownerId, state),
|
&& Own(t.Player, occurrence, ownerId, state, uid),
|
||||||
OnCardDrawnTrigger t =>
|
OnCardDrawnTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.CardDrawn
|
occurrence.Kind == TriggerEventKind.CardDrawn
|
||||||
&& Own(t.Player, occurrence, ownerId, state),
|
&& Own(t.Player, occurrence, ownerId, state, uid),
|
||||||
OnUnitMoveTrigger t =>
|
OnUnitMoveTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.UnitMove
|
occurrence.Kind == TriggerEventKind.UnitMove
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnUnitAttackTrigger t =>
|
OnUnitAttackTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.UnitAttack
|
occurrence.Kind == TriggerEventKind.UnitAttack
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnSpiritSacrificedTrigger t =>
|
OnSpiritSacrificedTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.SpiritSacrificed
|
occurrence.Kind == TriggerEventKind.SpiritSacrificed
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnAscendTrigger t =>
|
OnAscendTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.Ascend
|
occurrence.Kind == TriggerEventKind.Ascend
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnTransitionTrigger t =>
|
OnTransitionTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.Transition
|
occurrence.Kind == TriggerEventKind.Transition
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnChanneledTrigger t =>
|
OnChanneledTrigger t =>
|
||||||
occurrence.Kind == TriggerEventKind.Channeled
|
occurrence.Kind == TriggerEventKind.Channeled
|
||||||
&& CardType(t.CardType, occurrence.CardType)
|
&& CardType(t.CardType, occurrence.CardType)
|
||||||
&& Own(t.Ownership, occurrence, ownerId, state),
|
&& Own(t.Ownership, occurrence, ownerId, state, uid),
|
||||||
OnEnterAuraRangeTrigger eat =>
|
OnEnterAuraRangeTrigger eat =>
|
||||||
occurrence.Kind == TriggerEventKind.EnterAuraRange
|
occurrence.Kind == TriggerEventKind.EnterAuraRange
|
||||||
&& Own(eat.AuraOwnership, occurrence, ownerId, state)
|
&& Own(eat.AuraOwnership, occurrence, ownerId, state, uid)
|
||||||
&& UnitOwnerMatches(eat.UnitOwnership, occurrence.Data?.TargetId, state, ownerId),
|
&& UnitOwnerMatches(eat.UnitOwnership, occurrence.Data?.TargetId, state, ownerId),
|
||||||
OnLeaveAuraRangeTrigger lat =>
|
OnLeaveAuraRangeTrigger lat =>
|
||||||
occurrence.Kind == TriggerEventKind.LeaveAuraRange
|
occurrence.Kind == TriggerEventKind.LeaveAuraRange
|
||||||
&& Own(lat.AuraOwnership, occurrence, ownerId, state)
|
&& Own(lat.AuraOwnership, occurrence, ownerId, state, uid)
|
||||||
&& UnitOwnerMatches(lat.UnitOwnership, occurrence.Data?.TargetId, state, ownerId),
|
&& UnitOwnerMatches(lat.UnitOwnership, occurrence.Data?.TargetId, state, ownerId),
|
||||||
OnRuinActivationTrigger rat =>
|
OnRuinActivationTrigger rat =>
|
||||||
occurrence.Kind == TriggerEventKind.RuinActivation
|
occurrence.Kind == TriggerEventKind.RuinActivation
|
||||||
&& Own(rat.RuinOwnership, occurrence, ownerId, state)
|
&& Own(rat.RuinOwnership, occurrence, ownerId, state, uid)
|
||||||
&& (rat.OccupantOwnership is null
|
&& (rat.OccupantOwnership is null
|
||||||
|| UnitOwnerMatches(rat.OccupantOwnership, occurrence.Data?.TargetId, state, ownerId)),
|
|| UnitOwnerMatches(rat.OccupantOwnership, occurrence.Data?.TargetId, state, ownerId)),
|
||||||
OnUnitOccupyRuinTrigger uor =>
|
OnUnitOccupyRuinTrigger uor =>
|
||||||
occurrence.Kind == TriggerEventKind.UnitOccupyRuin
|
occurrence.Kind == TriggerEventKind.UnitOccupyRuin
|
||||||
&& Own(uor.UnitOwnership, occurrence, ownerId, state),
|
&& Own(uor.UnitOwnership, occurrence, ownerId, state, uid),
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private static bool Own(string? scope, TriggerOccurrence occ, string unitOwnerId, GameState _)
|
/// <param name="evalUnitId">
|
||||||
|
/// Instance ID of the unit whose trigger is being evaluated.
|
||||||
|
/// Only used for the "ExactSelf" scope: the trigger fires only when this unit
|
||||||
|
/// is the specific unit that caused the event (occ.Data.SourceId == evalUnitId).
|
||||||
|
/// </param>
|
||||||
|
private static bool Own(string? scope, TriggerOccurrence occ, string unitOwnerId, GameState _,
|
||||||
|
string? evalUnitId = null)
|
||||||
=> (scope?.ToLowerInvariant()) switch
|
=> (scope?.ToLowerInvariant()) switch
|
||||||
{
|
{
|
||||||
null or "any" => true,
|
null or "any" => true,
|
||||||
"own" or "self" or "owner" => occ.ActorId == unitOwnerId,
|
"own" or "self" or "owner" => occ.ActorId == unitOwnerId,
|
||||||
"enemy" => occ.ActorId != unitOwnerId,
|
"enemy" => occ.ActorId != unitOwnerId,
|
||||||
"ally" => occ.ActorId == unitOwnerId,
|
"ally" => occ.ActorId == unitOwnerId,
|
||||||
_ => true,
|
// ExactSelf: fires only for the specific unit that performed the action.
|
||||||
|
// Requires occ.Data.SourceId to carry the acting unit's instance ID.
|
||||||
|
"exactself" => evalUnitId is not null && occ.Data?.SourceId == evalUnitId,
|
||||||
|
_ => true,
|
||||||
};
|
};
|
||||||
|
|
||||||
private static bool UnitOwnerMatches(
|
private static bool UnitOwnerMatches(
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ using SOR.Database.Enums;
|
|||||||
[JsonDerivedType(typeof(CardSTCostRangeFilter), "CardSTCostRange")]
|
[JsonDerivedType(typeof(CardSTCostRangeFilter), "CardSTCostRange")]
|
||||||
[JsonDerivedType(typeof(WithinRangeFilter), "WithinRange")]
|
[JsonDerivedType(typeof(WithinRangeFilter), "WithinRange")]
|
||||||
[JsonDerivedType(typeof(IsSelfFilter), "IsSelf")]
|
[JsonDerivedType(typeof(IsSelfFilter), "IsSelf")]
|
||||||
|
[JsonDerivedType(typeof(IsExactSelfFilter), "IsExactSelf")]
|
||||||
// ── Tile filters ─────────────────────────────────────────────────────────────
|
// ── Tile filters ─────────────────────────────────────────────────────────────
|
||||||
[JsonDerivedType(typeof(TileAffinityMatchesFilter), "TileAffinityMatches")]
|
[JsonDerivedType(typeof(TileAffinityMatchesFilter), "TileAffinityMatches")]
|
||||||
[JsonDerivedType(typeof(TileIsOccupiedFilter), "TileIsOccupied")]
|
[JsonDerivedType(typeof(TileIsOccupiedFilter), "TileIsOccupied")]
|
||||||
@@ -86,9 +87,18 @@ public sealed class CardSTCostRangeFilter : Filter { public int Min { get; set;
|
|||||||
/// <summary>Unit must be within Min..Max Manhattan distance of the ability's source unit.</summary>
|
/// <summary>Unit must be within Min..Max Manhattan distance of the ability's source unit.</summary>
|
||||||
public sealed class WithinRangeFilter : Filter { public int Min { get; set; } public int Max { get; set; } }
|
public sealed class WithinRangeFilter : Filter { public int Min { get; set; } public int Max { get; set; } }
|
||||||
|
|
||||||
/// <summary>Matches only the exact unit that owns this ability (not all friendly units).</summary>
|
/// <summary>
|
||||||
|
/// Matches any unit that shares the same card definition as the ability source.
|
||||||
|
/// Use for abilities that affect "all copies of this card type".
|
||||||
|
/// </summary>
|
||||||
public sealed class IsSelfFilter : Filter { }
|
public sealed class IsSelfFilter : Filter { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Matches only the exact unit instance that owns this ability (by InstanceId).
|
||||||
|
/// Use this instead of IsSelf when only the specific unit on the battlefield should be affected.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class IsExactSelfFilter : Filter { }
|
||||||
|
|
||||||
// ── Tile filter implementations ───────────────────────────────────────────────
|
// ── Tile filter implementations ───────────────────────────────────────────────
|
||||||
|
|
||||||
public sealed class TileAffinityMatchesFilter : Filter
|
public sealed class TileAffinityMatchesFilter : Filter
|
||||||
|
|||||||
Reference in New Issue
Block a user