Commit 2eca77b8 authored by nanahira's avatar nanahira

fix kaiju spsummon procedure

parent a62afcbd
...@@ -33,34 +33,26 @@ function c102380.initial_effect(c) ...@@ -33,34 +33,26 @@ function c102380.initial_effect(c)
e3:SetOperation(c102380.spcop) e3:SetOperation(c102380.spcop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c102380.mzfilter(c) function c102380.filter1(c,tp,rg)
return c:GetSequence()<5 return rg:IsExists(c102380.filter2,1,c,tp,c)
end
function c102380.filter2(c,tp,mc)
local mg=Group.FromCards(c,mc)
return Duel.GetMZoneCount(1-tp,mg,tp)>0
end end
function c102380.spcon(e,c) function c102380.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(Card.IsReleasable,tp,0,LOCATION_MZONE,nil) local rg=Duel.GetMatchingGroup(Card.IsReleasable,tp,0,LOCATION_MZONE,nil)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return rg:IsExists(c102380.filter1,1,nil,tp,rg)
local ct=-ft+1
return ft>-2 and rg:GetCount()>1 and (ft>0 or rg:IsExists(c102380.mzfilter,ct,nil))
end end
function c102380.spop(e,tp,eg,ep,ev,re,r,rp,c) function c102380.spop(e,tp,eg,ep,ev,re,r,rp,c)
local rg=Duel.GetMatchingGroup(Card.IsReleasable,tp,0,LOCATION_MZONE,nil) local rg=Duel.GetMatchingGroup(Card.IsReleasable,tp,0,LOCATION_MZONE,nil)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=nil local g=rg:FilterSelect(tp,c102380.filter1,1,1,nil,tp,rg)
if ft>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local g2=rg:FilterSelect(tp,c102380.filter2,1,1,g:GetFirst(),tp,g:GetFirst())
g=rg:Select(tp,2,2,nil) g:Merge(g2)
elseif ft==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=rg:FilterSelect(tp,c102380.mzfilter,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=rg:Select(tp,1,1,g:GetFirst())
g:Merge(g2)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=rg:FilterSelect(tp,c102380.mzfilter,2,2,nil)
end
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c102380.damcon(e,tp,eg,ep,ev,re,r,rp) function c102380.damcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -31,19 +31,17 @@ function c28674152.initial_effect(c) ...@@ -31,19 +31,17 @@ function c28674152.initial_effect(c)
e3:SetOperation(c28674152.tkop) e3:SetOperation(c28674152.tkop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c28674152.spfilter(c,ft) function c28674152.spfilter(c,tp)
return c:IsReleasable() and (ft>0 or c:GetSequence()<5) return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function c28674152.spcon(e,c) function c28674152.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c28674152.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
return ft>-1 and Duel.IsExistingMatchingCard(c28674152.spfilter,tp,0,LOCATION_MZONE,1,nil,ft)
end end
function c28674152.spop(e,tp,eg,ep,ev,re,r,rp,c) function c28674152.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c28674152.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ft) local g=Duel.SelectMatchingCard(tp,c28674152.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c28674152.cfilter(c) function c28674152.cfilter(c)
......
...@@ -33,19 +33,17 @@ function c29726552.initial_effect(c) ...@@ -33,19 +33,17 @@ function c29726552.initial_effect(c)
e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c29726552.spfilter(c,ft) function c29726552.spfilter(c,tp)
return c:IsReleasable() and (ft>0 or c:GetSequence()<5) return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function c29726552.spcon(e,c) function c29726552.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c29726552.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
return ft>-1 and Duel.IsExistingMatchingCard(c29726552.spfilter,tp,0,LOCATION_MZONE,1,nil,ft)
end end
function c29726552.spop(e,tp,eg,ep,ev,re,r,rp,c) function c29726552.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c29726552.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ft) local g=Duel.SelectMatchingCard(tp,c29726552.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c29726552.cfilter(c) function c29726552.cfilter(c)
......
...@@ -35,19 +35,17 @@ function c36956512.initial_effect(c) ...@@ -35,19 +35,17 @@ function c36956512.initial_effect(c)
e3:SetOperation(c36956512.atkop) e3:SetOperation(c36956512.atkop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c36956512.spfilter(c,ft) function c36956512.spfilter(c,tp)
return c:IsReleasable() and (ft>0 or c:GetSequence()<5) return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function c36956512.spcon(e,c) function c36956512.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c36956512.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
return ft>-1 and Duel.IsExistingMatchingCard(c36956512.spfilter,tp,0,LOCATION_MZONE,1,nil,ft)
end end
function c36956512.spop(e,tp,eg,ep,ev,re,r,rp,c) function c36956512.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c36956512.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ft) local g=Duel.SelectMatchingCard(tp,c36956512.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c36956512.cfilter(c) function c36956512.cfilter(c)
......
...@@ -11,19 +11,17 @@ function c46565218.initial_effect(c) ...@@ -11,19 +11,17 @@ function c46565218.initial_effect(c)
e1:SetOperation(c46565218.spop) e1:SetOperation(c46565218.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c46565218.spfilter(c,ft) function c46565218.spfilter(c,tp)
return c:IsReleasable() and (ft>0 or c:GetSequence()<5) return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function c46565218.spcon(e,c) function c46565218.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c46565218.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
return ft>-1 and Duel.IsExistingMatchingCard(c46565218.spfilter,tp,0,LOCATION_MZONE,1,nil,ft)
end end
function c46565218.spop(e,tp,eg,ep,ev,re,r,rp,c) function c46565218.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c46565218.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ft) local g=Duel.SelectMatchingCard(tp,c46565218.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46565218,0)) e1:SetDescription(aux.Stringid(46565218,0))
......
...@@ -30,19 +30,17 @@ function c48770333.initial_effect(c) ...@@ -30,19 +30,17 @@ function c48770333.initial_effect(c)
e3:SetOperation(c48770333.atkop) e3:SetOperation(c48770333.atkop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c48770333.spfilter(c,ft) function c48770333.spfilter(c,tp)
return c:IsReleasable() and (ft>0 or c:GetSequence()<5) return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function c48770333.spcon(e,c) function c48770333.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c48770333.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
return ft>-1 and Duel.IsExistingMatchingCard(c48770333.spfilter,tp,0,LOCATION_MZONE,1,nil,ft)
end end
function c48770333.spop(e,tp,eg,ep,ev,re,r,rp,c) function c48770333.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c48770333.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ft) local g=Duel.SelectMatchingCard(tp,c48770333.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c48770333.cfilter(c) function c48770333.cfilter(c)
......
...@@ -43,19 +43,17 @@ function c63014935.initial_effect(c) ...@@ -43,19 +43,17 @@ function c63014935.initial_effect(c)
e4:SetOperation(c63014935.spcop) e4:SetOperation(c63014935.spcop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c63014935.spfilter(c,ft) function c63014935.spfilter(c,tp)
return c:IsReleasable() and (ft>0 or c:GetSequence()<5) return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function c63014935.spcon(e,c) function c63014935.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c63014935.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
return ft>-1 and Duel.IsExistingMatchingCard(c63014935.spfilter,tp,0,LOCATION_MZONE,1,nil,ft)
end end
function c63014935.spop(e,tp,eg,ep,ev,re,r,rp,c) function c63014935.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c63014935.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ft) local g=Duel.SelectMatchingCard(tp,c63014935.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c63014935.damcost(e,tp,eg,ep,ev,re,r,rp,chk) function c63014935.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -32,19 +32,17 @@ function c63941210.initial_effect(c) ...@@ -32,19 +32,17 @@ function c63941210.initial_effect(c)
e3:SetOperation(c63941210.disop) e3:SetOperation(c63941210.disop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c63941210.spfilter(c,ft) function c63941210.spfilter(c,tp)
return c:IsReleasable() and (ft>0 or c:GetSequence()<5) return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function c63941210.spcon(e,c) function c63941210.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c63941210.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
return ft>-1 and Duel.IsExistingMatchingCard(c63941210.spfilter,tp,0,LOCATION_MZONE,1,nil,ft)
end end
function c63941210.spop(e,tp,eg,ep,ev,re,r,rp,c) function c63941210.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c63941210.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ft) local g=Duel.SelectMatchingCard(tp,c63941210.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c63941210.cfilter(c) function c63941210.cfilter(c)
......
...@@ -23,7 +23,7 @@ end ...@@ -23,7 +23,7 @@ end
function c75732622.spcon(e,c) function c75732622.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and not Duel.IsPlayerAffectedByEffect(tp,59822133) and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsPlayerCanSpecialSummonCount(tp,2) and Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.IsPlayerCanSpecialSummonMonster(tp,75732623,0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) and Duel.IsPlayerCanSpecialSummonMonster(tp,75732623,0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_DARK)
......
...@@ -30,19 +30,17 @@ function c93332803.initial_effect(c) ...@@ -30,19 +30,17 @@ function c93332803.initial_effect(c)
e3:SetOperation(c93332803.desop) e3:SetOperation(c93332803.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c93332803.spfilter(c,ft) function c93332803.spfilter(c,tp)
return c:IsReleasable() and (ft>0 or c:GetSequence()<5) return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function c93332803.spcon(e,c) function c93332803.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c93332803.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
return ft>-1 and Duel.IsExistingMatchingCard(c93332803.spfilter,tp,0,LOCATION_MZONE,1,nil,ft)
end end
function c93332803.spop(e,tp,eg,ep,ev,re,r,rp,c) function c93332803.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c93332803.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ft) local g=Duel.SelectMatchingCard(tp,c93332803.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c93332803.cfilter(c) function c93332803.cfilter(c)
......
...@@ -16,7 +16,7 @@ function c93912845.spfilter(c,e,tp) ...@@ -16,7 +16,7 @@ function c93912845.spfilter(c,e,tp)
end end
function c93912845.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c93912845.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c93912845.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c93912845.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and not Duel.IsPlayerAffectedByEffect(tp,59822133) and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingTarget(c93912845.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingTarget(c93912845.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsPlayerCanSpecialSummonMonster(tp,93912846,0,0x4011,1500,1500,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,1-tp) end and Duel.IsPlayerCanSpecialSummonMonster(tp,93912846,0,0x4011,1500,1500,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,1-tp) end
...@@ -26,7 +26,7 @@ function c93912845.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -26,7 +26,7 @@ function c93912845.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c93912845.activate(e,tp,eg,ep,ev,re,r,rp) function c93912845.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
...@@ -42,8 +42,9 @@ function c93912845.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,8 +42,9 @@ function c93912845.activate(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e2,true) tc:RegisterEffect(e2,true)
end end
end end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>1 if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,93912846,0,0x4011,1500,1500,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,1-tp) then and Duel.IsPlayerCanSpecialSummonMonster(tp,93912846,0,0x4011,1500,1500,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,1-tp)
and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
for i=1,2 do for i=1,2 do
local token=Duel.CreateToken(tp,93912846) local token=Duel.CreateToken(tp,93912846)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP)
......
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