Commit 533e5d7c authored by zengsxing's avatar zengsxing

Update c101205024.lua

parent d6654c03
...@@ -40,17 +40,19 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,17 +40,19 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function s.desfilter(c) function s.desfilter(c,tp)
return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c) local code=c:GetCode()
if c:IsControler(1-tp) then code=nil end
return c:IsControler(1-tp) and aux.NegateAnyFilter(c) and c:IsFaceup() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,nil) or c:IsControler(tp) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end end
function s.thfilter(c,tc) function s.thfilter(c,code)
return c:IsType(TYPE_FIELD) and c:IsAbleToHand() and (not tc or tc:IsControler(1-c:GetControler()) or not c:IsCode(tc:GetCode())) return c:IsType(TYPE_FIELD) and c:IsAbleToHand() and (not code or not c:IsCode(code))
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_FZONE) and (chkc:IsControler(1-tp)and chkc:IsFaceup() and aux.NegateAnyFilter(c) or Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,chkc) and chkc:IsControler(tp))end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,1,nil):GetFirst() local tc=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,1,nil,tp):GetFirst()
if tc:IsControler(tp) then if tc:IsControler(tp) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
else else
...@@ -62,8 +64,9 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,8 +64,9 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
local code=tc:GetCode()
if tc:IsControler(tp) and Duel.Destroy(tc,REASON_EFFECT)>0 then if tc:IsControler(tp) and Duel.Destroy(tc,REASON_EFFECT)>0 then
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,code)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
...@@ -80,11 +83,6 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,11 +83,6 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
Duel.AdjustInstantly() Duel.AdjustInstantly()
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
......
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