Commit e19bd978 authored by nanahira's avatar nanahira

location count cleanup

parent 2e720ddd
......@@ -24,7 +24,7 @@ function c12632096.ctfilter(c)
end
function c12632096.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local rt=math.min(Duel.GetMatchingGroupCount(c12632096.ctfilter,tp,0,LOCATION_MZONE,nil),Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL),c:GetOverlayCount(),3)
local rt=math.min(Duel.GetMatchingGroupCount(c12632096.ctfilter,tp,0,LOCATION_MZONE,nil),(Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL),c:GetOverlayCount(),3))
if chk==0 then return rt>0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,rt,REASON_COST)
local ct=Duel.GetOperatedGroup():GetCount()
......@@ -44,7 +44,7 @@ function c12632096.ctop(e,tp,eg,ep,ev,re,r,rp)
e1:SetLabel(c:GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local ct=math.min(e:GetLabel(),Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL))
local ct=math.min(e:GetLabel(),(Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,c12632096.ctfilter,tp,0,LOCATION_MZONE,ct,ct,nil)
Duel.GetControl(g,tp,PHASE_END,1)
......
......@@ -72,7 +72,7 @@ function c1278431.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c1278431.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),3)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),3)
if ft<1 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -57,7 +57,7 @@ function c25451652.spop(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.GetMatchingGroup(c25451652.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
local ct=5
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
ct=math.min(ct,g1:GetCount(),Duel.GetLocationCount(tp,LOCATION_MZONE))
ct=math.min(ct,g1:GetCount(),(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if ct>0 and g2:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=g2:Select(tp,1,ct,nil)
......
......@@ -27,7 +27,7 @@ function c25472513.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c25472513.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),4)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),4)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if ft<=0 then return end
local c=e:GetHandler()
......
......@@ -44,14 +44,14 @@ function c28806532.tftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c28806532.tffilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c28806532.tffilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
local ct=math.min(Duel.GetLocationCount(tp,LOCATION_SZONE),2)
local ct=math.min((Duel.GetLocationCount(tp,LOCATION_SZONE)),2)
local g=Duel.SelectTarget(tp,c28806532.tffilter,tp,LOCATION_GRAVE,0,1,ct,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,g:GetCount(),0,0)
end
function c28806532.tfop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()<=0 then return end
local ct=math.min(2,Duel.GetLocationCount(tp,LOCATION_SZONE))
local ct=math.min(2,(Duel.GetLocationCount(tp,LOCATION_SZONE)))
if ct<1 then return end
if g:GetCount()>ct then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
......
......@@ -24,7 +24,7 @@ function c31548814.spfilter(c,e,tp)
end
function c31548814.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),3)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),3)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(c31548814.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return ft>0 and g:CheckWithSumEqual(Card.GetLevel,8,1,ft)
......@@ -32,7 +32,7 @@ function c31548814.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c31548814.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),3)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),3)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(c31548814.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if ft<=0 or g:GetCount()==0 then return end
......
......@@ -106,7 +106,7 @@ function c3775068.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c3775068.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=3
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE))
ft=math.min(ft,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c3775068.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
......
......@@ -70,11 +70,11 @@ end
function c40392714.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c40392714.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and c:IsRelateToBattle()
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler(),tp)>0 and c:IsRelateToBattle()
and Duel.IsExistingTarget(c40392714.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=2
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)+1)
ft=math.min(ft,(Duel.GetMZoneCount(tp,e:GetHandler(),tp)))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c40392714.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
......
......@@ -47,11 +47,11 @@ function c41114306.spfilter(c,e,tp)
end
function c41114306.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c41114306.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler(),tp)>0
and Duel.IsExistingTarget(c41114306.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=2
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)+1)
ft=math.min(ft,(Duel.GetMZoneCount(tp,e:GetHandler(),tp)))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c41114306.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
......
......@@ -85,7 +85,7 @@ function c4998619.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c4998619.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=3
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE))
ft=math.min(ft,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c4998619.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
......
......@@ -59,7 +59,7 @@ end
function c55705473.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=2
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
ct=math.min(ct,Duel.GetLocationCount(tp,LOCATION_MZONE))
ct=math.min(ct,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c55705473.spfilter,tp,LOCATION_DECK,0,1,ct,nil,e,tp)
......
......@@ -27,7 +27,7 @@ function c58787301.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c58787301.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),2)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),2)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
......
......@@ -52,7 +52,7 @@ function c67120578.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c67120578.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c67120578.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ct=math.min(2,Duel.GetLocationCount(tp,LOCATION_MZONE))
local ct=math.min(2,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c67120578.spfilter,tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
......
......@@ -19,7 +19,7 @@ end
function c67284107.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=5
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE))
ft=math.min(ft,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,67284108,0,0x4011,0,0,1,RACE_ZOMBIE,ATTRIBUTE_DARK) then return end
repeat
local token=Duel.CreateToken(tp,67284108)
......
......@@ -88,11 +88,11 @@ end
function c77387463.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c77387463.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and c:IsRelateToBattle()
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler(),tp)>0 and c:IsRelateToBattle()
and Duel.IsExistingTarget(c77387463.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=3
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)+1)
ft=math.min(ft,(Duel.GetMZoneCount(tp,e:GetHandler(),tp)))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c77387463.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
......
......@@ -71,11 +71,11 @@ function c78509901.spfilter(c,e,tp)
end
function c78509901.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c78509901.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler(),tp)>0
and Duel.IsExistingTarget(c78509901.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=3
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)+1)
ft=math.min(ft,(Duel.GetMZoneCount(tp,e:GetHandler(),tp)))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c78509901.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
......
......@@ -45,7 +45,7 @@ function c78785392.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c78785392.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=math.min(4,Duel.GetLocationCount(tp,LOCATION_MZONE))
local ct=math.min(4,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
local g=Duel.GetMatchingGroup(c78785392.filter,tp,LOCATION_DECK,0,nil,e,tp)
if not Duel.IsPlayerAffectedByEffect(tp,59822133)
and ct>3 and g:GetClassCount(Card.GetCode)>3 then
......
......@@ -27,7 +27,7 @@ end
function c93749093.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=2
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
ct=math.min(ct,Duel.GetLocationCount(tp,LOCATION_MZONE))
ct=math.min(ct,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c93749093.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,ct,e:GetHandler(),e,tp)
......
......@@ -60,7 +60,7 @@ function c94703021.tktg2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c94703021.tkop2(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanSpecialSummonMonster(tp,94703022,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) then return end
local ct=math.min(Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK),Duel.GetLocationCount(tp,LOCATION_MZONE))
local ct=math.min(Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK),(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if ct<1 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
repeat
......
......@@ -55,7 +55,7 @@ function c94801854.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c94801854.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c94801854.spfilter2,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
local ct=math.min(2,Duel.GetLocationCount(tp,LOCATION_MZONE))
local ct=math.min(2,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if Duel.IsPlayerAffectedByEffect(tp,59822133) or not Duel.IsEnvironment(40005099) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c94801854.spfilter2,tp,LOCATION_REMOVED,0,1,ct,nil,e,tp)
......
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