Skip to main content

manabrew_engine/card/
filter_constants.rs

1//! Constants for card filter strings used in ValidCard$, Affected$, ValidBlocker$, etc.
2//!
3//! These replace scattered magic strings throughout the engine. Using constants
4//! prevents typos and makes it easy to find all usages.
5
6// Card type filters
7pub const CREATURE: &str = "Creature";
8pub const LAND: &str = "Land";
9pub const PERMANENT: &str = "Permanent";
10pub const SPELL: &str = "Spell";
11pub const CARD: &str = "Card";
12pub const ARTIFACT: &str = "Artifact";
13pub const ENCHANTMENT: &str = "Enchantment";
14pub const PLANESWALKER: &str = "Planeswalker";
15pub const INSTANT: &str = "Instant";
16pub const SORCERY: &str = "Sorcery";
17
18// Controller/ownership qualifiers
19pub const YOU_CTRL: &str = "YouCtrl";
20pub const YOU_CONTROL: &str = "YouControl";
21pub const OPP_CTRL: &str = "OppCtrl";
22pub const OPPONENT_CTRL: &str = "OpponentCtrl";
23pub const YOU_DONT_CTRL: &str = "YouDontCtrl";
24
25// Player references
26pub const PLAYER: &str = "Player";
27pub const YOU: &str = "You";
28pub const OPPONENT: &str = "Opponent";
29pub const ALL: &str = "All";
30pub const EACH: &str = "Each";
31pub const DEFENDING_PLAYER: &str = "DefendingPlayer";
32
33// Self reference
34pub const CARD_SELF: &str = "Card.Self";
35pub const SELF_REF: &str = "Self";
36pub const OTHER: &str = "Other";
37
38// Boolean-like values
39pub const TRUE: &str = "True";
40pub const FALSE: &str = "False";
41pub const ANY: &str = "Any";
42
43// Type qualifiers
44pub const NON_LAND: &str = "nonLand";
45pub const NON_CREATURE: &str = "nonCreature";
46pub const NON_ARTIFACT: &str = "nonArtifact";
47pub const BASIC: &str = "Basic";
48
49// Combat qualifiers
50pub const ATTACKING: &str = "attacking";
51pub const KICKED: &str = "kicked";
52pub const WITH_FLYING: &str = "withFlying";
53
54// SpellAbility kind tokens (used by `SpellAbility.isValid` — TargetType$ /
55// SubAbilityKind$ / SubType$ filters). Mirror Java SpellAbility.isValid:2194-2236.
56pub const ABILITY: &str = "Ability";
57pub const TRIGGERED: &str = "Triggered";
58pub const ACTIVATED: &str = "Activated";
59pub const STATIC: &str = "Static";
60pub const LAND_ABILITY: &str = "LandAbility";
61pub const SPELL_ABILITY: &str = "SpellAbility";
62
63// SpellAbility property qualifiers (after the `.` in tokens like
64// `Spell.singleTarget`). Mirror Java ForgeScript.spellAbilityHasProperty.
65pub const SINGLE_TARGET: &str = "singleTarget";