Skip to main content

Module svar

Module svar 

Source

Functions§

evaluate_svar
Evaluate a simple SVar expression. Supports Count$Kicked.A.B (returns A if kicked, B otherwise) and Count$KickedCount (returns the multikicker count).
player_condition_matches
resolve_cost_amount_svar
Resolve a cost-adjustment Amount$ <ident> slot. Tries a direct integer parse first, then looks up ident on the host’s SVar table and routes through the subset of Count$… patterns relevant for cost adjustment. Mirrors Java AbilityUtils.calculateAmount(host, name, staticAbility) for the static-ability path. Owned by svar/ so cost callers don’t reimplement SVar walking.
resolve_count_svar
Resolve a Count$ SVar expression that requires game state access. Handles patterns like Count$Valid Forest.YouCtrl, Count$Converge, Count$CardPower, etc.
resolve_count_svar_for_sa
resolve_numeric_svar
Resolve a numeric parameter from a SpellAbility, expanding SVar references.
resolve_numeric_value
Resolve a raw numeric DSL value using the same semantics as resolve_numeric_svar, without first looking it up in sa.params.