pub struct RunParams {Show 84 fields
pub card: Option<CardId>,
pub card_lki: Option<CardId>,
pub cards: Option<Vec<CardId>>,
pub zone_changes: Option<Vec<ZoneChangeRecord>>,
pub change_zone_table: Option<CardZoneTable>,
pub origin: Option<ZoneType>,
pub destination: Option<ZoneType>,
pub destinations: Option<String>,
pub activator: Option<PlayerId>,
pub cause_player: Option<PlayerId>,
pub player: Option<PlayerId>,
pub phase: Option<PhaseType>,
pub damage_source: Option<CardId>,
pub damage_target_player: Option<PlayerId>,
pub damage_target_card: Option<CardId>,
pub target_player: Option<PlayerId>,
pub target_card: Option<CardId>,
pub damage_amount: Option<i32>,
pub is_combat_damage: Option<bool>,
pub first_time: Option<bool>,
pub fizzle: Option<bool>,
pub valiant: Option<bool>,
pub attacker: Option<CardId>,
pub attacked_player: Option<PlayerId>,
pub attacked_card: Option<CardId>,
pub other_attacker_ids: Option<Vec<CardId>>,
pub defenders_player_ids: Option<Vec<PlayerId>>,
pub defenders_card_ids: Option<Vec<CardId>>,
pub attacking_player: Option<PlayerId>,
pub defending_player: Option<PlayerId>,
pub spell_card: Option<CardId>,
pub spell_controller: Option<PlayerId>,
pub card2: Option<CardId>,
pub explored: Option<CardId>,
pub spell_ability: Option<SpellAbility>,
pub source_sa: Option<SpellAbility>,
pub ability_mana: Option<SpellAbility>,
pub cause: Option<SpellAbility>,
pub causer: Option<CardId>,
pub produced: Option<String>,
pub mode: Option<String>,
pub num: Option<i32>,
pub number: Option<i32>,
pub blocker: Option<CardId>,
pub blocked_attacker: Option<CardId>,
pub life_amount: Option<i32>,
pub counter_type: Option<String>,
pub counter_amount: Option<i32>,
pub attacker_ids: Option<Vec<CardId>>,
pub blocker_ids: Option<Vec<CardId>>,
pub original_controller: Option<PlayerId>,
pub mana_expend_amount: Option<i32>,
pub enlisted: Option<CardId>,
pub cause_card: Option<CardId>,
pub coin_flip_won: Option<bool>,
pub die_result: Option<i32>,
pub die_results: Option<Vec<i32>>,
pub natural_result: Option<i32>,
pub die_sides: Option<i32>,
pub num_attackers: Option<usize>,
pub exploited_card: Option<CardId>,
pub lki_p1p1_counters: Option<i32>,
pub lki_power: Option<i32>,
pub lki_toughness: Option<i32>,
pub cumulative_upkeep_paid: Option<bool>,
pub echo_paid: Option<bool>,
pub class_level: Option<i32>,
pub room_name: Option<String>,
pub crew_cards: Option<Vec<CardId>>,
pub championed_card: Option<CardId>,
pub source_card: Option<CardId>,
pub source_player: Option<PlayerId>,
pub object_card: Option<CardId>,
pub object_player: Option<PlayerId>,
pub counter_map: Option<BTreeMap<String, i32>>,
pub counter_table: Option<Vec<CounterTableEntry>>,
pub damage_map: Option<CardDamageMap>,
pub clash_won: Option<bool>,
pub card_state_name: Option<String>,
pub drawn_this_turn_snapshot: Option<i32>,
pub first_time_players: Option<Vec<PlayerId>>,
pub all_votes: Option<Vec<(String, Vec<PlayerId>)>>,
pub discarded_before: Option<Vec<CardId>>,
pub rolled_to_visit_attractions: Option<bool>,
}Expand description
Typed event parameter keys — mirrors Java AbilityKey enum. In Java this is Map<AbilityKey, Object>. In Rust we use a struct because Rust has no Object type (justified deviation).
Fields§
§card: Option<CardId>§card_lki: Option<CardId>§cards: Option<Vec<CardId>>Additional card collection payload used by many Java triggers (AbilityKey.Cards).
zone_changes: Option<Vec<ZoneChangeRecord>>Batched zone-change payload used by Java’s CardZoneTable triggers.
change_zone_table: Option<CardZoneTable>Java-style CardZoneTable object payload for batch zone-change triggers.
origin: Option<ZoneType>§destination: Option<ZoneType>§destinations: Option<String>CSV destination payload used by TriggerAbilityTriggered for batch triggers.
activator: Option<PlayerId>Java AbilityKey.Activator.
cause_player: Option<PlayerId>§player: Option<PlayerId>§phase: Option<PhaseType>§damage_source: Option<CardId>§damage_target_player: Option<PlayerId>§damage_target_card: Option<CardId>§target_player: Option<PlayerId>Java AbilityKey.Target payload split by target type.
target_card: Option<CardId>§damage_amount: Option<i32>§is_combat_damage: Option<bool>§first_time: Option<bool>Java AbilityKey.FirstTime marker.
fizzle: Option<bool>Java AbilityKey.Fizzle marker.
valiant: Option<bool>Java AbilityKey.Valiant marker.
attacker: Option<CardId>§attacked_player: Option<PlayerId>Java AbilityKey.Attacked split by entity type.
attacked_card: Option<CardId>§other_attacker_ids: Option<Vec<CardId>>Java AbilityKey.OtherAttackers.
defenders_player_ids: Option<Vec<PlayerId>>Java AbilityKey.Defenders split by entity type.
defenders_card_ids: Option<Vec<CardId>>§attacking_player: Option<PlayerId>Java AbilityKey.AttackingPlayer.
defending_player: Option<PlayerId>§spell_card: Option<CardId>§spell_controller: Option<PlayerId>§card2: Option<CardId>Second card involved (e.g. second creature in a Fight trigger).
explored: Option<CardId>Java AbilityKey.Explored.
spell_ability: Option<SpellAbility>SpellAbility that was countered
source_sa: Option<SpellAbility>Java AbilityKey.SourceSA.
ability_mana: Option<SpellAbility>Java AbilityKey.AbilityMana.
cause: Option<SpellAbility>Cause of the event (e.g. counterspell)
causer: Option<CardId>Java AbilityKey.Causer payload.
produced: Option<String>Java AbilityKey.Produced.
mode: Option<String>Java AbilityKey.Mode.
num: Option<i32>Java AbilityKey.Num.
number: Option<i32>Java AbilityKey.Number.
blocker: Option<CardId>Blocking creature (for Blocks trigger).
blocked_attacker: Option<CardId>Attacker being blocked (for Blocks trigger).
life_amount: Option<i32>Life amount gained or lost (for LifeGained/LifeLost triggers).
counter_type: Option<String>Counter type name (for CounterAdded/CounterRemoved triggers).
counter_amount: Option<i32>Number of counters added/removed.
attacker_ids: Option<Vec<CardId>>Batch of attacker IDs (for AttackersDeclared).
blocker_ids: Option<Vec<CardId>>Batch of blocker IDs (for BlockersDeclared).
original_controller: Option<PlayerId>Original controller before a control change.
mana_expend_amount: Option<i32>Cumulative mana expend amount (for ManaExpend trigger).
enlisted: Option<CardId>Enlisted card (for TriggerType::Enlisted).
cause_card: Option<CardId>The spell/ability card that caused the event (for BecomesTarget — the targeting spell).
coin_flip_won: Option<bool>Coin-flip outcome (true = win/heads).
die_result: Option<i32>Rolled die result (modified).
die_results: Option<Vec<i32>>Batch of rolled die results (for RolledDieOnce aggregate triggers).
natural_result: Option<i32>Rolled die natural result before modifiers.
die_sides: Option<i32>Number of sides on the rolled die.
num_attackers: Option<usize>Number of attackers declared this combat (for Exalted Alone$ True check).
exploited_card: Option<CardId>The creature that was exploited (for Exploited trigger).
lki_p1p1_counters: Option<i32>LKI +1/+1 counter count on a card that just left the battlefield. Used by Modular triggers to know how many counters to move.
lki_power: Option<i32>LKI power on a card that just left the battlefield. Used for TriggeredCard$CardPower without depending on mutable card state.
lki_toughness: Option<i32>LKI toughness on a card that just left the battlefield. Used for TriggeredCard$CardToughness without depending on mutable card state.
cumulative_upkeep_paid: Option<bool>Whether cumulative upkeep was paid (for PayCumulativeUpkeep trigger).
echo_paid: Option<bool>Whether echo was paid (for PayEcho trigger).
class_level: Option<i32>Gained class level value.
room_name: Option<String>Room name payload for room-enter triggers.
crew_cards: Option<Vec<CardId>>Cards that crewed/saddled another card.
championed_card: Option<CardId>Championed card payload.
source_card: Option<CardId>Generic source card payload for triggers like Mentored.
source_player: Option<PlayerId>Generic source player payload for triggers like CounterPlayerAddedAll.
object_card: Option<CardId>Generic object card payload for triggers like CounterTypeAddedAll.
object_player: Option<PlayerId>Generic object player payload for triggers like CounterTypeAddedAll.
counter_map: Option<BTreeMap<String, i32>>Counter type -> amount map payload.
counter_table: Option<Vec<CounterTableEntry>>§damage_map: Option<CardDamageMap>Java AbilityKey.DamageMap.
clash_won: Option<bool>Clash outcome.
card_state_name: Option<String>Card state name payload (for door/room state specific checks).
drawn_this_turn_snapshot: Option<i32>Snapshot of drawn_this_turn at the time a Drawn event fires.
Used by Number$ N triggers to compare against the exact draw count
at fire time (not at deferred match time).
first_time_players: Option<Vec<PlayerId>>Players for whom this was the first relevant event this turn.
all_votes: Option<Vec<(String, Vec<PlayerId>)>>Java AbilityKey.AllVotes.
discarded_before: Option<Vec<CardId>>Java AbilityKey.DiscardedBefore.
rolled_to_visit_attractions: Option<bool>Java AbilityKey.RolledToVisitAttractions.
Implementations§
Source§impl RunParams
impl RunParams
pub fn add_common_trigger_objects(&self, sa: &mut SpellAbility)
pub fn get_value(&self, key: AbilityKey) -> Option<AbilityValue>
pub fn as_ability_map(&self) -> HashMap<AbilityKey, AbilityValue>
Sourcepub fn get(&self, key: AbilityKey) -> Option<AbilityValue>
pub fn get(&self, key: AbilityKey) -> Option<AbilityValue>
Java-parity alias for Map<AbilityKey, Object>.get(...).
Sourcepub fn get_card(&self, key: AbilityKey) -> Option<CardId>
pub fn get_card(&self, key: AbilityKey) -> Option<CardId>
Get a card ID from run-params by AbilityKey.
Provides a generic accessor so code can use AbilityKey enum values
to pull data from the typed struct.
Sourcepub fn get_player(&self, key: AbilityKey) -> Option<PlayerId>
pub fn get_player(&self, key: AbilityKey) -> Option<PlayerId>
Get a player ID from run-params by AbilityKey.
Sourcepub fn get_amount(&self, key: AbilityKey) -> Option<i32>
pub fn get_amount(&self, key: AbilityKey) -> Option<i32>
Get an integer amount from run-params by AbilityKey.
Sourcepub fn get_bool(&self, key: AbilityKey) -> Option<bool>
pub fn get_bool(&self, key: AbilityKey) -> Option<bool>
Get a bool marker by AbilityKey.
Sourcepub fn get_spell_ability(&self, key: AbilityKey) -> Option<&SpellAbility>
pub fn get_spell_ability(&self, key: AbilityKey) -> Option<&SpellAbility>
Get a SpellAbility by AbilityKey.
Sourcepub fn get_cards(&self, key: AbilityKey) -> Option<&[CardId]>
pub fn get_cards(&self, key: AbilityKey) -> Option<&[CardId]>
Get a card list by AbilityKey.
Sourcepub fn get_string(&self, key: AbilityKey) -> Option<&str>
pub fn get_string(&self, key: AbilityKey) -> Option<&str>
Get a string payload by AbilityKey.