Skip to content

add Chain namespace#1258

Open
that-hatter wants to merge 3 commits intomasterfrom
chain-namespace
Open

add Chain namespace#1258
that-hatter wants to merge 3 commits intomasterfrom
chain-namespace

Conversation

@that-hatter
Copy link
Copy Markdown
Member

@that-hatter that-hatter commented May 2, 2026

  • Added a Chain namespace for functions related to Chains and Chain Links.
  • Broke down Duel.GetChainInfo into multiple functions that retrieve one thing, making it more modular and friendlier to documentation/typing.
    • Also added equivalent checker functions for triggering properties.
    • Also added functions for retrieving and checking "dynamic" Chain properties (refers to the current properties if the card is still the same copy, otherwise refers to the triggering properties).
  • Added a mechanism for associating an arbitrary amount of information to a specific Chain Link, as opposed to Effect.SetLabel and Effect.SetLabelObject (which are associated to the effect itself), and Duel.SetTargetParam (which only allows saving one value).
  • Moved existing Chain-related functions to the new namespace. The old names should eventually be deprecated.
  • Updated several cards to use the new Chain functions:
    • All cards that use CHAININFO_TRIGGERING_SETCODES.

@that-hatter that-hatter requested a review from pyrQ as a code owner May 2, 2026 22:32
* Added sepatate `Chain.GetTriggeringLocationSymbolic` and `Chain.GetTriggeringSequenceSymbolic`.
* Made `Chain.GetTriggeringType` and `Chain.IsTriggeringType` only refer to `CHAININFO_TRIGGERING_TYPE`. Separate functions may be added later for `CHAININFO_TYPE` and `CHAININFO_EXTTYPE` when they're needed.
* Integrated symbolic locations into `Chain.IsTriggeringLocation` to be consistent with `Card.IsLocation`.
    * Symbolic sequences, however, are not integrated into `Chain.IsTriggeringSequence`, and there's no separate function for it (it's currently unused).
* Added `Chain.IsTriggeringEffect`.
* Minor optimization: Since all chain info functions only pass a single param now, removed variadic args handling from `chaininfo_fn` .
* Used Lua's `select` function for `chain_event_fn`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant