Commit dfb858e4 authored by wind2009's avatar wind2009

Merge branch 'patch-getszonecount' into develop

parents 018fd752 9ebae628
......@@ -82,7 +82,7 @@ function c27946124.setfilter(c)
end
function c27946124.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c27946124.setfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>-1
if chk==0 then return Duel.GetSZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingTarget(c27946124.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=Duel.SelectTarget(tp,c27946124.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
......
......@@ -36,7 +36,7 @@ function c33773528.actcon(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer() and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c33773528.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x15c) and c:IsType(TYPE_TRAP) and c:GetEquipTarget() and c:IsAbleToGraveAsCost()
return c:IsFaceup() and c:IsSetCard(0x15c) and c:IsType(TYPE_TRAP) and c:GetEquipTarget() and c:IsAbleToGraveAsCost() and Duel.GetSZoneCount(tp,c)>0
and Duel.IsExistingTarget(c33773528.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,c:GetCode())
end
function c33773528.setfilter(c,code)
......
......@@ -37,7 +37,8 @@ function c36346532.efilter(e,re)
return re:IsActiveType(TYPE_MONSTER) and re:GetOwner()~=e:GetOwner()
end
function c36346532.cfilter(c,tp)
return c:GetSequence()<5 and c:IsFacedown() and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(c36346532.setfilter,tp,LOCATION_DECK,0,1,nil,c,tp)
return c:GetSequence()<5 and c:IsFacedown() and c:IsAbleToGrave() and Duel.GetSZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c36346532.setfilter,tp,LOCATION_DECK,0,1,nil,c,tp)
end
function c36346532.setfilter(c,mc,tp)
if not (c:IsSetCard(0xd4) and c:IsType(TYPE_TRAP)) then return false end
......
......@@ -71,8 +71,9 @@ function c47408488.plcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c47408488.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=e:GetHandler():GetCounter(0x6)
return ct>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=-1+ct
local c=e:GetHandler()
local ct=c:GetCounter(0x6)
return ct>0 and Duel.GetSZoneCount(tp,c)>=ct
and Duel.IsExistingMatchingCard(c47408488.plfilter,tp,LOCATION_DECK,0,ct,nil)
end
end
......
......@@ -31,9 +31,9 @@ function c54895237.initial_effect(c)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c54895237.costfilter(c,tp,sft)
function c54895237.costfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS) and c:IsAbleToGraveAsCost()
and Duel.GetMZoneCount(tp,c)>0 and (sft>0 or c:IsLocation(LOCATION_SZONE) and sft>-1)
and Duel.GetMZoneCount(tp,c)>0 and Duel.GetSZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c54895237.setfilter,tp,LOCATION_HAND,0,1,nil,c,tp)
end
function c54895237.setfilter(c,cc,tp)
......@@ -41,10 +41,9 @@ function c54895237.setfilter(c,cc,tp)
and not c:IsForbidden() and c:CheckUniqueOnField(tp,LOCATION_ONFIELD,cc)
end
function c54895237.gspcost(e,tp,eg,ep,ev,re,r,rp,chk)
local sft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return Duel.IsExistingMatchingCard(c54895237.costfilter,tp,LOCATION_ONFIELD,0,1,nil,tp,sft) end
if chk==0 then return Duel.IsExistingMatchingCard(c54895237.costfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c54895237.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp,sft)
local g=Duel.SelectMatchingCard(tp,c54895237.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function c54895237.gsptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -17,8 +17,7 @@ function c63086455.tgfilter(c,e,tp)
end
function c63086455.setfilter(c,cc,e,tp)
local b1=Duel.GetMZoneCount(1-tp,cc,tp)>0
local st=Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp)
local b2=st>0 or cc:IsLocation(LOCATION_SZONE) and cc:GetSequence()<5 and st>-1
local b2=Duel.GetSZoneCount(1-tp,cc,tp)>0
return b1 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp)
or (b2 or c:IsType(TYPE_FIELD)) and c:IsSSetable(true)
end
......
......@@ -31,7 +31,7 @@ function c91299846.initial_effect(c)
c:RegisterEffect(e3)
end
function c91299846.cfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS) and c:IsAbleToGraveAsCost()
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS) and c:IsAbleToGraveAsCost() and Duel.GetSZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c91299846.tffilter,tp,LOCATION_DECK,0,1,nil,c,tp)
end
function c91299846.tffilter(c,cc,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