Commit 226ced13 authored by POLYMER's avatar POLYMER

fix

parent 03be6656
...@@ -55,7 +55,6 @@ function cm.fselect(g) ...@@ -55,7 +55,6 @@ function cm.fselect(g)
return g:GetClassCount(Card.GetLeftScale)==#g return g:GetClassCount(Card.GetLeftScale)==#g
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if #g==0 then return end if #g==0 then return end
local num=g:GetClassCount(Card.GetLeftScale) local num=g:GetClassCount(Card.GetLeftScale)
......
...@@ -111,7 +111,7 @@ function cm.rffilter(c) ...@@ -111,7 +111,7 @@ function cm.rffilter(c)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsLocation(LOCATION_SZONE) or not c:IsFaceup() then return end if not c:IsLocation(LOCATION_SZONE) then return end
local lg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local lg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local x,y=cm.xylabel(c,tp) local x,y=cm.xylabel(c,tp)
local g=lg:Filter(cm.islinkdir,nil,x,y,tp) local g=lg:Filter(cm.islinkdir,nil,x,y,tp)
......
...@@ -243,7 +243,7 @@ function cm.rffilter(c) ...@@ -243,7 +243,7 @@ function cm.rffilter(c)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsLocation(LOCATION_SZONE) then return end if not c:IsLocation(LOCATION_SZONE) then return end
local lg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local lg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local x,y=cm.xylabel(c,tp) local x,y=cm.xylabel(c,tp)
local g=lg:Filter(cm.islinkdir,nil,x,y,tp) local g=lg:Filter(cm.islinkdir,nil,x,y,tp)
......
...@@ -138,7 +138,7 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -138,7 +138,7 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject() local te=e:GetLabelObject()
if cm[0] or CONVIATRESS_BUFF[te] then return end if cm[0] or CONVIATRESS_BUFF[te] then return end
local tg=te:GetTarget() or aux.TRUE local tg=te:GetTarget() or aux.TRUE
if te:GetHandler():GetType()&0x20004==0x20004 and te:IsHasType(EFFECT_TYPE_ACTIVATE) and not te:GetCost() and not te:GetTarget() and not te:GetOperation() then if te:GetHandler():GetType()&0x20004==0x20004 and te:IsHasType(EFFECT_TYPE_ACTIVATE) and not te:GetCost() and not te:GetTarget() then
local extg=Duel.GetMatchingGroup(cm.extfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil) local extg=Duel.GetMatchingGroup(cm.extfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil)
if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(11451779,2)) then if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(11451779,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
...@@ -306,7 +306,6 @@ end ...@@ -306,7 +306,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,nil) local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil,tp) local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil,tp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local th=false local th=false
if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
...@@ -22,7 +22,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -22,7 +22,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -39,7 +39,14 @@ function cm.getlv(c) ...@@ -39,7 +39,14 @@ function cm.getlv(c)
end end
end end
function cm.gcheck(g,sg) 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 if lvsum==1 then
return sg:IsExists(Card.IsCode,1,nil,60001508) return sg:IsExists(Card.IsCode,1,nil,60001508)
elseif lvsum==2 then elseif lvsum==2 then
...@@ -52,7 +59,7 @@ function cm.con(e,tp) ...@@ -52,7 +59,7 @@ function cm.con(e,tp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.tgcheck,tp,LOCATION_HAND,0,c) local g=Duel.GetMatchingGroup(cm.tgcheck,tp,LOCATION_HAND,0,c)
local sg=Duel.GetMatchingGroup(cm.thcheck,tp,LOCATION_REMOVED,0,nil) 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 end
function cm.op2(e,tp,eg,ep,ev,re,r,rp) function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -66,7 +73,16 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +73,16 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.AdjustAll() Duel.AdjustAll()
og:RemoveCard(c) og:RemoveCard(c)
local ag=Group.CreateGroup() 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 if lvsum==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
ag=sg:FilterSelect(tp,Card.IsCode,1,1,nil,60001508) 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) ...@@ -52,6 +52,7 @@ function cm.fop(e,tp,eg,ep,ev,re,r,rp)
g1:AddCard(c) g1:AddCard(c)
if Duel.SendtoGrave(g1,REASON_EFFECT)>2 then if Duel.SendtoGrave(g1,REASON_EFFECT)>2 then
Duel.AdjustAll() Duel.AdjustAll()
local g3=Duel.GetMatchingGroup(cm.ffil2,tp,LOCATION_REMOVED,0,nil):GetFirst()
Duel.SendtoHand(g3,nil,REASON_EFFECT) Duel.SendtoHand(g3,nil,REASON_EFFECT)
end end
end end
......
...@@ -14,8 +14,8 @@ function cm.filter(c) ...@@ -14,8 +14,8 @@ function cm.filter(c)
return c:IsCode(60001505) and c:IsAbleToHand() return c:IsCode(60001505) and c:IsAbleToHand()
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) 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 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) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.cfil(c) function cm.cfil(c)
return c:IsFaceup() and c:IsCanAddCounter(0x624,1) and c:IsType(TYPE_MONSTER) return c:IsFaceup() and c:IsCanAddCounter(0x624,1) and c:IsType(TYPE_MONSTER)
...@@ -25,7 +25,7 @@ function cm.mfil(c) ...@@ -25,7 +25,7 @@ function cm.mfil(c)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) 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 if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
local a1,a2,a3=0 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