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

fix

parent 9429ea8b
......@@ -53,27 +53,52 @@ function cm.hand(g)
end
function cm.spcon(e,c,og,min,max)
if c==nil then return true end
if og and not min then return true end
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)
if og then
local og2=og:Filter(Card.IsCanBeXyzMaterial,nil,c)
g:Merge(og2)
mg=og:Filter(cm.spfilter,c,c)
else
mg=g
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
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
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)
if og then
local og2=og:Filter(Card.IsCanBeXyzMaterial,nil,c)
g:Merge(og2)
mg=og:Filter(cm.spfilter,c,c)
else
mg=g
end
local sg=aux.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
Duel.SetSelectedCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:SelectSubGroup(tp,cm.hand,Duel.IsSummonCancelable(),2,2)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
local cancel=Duel.IsSummonCancelable()
aux.GCheckAdditional=aux.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local g=mg:SelectSubGroup(tp,aux.XyzLevelFreeGoal,cancel,minc,maxc,tp,c,cm.hand)
aux.GCheckAdditional=nil
if g and #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
......
......@@ -55,27 +55,52 @@ function cm.hand(g)
end
function cm.spcon(e,c,og,min,max)
if c==nil then return true end
if og and not min then return true end
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)
if og then
local og2=og:Filter(Card.IsCanBeXyzMaterial,nil,c)
g:Merge(og2)
mg=og:Filter(cm.spfilter,c,c)
else
mg=g
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
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
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)
if og then
local og2=og:Filter(Card.IsCanBeXyzMaterial,nil,c)
g:Merge(og2)
mg=og:Filter(cm.spfilter,c,c)
else
mg=g
end
local sg=aux.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
Duel.SetSelectedCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:SelectSubGroup(tp,cm.hand,Duel.IsSummonCancelable(),2,2)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
local cancel=Duel.IsSummonCancelable()
aux.GCheckAdditional=aux.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local g=mg:SelectSubGroup(tp,aux.XyzLevelFreeGoal,cancel,minc,maxc,tp,c,cm.hand)
aux.GCheckAdditional=nil
if g and #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
......
......@@ -38,8 +38,8 @@ end
function cm.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function cm.filter(c)
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())
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()) and not (act and c:IsCode(m))
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
......@@ -52,7 +52,8 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=0
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())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
......
......@@ -44,8 +44,11 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
c:ReplaceEffect(m+10,0)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,2,2)
local loc=c:GetLocation()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g)
end
end
function cm.matfilter(c)
......
......@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
c:ReplaceEffect(m+10,0)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),4,2)
local loc=c:GetLocation()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g)
end
end
\ No newline at end of file
......@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
c:ReplaceEffect(m+10,0)
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1,1)
local loc=c:GetLocation()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g)
end
end
\ No newline at end of file
......@@ -44,7 +44,10 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
c:ReplaceEffect(m+10,0)
c:EnableReviveLimit()
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.ConfirmCards(1-tp,c)
local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g)
end
end
\ No newline at end of file
......@@ -16,8 +16,8 @@ end
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 g2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,e:GetHandler())
local b1=#g1>0
local b2=#g2>0
local b1=#g1>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=#g2>0 and Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return b1 or b2 end
local s=0
if b1 and not b2 then
......@@ -72,8 +72,21 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
elseif e:GetLabel()==1 then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local res=false
local ct=Duel.Draw(p,1,REASON_EFFECT)
local res=0
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
local dc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-p,dc)
......@@ -82,8 +95,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if dc:IsSetCard(0x6977) then
ct=Duel.Draw(p,1,REASON_EFFECT)
end
end
if res then
end--]]
if res>0 then
local dg=Duel.GetOperatedGroup()
Duel.ConfirmCards(1-p,dg)
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
if #g<2 then return end
Duel.BreakEffect()
......
......@@ -44,5 +44,5 @@ function cm.xmatcon(e)
return e:GetHandler():GetOriginalAttribute()==ATTRIBUTE_DARK
end
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
\ No newline at end of file
......@@ -8,7 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c22348017.spcon)
e1:SetTarget(c22348017.sptg)
e1:SetOperation(c22348017.spop)
......
......@@ -26,7 +26,7 @@ function c67200324.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c67200324.negop(e,tp,eg,ep,ev,re,r,rp)
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)
local e1=Effect.CreateEffect(e:GetHandler())
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