Commit d58dbbaa authored by Vury Leo's avatar Vury Leo

Add GMX Dinosaur support

parent 640aa925
Pipeline #42853 failed with stages
in 4 minutes and 36 seconds
......@@ -20,7 +20,12 @@ function s.cfilter2(c)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_DECK,0,1,nil)
return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(
function(c) return s.cfilter1(c) or s.cfilter2(c) end,
tp,LOCATION_DECK,0,2,nil
)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA)
end
......@@ -35,9 +40,22 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if #g1==0 then return end
local g2=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_DECK,0,nil)
if #g2==0 then return end
local _,seq1=g1:GetMaxGroup(Card.GetSequence)
local _,seq2=g2:GetMaxGroup(Card.GetSequence)
local seq=math.min(seq1,seq2)
-- top card in g1
local c1=g1:GetMaxGroup(Card.GetSequence):GetFirst()
-- top card in g2
local c2=g2:GetMaxGroup(Card.GetSequence):GetFirst()
local seq=math.min(c1:GetSequence(),c2:GetSequence())
-- same card: try 2nd top
if c1==c2 then
g1:RemoveCard(c1)
g2:RemoveCard(c2)
-- if no 2nd cards, just exit
if #g1==0 and #g2==0 then return end
local seq1=(#g1>0) and select(2,g1:GetMaxGroup(Card.GetSequence)) or -1
local seq2=(#g2>0) and select(2,g2:GetMaxGroup(Card.GetSequence)) or -1
seq=math.max(seq1,seq2)
end
local excavate_count=dcount-seq
Duel.ConfirmDecktop(tp,excavate_count)
Duel.SetLP(tp,Duel.GetLP(tp)-excavate_count*400)
......
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