--Wondertain Crossover function c212265.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Avoid battle damage local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetRange(LOCATION_FZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(c212265.filter) e2:SetValue(1) c:RegisterEffect(e2) --Draw local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(212265,0)) e3:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1,212265) e3:SetTarget(c212265.drawtg) e3:SetOperation(c212265.drawop) c:RegisterEffect(e3) --control local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(212265,1)) e4:SetCategory(CATEGORY_CONTROL+CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_FZONE) e4:SetCountLimit(1,212266) e4:SetTarget(c212265.cttg) e4:SetOperation(c212265.ctop) c:RegisterEffect(e4) end function c212265.filter(e,c) return c:IsSetCard(0x244d) end function c212265.cfilter(c) return c:IsSetCard(0x244d) end function c212265.drawtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,2) and Duel.IsExistingMatchingCard(c212265.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) end function c212265.drawop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.DiscardHand(tp,c212265.cfilter,1,1,REASON_EFFECT)>0 then Duel.Draw(tp,2,REASON_EFFECT) end end function c212265.ctfilter(c) local tp=c:GetControler() return c:IsFaceup() and c:IsSetCard(0x244d) and c:IsType(TYPE_LINK) and c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0 end function c212265.ctfilter2(c) local tp=c:GetControler() return c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0 end function c212265.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(c212265.ctfilter2,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingTarget(c212265.ctfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g1=Duel.SelectTarget(tp,c212265.ctfilter2,tp,0,LOCATION_MZONE,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g2=Duel.SelectTarget(tp,c212265.ctfilter,tp,LOCATION_MZONE,0,1,1,nil) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) end function c212265.ctop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local a=g:GetFirst() local b=g:GetNext() if a:IsRelateToEffect(e) and b:IsRelateToEffect(e) and Duel.SwapControl(a,b)~=0 then Duel.BreakEffect() Duel.Destroy(e:GetHandler(),REASON_EFFECT) end end