Skip to main content

Module replacement_effect

Module replacement_effect 

Source
Expand description

Replacement effect parsing and types.

Mirrors the Java Forge forge/game/replacement/ package, specifically ReplacementEffect.java.

Card scripts encode replacement effects as R$-prefixed lines, e.g.:

R$ Event$ DamageDone | ActiveZones$ Battlefield | ValidCard$ Card.Self | Prevent$ True | Description$ Prevent all damage dealt to ~.
R$ Event$ Draw | ValidPlayer$ You | Description$ Skip your draw step.
R$ Event$ Moved | Destination$ Graveyard | Origin$ Battlefield | ValidCard$ Card.Self | Description$ If ~ would die, exile it instead.
R$ Event$ Destroy | ValidCard$ Card.Self | Description$ ~ is indestructible.

Re-exports§

pub use crate::player::GameLossReason;
pub use super::replacement_layer::ReplacementLayer;
pub use super::replacement_type::ReplacementType;

Structs§

ReplacementEffect
A parsed replacement effect from an R$ line in a card script.
ReplacementEffectIr

Enums§

ReplacementChainIr

Functions§

parse_replacement_effect
Parse an R$ (or R:) replacement-effect line from a card script.
zone_matches
Check if a zone name string matches zone.