Commit e65e8990 authored by Nemo Ma's avatar Nemo Ma

fix

parent 08c1f3d7
...@@ -326,14 +326,14 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -326,14 +326,14 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
e1:SetTargetRange(0,LOCATION_ONFIELD) e1:SetTargetRange(0,LOCATION_ONFIELD)
e1:SetReset(RESET_CHAIN) e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING) e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetLabelObject(e1) e2:SetLabelObject(e1)
e2:SetOperation(cm.disop5) e2:SetOperation(cm.disop5)
e2:SetReset(RESET_CHAIN) e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetLabelObject(e2) e3:SetLabelObject(e2)
......
--混沌的轮回 循环 --混沌的轮回 循环
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end local m=30000220
local m,cm=rscf.DefineCard(30000220) local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1=rsef.ACT(c,nil,nil,nil,"td,dr",nil,nil,nil,cm.tg,cm.act) --Activate
local e2=rsef.I(c,{m,0},nil,"td,dr","tg",LOCATION_GRAVE,aux.exccon,nil,rstg.target({cm.tdfilter,"td",LOCATION_GRAVE+LOCATION_REMOVED,0,2 },rsop.list(Card.IsAbleToDeck,"td"),rsop.list(1,"dr")),cm.drop) local e1=Effect.CreateEffect(c)
if cm.actct then return end e1:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
cm.actct=0 e1:SetType(EFFECT_TYPE_ACTIVATE)
local ge1=Effect.CreateEffect(c) e1:SetCode(EVENT_FREE_CHAIN)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetTarget(cm.tg)
ge1:SetCode(EVENT_CHAIN_NEGATED) e1:SetOperation(cm.act)
ge1:SetOperation(cm.regop) c:RegisterEffect(e1)
Duel.RegisterEffect(ge1,tp) --Effect 2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(aux.exccon)
e2:SetTarget(cm.tdtg)
e2:SetOperation(cm.tdop)
c:RegisterEffect(e2)
if cm.ctcounter==nil then
cm.ctcounter=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop1)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_CHAIN_NEGATED)
ge2:SetOperation(cm.checkop2)
Duel.RegisterEffect(ge2,0)
end
end end
function cm.checkfun(att) --all
return function(c) function cm.checkop1(e,tp,eg,ep,ev,re,r,rp)
return (c:IsType(TYPE_MONSTER) and c:IsAttribute(att)) or ((c:IsComplexType(TYPE_SPELL+TYPE_PENDULUM) and c:GetAttribute()&att>0)) local ct1,ct2,pl=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_CODE2,CHAININFO_TRIGGERING_CONTROLER)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and (ct1==30000220 or ct2==30000220) then
cm[pl]=cm[pl]+1
end end
end end
cm.hnchecks={cm.checkfun(ATTRIBUTE_LIGHT),cm.checkfun(ATTRIBUTE_DARK)} function cm.checkop2(e,tp,eg,ep,ev,re,r,rp)
function cm.regop(e,tp,eg,ep,ev,re,r,rp) local ct1,ct2,pl=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_CODE2,CHAININFO_TRIGGERING_CONTROLER)
if re:GetHandler():IsCode(m) then if re:IsHasType(EFFECT_TYPE_ACTIVATE) and (ct1==30000220 or ct2==30000220) then
cm.actct=math.max(cm.actct-1,0) cm[pl]=cm[pl]-1
end end
end end
function cm.cfilter(c) --Effect 1
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToDeck() function cm.tf(c)
local chk=c:IsType(TYPE_MONSTER)
if c:IsLocation(LOCATION_PZONE) then
chk=c:GetOriginalType()&TYPE_MONSTER~=0
end
local b1=c:IsFaceupEx()
local b2=c:IsAbleToDeck()
local b3=c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
return b1 and b2 and b3 and chk
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil) local g=Duel.GetMatchingGroup(cm.tf,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_PZONE,0,nil)
if chk==0 then return g:CheckSubGroupEach(cm.hnchecks,aux.TRUE) and Duel.IsPlayerCanDraw(tp,cm.actct+3) end if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK) and Duel.IsPlayerCanDraw(tp,cm[tp]+2) end
cm.actct=cm.actct+1 Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,cm[tp]+2)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end end
function cm.act(e,tp) function cm.act(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil) Debug.Message(cm[tp])
if not g:CheckSubGroupEach(cm.hnchecks,aux.TRUE) then return end local g=Duel.GetMatchingGroup(cm.tf,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_PZONE,0,nil)
local tg=g:SelectSubGroupEach(tp,cm.hnchecks,false,aux.TRUE) if not g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
local hg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND) local hg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if #hg>0 then if #hg>0 then Duel.ConfirmCards(1-tp,hg) end
Duel.ConfirmCards(1-tp,hg)
end
Duel.HintSelection(tg-hg) Duel.HintSelection(tg-hg)
if Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)>0 then if Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)==0 then return false end
local og=Duel.GetOperatedGroup() local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then local gt=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
Duel.ShuffleDeck(tp) if gt==0 then return false end
end Duel.Draw(tp,cm[tp]+2,REASON_EFFECT)
Duel.Draw(tp,cm.actct+2,REASON_EFFECT) end
end --Effect 2
function cm.df(c,e)
local b1=c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
local b2=c:IsFaceupEx()
local b3=c:IsAbleToDeck()
return b1 and b2 and b3 and c:IsCanBeEffectTarget(e)
end end
function cm.tdfilter(c) function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) and c:IsAbleToDeck() local ec=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.df(chkc,e) end
local g=Duel.GetMatchingGroup(cm.df,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
if chk==0 then return ec:IsAbleToDeck() and #g>=2 and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,2,2,nil)
Duel.SetTargetCard(sg)
local tg=sg:Clone()
tg:AddCard(ec)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function cm.drop(e,tp) function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=rsgf.GetTargetGroup() local ec=e:GetHandler()
local c=aux.ExceptThisCard(e) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not c or #tg<=0 then return end if #tg>0 and ec:IsRelateToEffect(e) then
tg:AddCard(c) local ttg=tg:Clone()
if Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)>0 then ttg:AddCard(ec)
local og=Duel.GetOperatedGroup() Duel.SendtoDeck(ttg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then local g=Duel.GetOperatedGroup()
Duel.ShuffleDeck(tp) if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end end
Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
\ No newline at end of file
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