Commit e6f1e8a3 authored by Nemo Ma's avatar Nemo Ma

fix

parent 6e0e5330
......@@ -73,6 +73,8 @@ function c33200071.thop(e,tp,eg,ep,ev,re,r,rp)
local cg=sg1:RandomSelect(1-tp,1)
local tc=cg:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand()
Duel.ShuffleDeck(tp)
end
end
......@@ -66,13 +66,13 @@ function c33400035.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x341)
end
function c33400035.refilter1(c)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x3341)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x3341) and c:IsAbleToRemoveAsCost()
end
function c33400035.refilter2(c)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x6342)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x6342) and c:IsAbleToRemoveAsCost()
end
function c33400035.refilter3(c)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c33400035.check(g)
return g:IsExists(Card.IsSetCard,1,nil,0x3341) and g:IsExists(Card.IsSetCard,1,nil,0x6342)
......@@ -81,9 +81,7 @@ function c33400035.xyzop(e,tp,chk,c)
local g1nm=Duel.GetMatchingGroupCount(c33400035.refilter1,tp,LOCATION_GRAVE,0,nil)
local g2nm=Duel.GetMatchingGroupCount(c33400035.refilter2,tp,LOCATION_GRAVE,0,nil)
local g3nm=Duel.GetMatchingGroupCount(c33400035.refilter3,tp,LOCATION_GRAVE,0,nil)
local cnm=g1nm+g2nm
local cnm2=g3nm-cnm
if chk==0 then return cnm>=3 or (g1nm==1 and g2nm==1 and cnm2>=1) end
if chk==0 then return g1nm>=1 and g2nm>=1 and g3nm>=3 end
local g=Duel.GetMatchingGroup(c33400035.refilter3,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:SelectSubGroup(tp,c33400035.check,false,3,99)
......@@ -151,7 +149,7 @@ end
function c33400035.matg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c33400035.cfilter1,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectTarget(tp,c33400035.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectTarget(tp,c33400035.cfilter1,tp,LOCATION_GRAVE,0,1,1,nil)
end
function c33400035.maop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......@@ -203,13 +201,13 @@ function c33400035.TojiEquip(ec,e,tp,eg,ep,ev,re,r,rp)
token:CancelToGrave()
if Duel.Equip(tp,token,ec,false) then
--immune
local e4=Effect.CreateEffect(ec)
local e4=Effect.CreateEffect(token)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(c33400035.efilter1)
token:RegisterEffect(e4)
--indes
local e5=Effect.CreateEffect(ec)
local e5=Effect.CreateEffect(token)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e5:SetValue(c33400035.valcon)
......
......@@ -53,10 +53,10 @@ function c33400411.ovfilter(c)
return c:IsFaceup()
end
function c33400411.refilter1(c)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5342)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5342) and c:IsSetCard(0x341) and c:IsAbleToRemoveAsCost()
end
function c33400411.refilter2(c)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x341)
return c:IsXyzType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x341) and c:IsAbleToRemoveAsCost()
end
function c33400411.check(g)
return g:IsExists(Card.IsSetCard,1,nil,0x5342)
......@@ -64,8 +64,7 @@ end
function c33400411.xyzop(e,tp,chk,c)
local g1nm=Duel.GetMatchingGroupCount(c33400411.refilter1,tp,LOCATION_GRAVE,0,nil)
local g2nm=Duel.GetMatchingGroupCount(c33400411.refilter2,tp,LOCATION_GRAVE,0,nil)
local cnm=g2nm-g1nm
if chk==0 then return cnm>=3 or (g1nm>=1 and g2nm>=3) end
if chk==0 then return g1nm>=1 and g2nm>=3 end
local g=Duel.GetMatchingGroup(c33400411.refilter2,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:SelectSubGroup(tp,c33400411.check,false,3,99)
......
......@@ -72,7 +72,7 @@ function cm.cfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x6343) and c:IsType(TYPE_SPELL+TYPE_EQUIP)
end
function cm.atkval2(e,c)
return Duel.GetMatchingGroupCount(cm.cfilter2,tp,LOCATION_ONFIELD,0,nil)
return Duel.GetMatchingGroupCount(cm.cfilter2,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil)
end
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -44,6 +44,7 @@ function cm.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(2,m)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.con)
e4:SetCost(cm.discost)
e4:SetTarget(cm.target)
e4:SetOperation(cm.activate)
......@@ -55,6 +56,7 @@ function cm.initial_effect(c)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCountLimit(2,m)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(cm.con)
e5:SetCost(cm.discost)
e5:SetTarget(cm.target)
e5:SetOperation(cm.activate)
......@@ -66,6 +68,7 @@ function cm.initial_effect(c)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCountLimit(2,m)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(cm.con)
e6:SetCost(cm.discost)
e6:SetTarget(cm.target)
e6:SetOperation(cm.activate)
......@@ -117,6 +120,9 @@ function cm.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_REMOVED
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler())
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=0
if e:GetHandler():GetFlagEffect(33401301)>0 then ft=1 end
......@@ -125,14 +131,15 @@ function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
end
function cm.filter(c)
function cm.filter(c,mc)
return c:IsAbleToRemove()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return eg:IsExists(cm.filter,1,nil) end
if chk==0 then return eg:IsExists(cm.filter,1,nil,e:GetHandler()) end
local g=eg:Filter(cm.filter,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
end
function cm.efilter(c,e)
return c:IsRelateToEffect(e)
......
......@@ -171,7 +171,8 @@ function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
end
function cm.setfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
return c:IsFaceup() and (c:IsType(TYPE_MONSTER) and c:IsCanTurnSet())
and (c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable())
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
......
......@@ -38,7 +38,8 @@ end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=tg:GetFirst()
Duel.SSet(tp,tc)
if Duel.IsExistingMatchingCard(cm.ckfilter,tp,0,LOCATION_ONFIELD,1,nil) then
if tc:IsType(TYPE_TRAP) then
......
......@@ -43,10 +43,32 @@ function cm.initial_effect(c)
e7:SetOperation(cm.spop)
c:RegisterEffect(e7)
end
function cm.fselect(g,ft,res)
function cm.bannedfselect(g,ft,res)
local sel=g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>0
return sel and ((res and #g~=2 and (g:IsExists(function(c)return bit.band(c:GetType(),0x20002)==0x20002 and c:IsSetCard(0x353b)end,1,nil) or #g==3)) or (not res and #g==3))
end
function cm.bannedcost(e,tp,eg,ep,ev,re,r,rp,chk)
local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local res=Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentPhase()==PHASE_END
if chk==0 then return costg:CheckSubGroup(cm.bannedfselect,1,3,ft,res) and not e:GetHandler():IsForbidden() end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=costg:SelectSubGroup(tp,cm.bannedfselect,false,1,3,ft,res)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={}
for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if #list>0 then
table.insert(list,5)
e:SetLabel(table.unpack(list))
else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT)
end
function cm.fselect(g,ft,res)
local sel=ft>0
return sel and ((res and #g~=2 and (g:IsExists(function(c)return bit.band(c:GetType(),0x20002)==0x20002 and c:IsSetCard(0x353b)end,1,nil) or #g==3)) or (not res and #g==3))
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
......
......@@ -34,7 +34,7 @@ end
function cm.fselect(g,ft)
return g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.bannedcost(e,tp,eg,ep,ev,re,r,rp,chk)
local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return costg:CheckSubGroup(cm.fselect,3,3,ft) and not e:GetHandler():IsForbidden() end
......@@ -44,6 +44,23 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={}
for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if #list>0 then
table.insert(list,5)
e:SetLabel(table.unpack(list))
else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cost=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return #cost>2 and ft>0 and not e:GetHandler():IsForbidden() end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,3,3,nil)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={}
for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if #list>0 then
table.insert(list,5)
......
......@@ -34,7 +34,7 @@ end
function cm.fselect(g,ft)
return g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.bannedcost(e,tp,eg,ep,ev,re,r,rp,chk)
local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return costg:CheckSubGroup(cm.fselect,3,3,ft) and not e:GetHandler():IsForbidden() end
......@@ -44,9 +44,24 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={}
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_SZONE) and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end
end
for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if #list>0 then
table.insert(list,5)
e:SetLabel(table.unpack(list))
else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cost=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return #cost>2 and ft>0 and not e:GetHandler():IsForbidden() end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,3,3,nil)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={}
for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if #list>0 then
table.insert(list,5)
e:SetLabel(table.unpack(list))
......
......@@ -30,7 +30,7 @@ end
function cm.fselect(g,ft)
return g:IsExists(function(c)return c:IsLocation(LOCATION_SZONE) and c:GetSequence()~=5 and c:IsFaceup()end,1,nil) or ft>0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.bannedcost(e,tp,eg,ep,ev,re,r,rp,chk)
local costg=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return costg:CheckSubGroup(cm.fselect,2,2,ft) and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) end
......@@ -40,6 +40,23 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={}
for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:IsFacedown() and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if #list>0 then
table.insert(list,5)
e:SetLabel(table.unpack(list))
else e:SetLabel(5) end
Duel.Release(g,REASON_EFFECT)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cost=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return #cost>1 and ft>0 and not e:GetHandler():IsForbidden() end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,2,2,nil)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-tp,cg) end
local list={}
for tc in aux.Next(g) do if tc:IsLocation(LOCATION_SZONE) and tc:GetSequence()~=5 then table.insert(list,tc:GetSequence()) end end
if #list>0 then
table.insert(list,5)
......
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