Commit 018fd752 authored by wind2009's avatar wind2009

Merge branch 'patch-getszonecount' into develop

parents 6a7cf7dd 94196fea
...@@ -29,12 +29,7 @@ function c10024317.initial_effect(c) ...@@ -29,12 +29,7 @@ function c10024317.initial_effect(c)
end end
function c10024317.desfilter(c,tp) function c10024317.desfilter(c,tp)
if c:IsFacedown() then return false end if c:IsFacedown() then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) return Duel.GetSZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c10024317.filter,tp,LOCATION_DECK,0,1,nil,true)
if ft==0 and c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 then
return Duel.IsExistingMatchingCard(c10024317.filter,tp,LOCATION_DECK,0,1,nil,true)
else
return Duel.IsExistingMatchingCard(c10024317.filter,tp,LOCATION_DECK,0,1,nil,false)
end
end end
function c10024317.filter(c,ignore) function c10024317.filter(c,ignore)
return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore) return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore)
......
...@@ -28,12 +28,7 @@ function c18716735.initial_effect(c) ...@@ -28,12 +28,7 @@ function c18716735.initial_effect(c)
end end
function c18716735.desfilter(c,tp) function c18716735.desfilter(c,tp)
if c:IsFacedown() then return false end if c:IsFacedown() then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) return Duel.GetSZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c18716735.filter,tp,LOCATION_DECK,0,1,nil,true)
if ft==0 and c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 then
return Duel.IsExistingMatchingCard(c18716735.filter,tp,LOCATION_DECK,0,1,nil,true)
else
return Duel.IsExistingMatchingCard(c18716735.filter,tp,LOCATION_DECK,0,1,nil,false)
end
end end
function c18716735.filter(c,ignore) function c18716735.filter(c,ignore)
return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore) return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore)
......
...@@ -24,33 +24,19 @@ end ...@@ -24,33 +24,19 @@ end
function c29223325.filter(c) function c29223325.filter(c)
return c:IsSetCard(0x97) and c:IsType(TYPE_MONSTER) and c:IsSSetable(true) return c:IsSetCard(0x97) and c:IsType(TYPE_MONSTER) and c:IsSSetable(true)
end end
function c29223325.desfilter(c) function c29223325.desfilter(c,tp,ft)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP) and Duel.GetSZoneCount(tp,c)>ft
end
function c29223325.desfilter2(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:GetSequence()<5
end end
function c29223325.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c29223325.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c29223325.desfilter(chkc) and chkc~=e:GetHandler() end if chkc then return chkc:IsOnField() and c29223325.desfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then if chk==0 then
if not Duel.IsExistingMatchingCard(c29223325.filter,tp,LOCATION_DECK,0,1,nil) then return false end if not Duel.IsExistingMatchingCard(c29223325.filter,tp,LOCATION_DECK,0,1,nil) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=0
if e:GetHandler():IsLocation(LOCATION_HAND) then ft=ft-1 end if e:GetHandler():IsLocation(LOCATION_HAND) then ft=1 end
if ft<0 then return false return Duel.IsExistingTarget(c29223325.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),tp,ft)
elseif ft>0 then
return Duel.IsExistingTarget(c29223325.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
else
return Duel.IsExistingTarget(c29223325.desfilter2,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
end end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if ft>0 then local g=Duel.SelectTarget(tp,c29223325.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),tp,0)
g=Duel.SelectTarget(tp,c29223325.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
else
g=Duel.SelectTarget(tp,c29223325.desfilter2,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c29223325.activate(e,tp,eg,ep,ev,re,r,rp) function c29223325.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -16,12 +16,7 @@ function c33256280.initial_effect(c) ...@@ -16,12 +16,7 @@ function c33256280.initial_effect(c)
end end
function c33256280.desfilter(c,tp) function c33256280.desfilter(c,tp)
if c:IsFacedown() then return false end if c:IsFacedown() then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) return Duel.GetSZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c33256280.filter,tp,LOCATION_DECK,0,1,nil,true)
if ft==0 and c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 then
return Duel.IsExistingMatchingCard(c33256280.filter,tp,LOCATION_DECK,0,1,nil,true)
else
return Duel.IsExistingMatchingCard(c33256280.filter,tp,LOCATION_DECK,0,1,nil,false)
end
end end
function c33256280.filter(c,ignore) function c33256280.filter(c,ignore)
return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore) return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore)
......
...@@ -16,12 +16,7 @@ function c60473572.initial_effect(c) ...@@ -16,12 +16,7 @@ function c60473572.initial_effect(c)
end end
function c60473572.desfilter(c,tp) function c60473572.desfilter(c,tp)
if c:IsFacedown() then return false end if c:IsFacedown() then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) return Duel.GetSZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c60473572.filter,tp,LOCATION_DECK,0,1,nil,true)
if ft==0 and c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 then
return Duel.IsExistingMatchingCard(c60473572.filter,tp,LOCATION_DECK,0,1,nil,true)
else
return Duel.IsExistingMatchingCard(c60473572.filter,tp,LOCATION_DECK,0,1,nil,false)
end
end end
function c60473572.filter(c,ignore) function c60473572.filter(c,ignore)
return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore) return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore)
......
...@@ -16,12 +16,7 @@ function c69351984.initial_effect(c) ...@@ -16,12 +16,7 @@ function c69351984.initial_effect(c)
end end
function c69351984.desfilter(c,tp) function c69351984.desfilter(c,tp)
if c:IsFacedown() then return false end if c:IsFacedown() then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) return Duel.GetSZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c69351984.filter,tp,LOCATION_DECK,0,1,nil,true)
if ft==0 and c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 then
return Duel.IsExistingMatchingCard(c69351984.filter,tp,LOCATION_DECK,0,1,nil,true)
else
return Duel.IsExistingMatchingCard(c69351984.filter,tp,LOCATION_DECK,0,1,nil,false)
end
end end
function c69351984.filter(c,ignore) function c69351984.filter(c,ignore)
return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore) return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore)
......
...@@ -16,12 +16,7 @@ function c7868571.initial_effect(c) ...@@ -16,12 +16,7 @@ function c7868571.initial_effect(c)
end end
function c7868571.desfilter(c,tp) function c7868571.desfilter(c,tp)
if c:IsFacedown() then return false end if c:IsFacedown() then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) return Duel.GetSZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c7868571.filter,tp,LOCATION_DECK,0,1,nil,true)
if ft==0 and c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 then
return Duel.IsExistingMatchingCard(c7868571.filter,tp,LOCATION_DECK,0,1,nil,true)
else
return Duel.IsExistingMatchingCard(c7868571.filter,tp,LOCATION_DECK,0,1,nil,false)
end
end end
function c7868571.filter(c,ignore) function c7868571.filter(c,ignore)
return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore) return c:IsSetCard(0xe1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore)
......
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