Commit 35cc5293 authored by POLYMER's avatar POLYMER

fix

parent 72d5cc21
......@@ -129,7 +129,11 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
return (Duel.GetFlagEffect(0,11451901)>0 or Duel.CheckEvent(EVENT_CUSTOM+11451902)) and ft>0 and Duel.GetFlagEffect(tp,11451902)>0
end
Duel.ResetFlagEffect(tp,11451902)
if Duel.GetFlagEffect(1,11451901)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetOperation(function(e)
if Duel.GetFlagEffect(1,11451901)==0 and Duel.GetCurrentChain()==e:GetLabel() then
--change code
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
......@@ -142,6 +146,10 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e3,tp)
end
Duel.RegisterFlagEffect(1,11451901,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(Duel.GetCurrentChain())
Duel.RegisterEffect(e1,tp)
end
function cm.nmfilter(c)
return c:GetFlagEffect(11451908)==0 and Duel.IsExistingMatchingCard(Card.IsOriginalCodeRule,0,LOCATION_GRAVE,LOCATION_GRAVE,1,c,table.unpack({c:GetOriginalCodeRule()}))
......
......@@ -159,7 +159,11 @@ function cm.cpcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return ft>0 and Duel.GetFlagEffect(tp,11451902)>0 and e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.ResetFlagEffect(tp,11451902)
if Duel.GetFlagEffect(1,11451901)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetOperation(function(e)
if Duel.GetFlagEffect(1,11451901)==0 and Duel.GetCurrentChain()==e:GetLabel() then
--change code
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
......@@ -172,6 +176,10 @@ function cm.cpcost2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e3,tp)
end
Duel.RegisterFlagEffect(1,11451901,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(Duel.GetCurrentChain())
Duel.RegisterEffect(e1,tp)
end
function cm.nmfilter(c)
return c:GetFlagEffect(11451908)==0 and Duel.IsExistingMatchingCard(Card.IsOriginalCodeRule,0,LOCATION_GRAVE,LOCATION_GRAVE,1,c,table.unpack({c:GetOriginalCodeRule()}))
......
......@@ -73,9 +73,15 @@ function cm.initial_effect(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return ft>0 and Duel.GetFlagEffect(tp,11451902)>0 end
if chk==0 then
return ft>0 and Duel.GetFlagEffect(tp,11451902)>0
end
Duel.ResetFlagEffect(tp,11451902)
if Duel.GetFlagEffect(1,11451901)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetOperation(function(e)
if Duel.GetFlagEffect(1,11451901)==0 and Duel.GetCurrentChain()==e:GetLabel() then
--change code
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
......@@ -88,6 +94,10 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e3,tp)
end
Duel.RegisterFlagEffect(1,11451901,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(Duel.GetCurrentChain())
Duel.RegisterEffect(e1,tp)
end
function cm.nmfilter(c)
return c:GetFlagEffect(11451908)==0 and Duel.IsExistingMatchingCard(Card.IsOriginalCodeRule,0,LOCATION_GRAVE,LOCATION_GRAVE,1,c,table.unpack({c:GetOriginalCodeRule()}))
......
......@@ -21,7 +21,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,13131309)
e2:SetCountLimit(1,13131310)
e2:SetCondition(cm.spcon2)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......
......@@ -135,7 +135,7 @@ function yume.QuickDualSelectCheck(g1,g2,uniqf,...)
--Experimental quick algorithm for checking if there are two cards from two groups, one for each group
--param uniqf is a function for extra unique restrictions like different card names(currently unimplemented)
local g3=g1&g2
return #g1>0 and #g2>0 and not (#g1==#g3 and #g2==#g3 and #g1==1) end
return #g1>0 and #g2>0 and not (#g1==#g3 and #g2==#g3 and #g1==1)
end
function yume.QuickDualSelect(tp,g1,g2,msg1,msg2,opf,...)
--Experimental quick algorithm for selecting two cards from two groups, one for each group
......
......@@ -50,6 +50,11 @@ function s.initial_effect(c)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
Duel.RegisterEffect(ge2,1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_ADJUST)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
local g=Duel.GetMatchingGroup(s.actfilter,0,0xff,0xff,nil)
for tc in aux.Next(g) do
local te=tc:GetActivateEffect()
......@@ -71,6 +76,8 @@ function s.initial_effect(c)
tc:RegisterEffect(ge2)
end
end
end)
Duel.RegisterEffect(e0,0)
end
end
function s.spcfilter1(c)
......
......@@ -8,9 +8,9 @@ function c91060017.initial_effect(c)
e3:SetCondition(cm.handcon)
c:RegisterEffect(e3)
local e13=e3:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(cm.handcon2)
c:RegisterEffect(e2)
e13:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e13:SetCondition(cm.handcon1)
c:RegisterEffect(e13)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
......@@ -48,34 +48,39 @@ end
function cm.handcon1(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
end
function cm.cfilter(c)
return c:IsAbleToGrave()
function cm.cfilter(c,e)
return c:IsAbleToGrave() and c:IsType(TYPE_MONSTER)and not c:IsImmuneToEffect(e)
end
function cm.filter(c,e,tp)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_LINK+TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.filter2(c,e,tp,g)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_LINK+TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:CheckFusionMaterial(g) or c:IsSynchroSummonable(nil,g) or c:IsLinkSummonable(g) or c:IsXyzSummonable(g))
end
function cm.chk(g,e,tp)
local sg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil,e,tp)
return sg:IsExists(Card.CheckFusionMaterial,1,nil,g)
or sg:IsExists(Card.IsSynchroSummonable,1,nil,nil,g) or sg:IsExists(Card.IsLinkSummonable,1,nil,g) or sg:IsExists(Card.IsXyzSummonable,1,nil,g)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return mg:CheckSubGroup(cm.chk,1,99,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spfit(c,g)
return c:CheckFusionMaterial(g) or c:IsSynchroSummonable(nil,g) or c:IsLinkSummonable(g) or c:IsXyzSummonable(g)
end
function cm.spfit2(g,c)
return c:CheckFusionMaterial(g) or c:IsSynchroSummonable(nil,g) or c:IsLinkSummonable(g) or c:IsXyzSummonable(g)
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=mg:SelectSubGroup(tp,cm.chk,false,1,99,e,tp)
Duel.SendtoGrave(g,REASON_EFFECT)
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fg=Duel.SelectMatchingCard(tp,cm.spfit,tp,LOCATION_EXTRA,0,1,1,nil,g)
if #fg>0 then
Duel.SpecialSummon(fg,0,tp,tp,false,false,POS_FACEUP)
local fc=Duel.SelectMatchingCard(tp,cm.spfit,tp,LOCATION_EXTRA,0,1,1,nil,mg):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=mg:SelectSubGroup(tp,cm.spfit2,false,1,99,fc)
if Duel.SendtoGrave(g,REASON_EFFECT)>0 and fc then
Duel.SpecialSummon(fc,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.desfilter(c,atk)
......
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