Commit e098bcfd authored by Tachibana's avatar Tachibana

ybb

parent e0294377
Pipeline #10954 passed with stages
in 39 minutes and 45 seconds
...@@ -63,13 +63,57 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -63,13 +63,57 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_HAND,0,1,nil,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local zg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_HAND,0,1,1,nil,tp)
local tc=zg:GetFirst()
if tc then
local b2=tc:GetActivateEffect():IsActivatable(tp)
if b2 then
if tc:IsType(TYPE_FIELD) then
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
Duel.Hint(HINT_CARD,0,tc:GetCode())
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
local tg=te:GetTarget()
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
tc:CreateEffectRelation(te)
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(event,true)
if tg then tg(e,tp,teg,tep,tev,tre,tr,trp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g then
local etc=g:GetFirst()
while etc do
etc:CreateEffectRelation(te)
etc=g:GetNext()
end
end
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
if etc then
etc=g:GetFirst()
while etc do
etc:ReleaseEffectRelation(te)
etc=g:GetNext()
end
end
if tc:GetType()==TYPE_SPELL or tc:GetType()==TYPE_TRAP or tc:IsType(TYPE_COUNTER+TYPE_QUICKPLAY) then
tc:CancelToGrave(false)
end
end
end
end end
end
function cm.thfilter(c,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and aux.IsCodeListed(c,m) and c:GetActivateEffect():IsActivatable(tp)
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment