Commit f2654cad authored by POLYMER's avatar POLYMER

fix

parent bf7bc667
...@@ -104,11 +104,11 @@ end ...@@ -104,11 +104,11 @@ end
function c119828752.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c119828752.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c119828752.filter1 end if chkc then return chkc:IsOnField() and c119828752.filter1 end
if chk==0 then return Duel.IsExistingTarget(c119828752.filter1,tp,LOCATION_MZONE,0,1,nil) if chk==0 then return Duel.IsExistingTarget(c119828752.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(c119828752.filter2,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end and Duel.IsExistingMatchingCard(c119828752.filter2,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c119828752.filter1,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectTarget(tp,c119828752.filter1,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
end end
function c119828752.operation(e,tp,eg,ep,ev,re,r,rp) function c119828752.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
......
...@@ -13,7 +13,7 @@ function s.initial_effect(c) ...@@ -13,7 +13,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_COUNTER+HINTMSG_DESTROY+CATEGORY_ATKCHANGE) e2:SetCategory(CATEGORY_COUNTER+CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
......
...@@ -11,7 +11,7 @@ function s.initial_effect(c) ...@@ -11,7 +11,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_COUNTER+HINTMSG_DESTROY+CATEGORY_ATKCHANGE) e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
......
...@@ -2,7 +2,7 @@ local s,id,o=GetID() ...@@ -2,7 +2,7 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_COUNTER+HINTMSG_DESTROY+CATEGORY_ATKCHANGE) e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -34,9 +34,10 @@ function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -34,9 +34,10 @@ function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local tc=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler()):GetFirst() local tc=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler()):GetFirst()
e:SetLabel(0) e:SetLabel(0)
e:SetCategory(CATEGORY_TOHAND)
for i=1,Duel.GetCurrentChain()-1 do for i=1,Duel.GetCurrentChain()-1 do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT) local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if te and te:GetHandler() and te:GetHandler()==tc then e:SetLabel(1) break end if te and te:GetHandler() and te:GetHandler()==tc then e:SetLabel(1) e:SetCategory(CATEGORY_TOHAND+CATEGORY_DISABLE) break end
end end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
......
...@@ -66,17 +66,23 @@ function c9911504.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -66,17 +66,23 @@ function c9911504.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
return true return true
end end
function c9911504.deckfilter(c,tp)
return c:IsSetCard(0x5952) and c:IsType(TYPE_MONSTER) and c:IsReleasable()
and Duel.IsExistingMatchingCard(c9911504.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c9911504.thfilter(c) function c9911504.thfilter(c)
return c:IsSetCard(0x5952) and c:IsAbleToHand() return c:IsSetCard(0x5952) and c:IsAbleToHand()
end end
function c9911504.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) function c9911504.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911504.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911504.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911504.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and rc:IsReleasable() and #g>0 return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and #g>0 and (rc:IsReleasable() or b0)
else else
return #g>0 return #g>0
end end
...@@ -84,8 +90,17 @@ function c9911504.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -84,8 +90,17 @@ function c9911504.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911504.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Release(rc,REASON_COST) Duel.Release(rc,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c9911504.thop(e,tp,eg,ep,ev,re,r,rp) function c9911504.thop(e,tp,eg,ep,ev,re,r,rp)
...@@ -96,25 +111,26 @@ function c9911504.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -96,25 +111,26 @@ function c9911504.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c9911504.tgcfilter1(c,check) function c9911504.tgcfilter1(c,check,re)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952))) if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
end local b0=c:IsFaceup() and c:IsSetCard(0x5952)
function c9911504.tgcfilter2(c,re) return (b0 and c:IsControler(tp)) or (not b0 and check)
return c:IsRelateToEffect(re) and c:IsReleasable()
end end
function c9911504.thcon2(e,tp,eg,ep,ev,re,r,rp) function c9911504.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911504.tgcfilter1,nil,check)>0 return eg:FilterCount(c9911504.tgcfilter1,nil,check,re)>0
end end
function c9911504.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) function c9911504.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
local sg=eg:Filter(c9911504.tgcfilter1,nil,check) local sg=eg:Filter(c9911504.tgcfilter1,nil,check,re)
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911504.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911504.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911504.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and sg:FilterCount(c9911504.tgcfilter2,nil,re)>0 and #g>0 return c:IsAbleToRemoveAsCost() and #g>0 and (sg:FilterCount(Card.IsReleasable,nil,re)>0 or b0)
else else
return #g>0 return #g>0
end end
...@@ -122,9 +138,18 @@ function c9911504.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -122,9 +138,18 @@ function c9911504.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911504.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911504.tgcfilter2,1,1,nil,re) local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
...@@ -63,17 +63,23 @@ function c9911507.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -63,17 +63,23 @@ function c9911507.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
return true return true
end end
function c9911507.deckfilter(c,tp)
return c:IsSetCard(0x5952) and c:IsType(TYPE_MONSTER) and c:IsReleasable()
and Duel.IsExistingMatchingCard(c9911507.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c9911507.thfilter(c) function c9911507.thfilter(c)
return c:IsSetCard(0x5952) and c:IsAbleToHand() return c:IsSetCard(0x5952) and c:IsAbleToHand()
end end
function c9911507.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) function c9911507.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911507.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911507.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911507.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and rc:IsReleasable() and #g>0 return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and #g>0 and (rc:IsReleasable() or b0)
else else
return #g>0 return #g>0
end end
...@@ -81,8 +87,17 @@ function c9911507.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -81,8 +87,17 @@ function c9911507.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911507.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Release(rc,REASON_COST) Duel.Release(rc,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c9911507.thop(e,tp,eg,ep,ev,re,r,rp) function c9911507.thop(e,tp,eg,ep,ev,re,r,rp)
...@@ -93,25 +108,26 @@ function c9911507.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,25 +108,26 @@ function c9911507.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c9911507.tgcfilter1(c,check) function c9911507.tgcfilter1(c,check,re)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952))) if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
end local b0=c:IsFaceup() and c:IsSetCard(0x5952)
function c9911507.tgcfilter2(c,re) return (b0 and c:IsControler(tp)) or (not b0 and check)
return c:IsRelateToEffect(re) and c:IsReleasable()
end end
function c9911507.thcon2(e,tp,eg,ep,ev,re,r,rp) function c9911507.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911507.tgcfilter1,nil,check)>0 return eg:FilterCount(c9911507.tgcfilter1,nil,check,re)>0
end end
function c9911507.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) function c9911507.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
local sg=eg:Filter(c9911507.tgcfilter1,nil,check) local sg=eg:Filter(c9911507.tgcfilter1,nil,check,re)
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911507.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911507.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911507.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and sg:FilterCount(c9911507.tgcfilter2,nil,re)>0 and #g>0 return c:IsAbleToRemoveAsCost() and #g>0 and (sg:FilterCount(Card.IsReleasable,nil,re)>0 or b0)
else else
return #g>0 return #g>0
end end
...@@ -119,9 +135,18 @@ function c9911507.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -119,9 +135,18 @@ function c9911507.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911507.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911507.tgcfilter2,1,1,nil,re) local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
...@@ -123,17 +123,23 @@ function c9911512.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -123,17 +123,23 @@ function c9911512.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
return true return true
end end
function c9911512.deckfilter(c,tp)
return c:IsSetCard(0x5952) and c:IsType(TYPE_MONSTER) and c:IsReleasable()
and Duel.IsExistingMatchingCard(c9911512.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c9911512.thfilter(c) function c9911512.thfilter(c)
return c:IsSetCard(0x5952) and c:IsAbleToHand() return c:IsSetCard(0x5952) and c:IsAbleToHand()
end end
function c9911512.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) function c9911512.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911512.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911512.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911512.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and rc:IsReleasable() and #g>0 return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and #g>0 and (rc:IsReleasable() or b0)
else else
return #g>0 return #g>0
end end
...@@ -141,8 +147,17 @@ function c9911512.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -141,8 +147,17 @@ function c9911512.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911512.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Release(rc,REASON_COST) Duel.Release(rc,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c9911512.thop(e,tp,eg,ep,ev,re,r,rp) function c9911512.thop(e,tp,eg,ep,ev,re,r,rp)
...@@ -153,25 +168,26 @@ function c9911512.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -153,25 +168,26 @@ function c9911512.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c9911512.tgcfilter1(c,check) function c9911512.tgcfilter1(c,check,re)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952))) if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
end local b0=c:IsFaceup() and c:IsSetCard(0x5952)
function c9911512.tgcfilter2(c,re) return (b0 and c:IsControler(tp)) or (not b0 and check)
return c:IsRelateToEffect(re) and c:IsReleasable()
end end
function c9911512.thcon2(e,tp,eg,ep,ev,re,r,rp) function c9911512.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911512.tgcfilter1,nil,check)>0 return eg:FilterCount(c9911512.tgcfilter1,nil,check,re)>0
end end
function c9911512.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) function c9911512.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
local sg=eg:Filter(c9911512.tgcfilter1,nil,check) local sg=eg:Filter(c9911512.tgcfilter1,nil,check,re)
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911512.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911512.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911512.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and sg:FilterCount(c9911512.tgcfilter2,nil,re)>0 and #g>0 return c:IsAbleToRemoveAsCost() and #g>0 and (sg:FilterCount(Card.IsReleasable,nil,re)>0 or b0)
else else
return #g>0 return #g>0
end end
...@@ -179,9 +195,18 @@ function c9911512.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -179,9 +195,18 @@ function c9911512.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911512.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911512.tgcfilter2,1,1,nil,re) local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
...@@ -86,17 +86,23 @@ function c9911514.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -86,17 +86,23 @@ function c9911514.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
return true return true
end end
function c9911514.deckfilter(c,tp)
return c:IsSetCard(0x5952) and c:IsType(TYPE_MONSTER) and c:IsReleasable()
and Duel.IsExistingMatchingCard(c9911514.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c9911514.thfilter(c) function c9911514.thfilter(c)
return c:IsSetCard(0x5952) and c:IsAbleToHand() return c:IsSetCard(0x5952) and c:IsAbleToHand()
end end
function c9911514.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) function c9911514.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911514.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911514.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911514.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and rc:IsReleasable() and #g>0 return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and #g>0 and (rc:IsReleasable() or b0)
else else
return #g>0 return #g>0
end end
...@@ -104,8 +110,17 @@ function c9911514.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -104,8 +110,17 @@ function c9911514.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911514.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Release(rc,REASON_COST) Duel.Release(rc,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c9911514.thop(e,tp,eg,ep,ev,re,r,rp) function c9911514.thop(e,tp,eg,ep,ev,re,r,rp)
...@@ -116,25 +131,26 @@ function c9911514.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -116,25 +131,26 @@ function c9911514.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c9911514.tgcfilter1(c,check) function c9911514.tgcfilter1(c,check,re)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952))) if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
end local b0=c:IsFaceup() and c:IsSetCard(0x5952)
function c9911514.tgcfilter2(c,re) return (b0 and c:IsControler(tp)) or (not b0 and check)
return c:IsRelateToEffect(re) and c:IsReleasable()
end end
function c9911514.thcon2(e,tp,eg,ep,ev,re,r,rp) function c9911514.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911514.tgcfilter1,nil,check)>0 return eg:FilterCount(c9911514.tgcfilter1,nil,check,re)>0
end end
function c9911514.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) function c9911514.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
local sg=eg:Filter(c9911514.tgcfilter1,nil,check) local sg=eg:Filter(c9911514.tgcfilter1,nil,check,re)
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911514.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911514.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911514.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and sg:FilterCount(c9911514.tgcfilter2,nil,re)>0 and #g>0 return c:IsAbleToRemoveAsCost() and #g>0 and (sg:FilterCount(Card.IsReleasable,nil,re)>0 or b0)
else else
return #g>0 return #g>0
end end
...@@ -142,9 +158,18 @@ function c9911514.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -142,9 +158,18 @@ function c9911514.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911514.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911514.tgcfilter2,1,1,nil,re) local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
...@@ -62,17 +62,23 @@ function c9911516.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -62,17 +62,23 @@ function c9911516.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
return true return true
end end
function c9911516.deckfilter(c,tp)
return c:IsSetCard(0x5952) and c:IsType(TYPE_MONSTER) and c:IsReleasable()
and Duel.IsExistingMatchingCard(c9911516.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c9911516.thfilter(c) function c9911516.thfilter(c)
return c:IsSetCard(0x5952) and c:IsAbleToHand() return c:IsSetCard(0x5952) and c:IsAbleToHand()
end end
function c9911516.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) function c9911516.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911516.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911516.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911516.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and rc:IsReleasable() and #g>0 return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and #g>0 and (rc:IsReleasable() or b0)
else else
return #g>0 return #g>0
end end
...@@ -80,8 +86,17 @@ function c9911516.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -80,8 +86,17 @@ function c9911516.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911516.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Release(rc,REASON_COST) Duel.Release(rc,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c9911516.thop(e,tp,eg,ep,ev,re,r,rp) function c9911516.thop(e,tp,eg,ep,ev,re,r,rp)
...@@ -92,25 +107,26 @@ function c9911516.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,25 +107,26 @@ function c9911516.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c9911516.tgcfilter1(c,check) function c9911516.tgcfilter1(c,check,re)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952))) if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
end local b0=c:IsFaceup() and c:IsSetCard(0x5952)
function c9911516.tgcfilter2(c,re) return (b0 and c:IsControler(tp)) or (not b0 and check)
return c:IsRelateToEffect(re) and c:IsReleasable()
end end
function c9911516.thcon2(e,tp,eg,ep,ev,re,r,rp) function c9911516.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911516.tgcfilter1,nil,check)>0 return eg:FilterCount(c9911516.tgcfilter1,nil,check,re)>0
end end
function c9911516.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) function c9911516.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
local sg=eg:Filter(c9911516.tgcfilter1,nil,check) local sg=eg:Filter(c9911516.tgcfilter1,nil,check,re)
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911516.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911516.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911516.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and sg:FilterCount(c9911516.tgcfilter2,nil,re)>0 and #g>0 return c:IsAbleToRemoveAsCost() and #g>0 and (sg:FilterCount(Card.IsReleasable,nil,re)>0 or b0)
else else
return #g>0 return #g>0
end end
...@@ -118,9 +134,18 @@ function c9911516.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -118,9 +134,18 @@ function c9911516.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911516.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911516.tgcfilter2,1,1,nil,re) local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
...@@ -66,17 +66,23 @@ function c9911518.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -66,17 +66,23 @@ function c9911518.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
return true return true
end end
function c9911518.deckfilter(c,tp)
return c:IsSetCard(0x5952) and c:IsType(TYPE_MONSTER) and c:IsReleasable()
and Duel.IsExistingMatchingCard(c9911518.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c9911518.thfilter(c) function c9911518.thfilter(c)
return c:IsSetCard(0x5952) and c:IsAbleToHand() return c:IsSetCard(0x5952) and c:IsAbleToHand()
end end
function c9911518.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) function c9911518.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911518.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911518.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911518.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and rc:IsReleasable() and #g>0 return c:IsAbleToRemoveAsCost() and rc:IsRelateToEffect(re) and #g>0 and (rc:IsReleasable() or b0)
else else
return #g>0 return #g>0
end end
...@@ -84,8 +90,17 @@ function c9911518.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -84,8 +90,17 @@ function c9911518.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911518.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Release(rc,REASON_COST) Duel.Release(rc,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c9911518.thop(e,tp,eg,ep,ev,re,r,rp) function c9911518.thop(e,tp,eg,ep,ev,re,r,rp)
...@@ -96,25 +111,26 @@ function c9911518.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -96,25 +111,26 @@ function c9911518.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c9911518.tgcfilter1(c,check) function c9911518.tgcfilter1(c,check,re)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952))) if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
end local b0=c:IsFaceup() and c:IsSetCard(0x5952)
function c9911518.tgcfilter2(c,re) return (b0 and c:IsControler(tp)) or (not b0 and check)
return c:IsRelateToEffect(re) and c:IsReleasable()
end end
function c9911518.thcon2(e,tp,eg,ep,ev,re,r,rp) function c9911518.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911518.tgcfilter1,nil,check)>0 return eg:FilterCount(c9911518.tgcfilter1,nil,check,re)>0
end end
function c9911518.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) function c9911518.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local check=Duel.IsPlayerAffectedByEffect(tp,9911509) local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
local sg=eg:Filter(c9911518.tgcfilter1,nil,check) local sg=eg:Filter(c9911518.tgcfilter1,nil,check,re)
local fe=Duel.IsPlayerAffectedByEffect(tp,9911520)
local b0=fe and Duel.IsExistingMatchingCard(c9911518.deckfilter,tp,LOCATION_DECK,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c9911518.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9911518.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and sg:FilterCount(c9911518.tgcfilter2,nil,re)>0 and #g>0 return c:IsAbleToRemoveAsCost() and #g>0 and (sg:FilterCount(Card.IsReleasable,nil,re)>0 or b0)
else else
return #g>0 return #g>0
end end
...@@ -122,9 +138,18 @@ function c9911518.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -122,9 +138,18 @@ function c9911518.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then if e:GetLabel()~=0 then
e:SetLabel(0) e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST) Duel.Remove(c,POS_FACEUP,REASON_COST)
if b0 and Duel.SelectYesNo(tp,aux.Stringid(9911520,1)) then
Duel.Hint(HINT_CARD,0,9911520)
fe:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,c9911518.deckfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Release(dg,REASON_COST)
Duel.SendtoGrave(dg,REASON_RELEASE+REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911518.tgcfilter2,1,1,nil,re) local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
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