Commit 328e0c90 authored by mallu11's avatar mallu11 Committed by GitHub

fix スプリガンズ・シップ エクスブロウラー (#1535)

parent ce212171
......@@ -30,27 +30,35 @@ end
function c62941499.desfilter(c)
return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5
end
function c62941499.seqfilter(c,seq)
function c62941499.exmzfilter(c,seq)
return c:GetSequence()==seq
end
function c62941499.seqfilter(c,seq,tp)
local loc=LOCATION_MZONE
if seq>=8 then
loc=LOCATION_SZONE
seq=seq-8
end
if seq>=5 and seq<=7 then return false end
if seq>=5 and loc==LOCATION_SZONE then return false end
if seq==7 and loc==LOCATION_MZONE then return false end
local cseq=c:GetSequence()
local cloc=c:GetLocation()
if cloc==LOCATION_SZONE and cseq>=5 then return false end
if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE
and (seq==1 and cseq==5 or seq==3 and cseq==6) then return true end
return cseq==seq or cloc==loc and math.abs(cseq-seq)==1
and (seq==1 and cseq==5 or seq==3 and cseq==6 or seq==cseq) then return true end
if cloc==LOCATION_MZONE and seq>=5 and loc==LOCATION_MZONE
and Duel.IsExistingMatchingCard(c62941499.exmzfilter,tp,0,LOCATION_MZONE,1,nil,seq) then
return seq==5 and cseq==1 or seq==6 and cseq==3
end
return cseq==seq or seq<5 and cseq<5 and cloc==loc and math.abs(cseq-seq)==1
end
function c62941499.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT)
and Duel.IsExistingMatchingCard(c62941499.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local filter=0
for i=0,16 do
if not Duel.IsExistingMatchingCard(c62941499.seqfilter,tp,0,LOCATION_ONFIELD,1,nil,i) then
for i=0,15 do
if not Duel.IsExistingMatchingCard(c62941499.seqfilter,tp,0,LOCATION_ONFIELD,1,nil,i,tp) then
filter=filter|1<<(i+16)
end
end
......@@ -58,19 +66,19 @@ function c62941499.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local flag=Duel.SelectField(tp,1,0,LOCATION_ONFIELD,filter)
local seq=math.log(flag>>16,2)
e:SetLabel(seq)
local g=Duel.GetMatchingGroup(c62941499.seqfilter,tp,0,LOCATION_ONFIELD,nil,seq)
local g=Duel.GetMatchingGroup(c62941499.seqfilter,tp,0,LOCATION_ONFIELD,nil,seq,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c62941499.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local seq=e:GetLabel()
local ct=Duel.GetMatchingGroupCount(c62941499.seqfilter,tp,0,LOCATION_ONFIELD,nil,seq)
local ct=Duel.GetMatchingGroupCount(c62941499.seqfilter,tp,0,LOCATION_ONFIELD,nil,seq,tp)
if ct<=0 or not c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) then return end
local count=c:RemoveOverlayCard(tp,1,ct,REASON_EFFECT)
if count<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c62941499.seqfilter,tp,0,LOCATION_ONFIELD,count,count,nil,seq)
local g=Duel.SelectMatchingCard(tp,c62941499.seqfilter,tp,0,LOCATION_ONFIELD,count,count,nil,seq,tp)
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
......
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