local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_BATTLE_DESTROYED)
e4:SetCondition(c220200329.condition)
e4:SetTarget(c220200329.target)
e4:SetOperation(c220200329.activate)
c:RegisterEffect(e4)
function c220200329.cfilter(c,tp)
return c:IsCord(220200347) and c:GetPreviousControler()==tp
end
function c220200329.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c220200329.cfilter,1,nil,tp)
end
function c220200329.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c220200329.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
if dg:GetCount()>0 then
if Duel.Destroy(dg,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
end
EXからXモンスターをX召喚扱いとして特殊召喚する。その後デッキからモンスターを1枚選びそのモンスターのX素材にできる。
という効果を作りたくて下のスクリプトを作ったのですがX召喚扱いになりません。理由が分からないのですが教えて頂けませんか?
function c10011.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c10011.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
ct=Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
if ct>0 then
local fg=Duel.GetMatchingGroup(c10011.matfilter,tp,LOCATION_DECK,0,nil,e,tp,false,false)
if fg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(10011,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c10011.matfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
end
function cyugioh.matfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsLinkAttribute(ATTRIBUTE_FIRE)
end
function cyugioh.filter(c,e,tp)
return c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function cyugioh.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cyugioh.filter(chkc,e,tp) end
if chk==0 then return (Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0)
and Duel.IsExistingTarget(cyugioh.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cyugioh.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cyugioh.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
function cyugioh.damfilter(c,e,tp)
return c:IsFaceup() and c:IsControler(1-tp) and c:IsType(TYPE_LINK) and (not e or c:IsRelateToEffect(e))
end
function cyugioh.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cyugioh.damfilter,1,nil,nil,tp) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,eg,eg:GetCount(),0,0)
end
function cyugioh.operation(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cyugioh.damfilter,nil,e,tp)
local dam=g:GetSum(Card.GetBaseAttack)
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
function cyugioh.linkfilter(c)
return c:IsCode(yugioh)
end
function cyugioh.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and c:GetMaterial():IsExists(cyugioh.linkfilter,1,nil)
end
function cyugioh.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function cyugioh.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function cyugioh.bdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>100 end
local lp=Duel.GetLP(tp)
e:SetLabel((lp-100)/1000)
Duel.PayLPCost(tp,lp-100)
end
function cyugioh.bdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,e:GetLabel()) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,e:GetLabel())
end
function cyugioh.bdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetOwner()
local bd=e:GetLabel()
Duel.Draw(tp,bd-1,REASON_RULE)
end
function cyugioh.sdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetOwner()==Duel.GetTurnPlayer() and Duel.GetTurnCount()~=1
end
※以下例文
function cyugioh.bdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetOwner()
local bd=e:GetLabel()
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(yugioh,0))
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(yugioh,1))
Duel.Draw(tp,bd-1,REASON_RULE)
end
function cyugioh.initial_effect(c)
--trickster fraud
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e3:SetCountLimit(1,yugioh+EFFECT_COUNT_CODE_DUEL)
e3:SetCondition(cyugioh.tfcon)
e3:SetTarget(cyugioh.tftg)
e3:SetOperation(cyugioh.tfop)
e3:SetRange(0xff)
c:RegisterEffect(e3)
end
function cyugioh.tfcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function cyugioh.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
local ht=Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)
if chk==0 then return (ht<3 and Duel.IsPlayerCanDraw(1-tp,3-ht)) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,3-ht)
end
function cyugioh.tfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetOwner()
local g=Group.CreateGroup()
local ht1=Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)
if ht1<3 then
Duel.Draw(1-tp,3-ht1,REASON_RULE)
--Remove
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(0xff)
e1:SetCountLimit(1)
e1:SetTarget(cyugioh.remtg)
e1:SetOperation(cyugioh.remop)
Duel.RegisterEffect(e1,tp)
end
end
function cyugioh.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
end
function cyugioh.remop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ht2=Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_GRAVE,0,nil,0xfb)
if ht2==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_HAND,ht2,ht2,nil)
if rg:GetCount()>0 then
Duel.Remove(rg,POS_FACEUP,REASON_RULE)
end
end
function cyugioh.initial_effect(c)
--Storm Access
local e1=Effect.CreateEffect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,yugioh+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(cyugioh.sacon)
e1:SetTarget(cyugioh.satg)
e1:SetOperation(cyugioh.saop)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetRange(0xff)
c:RegisterEffect(e1)
end
function cyugioh.sacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=1000
end
function cyugioh.satg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(tp)
end
function cyugioh.saop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.AnnounceCard(tp,TYPE_LINK)
local token=Duel.CreateToken(tp,tc,nil,nil,nil,nil,nil,nil)
if token then
Duel.SendtoDeck(token,nil,0,REASON_RULE)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
end
end
function cyugioh.initial_effect(c)
--Master Storm Access
local e1=Effect.CreateEffect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCountLimit(1)
e1:SetTarget(cyugioh.msatg)
e1:SetOperation(cyugioh.msaop)
e1:SetRange(0xff)
c:RegisterEffect(e1)
end
function cyugioh.msatg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(tp)
Duel.SetChainLimit(cyugioh.chainlimit)
end
function cyugioh.chainlimit(e,te,rp,tp)
return not e:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cyugioh.msaop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cyugioh.announce_filter={RACE_CYBERSE,OPCODE_ISRACE,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_AND}
local tc=Duel.AnnounceCardFilter(tp,table.unpack(cyugioh.announce_filter))
local token=Duel.CreateToken(tp,tc,nil,nil,nil,nil,nil,nil)
if token then
Duel.SendtoDeck(token,nil,0,REASON_RULE)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
end
end
--バレット&カートリッジ
function cYugioh.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTarget(cYugioh.tg)
e1:SetOperation(cYugioh.op)
c:RegisterEffect(e1)
end
function cYugioh.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,4,nil) and Duel.IsPlayerCanDraw(tp,1)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,4,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cYugioh.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_DECK,0,4,4,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,4,REASON_EFFECT) end
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if c:IsRelateToEffect(e) then
Duel.Draw(p,1,REASON_EFFECT)
Duel.BreakEffect()
c:CancelToGrave()
Duel.ShuffleDeck(tp)
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_HAND)
e1:SetCondition(cYugioh.descon)
e1:SetTarget(cYugioh.destg)
e1:SetOperation(cYugioh.desop)
e1:SetReset(RESET_EVENT+0x1de0000)
c:RegisterEffect(e1)
end
end
function cYugioh.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DRAW)
end
function cYugioh.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function cYugioh.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
イベントコードのEVENT_STARTUPって使えないのでしょうか?下のテキストだとうまく動いてくれるのですが、PREDRAWをSTARTUPにすると動いてくれません。
constantにあるので使えると思うのですが何か条件があるのでしょうか?よろしければ教えてください
function c10022.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_PREDRAW)
e0:SetCountLimit(1,10022+EFFECT_COUNT_CODE_DUEL)
e0:SetRange(LOCATION_DECK)
e0:SetOperation(c10022.op)
c:RegisterEffect(e0)
end
function c10022.rfilter(c)
return c:IsCode(10022)
end
function c10022.op(e,tp,eg,ep,ev,re,r,rp,chk)
local dc=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.ShuffleDeck(tp)
end
①の効果は1ターンに2度までしか使用できない。
①:自分のデッキ・手札・フィールドからチューナー1体とチューナー以外のモンスターを任意の数だけ墓地へ送り、
墓地へ送ったモンスターのレベルの合計と同じレベルを持つSモンスター1体を、エクストラデッキからS召喚扱いで特殊召喚する。
②:このカードが墓地に存在する場合、自分の墓地の「シンクロ・フュージョン」以外のカードを3枚除外して発動できる。
墓地のこのカードを手札に加える。
というカードのスクリプトを作ったのですが、デッキのモンスターのレベル的に特殊召喚できないはずのSモンスターを選択出来て、
その後[Script Error]: [string "./script/c134217715.lua"]:49: attempt to index a nil value とエラーを吐いてしまいます、何処をどうすればいいのか教えてください。
--シンクロ・フュージョン
function c134217715.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(2,134217715+EFFECT_COUNT_CODE_OATH)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c134217715.activate)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetDescription(aux.Stringid(134217715,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c134217715.thcost)
e2:SetTarget(c134217715.thtg)
e2:SetOperation(c134217715.thop)
c:RegisterEffect(e2)
end
function c134217715.filter1(c,e,tp)
local lv=c:GetLevel()
return c:IsType(TYPE_SYNCHRO) and lv<13
and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c134217715.filter2(c,tp,lv)
local rlv=lv-c:GetLevel()
local rg=Duel.GetMatchingGroup(c134217715.filter3,tp,LOCATION_ONFIELD+LOCATION_DECK+LOCATION_HAND,0,c)
return rlv>0 and c:IsType(TYPE_TUNER) and rg:CheckWithSumEqual(Card.GetLevel,rlv,1,63)
end
function c134217715.filter3(c)
return c:GetLevel()>0 and not c:IsType(TYPE_TUNER)
end
function c134217715.activate(e,tp,eg,ep,ev,re,r,rp)
if aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
and Duel.IsExistingMatchingCard(c134217715.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(134217715,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c134217715.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local lv=g1:GetFirst():GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c134217715.filter2,tp,LOCATION_ONFIELD+LOCATION_DECK+LOCATION_HAND,0,1,1,nil,tp,lv)
local rlv=lv-g2:GetFirst():GetLevel()
local rg=Duel.GetMatchingGroup(c134217715.filter3,tp,LOCATION_ONFIELD+LOCATION_DECK+LOCATION_HAND,0,g2:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g3=rg:SelectWithSumEqual(tp,Card.GetLevel,rlv,1,63)
g2:Merge(g3)
Duel.SendtoGrave(g2,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
Duel.SpecialSummon(g1,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
g1:GetFirst():CompleteProcedure()
end
end
function c134217715.thfilter(c)
return c:IsAbleToRemoveAsCost() and not c:IsCode(134217715)
end
function c134217715.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c134217715.thfilter,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c134217715.thfilter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c134217715.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c134217715.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end