Card.IsRelateToEffect
Signature
lua
Card.IsRelateToEffect(Card c, Effect e) -> boolDescription
Checks whether c is still related to effect e. When an effect enters the Chain, its handler and cards selected with Duel.SetTargetCard or Duel.SelectTarget are related to that effect. That relation is normally lost once the card leaves its expected place.
Parameters
cCard- Card whose relation is checked.eEffect- Effect relation to test against.
Returns
bool- True if c still has relation to e.
Source
D:\Programs\GitHub\ygopro-core\libcard.cpp:3617
Guided Examples
Learn how to use this function in context:
- Beginner Script Ladder
- Client UI And Prompt Behavior
- Common Script Errors And Debugging
- Counter Traps
- Write Your First Custom Card
- First Scripts To Study
More guided lessons (4)
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 6854 indexed script(s).
- Search this function in the Script Explorer with
Card.IsRelateToEffect.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.lua
lua
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Equip(tp,c,tc) thenPendulum Evolution (55795155)
Source: Scripts/c55795155.lua
lua
function c55795155.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)Astrograph Sorcerer (76794549)
Source: Scripts/c76794549.lua
lua
function c76794549.rpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(76794549,6))
local g=Duel.SelectMatchingCard(tp,c76794549.rpfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)