add Chain namespace#1258
Open
that-hatter wants to merge 19 commits into
Open
Conversation
* 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`.
* Renamed `Chain.Info` to `Chain.Data` to avoid confusion with existing "chain info" functions
* overwrote `Debug.ReloadFIleBegin` to avoid having the tracking global effect deleted
* allowed `Chain.Data` to take an optional `key` parameter, which makes it return different tables associated to the same chain link, avoiding potential conflicts when two effects try to access the same chain link data
* by passing `nil` as key, a "shared" table can be accessed
* added `Effect.GetChainData` which passes the effect as the `key` to `Chain.Data`
* `Cost.Choice` now stores the selected choice as chain data, instead of a label * `Cost.DetachFromSelf` now stores the detached material as chain data
* added tracking for "resolving properties": card properties at the start of resolution * added tracking for "registering peroperties": card properties when they register a Duel effect * integrated branches for resolving properties and registering properties in the various `Chain.Get...` and `Chain.Is...` functions * added `Effect.GetCard...` and `Effect.IsCard...` functions, which work similarly to `Chain.Get...`/`Chain.Is...`, but also handles rulings for non-activated effects * prevented `Debug.ReloadFieldBegin` from resetting global effects registered in the file * general file reorganization
- 'effect_card_prop' function: default to current properties - fusion proc: added the 'EFFECT_FLAG_IGNORE_IMMUNE' property to the global effects to prevent script errors with '"naffected by..." effects (should probably exclude global effects from the tracking altogether?) - updated some more cards to use effect properties: "cannot be destroyed by..." (e.g. "Number 76: Harmonizer Gradielle") and "cannot be targeted by..." (e.g. "Sea Stealth II")
- Chain.IsTriggeringSetcode: which param should and shouldn't be passed as a table was flipped - replaced 'Duel.GetCurrentChain' with 'Chain.GetCurrentLink' - Power Patron Shadow Beast Nervedo: also check 're:IsMonsterEffect()' - Evil★Twin Ki-sikil Deal: missing variable declaration - Trickstar Light Stage: simplify a bit by using the effect properties - use 'ev' + not triggering: Azamina Moa Regina Dracotail Gulamel Dead-End Power Patron Realm - Viraia
* added Level to CARD_PROPERTIES * added "composite type" and "exact type" functions * excluded global effects from dynamic properties
use Chain.IsTriggeringCompositeType
* added Effect.IsGlobalEffect * changed IsExactType to check if the card's type exactly matches the passed type(s) * added Card.IsCompositeType which has IsExactType's old behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chainnamespace for functions related to Chains and Chain Links.Duel.GetChainInfointo multiple functions that retrieve one thing, making it more modular and friendlier to documentation/typing.Effect.SetLabelandEffect.SetLabelObject(which are associated to the effect itself), andDuel.SetTargetParam(which only allows saving one value).CHAININFO_TRIGGERING_SETCODES.