Skip to main content

Module ability_factory

Module ability_factory 

Source
Expand description

AbilityFactory — factory for creating spell abilities from card scripts.

Mirrors Java’s AbilityFactory.java. Parses ability strings (AB$, SP$, DB$, ST$ prefixed) and constructs the corresponding SpellAbility with all sub-abilities resolved.

Enums§

AbilityRecordType
The record type prefix for an ability definition. Mirrors Java’s AbilityFactory.AbilityRecordType.

Constants§

ADDITIONAL_ABILITY_KEYS
Keys used for additional sub-abilities in ability scripts. Mirrors Java’s AbilityFactory.additionalAbilityKeys.

Functions§

adjust_change_zone_target
Adjust the change-zone target for effects that move cards between zones. Mirrors Java’s AbilityFactory.adjustChangeZoneTarget(MapOfParams, SpellAbility).
build_fused_ability
Build a fused spell ability for split/fused cards. Mirrors Java’s AbilityFactory.buildFusedAbility(Card).
build_spell_ability
Build a SpellAbility chain from a card’s ability text, walking SubAbility$ SVars to construct the linked list. Mirrors Java’s AbilityFactory.getAbility() + sub-ability chain construction.
build_spell_ability_for_card_cast
Build a spell ability for card-casting contexts.
build_spell_ability_from_host_card
Build a SpellAbility chain from script text using a concrete host card.
get_ability
Java-name alias for build_spell_ability_from_host_card. Mirrors AbilityFactory.getAbility(String abString, Card card).
get_map_params
Parse a pipe-delimited ability string into a key-value map. Mirrors Java’s AbilityFactory.getMapParams().
parse_ability_cost
Parse the cost of an ability from its parameters. Mirrors Java’s AbilityFactory.parseAbilityCost(Card, MapOfParams, RecordType).