Commit c08bef22 authored by Nemo Ma's avatar Nemo Ma

fix

parent 198942d4
......@@ -40,7 +40,7 @@ function cm.filter(c)
return c:IsPreviousLocation(LOCATION_DECK+LOCATION_GRAVE)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil) and not e:GetHandler():IsPublic()
return eg:IsExists(cm.filter,1,nil)
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -40,7 +40,7 @@ function cm.filter(c)
return c:IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil) and not e:GetHandler():IsPublic()
return eg:IsExists(cm.filter,1,nil)
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -49,7 +49,7 @@ function cm.filter(c)
return c:IsFaceup()
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil) and not e:GetHandler():IsPublic()
return eg:IsExists(cm.filter,1,nil)
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -67,10 +67,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e12)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPublic()
return true
end
function cm.adcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsFacedown,1,nil) and not e:GetHandler():IsPublic()
return eg:IsExists(Card.IsFacedown,1,nil)
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -35,7 +35,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPublic()
return true
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -35,7 +35,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and not e:GetHandler():IsPublic()
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -39,6 +39,11 @@ function cm.initial_effect(c)
e4:SetTarget(cm.drtg)
e4:SetOperation(cm.drop)
c:RegisterEffect(e4)
--act in hand
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
c:RegisterEffect(e5)
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
......@@ -77,7 +82,21 @@ function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.GetCurrentChain()==0 and Duel.GetTurnPlayer()==1-tp
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckActivateEffect(false,false,false)~=nil and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
local c=e:GetHandler()
if chk==0 then
local res=true
if Card.SetCardData then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
res=dc:GetActivateEffect():IsActivatable(tp)
dc:SetCardData(CARDDATA_TYPE,TYPE_SPELL)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
return res and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
end
function cm.filter(c)
return c:GetTurnID()==Duel.GetTurnCount() and not c:IsReason(REASON_RETURN) and c:IsType(TYPE_MONSTER)
......
......@@ -38,7 +38,7 @@ function cm.matfilter(c)
end
function cm.costcon(e)
local tp=e:GetHandlerPlayer()
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0 then return false end
if Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE)==0 then return false end
return true
end
function cm.costchk(e,te_or_c,tp)
......
......@@ -72,7 +72,7 @@ end
function cm.immval(e,te_or_c)
local res=aux.GetValueType(te_or_c)~="Effect" or (te_or_c:IsActivated() and te_or_c:GetOwner()~=e:GetHandler())
if res then
if te_or_c:IsActivated() then Duel.Hint(HINT_CARD,0,m) end
if aux.GetValueType(te_or_c)=="Effect" then Duel.Hint(HINT_CARD,0,m) end
local c=e:GetHandler()
local flag=c:GetFlagEffectLabel(m)
if flag then
......
......@@ -32,10 +32,10 @@ function cm.retfilter(c)
return Duel.GetLocationCount(p,LOCATION_MZONE)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_REMOVED,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tffilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tffilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_REMOVED,0,1,1,nil)
local g=Duel.SelectTarget(tp,cm.tffilter,tp,LOCATION_REMOVED,0,1,1,nil)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -26,6 +26,9 @@ function cm.initial_effect(c)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
elements={{"tama_elements",{{TAMA_ELEMENT_WATER,1},{TAMA_ELEMENT_LIFE,2}}}}
cm[c]=elements
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and aux.NegateEffectMonsterFilter(chkc) end
......@@ -42,7 +45,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
else
local hb=true
local tc1=nil
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(m,1)) then
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and not Duel.SelectYesNo(1-tp,aux.Stringid(m,1)) then
Duel.DiscardHand(1-tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
tc1=Duel.GetOperatedGroup()
hb=false
......
......@@ -34,7 +34,7 @@ function cm.spcon(e,c)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -33,7 +33,6 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.accon)
e1:SetOperation(cm.acop)
c:RegisterEffect(e1)
......
......@@ -76,7 +76,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
local wg=Duel.GetMatchingGroup(s.copfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c)
for wbc in aux.Next(wg) do
if c:IsFaceup() then
local cid=c:CopyEffect(wbc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD_DISABLE,1)
local cid=c:CopyEffect(wbc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE,1)
wbc:RegisterFlagEffect(id,0,0,0,cid)
end
end
......
......@@ -27,14 +27,14 @@ function s.initial_effect(c)
e3:SetCondition(s.imcon)
e3:SetValue(s.efilter)
c:RegisterEffect(e3)
local e33=Effect.CreateEffect(c)
e33:SetType(EFFECT_TYPE_FIELD)
e33:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e33:SetCode(EFFECT_CANNOT_ACTIVATE)
e33:SetRange(LOCATION_MZONE)
e33:SetTargetRange(0,1)
e33:SetValue(s.aclimit)
c:RegisterEffect(e33)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(s.aclimit)
c:RegisterEffect(e2)
--攻击力上升
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,7))
......@@ -85,4 +85,4 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
end
function s.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE
end
\ No newline at end of file
end
......
......@@ -9,7 +9,8 @@ function s.initial_effect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,id)
e3:SetCondition(s.remcon)
e3:SetTarget(s.remtg)
......@@ -19,6 +20,7 @@ function s.initial_effect(c)
e6:SetDescription(aux.Stringid(id,1))
e6:SetCategory(CATEGORY_REMOVE)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetCountLimit(1,id)
e6:SetCondition(s.remcon)
......@@ -30,6 +32,7 @@ function s.initial_effect(c)
e5:SetDescription(aux.Stringid(id,2))
e5:SetCategory(CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCountLimit(1,id)
e5:SetCondition(s.remcon)
......@@ -45,8 +48,8 @@ function s.initial_effect(c)
e33:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e33:SetCountLimit(1,{id,1})
e33:SetCondition(s.sccon)
e33:SetTarget(s.sctg)
e33:SetOperation(s.scop)
e33:SetTarget(s.sptg)
e33:SetOperation(s.spop)
c:RegisterEffect(e33)
end
--Remove
......@@ -97,18 +100,17 @@ function s.filter(c,e,tp)
return c:IsSetCard(0x20ab) and c:IsLevelBelow(9) and c:IsType(TYPE_SYNCHRO)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_SYNCHRO)
return #pg<=0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp) end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_SYNCHRO)
if #pg>0 then return end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP)
end
end
......@@ -16,13 +16,13 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
--特殊召唤
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(s.sptg1)
e3:SetCountLimit(1,id)
e3:SetCountLimit(1,{id,1})
e3:SetOperation(s.spop1)
c:RegisterEffect(e3)
local e4=e3:Clone()
......
......@@ -41,7 +41,7 @@ function s.initial_effect(c)
end
s.listed_series={0x20ab}
function s.filter(c)
return c:IsFaceup() and c:HasLevel() and c:IsSetCard(0x20ab)
return c:IsFaceup() and c:IsSetCard(0x20ab)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
......
......@@ -50,11 +50,11 @@ function s.setfilter(c)
return c:IsFaceup() and c:IsSetCard(0x20ab) and c:IsType(TYPE_SYNCHRO)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.IsTurnPlayer(tp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.GetTurnPlayer(tp)
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.costfilter(c)
return c:IsMonster() and c:IsRace(RACE_WARRIOR) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
return c:IsRace(RACE_WARRIOR) and c:IsAbleToRemoveAsCost()
end
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
......
......@@ -52,7 +52,7 @@ function c33200951.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetRitualMaterial(tp):Filter(c33200951.refilter,nil)
local mg2=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_PZONE,0,e:GetHandler())
mg:Merge(mg2)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33200951.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -55,7 +55,7 @@ function c33200952.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetRitualMaterial(tp):Filter(c33200951.refilter,nil)
local mg2=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_PZONE,0,e:GetHandler())
mg:Merge(mg2)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33200952.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -55,7 +55,7 @@ function c33200953.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetRitualMaterial(tp):Filter(c33200951.refilter,nil)
local mg2=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_PZONE,0,e:GetHandler())
mg:Merge(mg2)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33200953.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -55,7 +55,7 @@ function c33200954.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetRitualMaterial(tp):Filter(c33200951.refilter,nil)
local mg2=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_PZONE,0,e:GetHandler())
mg:Merge(mg2)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33200954.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -55,7 +55,7 @@ function c33200955.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetRitualMaterial(tp):Filter(c33200951.refilter,nil)
local mg2=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_PZONE,0,e:GetHandler())
mg:Merge(mg2)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33200955.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -54,7 +54,7 @@ function c33200956.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetRitualMaterial(tp):Filter(c33200951.refilter,nil)
local mg2=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_PZONE,0,e:GetHandler())
mg:Merge(mg2)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and mg:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33200956.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -88,7 +88,7 @@ function c33200959.spop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,5)
local ct=g:GetCount()
local atk=c:GetAttack()
if ct>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:FilterCount(c33200959.dspfilter,nil,e,tp,atk)>0
if ct>0 and g:FilterCount(c33200959.dspfilter,nil,e,tp,atk)>0
and Duel.SelectYesNo(tp,aux.Stringid(33200959,2)) then
Duel.DisableShuffleCheck()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -85,23 +85,20 @@ function cm.top(e,tp)
local g=Duel.GetOperatedGroup()
local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.BreakEffect()
if sg:GetClassCount(Card.GetCode)==#sg then
local rct=sg:FilterCount(cm.rfilter2,nil)
local num=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if rct==0 or num==0 then return end
if rct>num then rct=num end
if not Duel.SelectYesNo(tp,aux.Stringid(9910024,0)) then return end
if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then
local rg=sg:Filter(cm.rfilter2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,rct,nil)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,#rg,nil)
if sg1:GetCount()>0 then
Duel.SendtoHand(sg1,nil,REASON_EFFECT)
end
else
local num=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if num<1 then return end
if num>#sg then num=#sg end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,num,num,nil)
local ct=math.min(#sg,num)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,ct,ct,nil)
if sg1:GetCount()>0 then
Duel.SendtoGrave(sg1,REASON_EFFECT)
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