Commit f2654cad authored by POLYMER's avatar POLYMER

fix

parent bf7bc667
......@@ -104,11 +104,11 @@ end
function c119828752.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
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)
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_SELECTMSG,tp,HINTMSG_TARGET)
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
function c119828752.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -13,7 +13,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
......
......@@ -11,7 +11,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
......
......@@ -2,7 +2,7 @@ local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
......@@ -34,9 +34,10 @@ function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local tc=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler()):GetFirst()
e:SetLabel(0)
e:SetCategory(CATEGORY_TOHAND)
for i=1,Duel.GetCurrentChain()-1 do
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
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
......@@ -95,4 +96,4 @@ function s.sdop(e,tp,eg,ep,ev,re,r,rp)
end
end
if e:GetHandler():IsRelateToEffect(e) then Duel.Destroy(e:GetHandler(),REASON_EFFECT) end
end
end
\ No newline at end of file
......@@ -66,17 +66,23 @@ function c9911504.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
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)
return c:IsSetCard(0x5952) and c:IsAbleToHand()
end
function c9911504.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e: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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -84,7 +90,16 @@ function c9911504.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Release(rc,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)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -96,25 +111,26 @@ function c9911504.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c9911504.tgcfilter1(c,check)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952)))
end
function c9911504.tgcfilter2(c,re)
return c:IsRelateToEffect(re) and c:IsReleasable()
function c9911504.tgcfilter1(c,check,re)
if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
local b0=c:IsFaceup() and c:IsSetCard(0x5952)
return (b0 and c:IsControler(tp)) or (not b0 and check)
end
function c9911504.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911504.tgcfilter1,nil,check)>0
return eg:FilterCount(c9911504.tgcfilter1,nil,check,re)>0
end
function c9911504.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -122,9 +138,18 @@ function c9911504.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911504.tgcfilter2,1,1,nil,re)
Duel.Release(rg,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)
local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -63,17 +63,23 @@ function c9911507.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
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)
return c:IsSetCard(0x5952) and c:IsAbleToHand()
end
function c9911507.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e: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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -81,7 +87,16 @@ function c9911507.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Release(rc,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)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -93,25 +108,26 @@ function c9911507.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c9911507.tgcfilter1(c,check)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952)))
end
function c9911507.tgcfilter2(c,re)
return c:IsRelateToEffect(re) and c:IsReleasable()
function c9911507.tgcfilter1(c,check,re)
if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
local b0=c:IsFaceup() and c:IsSetCard(0x5952)
return (b0 and c:IsControler(tp)) or (not b0 and check)
end
function c9911507.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911507.tgcfilter1,nil,check)>0
return eg:FilterCount(c9911507.tgcfilter1,nil,check,re)>0
end
function c9911507.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -119,9 +135,18 @@ function c9911507.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911507.tgcfilter2,1,1,nil,re)
Duel.Release(rg,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)
local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -123,17 +123,23 @@ function c9911512.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
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)
return c:IsSetCard(0x5952) and c:IsAbleToHand()
end
function c9911512.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e: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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -141,7 +147,16 @@ function c9911512.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Release(rc,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)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -153,25 +168,26 @@ function c9911512.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c9911512.tgcfilter1(c,check)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952)))
end
function c9911512.tgcfilter2(c,re)
return c:IsRelateToEffect(re) and c:IsReleasable()
function c9911512.tgcfilter1(c,check,re)
if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
local b0=c:IsFaceup() and c:IsSetCard(0x5952)
return (b0 and c:IsControler(tp)) or (not b0 and check)
end
function c9911512.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911512.tgcfilter1,nil,check)>0
return eg:FilterCount(c9911512.tgcfilter1,nil,check,re)>0
end
function c9911512.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -179,9 +195,18 @@ function c9911512.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911512.tgcfilter2,1,1,nil,re)
Duel.Release(rg,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)
local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -86,17 +86,23 @@ function c9911514.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
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)
return c:IsSetCard(0x5952) and c:IsAbleToHand()
end
function c9911514.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e: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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -104,7 +110,16 @@ function c9911514.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Release(rc,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)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -116,25 +131,26 @@ function c9911514.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c9911514.tgcfilter1(c,check)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952)))
end
function c9911514.tgcfilter2(c,re)
return c:IsRelateToEffect(re) and c:IsReleasable()
function c9911514.tgcfilter1(c,check,re)
if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
local b0=c:IsFaceup() and c:IsSetCard(0x5952)
return (b0 and c:IsControler(tp)) or (not b0 and check)
end
function c9911514.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911514.tgcfilter1,nil,check)>0
return eg:FilterCount(c9911514.tgcfilter1,nil,check,re)>0
end
function c9911514.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -142,9 +158,18 @@ function c9911514.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911514.tgcfilter2,1,1,nil,re)
Duel.Release(rg,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)
local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -62,17 +62,23 @@ function c9911516.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
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)
return c:IsSetCard(0x5952) and c:IsAbleToHand()
end
function c9911516.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e: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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -80,7 +86,16 @@ function c9911516.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Release(rc,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)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -92,25 +107,26 @@ function c9911516.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c9911516.tgcfilter1(c,check)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952)))
end
function c9911516.tgcfilter2(c,re)
return c:IsRelateToEffect(re) and c:IsReleasable()
function c9911516.tgcfilter1(c,check,re)
if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
local b0=c:IsFaceup() and c:IsSetCard(0x5952)
return (b0 and c:IsControler(tp)) or (not b0 and check)
end
function c9911516.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911516.tgcfilter1,nil,check)>0
return eg:FilterCount(c9911516.tgcfilter1,nil,check,re)>0
end
function c9911516.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -118,9 +134,18 @@ function c9911516.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911516.tgcfilter2,1,1,nil,re)
Duel.Release(rg,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)
local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -66,17 +66,23 @@ function c9911518.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
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)
return c:IsSetCard(0x5952) and c:IsAbleToHand()
end
function c9911518.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e: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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -84,7 +90,16 @@ function c9911518.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Release(rc,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)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -96,25 +111,26 @@ function c9911518.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c9911518.tgcfilter1(c,check)
return c:IsOnField() and (check or (c:IsFaceup() and c:IsSetCard(0x5952)))
end
function c9911518.tgcfilter2(c,re)
return c:IsRelateToEffect(re) and c:IsReleasable()
function c9911518.tgcfilter1(c,check,re)
if not c:IsOnField() or not c:IsRelateToEffect(re) then return false end
local b0=c:IsFaceup() and c:IsSetCard(0x5952)
return (b0 and c:IsControler(tp)) or (not b0 and check)
end
function c9911518.thcon2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsPlayerAffectedByEffect(tp,9911509)
return eg:FilterCount(c9911518.tgcfilter1,nil,check)>0
return eg:FilterCount(c9911518.tgcfilter1,nil,check,re)>0
end
function c9911518.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
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)
if chk==0 then
if e:GetLabel()~=0 then
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
return #g>0
end
......@@ -122,9 +138,18 @@ function c9911518.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()~=0 then
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=sg:FilterSelect(tp,c9911518.tgcfilter2,1,1,nil,re)
Duel.Release(rg,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)
local rg=sg:FilterSelect(tp,Card.IsReleasable,1,1,nil)
Duel.Release(rg,REASON_COST)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
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