Commit a732afa6 authored by POLYMER's avatar POLYMER

fix

parent 696a55d1
...@@ -73,7 +73,7 @@ function c19209516.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,7 +73,7 @@ function c19209516.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
function c19209516.efilter(e,c,rp,r,re) function c19209516.efilter(e,c,rp,r,re)
return re and r&REASON_EFFECT>0 and rp==1-e:GetHandlerPlayer() return c==e:GetHandler() and re and r&REASON_EFFECT>0 and rp==1-e:GetHandlerPlayer()
end end
function c19209516.pfilter(c) function c19209516.pfilter(c)
return c:IsCode(19209511) and not c:IsForbidden() return c:IsCode(19209511) and not c:IsForbidden()
......
...@@ -97,7 +97,6 @@ function cm.ActivateCard(c,tp,oe) ...@@ -97,7 +97,6 @@ function cm.ActivateCard(c,tp,oe)
end end
end end
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL and e:GetHandler():IsReason(REASON_EFFECT) return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL and e:GetHandler():IsReason(REASON_EFFECT)
...@@ -118,37 +117,7 @@ end ...@@ -118,37 +117,7 @@ end
function cm.slfilter(c,sc,lv) function cm.slfilter(c,sc,lv)
return c:GetSynchroLevel(sc)==lv return c:GetSynchroLevel(sc)==lv
end end
function Auxiliary.SynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk)
local eg=mg:Clone()
local tempg=mg-sg
for c in aux.Next(tempg) do
if eg:IsContains(c) then
sg:AddCard(c)
ct=ct+1
if Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk) or (ct<maxc and Auxiliary.SynMixCheckRecursive(c,tp,sg,eg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk)) then return true end
sg:RemoveCard(c)
ct=ct-1
--eg:RemoveCard(c)
eg:Sub(eg:Filter(cm.slfilter,nil,syncard,c:GetSynchroLevel(syncard)))
end
end
return false
end
function Auxiliary.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgchk)
cm.fparams={f4,c1,c2,c3}
if f4 and not f4(c,syncard,c1,c2,c3) then return false end
local sg=Group.FromCards(c1,c)
sg:AddCard(c1)
if c2 then sg:AddCard(c2) end
if c3 then sg:AddCard(c3) end
local mg=mg1:Clone()
if f4 then
mg=mg:Filter(f4,sg,syncard,c1,c2,c3)
else
mg:Sub(sg)
end
return Auxiliary.SynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,gc,mgchk)
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 g=Duel.GetMatchingGroup(cm.symfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil,e) local g=Duel.GetMatchingGroup(cm.symfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil,e)
if chk==0 then if chk==0 then
...@@ -178,7 +147,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -178,7 +147,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.symfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil,e) local g=Duel.GetMatchingGroup(cm.symfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil,e)
local tc=Duel.SelectMatchingCard(tp,cm.espfil3,tp,LOCATION_EXTRA,0,1,1,nil,g,e,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.espfil3,tp,LOCATION_EXTRA,0,1,1,nil,g,e,tp):GetFirst()
cm.SubGroupParams={function(c,sc) return c:GetSynchroLevel(tc)==sc:GetSynchroLevel(tc) and (not cm.fparams or (cm.fparams[1](c,tc,table.unpack(cm.fparams,2))==cm.fparams[1](sc,tc,table.unpack(cm.fparams,2)))) end,Card.GetLevel,nil,false} cm.SubGroupParams={function(c,sc) return c:GetSynchroLevel(tc)==sc:GetSynchroLevel(tc) and (not cm.fparams or (cm.fparams[1](c,tc,table.unpack(cm.fparams,2))==cm.fparams[1](sc,tc,table.unpack(cm.fparams,2)))) end,Card.GetLevel,nil,false}
local mat1=g:SelectSubGroup(tp,cm.espfil2,false,1,3,tc) local mat1=cm.SelectSubGroup(g,tp,cm.espfil2,false,1,3,tc)
cm.SubGroupParams={} cm.SubGroupParams={}
cm.fparams=nil cm.fparams=nil
if mat1:IsExists(function(c) return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND) end,1,nil) then if mat1:IsExists(function(c) return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND) end,1,nil) then
...@@ -204,7 +173,34 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -204,7 +173,34 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
function cm.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and (c:IsSetCard(0x181) or aux.IsCodeListed(c,56099748)) and c:IsFaceup() and c:IsSSetable()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetCondition(cm.setcon)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function cm.fit1(c)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x181)
end
function cm.setcon(e,c)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(cm.fit1,tp,LOCATION_MZONE,0,1,nil)
end
--subgroup optimization --subgroup optimization
function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...) function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
......
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