Commit d415d50c authored by sidschingis's avatar sidschingis

fix

needs to target at least 1 Monster in each Graveyard
parent d751cff9
...@@ -28,23 +28,27 @@ end ...@@ -28,23 +28,27 @@ end
function c96142517.filter1(c,e,tp) function c96142517.filter1(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) return c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c96142517.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetRank()+1) and Duel.IsExistingMatchingCard(c96142517.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetRank()+1)
and Duel.IsExistingMatchingCard(c96142517.filter3,tp,0,LOCATION_GRAVE,1,nil,c:GetRank())
end end
function c96142517.filter2(c,e,tp,rank) function c96142517.filter2(c,e,tp,rank)
return c:GetRank()==rank and (c:IsSetCard(0x1048) or c:IsSetCard(0x1073)) return c:GetRank()==rank and (c:IsSetCard(0x1048) or c:IsSetCard(0x1073))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end end
function c96142517.filter3(c,e,tp,rank) function c96142517.filter3(c,rank)
return c:GetRank()==rank and c:IsType(TYPE_XYZ) return c:GetRank()==rank and c:IsType(TYPE_XYZ)
end end
function c96142517.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c96142517.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c96142517.filter1(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c96142517.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c96142517.filter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp)end and Duel.IsExistingTarget(c96142517.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tg=Duel.SelectTarget(tp,c96142517.filter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp) local tg=Duel.SelectTarget(tp,c96142517.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
e:SetLabel(tg:GetFirst():GetRank()) local rank=tg:GetFirst():GetRank()
local g=Duel.GetMatchingGroup(c96142517.filter3,tp,LOCATION_GRAVE,LOCATION_GRAVE,tg:GetFirst(),e,tp,tg:GetFirst():GetRank()) e:SetLabel(rank)
local tg2=Duel.SelectTarget(tp,c96142517.filter3,tp,0,LOCATION_GRAVE,1,1,nil,rank)
tg:Merge(tg2)
local g=Duel.GetMatchingGroup(c96142517.filter3,tp,LOCATION_GRAVE,LOCATION_GRAVE,tg:GetFirst(),rank)
g:Sub(tg2)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(96142517,1)) then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(96142517,1)) then
g=g:Select(tp,1,99,nil) g=g:Select(tp,1,99,nil)
tg:Merge(g) tg:Merge(g)
......
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