Commit 4183a879 authored by Huangnan's avatar Huangnan

fix

parent e8b5763d
Pipeline #38087 failed with stages
in 91 minutes and 47 seconds
......@@ -39,7 +39,14 @@ function cm.getlv(c)
end
end
function cm.gcheck(g,sg)
local lvsum=g:GetSum(cm.getlv)
local lvsum=0
for tc in aux.Next(g) do
if tc:IsLevelAbove(1) then
lvsum=lvsum+tc:GetLevel()
else
lvsum=lvsum+1
end
end
if lvsum==1 then
return sg:IsExists(Card.IsCode,1,nil,60001508)
elseif lvsum==2 then
......@@ -52,7 +59,7 @@ function cm.con(e,tp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.tgcheck,tp,LOCATION_HAND,0,c)
local sg=Duel.GetMatchingGroup(cm.thcheck,tp,LOCATION_REMOVED,0,nil)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==tp and Duel.GetCurrentChain()<1 and sg:CheckSubGroup(cm.gcheck,1,#g,sg)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==tp and Duel.GetCurrentChain()<1 and g:CheckSubGroup(cm.gcheck,1,#g,sg)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -66,7 +73,16 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.AdjustAll()
og:RemoveCard(c)
local ag=Group.CreateGroup()
local lvsum=og:GetSum(cm.getlv)
local lvsum=0
for tc in aux.Next(og) do
if tc:IsLevelAbove(1) then
lvsum=lvsum+tc:GetLevel()
else
lvsum=lvsum+1
end
end
Debug.Message(#og)
Debug.Message(lvsum)
if lvsum==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
ag=sg:FilterSelect(tp,Card.IsCode,1,1,nil,60001508)
......
......@@ -52,6 +52,7 @@ function cm.fop(e,tp,eg,ep,ev,re,r,rp)
g1:AddCard(c)
if Duel.SendtoGrave(g1,REASON_EFFECT)>2 then
Duel.AdjustAll()
local g3=Duel.GetMatchingGroup(cm.ffil2,tp,LOCATION_REMOVED,0,nil):GetFirst()
Duel.SendtoHand(g3,nil,REASON_EFFECT)
end
end
......
......@@ -14,8 +14,8 @@ function cm.filter(c)
return c:IsCode(60001505) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.cfil(c)
return c:IsFaceup() and c:IsCanAddCounter(0x624,1) and c:IsType(TYPE_MONSTER)
......@@ -25,7 +25,7 @@ function cm.mfil(c)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local a1,a2,a3=0
......
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