Commit 5f305750 authored by Nemo Ma's avatar Nemo Ma

fix

parent 9429ea8b
...@@ -53,27 +53,52 @@ function cm.hand(g) ...@@ -53,27 +53,52 @@ function cm.hand(g)
end end
function cm.spcon(e,c,og,min,max) function cm.spcon(e,c,og,min,max)
if c==nil then return true end if c==nil then return true end
if og and not min then return true end
local tp=c:GetControler() local tp=c:GetControler()
local minc=2
local maxc=2
if min then
minc=math.max(minc,min)
maxc=math.min(maxc,max)
end
if maxc<minc then return false end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c)
if og then if og then
local og2=og:Filter(Card.IsCanBeXyzMaterial,nil,c) mg=og:Filter(cm.spfilter,c,c)
g:Merge(og2) else
mg=g
end end
return g:CheckSubGroup(cm.hand,2,2) local sg=aux.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
if sg:IsExists(aux.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(sg)
aux.GCheckAdditional=aux.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local res=mg:CheckSubGroup(aux.XyzLevelFreeGoal,minc,maxc,tp,c,cm.hand)
aux.GCheckAdditional=nil
return res
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then return true end if og and not min then return true end
local minc=2
local maxc=2
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c)
if og then if og then
local og2=og:Filter(Card.IsCanBeXyzMaterial,nil,c) mg=og:Filter(cm.spfilter,c,c)
g:Merge(og2) else
mg=g
end end
local sg=aux.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
Duel.SetSelectedCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:SelectSubGroup(tp,cm.hand,Duel.IsSummonCancelable(),2,2) local cancel=Duel.IsSummonCancelable()
if sg then aux.GCheckAdditional=aux.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
sg:KeepAlive() local g=mg:SelectSubGroup(tp,aux.XyzLevelFreeGoal,cancel,minc,maxc,tp,c,cm.hand)
e:SetLabelObject(sg) aux.GCheckAdditional=nil
if g and #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true return true
else return false end else return false end
end end
......
...@@ -55,27 +55,52 @@ function cm.hand(g) ...@@ -55,27 +55,52 @@ function cm.hand(g)
end end
function cm.spcon(e,c,og,min,max) function cm.spcon(e,c,og,min,max)
if c==nil then return true end if c==nil then return true end
if og and not min then return true end
local tp=c:GetControler() local tp=c:GetControler()
local minc=2
local maxc=2
if min then
minc=math.max(minc,min)
maxc=math.min(maxc,max)
end
if maxc<minc then return false end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c)
if og then if og then
local og2=og:Filter(Card.IsCanBeXyzMaterial,nil,c) mg=og:Filter(cm.spfilter,c,c)
g:Merge(og2) else
mg=g
end end
return g:CheckSubGroup(cm.hand,2,2) local sg=aux.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
if sg:IsExists(aux.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(sg)
aux.GCheckAdditional=aux.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local res=mg:CheckSubGroup(aux.XyzLevelFreeGoal,minc,maxc,tp,c,cm.hand)
aux.GCheckAdditional=nil
return res
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then return true end if og and not min then return true end
local minc=2
local maxc=2
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c)
if og then if og then
local og2=og:Filter(Card.IsCanBeXyzMaterial,nil,c) mg=og:Filter(cm.spfilter,c,c)
g:Merge(og2) else
mg=g
end end
local sg=aux.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
Duel.SetSelectedCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:SelectSubGroup(tp,cm.hand,Duel.IsSummonCancelable(),2,2) local cancel=Duel.IsSummonCancelable()
if sg then aux.GCheckAdditional=aux.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
sg:KeepAlive() local g=mg:SelectSubGroup(tp,aux.XyzLevelFreeGoal,cancel,minc,maxc,tp,c,cm.hand)
e:SetLabelObject(sg) aux.GCheckAdditional=nil
if g and #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true return true
else return false end else return false end
end end
......
...@@ -38,8 +38,8 @@ end ...@@ -38,8 +38,8 @@ end
function cm.cfilter(c,code) function cm.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code) return c:IsFaceup() and c:IsCode(code)
end end
function cm.filter(c) function cm.filter(c,act)
return c:IsSetCard(0x97d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode()) return c:IsSetCard(0x97d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode()) and not (act and c:IsCode(m))
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
...@@ -52,7 +52,8 @@ end ...@@ -52,7 +52,8 @@ 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)
local ft=0 local ft=0
if not e:GetHandler():IsLocation(LOCATION_SZONE) then ft=1 end if not e:GetHandler():IsLocation(LOCATION_SZONE) then ft=1 end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and (Duel.GetLocationCount(tp,LOCATION_SZONE)>ft or e:IsHasType(EFFECT_TYPE_QUICK_O)) end local act=e:IsHasType(EFFECT_TYPE_ACTIVATE)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,act) and (Duel.GetLocationCount(tp,LOCATION_SZONE)>ft or e:IsHasType(EFFECT_TYPE_QUICK_O)) end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
......
...@@ -44,8 +44,11 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,8 +44,11 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
c:ReplaceEffect(m+10,0) c:ReplaceEffect(m+10,0)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,2,2) aux.AddLinkProcedure(c,cm.matfilter,2,2)
local loc=c:GetLocation()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT) Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g)
end end
end end
function cm.matfilter(c) function cm.matfilter(c)
......
...@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
c:ReplaceEffect(m+10,0) c:ReplaceEffect(m+10,0)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),4,2) aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),4,2)
local loc=c:GetLocation()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT) Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g)
end end
end end
\ No newline at end of file
...@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
c:ReplaceEffect(m+10,0) c:ReplaceEffect(m+10,0)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1,1) aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1,1)
local loc=c:GetLocation()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT) Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g)
end end
end end
\ No newline at end of file
...@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
c:ReplaceEffect(m+10,0) c:ReplaceEffect(m+10,0)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),true) aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),true)
local loc=c:GetLocation()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT) Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g)
end end
end end
\ No newline at end of file
...@@ -16,8 +16,8 @@ end ...@@ -16,8 +16,8 @@ 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)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp) local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
local g2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,e:GetHandler()) local g2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,e:GetHandler())
local b1=#g1>0 local b1=#g1>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=#g2>0 local b2=#g2>0 and Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local s=0 local s=0
if b1 and not b2 then if b1 and not b2 then
...@@ -72,8 +72,21 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,8 +72,21 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
elseif e:GetLabel()==1 then elseif e:GetLabel()==1 then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local res=false local res=0
local ct=Duel.Draw(p,1,REASON_EFFECT) local g=Duel.GetMatchingGroup(aux.NOT(Card.IsSetCard),p,LOCATION_DECK,0,nil,0x6977)
local dcount=Duel.GetFieldGroupCount(p,LOCATION_DECK,0)
local seq=-1
local tc=g:GetFirst()
local dcard=nil
while tc do
if tc:GetSequence()>seq then
seq=tc:GetSequence()
dcard=tc
end
tc=g:GetNext()
end
res=Duel.Draw(p,dcount-seq,REASON_EFFECT)
--[[local ct=Duel.Draw(p,1,REASON_EFFECT)
while ct>0 do while ct>0 do
local dc=Duel.GetOperatedGroup():GetFirst() local dc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-p,dc) Duel.ConfirmCards(1-p,dc)
...@@ -82,8 +95,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,8 +95,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if dc:IsSetCard(0x6977) then if dc:IsSetCard(0x6977) then
ct=Duel.Draw(p,1,REASON_EFFECT) ct=Duel.Draw(p,1,REASON_EFFECT)
end end
end end--]]
if res then if res>0 then
local dg=Duel.GetOperatedGroup()
Duel.ConfirmCards(1-p,dg)
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0) local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
if #g<2 then return end if #g<2 then return end
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -44,5 +44,5 @@ function cm.xmatcon(e) ...@@ -44,5 +44,5 @@ function cm.xmatcon(e)
return e:GetHandler():GetOriginalAttribute()==ATTRIBUTE_DARK return e:GetHandler():GetOriginalAttribute()==ATTRIBUTE_DARK
end end
function cm.rmtg(e,c) function cm.rmtg(e,c)
return e:GetHandler():GetOverlayGroup():IsContains(c) return e:GetHandler():GetOverlayGroup():IsContains(c) and not c:IsReason(REASON_LOST_OVERLAY+REASON_RULE)
end end
\ No newline at end of file
...@@ -8,7 +8,7 @@ function cm.initial_effect(c) ...@@ -8,7 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c22348017.spcon) e1:SetCondition(c22348017.spcon)
e1:SetTarget(c22348017.sptg) e1:SetTarget(c22348017.sptg)
e1:SetOperation(c22348017.spop) e1:SetOperation(c22348017.spop)
......
...@@ -26,7 +26,7 @@ function c67200324.negtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,7 +26,7 @@ function c67200324.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c67200324.negop(e,tp,eg,ep,ev,re,r,rp) function c67200324.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.NegateActivation(ev) and c:IsRelateToEffect(e) and re:GetHandler():IsRelateToEffect(re) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(67200324,1)) e1:SetDescription(aux.Stringid(67200324,1))
......
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