Commit 2c0b368e authored by TanakaKotoha's avatar TanakaKotoha

mopemope

parent c969d649
--时机龙骑·刻神指令 --时机龙骑·刻神指令
function c40009205.initial_effect(c) local m=40009205
local cm=_G["c"..m]
function cm.initial_effect(c)
--proce
c:EnableReviveLimit() c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false) aux.EnablePendulumAttribute(c,false)
aux.AddXyzProcedure(c,c40009205.mfilter,10,3) aux.AddXyzProcedure(c,cm.matfilter,10,3)
-- --pendulum
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40009205,0)) e1:SetDescription(aux.Stringid(m,3))
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G) e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c40009205.PendCondition()) e1:SetCondition(cm.PendCondition())
e1:SetOperation(c40009205.PendOperation()) e1:SetOperation(cm.PendOperation())
e1:SetValue(SUMMON_TYPE_PENDULUM) e1:SetValue(SUMMON_TYPE_PENDULUM)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroy --reg
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40009205,1)) e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,40009205) e2:SetCountLimit(1,m)
e2:SetCondition(c40009205.atkcon) e2:SetCondition(cm.xyzcon)
e2:SetOperation(c40009205.atkop) e2:SetOperation(cm.xyzop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--pendulum --place
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(cm.reg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(40009205,4)) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c40009205.pencon) e4:SetCountLimit(1)
e4:SetTarget(c40009205.pentg) e4:SetCondition(cm.pcon)
e4:SetOperation(c40009205.penop) e4:SetTarget(cm.ptg)
e4:SetOperation(cm.pop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c40009205.mfilter(c) function cm.xyzcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.xyzop(e,tp)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,0,m)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(cm.negcon)
e1:SetOperation(cm.negop)
Duel.RegisterEffect(e1,tp)
end
function cm.matfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_DARK) return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_DARK)
end end
function c40009205.PConditionFilter(c,e,tp) function cm.PConditionExtraFilterSpecific(c,e,tp,nu1,nu2,te)
local lv=0 if not te then return true end
if c.pendulum_level then local f=te:GetValue()
lv=c.pendulum_level return not f or f(te,c,e,tp,nil,nil)
else end
lv=c:GetLevel() function cm.PConditionExtraFilter(c,e,tp,nu1,nu2,eset)
end for _,te in ipairs(eset) do
local bool=aux.PendulumSummonableBool(c) if cm.PConditionExtraFilterSpecific(c,e,tp,nil,nil,te) then return true end
return (c:IsLocation(LOCATION_HAND) end
or c:IsLocation(LOCATION_REMOVED) return false
or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) end
and c:IsSetCard(0xf1c) function cm.PConditionFilter(c,e,tp,nu1,nu2,eset)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool) local bool=Auxiliary.PendulumSummonableBool(c)
return (c:IsLevelAbove(1) or c.pendulum_level) and c:IsSetCard(0x1f1c) and (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and not c:IsForbidden() and not c:IsForbidden()
and (Auxiliary.PendulumChecklist&(0x1<<tp)==0 or cm.PConditionExtraFilter(c,e,tp,nil,nil,eset))
end end
-- function cm.PendCondition()
function c40009205.PendCondition() return function(e,c,og)
return
function(e,c,og)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local seq=c:GetSequence() local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if Auxiliary.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 then return false end
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or c==rpz then return false end
local loc=0 local loc=0
local LE=Duel.GetLocationCountFromEx(tp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND+LOCATION_REMOVED end
local LM=Duel.GetLocationCount(tp,LOCATION_MZONE)
if LE>0 then loc=loc+LOCATION_EXTRA end
if LM>0 then loc=loc+LOCATION_HAND+LOCATION_REMOVED end
if loc==0 then return false end if loc==0 then return false end
local g=nil local g=nil
if og then if og then
g=og:Filter(Card.IsLocation,nil,loc) g=og:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_REMOVED)
else else
g=Duel.GetFieldGroup(tp,loc,0) g=Duel.GetFieldGroup(tp,LOCATION_HAND+LOCATION_REMOVED,0)
end end
return g:IsExists(c40009205.PConditionFilter,1,nil,e,tp) return g:IsExists(cm.PConditionFilter,1,nil,e,tp,nil,nil,eset)
end end
end end
-- function cm.PendOperation()
function c40009205.PendOperation() return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
return Duel.Hint(HINT_CARD,0,m)
function(e,tp,eg,ep,ev,re,r,rp,c,sg,og) local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local tg=nil
local loc=0
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp)
local ft=Duel.GetUsableMZoneCount(tp) local ft=Duel.GetUsableMZoneCount(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1 ft=1
end end
local loc=0 if ft1>0 then
if ft1>0 then loc=loc+LOCATION_HAND+LOCATION_REMOVED end loc=loc|LOCATION_HAND
if ft2>0 then loc=loc+LOCATION_EXTRA end loc=loc|LOCATION_REMOVED
local tg=nil end
if og then if og then
tg=og:Filter(Card.IsLocation,nil,loc):Filter(c40009205.PConditionFilter,nil,e,tp) tg=og:Filter(Card.IsLocation,nil,loc):Filter(cm.PConditionFilter,nil,e,tp,nil,nil,eset)
else else
tg=Duel.GetMatchingGroup(c40009205.PConditionFilter,tp,loc,0,nil,e,tp) tg=Duel.GetMatchingGroup(cm.PConditionFilter,tp,loc,0,nil,e,tp,nil,nil,eset)
end
ft1=math.min(ft1,tg:FilterCount(Card.IsLocation,nil,LOCATION_HAND+LOCATION_REMOVED))
ft2=math.min(ft2,tg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA))
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
while true do
local ct1=tg:FilterCount(Card.IsLocation,nil,LOCATION_HAND+LOCATION_REMOVED)
local ct2=tg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
local ct=ft
if ct1>ft1 then ct=math.min(ct,ft1) end
if ct2>ft2 then ct=math.min(ct,ft2) end
if ct<=0 then break end
if sg:GetCount()>0 and not Duel.SelectYesNo(tp,210) then ft=0 break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,1,ct,nil)
tg:Sub(g)
sg:Merge(g)
if g:GetCount()<ct then ft=0 break end
ft=ft-g:GetCount()
ft1=ft1-g:FilterCount(Card.IsLocation,nil,LOCATION_HAND+LOCATION_REMOVED)
ft2=ft2-g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
end
if ft>0 then
local tg1=tg:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_REMOVED)
local tg2=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
if ft1>0 and ft2==0 and tg1:GetCount()>0 and (sg:GetCount()==0 or Duel.SelectYesNo(tp,210)) then
local ct=math.min(ft1,ft)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg1:Select(tp,1,ct,nil)
sg:Merge(g)
end end
if ft1==0 and ft2>0 and tg2:GetCount()>0 and (sg:GetCount()==0 or Duel.SelectYesNo(tp,210)) then local ce=nil
local ct=math.min(ft2,ft) local b1=Auxiliary.PendulumChecklist&(0x1<<tp)==0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local b2=#eset>0
local g=tg2:Select(tp,1,ct,nil) if b1 and b2 then
sg:Merge(g) local options={1163}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
if op>0 then
ce=eset[op]
end
elseif b2 and not b1 then
local options={}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
ce=eset[op+1]
end end
if ce then
tg=tg:Filter(cm.PConditionExtraFilterSpecific,nil,e,tp,nil,nil,ce)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Auxiliary.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,0,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,math.min(#tg,ft))
Auxiliary.GCheckAdditional=nil
if not g then return end
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset()
else
Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp)
end
sg:Merge(g)
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
end end
end end
function c40009205.atkcon(e,tp,eg,ep,ev,re,r,rp) function cm.tdfilter(c)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) return c:IsFaceup() and c:IsSetCard(0x1f1c) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c40009205.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCost(c40009205.drcost)
e1:SetCondition(c40009205.discon2)
e1:SetOperation(c40009205.disop2)
Duel.RegisterEffect(e1,tp)
end end
function c40009205.crfilter(c) function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsFaceup() and c:IsSetCard(0xf1c) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost() return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_REMOVED,0,2,nil)
and rp==1-tp and Duel.IsChainDisablable(ev) and aux.nbcon(tp,re)
end end
function c40009205.drcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.IsExistingMatchingCard(c40009205.crfilter,tp,LOCATION_REMOVED,0,2,nil) end if not Duel.SelectYesNo(tp,aux.Stringid(m,1)) then return end
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c40009205.crfilter,tp,LOCATION_REMOVED,0,2,2,nil) local tg=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST) Duel.HintSelection(tg)
end Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
function c40009205.discon2(e,tp,eg,ep,ev,re,r,rp) local rc=re:GetHandler()
return Duel.IsChainDisablable(ev) and rp~=tp if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
end Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)
function c40009205.disop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(40009205,2)) then
Duel.Hint(HINT_CARD,0,40009205)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(40009205,3))
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end end
end
function cm.reg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if re and re:IsHasType(EFFECT_TYPE_ACTIONS) then
c:RegisterFlagEffect(m+100,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
end end
function c40009205.pencon(e,tp,eg,ep,ev,re,r,rp) function cm.pcon(e,tp)
return not e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) return e:GetHandler():GetFlagEffect(m+100)>0
end end
function c40009205.pentg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end end
function c40009205.penfilter(c,e,tp) function cm.spfilter(c,e,tp)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0xf1c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x1f1c) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c40009205.penop(e,tp,eg,ep,ev,re,r,rp) function cm.pop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c40009205.penfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp) if not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then return end
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(40009205,5)) then local sg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
Duel.BreakEffect() if #sg>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local sg2=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) Duel.BreakEffect()
end Duel.SpecialSummon(sg2,0,tp,tp,false,false,POS_FACEUP)
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