Commit 7ebd0f56 authored by Tachibana's avatar Tachibana

得得得得得

parent 7f852fbb
Pipeline #12031 passed with stage
in 27 minutes and 30 seconds
No preview for this file type
expansions/pics/30600100.jpg

13.2 KB | W: | H:

expansions/pics/30600100.jpg

47.6 KB | W: | H:

expansions/pics/30600100.jpg
expansions/pics/30600100.jpg
expansions/pics/30600100.jpg
expansions/pics/30600100.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/53702500.jpg

46.7 KB | W: | H:

expansions/pics/53702500.jpg

168 KB | W: | H:

expansions/pics/53702500.jpg
expansions/pics/53702500.jpg
expansions/pics/53702500.jpg
expansions/pics/53702500.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/65052411.jpg

20.1 KB | W: | H:

expansions/pics/65052411.jpg

124 KB | W: | H:

expansions/pics/65052411.jpg
expansions/pics/65052411.jpg
expansions/pics/65052411.jpg
expansions/pics/65052411.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -248,24 +248,12 @@ function rk.backop(e,tp,eg,ep,ev,re,r,rp)
if c:IsFacedown() then
Duel.ConfirmCards(1-tp,Group.FromCards(c))
end
local Reg=Card.RegisterEffect
function Card.RegisterEffect(card,effect,flag)
if effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and c:GetFlagEffect(16199999)==0 then
local er=effect:Clone()
Reg(c,er,true)
Debug.Message(1)
end
return Reg(card,effect,flag)
end
c:ReplaceEffect(tcode,0,0)
Duel.CreateToken(tp,tcode)
Duel.Hint(HINT_CARD,0,tcode)
if c:IsLocation(LOCATION_HAND) then
local sp=c:GetControler()
Duel.ShuffleHand(sp)
end
Card.RegisterEffect=Reg
c:RegisterFlagEffect(16199999,0,0,0)
end
Duel.Readjust()
end
......
--翠之化猫 伊维亚
function c17032610.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--scale change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17032610,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCost(c17032610.sccost)
e1:SetOperation(c17032610.scop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17032610,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(c17032610.spcon)
e2:SetTarget(c17032610.sptg)
e2:SetOperation(c17032610.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_MATERIAL)
e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e4:SetCondition(c17032610.atkcon)
e4:SetOperation(c17032610.atkop)
c:RegisterEffect(e4)
end
function c17032610.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c17032610.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LSCALE)
e1:SetValue(10)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RSCALE)
c:RegisterEffect(e2)
end
function c17032610.cfilter(c)
return c:IsType(TYPE_FIELD)
end
function c17032610.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function c17032610.spfilter1(c,e,tp)
return c:IsSetCard(0x37f6) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c17032610.spfilter2,tp,LOCATION_MZONE,0,1,nil,e,tp,c)
end
function c17032610.synfilter(c,g)
return c:IsSynchroSummonable(nil,g)
end
function c17032610.spfilter2(c,e,tp,mc)
if c~=e:GetHandler() then return false end
local g=Group.FromCards(c,mc)
local e1=nil
local e2=nil
e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_LEVEL)
e1:SetValue(c17032610.slevel)
mc:RegisterEffect(e1,true)
local res=Duel.IsExistingMatchingCard(c17032610.synfilter,tp,LOCATION_EXTRA,0,1,nil,g)
if e1 then e1:Reset() end
if e2 then e2:Reset() end
return res
end
function c17032610.slevel(e,c)
local lv=e:GetHandler():GetLevel()
local lv2=e:GetHandler():GetLeftScale()
return lv2*65536+lv
end
function c17032610.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c17032610.spfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c17032610.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c17032610.spfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
local mg=Group.FromCards(c,tc)
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_LEVEL)
e1:SetValue(c17032610.slevel)
tc:RegisterEffect(e1,true)
end
Duel.SpecialSummonComplete()
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
function c17032610.atkcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():IsRace(RACE_DRAGON)
end
function c17032610.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetCondition(c17032610.aacon)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
end
function c17032610.aacon(e)
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
Chikichikibanban={}
chiki=Chikichikibanban
POS_FACEUP_DEFENCE=POS_FACEUP_DEFENSE
POS_FACEDOWN_DEFENCE=POS_FACEDOWN_DEFENSE
RACE_CYBERS=RACE_CYBERSE
--Synchro monster, 1 tuner + min to max monsters
function Chikichikibanban.AddSynchroProcedure(c,f1,f2,minc,loc1,loc2,maxc,op)
if maxc==nil then maxc=99 end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1164)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(Chikichikibanban.SynCondition(f1,f2,minc,loc1,loc2,maxc,op))
e1:SetTarget(Chikichikibanban.SynTarget(f1,f2,minc,loc1,loc2,maxc,op))
e1:SetOperation(Chikichikibanban.SynOperation(f1,f2,minc,loc1,loc2,maxc,op))
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
end
function Chikichikibanban.SynCondition(f1,f2,minc,loc1,loc2,maxc,op)
return function(e,c,smat,mg,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local exg=Duel.GetFieldGroup(c:GetControler(),loc1+LOCATION_MZONE,loc2)
if not mg then
mg=exg
else
mg:Merge(exg)
end
if smat and smat:IsType(TYPE_TUNER) and (not f1 or f1(smat)) then
return Duel.CheckTunerMaterial(c,smat,f1,f2,minc,maxc,mg) end
return Duel.CheckSynchroMaterial(c,f1,f2,minc,maxc,smat,mg)
end
end
function Chikichikibanban.SynTarget(f1,f2,minc,loc1,loc2,maxc,op)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg,min,max)
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local g=nil
local exg=Duel.GetFieldGroup(c:GetControler(),loc1+LOCATION_MZONE,loc2)
if not mg then
mg=exg
else
mg:Merge(exg)
end
if smat and smat:IsType(TYPE_TUNER) and (not f1 or f1(smat)) then
g=Duel.SelectTunerMaterial(c:GetControler(),c,smat,f1,f2,minc,maxc,mg)
else
g=Duel.SelectSynchroMaterial(c:GetControler(),c,f1,f2,minc,maxc,smat,mg)
end
if op then op(e,tp,1,g:GetFirst()) end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function Chikichikibanban.SynOperation(f1,f2,minc,loc1,loc2,maxc,op)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
end
--Xyz monster, lv k*n
function Chikichikibanban.AddXyzProcedure(c,f,lv,ct,loc1,loc2,alterf,desc,maxc,op)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
if not maxc then maxc=ct end
if alterf then
e1:SetCondition(Chikichikibanban.XyzCondition2(f,lv,ct,loc1,loc2,maxc,alterf,desc,op))
e1:SetTarget(Chikichikibanban.XyzTarget2(f,lv,ct,loc1,loc2,maxc,alterf,desc,op))
e1:SetOperation(Chikichikibanban.XyzOperation2(f,lv,ct,loc1,loc2,maxc,alterf,desc,op))
else
e1:SetCondition(Chikichikibanban.XyzCondition(f,lv,ct,loc1,loc2,maxc))
e1:SetTarget(Chikichikibanban.XyzTarget(f,lv,ct,loc1,loc2,maxc))
e1:SetOperation(Chikichikibanban.XyzOperation(f,lv,ct,loc1,loc2,maxc))
end
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
end
--Xyz Summon(normal)
function Chikichikibanban.XyzCondition(f,lv,minc,loc1,loc2,maxc)
--og: use special material
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local mg=Group.CreateGroup()
if og then
mg:Merge(og)
end
local exg=Duel.GetFieldGroup(tp,loc1+LOCATION_MZONE,loc2)
mg:Merge(exg)
return Duel.CheckXyzMaterial(c,f,lv,minc,maxc,mg)
end
end
function Chikichikibanban.XyzTarget(f,lv,minc,loc1,loc2,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local mg=Group.CreateGroup()
local exg=Duel.GetFieldGroup(tp,loc1+LOCATION_MZONE,loc2)
mg:Merge(exg)
if og then
mg:Merge(og)
end
local g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,mg)
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function Chikichikibanban.XyzOperation(f,lv,minc,loc1,loc2,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
--Xyz summon(alterf)
function Chikichikibanban.XyzCondition2(f,lv,minc,loc1,loc2,maxc,alterf,desc,op)
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+loc1,loc2)
end
if (not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,op) then
return true
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
return Duel.CheckXyzMaterial(c,f,lv,minc,maxc,mg)
end
end
function Chikichikibanban.XyzTarget2(f,lv,minc,loc1,loc2,maxc,alterf,desc,op)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+loc1,loc2)
end
local b1=Duel.CheckXyzMaterial(c,f,lv,minc,maxc,mg)
local b2=(not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,op)
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,desc)) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,op)
if op then op(e,tp,1,g:GetFirst()) end
else
e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,mg)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function Chikichikibanban.XyzOperation2(f,lv,minc,loc1,loc2,maxc,alterf,desc,op)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
--Xyz Summon(free)
function Chikichikibanban.AddXyzProcedureLevelFree(c,f,gf,minc,loc1,loc2,maxc,alterf,desc,op)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
if alterf then
e1:SetCondition(Chikichikibanban.XyzLevelFreeCondition2(f,gf,minc,loc1,loc2,maxc,alterf,desc,op))
e1:SetTarget(Chikichikibanban.XyzLevelFreeTarget2(f,gf,minc,loc1,loc2,maxc,alterf,desc,op))
e1:SetOperation(Chikichikibanban.XyzLevelFreeOperation2(f,gf,minc,loc1,loc2,maxc,alterf,desc,op))
else
e1:SetCondition(Chikichikibanban.XyzLevelFreeCondition(f,gf,minc,loc1,loc2,maxc))
e1:SetTarget(Chikichikibanban.XyzLevelFreeTarget(f,gf,minc,loc1,loc2,maxc))
e1:SetOperation(Chikichikibanban.XyzLevelFreeOperation(f,gf,minc,loc1,loc2,maxc))
end
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
end
--Xyz Summon(level free)
function Chikichikibanban.XyzLevelFreeFilter(c,xyzc,f)
return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsCanBeXyzMaterial(xyzc) and (not f or f(c,xyzc))
end
function Chikichikibanban.XyzLevelFreeGoal(g,tp,xyzc,gf)
return (not gf or gf(g)) and Duel.GetLocationCountFromEx(tp,tp,g,xyzc)>0
end
function Chikichikibanban.XyzLevelFreeCondition(f,gf,minc,loc1,loc2,maxc)
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local minc=minc
local maxc=maxc
if not maxc then maxc=minc end
if min then
minc=math.max(minc,min)
maxc=math.min(maxc,max)
end
if maxc<minc then return false end
local mg=nil
if og then
mg=og:Filter(Chikichikibanban.XyzLevelFreeFilter,nil,c,f)
else
mg=Duel.GetMatchingGroup(Chikichikibanban.XyzLevelFreeFilter,tp,LOCATION_MZONE,0,nil,c,f)
end
local exg=Duel.GetMatchingGroup(Chikichikibanban.XyzLevelFreeFilter,tp,loc1,loc2,nil,c,f)
mg:Merge(exg)
local sg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
if sg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(sg)
Auxiliary.GCheckAdditional=Auxiliary.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local res=mg:CheckSubGroup(Chikichikibanban.XyzLevelFreeGoal,minc,maxc,tp,c,gf)
Auxiliary.GCheckAdditional=nil
return res
end
end
function Chikichikibanban.XyzLevelFreeTarget(f,gf,minc,loc1,loc2,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local minc=minc
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local mg=nil
if og then
mg=og:Filter(Chikichikibanban.XyzLevelFreeFilter,nil,c,f)
else
mg=Duel.GetMatchingGroup(Chikichikibanban.XyzLevelFreeFilter,tp,LOCATION_MZONE,0,nil,c,f)
end
local exg=Duel.GetMatchingGroup(Chikichikibanban.XyzLevelFreeFilter,tp,loc1,loc2,nil,c,f)
mg:Merge(exg)
local sg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
Duel.SetSelectedCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local cancel=Duel.IsSummonCancelable()
Auxiliary.GCheckAdditional=Auxiliary.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local g=mg:SelectSubGroup(tp,Chikichikibanban.XyzLevelFreeGoal,cancel,minc,maxc,tp,c,gf)
Auxiliary.GCheckAdditional=nil
if g and g:GetCount()>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function Chikichikibanban.XyzLevelFreeOperation(f,gf,minc,loc1,loc2,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
--Xyz summon(level free&alterf)
function Chikichikibanban.XyzLevelFreeCondition2(f,gf,minc,loc1,loc2,maxc,alterf,desc,op)
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+loc1,loc2)
end
local altg=mg:Filter(Auxiliary.XyzAlterFilter,nil,alterf,c,e,tp,op):Filter(Auxiliary.MustMaterialCheck,nil,tp,EFFECT_MUST_BE_XMATERIAL)
if (not min or min<=1) and altg:GetCount()>0 then
return true
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
mg=mg:Filter(Chikichikibanban.XyzLevelFreeFilter,nil,c,f)
local sg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
if sg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(sg)
Auxiliary.GCheckAdditional=Auxiliary.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local res=mg:CheckSubGroup(Chikichikibanban.XyzLevelFreeGoal,minc,maxc,tp,c,gf)
Auxiliary.GCheckAdditional=nil
return res
end
end
function Chikichikibanban.XyzLevelFreeTarget2(f,gf,minc,loc1,loc2,maxc,alterf,desc,op)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE+loc1,loc2)
end
local sg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_XMATERIAL)
local mg2=mg:Filter(Chikichikibanban.XyzLevelFreeFilter,nil,c,f)
Duel.SetSelectedCard(sg)
local b1=mg2:CheckSubGroup(Chikichikibanban.XyzLevelFreeGoal,minc,maxc,tp,c,gf)
local b2=(not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,op)
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,desc)) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,op)
if op then op(e,tp,1,g:GetFirst()) end
else
e:SetLabel(0)
Duel.SetSelectedCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local cancel=Duel.IsSummonCancelable()
Auxiliary.GCheckAdditional=Auxiliary.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
g=mg2:SelectSubGroup(tp,Chikichikibanban.XyzLevelFreeGoal,cancel,minc,maxc,tp,c,gf)
Auxiliary.GCheckAdditional=nil
end
if g and g:GetCount()>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function Chikichikibanban.XyzLevelFreeOperation2(f,gf,minc,loc1,loc2,maxc,alterf,desc,op)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
--Fake dark synchro
function Chikichikibanban.FakeDarkSynchroProcedure(c,f,gf,minc,maxc,op,self_location,opponent_location,mat_operation,...)
local self_location=self_location or 0
local opponent_location=opponent_location or 0
local operation_params={...}
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(Chikichikibanban.FakeDarkSynchroCondition(f,gf,minc,maxc,op,self_location,opponent_location))
e1:SetTarget(Chikichikibanban.FakeDarkSynchroTarget(f,gf,minc,maxc,op,self_location,opponent_location))
e1:SetOperation(Chikichikibanban.FakeDarkSynchroOperation(f,gf,minc,maxc,op,self_location,opponent_location,mat_operation,operation_params))
c:RegisterEffect(e1)
end
function Chikichikibanban.FakeDarkSynchroMaterialFilter(c,sc,f)
return (not f or f(c,sc))
end
function Chikichikibanban.FakeDarkSynchroFreeGoal(g,tp,sc,gf)
return (not gf or gf(g)) and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
end
function Chikichikibanban.FakeDarkSynchroMaterialFilter2(c,sc,e,tp,op)
return (not op or op(e,tp,0,c))
end
function Chikichikibanban.FakeDarkSynchroCondition(f,gf,minc,maxc,op,self_location,opponent_location)
return function(e,c,og,min,max)
if c==nil then return true end
if og and not min then return true end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local tp=c:GetControler()
local mg=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=mg:Filter(Chikichikibanban.FakeDarkSynchroMaterialFilter,nil,c,f)
return sg:CheckSubGroup(Chikichikibanban.FakeDarkSynchroFreeGoal,minc,maxc,tp,c,gf)
and sg:IsExists(Chikichikibanban.FakeDarkSynchroMaterialFilter2,1,nil,c,e,tp,op)
end
end
function Chikichikibanban.FakeDarkSynchroTarget(f,gf,minc,maxc,op,self_location,opponent_location)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
if og and not min then
return true
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local tp=c:GetControler()
local mg=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=mg:Filter(Chikichikibanban.FakeDarkSynchroMaterialFilter,nil,c,f)
local cancel=Duel.IsSummonCancelable()
local tg=sg:SelectSubGroup(tp,Chikichikibanban.FakeDarkSynchroFreeGoal,cancel,minc,maxc,tp,c,gf)
if tg then
if op then op(e,tp,1,tg:GetFirst()) end
tg:KeepAlive()
e:SetLabelObject(tg)
return true
else return false end
end
end
function Chikichikibanban.FakeDarkSynchroOperation(f,gf,minc,maxc,op,self_location,opponent_location,mat_operation,operation_params)
return function(e,tp,eg,ep,ev,re,r,rp,c)
local tg=e:GetLabelObject()
c:SetMaterial(tg)
mat_operation(tg,table.unpack(operation_params))
tg:DeleteGroup()
end
end
--special summon procedure
function Chikichikibanban.SpecialSummonProcedure(c,f,gf,minc,maxc,op,c_location,self_location,opponent_location,mat_operation,...)
local c_location=c_location or 0
local self_location=self_location or 0
local opponent_location=opponent_location or 0
local operation_params={...}
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(c_location)
e1:SetCondition(Chikichikibanban.SpecialSummonProcedureCondition(f,gf,minc,maxc,op,self_location,opponent_location))
e1:SetTarget(Chikichikibanban.SpecialSummonProcedureTarget(f,gf,minc,maxc,op,self_location,opponent_location))
e1:SetOperation(Chikichikibanban.SpecialSummonProcedureOperation(f,gf,minc,maxc,op,self_location,opponent_location,mat_operation,operation_params))
c:RegisterEffect(e1)
return e1
end
function Chikichikibanban.SpecialSummonProcedureMaterialFilter(c,sc,f)
return (not f or f(c,sc))
end
function Chikichikibanban.SpecialSummonProcedureFreeGoal(g,tp,sc,gf)
return (not gf or gf(g)) and ((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not sc:IsLocation(LOCATION_EXTRA)) or
(sc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0))
end
function Chikichikibanban.SpecialSummonProcedureMaterialFilter2(c,sc,e,tp,op)
return (not op or op(e,tp,0,c))
end
function Chikichikibanban.SpecialSummonProcedureCondition(f,gf,minc,maxc,op,self_location,opponent_location)
return function(e,c,og,min,max)
if c==nil then return true end
if og and not min then return true end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local tp=c:GetControler()
local mg=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=mg:Filter(Chikichikibanban.SpecialSummonProcedureMaterialFilter,nil,c,f)
return sg:CheckSubGroup(Chikichikibanban.SpecialSummonProcedureFreeGoal,minc,maxc,tp,c,gf)
and sg:IsExists(Chikichikibanban.SpecialSummonProcedureMaterialFilter2,1,nil,c,e,tp,op)
end
end
function Chikichikibanban.SpecialSummonProcedureTarget(f,gf,minc,maxc,op,self_location,opponent_location)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
if og and not min then
return true
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local tp=c:GetControler()
local mg=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=mg:Filter(Chikichikibanban.SpecialSummonProcedureMaterialFilter,nil,c,f)
local cancel=Duel.IsSummonCancelable()
local tg=sg:SelectSubGroup(tp,Chikichikibanban.SpecialSummonProcedureFreeGoal,cancel,minc,maxc,tp,c,gf)
if tg then
if op then op(e,tp,1,tg:GetFirst()) end
tg:KeepAlive()
e:SetLabelObject(tg)
return true
else return false end
end
end
function Chikichikibanban.SpecialSummonProcedureOperation(f,gf,minc,maxc,op,self_location,opponent_location,mat_operation,operation_params)
return function(e,tp,eg,ep,ev,re,r,rp,c)
local tg=e:GetLabelObject()
c:SetMaterial(tg)
mat_operation(tg,table.unpack(operation_params))
tg:DeleteGroup()
end
end
--special summon procedure(nomal)
function Chikichikibanban.SpecialSummonProcedureN(c,c_location,c_condition,op)
local c_location=c_location or 0
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(c_location)
e1:SetCondition(Chikichikibanban.SpecialSummonProcedureConditionN(c_condition,op))
e1:SetOperation(Chikichikibanban.SpecialSummonProcedureOperationN(c_condition,op))
c:RegisterEffect(e1)
return e1
end
function Chikichikibanban.SpecialSummonProcedureConditionN(c_condition,op)
return function(e,c)
if c==nil then return true end
local tp=c:GetControler()
return (not c_condition or c_condition(e,c)) and (not op or op(e,tp,0,c)) end
end
function Chikichikibanban.SpecialSummonProcedureOperationN(c_condition,op)
return function(e,tp,eg,ep,ev,re,r,rp,c)
if op then op(e,tp,1,e:GetHandler()) end
end
end
--special summon procedure(special)
function Chikichikibanban.SpecialSummonProcedureS(c,c_location,c_pos,c_condition,op)
local c_location=c_location or 0
local c_pos=c_pos or 0
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetTargetRange(c_pos,1)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetRange(c_location)
e1:SetCondition(Chikichikibanban.SpecialSummonProcedureConditionS(c_condition,op))
e1:SetOperation(Chikichikibanban.SpecialSummonProcedureOperationS(c_condition,op))
c:RegisterEffect(e1)
return e1
end
function Chikichikibanban.SpecialSummonProcedureConditionS(c_condition,op)
return function(e,c)
if c==nil then return true end
local tp=c:GetControler()
return (not c_condition or c_condition(e,c)) and (not op or op(e,tp,0,c)) end
end
function Chikichikibanban.SpecialSummonProcedureOperationS(c_condition,op)
return function(e,tp,eg,ep,ev,re,r,rp,c)
if op then op(e,tp,1,e:GetHandler()) end
end
end
function Chikichikibanban.releasablehspfilter(c,sc,f)
return (not f or f(c,sc)) and c:IsReleasable()
end
function Chikichikibanban.releasablehspcon(self_location,opponent_location,controler,f,gf,minc,maxc)
return function(e,c)
if c==nil then return true end
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local tp=c:GetControler()
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.releasablehspfilter,nil,c,f)
return sg:CheckSubGroup(Chikichikibanban.SpecialSummonProcedureFreeGoal,minc,maxc,controler,c,gf)
end
end
function Chikichikibanban.releasablehspop(self_location,opponent_location,controler,f,gf,minc,maxc)
return function(e,tp,chk)
if chk==0 then return true end
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.SpecialSummonProcedureMaterialFilter,nil,c,f)
local tg=sg:SelectSubGroup(tp,Chikichikibanban.SpecialSummonProcedureFreeGoal,false,minc,maxc,controler,e:GetHandler(),gf)
Duel.Release(tg,REASON_COST)
end
end
function Chikichikibanban.togravehspfilter(c,sc,f)
return (not f or f(c,sc)) and c:IsAbleToGraveAsCost()
end
function Chikichikibanban.togravehspcon(self_location,opponent_location,controler,f,gf,minc,maxc)
return function(e,c)
if c==nil then return true end
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local tp=c:GetControler()
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.togravehspfilter,nil,c,f)
return sg:CheckSubGroup(Chikichikibanban.SpecialSummonProcedureFreeGoal,minc,maxc,controler,c,gf)
end
end
function Chikichikibanban.togravehspop(self_location,opponent_location,controler,f,gf,minc,maxc)
return function(e,tp,chk)
if chk==0 then return true end
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.togravehspfilter,nil,c,f)
local tg=sg:SelectSubGroup(tp,Chikichikibanban.SpecialSummonProcedureFreeGoal,false,minc,maxc,controler,e:GetHandler(),gf)
Duel.SendtoGrave(tg,REASON_COST)
end
end
function Chikichikibanban.todeckhspfilter(c,sc,f)
return (not f or f(c,sc)) and c:IsAbleToDeckAsCost()
end
function Chikichikibanban.todeckhspcon(self_location,opponent_location,controler,f,gf,minc,maxc)
return function(e,c)
if c==nil then return true end
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local tp=c:GetControler()
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.todeckhspfilter,nil,c,f)
return sg:CheckSubGroup(Chikichikibanban.SpecialSummonProcedureFreeGoal,minc,maxc,controler,c,gf)
end
end
function Chikichikibanban.todeckhspop(self_location,opponent_location,controler,f,gf,minc,maxc)
return function(e,tp,chk)
if chk==0 then return true end
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.todeckhspfilter,nil,c,f)
local tg=sg:SelectSubGroup(tp,Chikichikibanban.SpecialSummonProcedureFreeGoal,false,minc,maxc,controler,e:GetHandler(),gf)
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
end
function Chikichikibanban.removehspfilter(c,sc,f)
return (not f or f(c,sc)) and c:IsAbleToRemoveAsCost()
end
function Chikichikibanban.removehspcon(self_location,opponent_location,controler,f,gf,minc,maxc)
return function(e,c)
if c==nil then return true end
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local tp=c:GetControler()
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.removehspfilter,nil,c,f)
return sg:CheckSubGroup(Chikichikibanban.SpecialSummonProcedureFreeGoal,minc,maxc,controler,c,gf)
end
end
function Chikichikibanban.removehspop(self_location,opponent_location,pos,controler,f,gf,minc,maxc)
return function(e,tp,chk)
if chk==0 then return true end
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.removehspfilter,nil,c,f)
local tg=sg:SelectSubGroup(tp,Chikichikibanban.SpecialSummonProcedureFreeGoal,false,minc,maxc,controler,e:GetHandler(),gf)
Duel.Remove(g,pos,REASON_COST)
end
end
function Chikichikibanban.handspfilter(c,e,tp,f)
return (not f or f(c,sc)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and ((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not c:IsLocation(LOCATION_EXTRA)) or
(c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0))
end
function Chikichikibanban.handsptg(self_location,opponent_location,op,controler,f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
local controler=controler
if not controler then controler=tp end
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.handspfilter,nil,e,controler,f)
if chk==0 then return (not op or op(e,tp,eg,ep,ev,re,r,rp,0,e:GetHandler()))
and sg:CheckSubGroup(Chikichikibanban.SpecialSummonProcedureFreeGoal2,minc,maxc,controler,gf) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,controler,self_location+opponent_location)
end
end
function Chikichikibanban.SpecialSummonProcedureFreeGoal2(g,tp,gf)
return (not gf or gf(g))
end
function Chikichikibanban.handspop(self_location,opponent_location,op,controler,f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp)
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
local controler=controler
if not controler then controler=tp end
if Duel.GetLocationCount(controler,LOCATION_MZONE,tp)<minc then return end
if minc>=2 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>maxc then ft=maxc elseif Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.handspfilter,nil,e,controler,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:SelectSubGroup(tp,Chikichikibanban.SpecialSummonProcedureFreeGoal2,false,minc,maxc,controler,gf)
if tg:GetCount()>0 then
Duel.SpecialSummon(tg,0,tp,controler,false,false,POS_FACEUP)
if op then Duel.BreakEffect() op(e,tp,eg,ep,ev,re,r,rp,1,e:GetHandler()) end
end
end
end
function Chikichikibanban.dccost(minc)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local minc=minc
if not minc then minc=1 end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,minc,minc,REASON_COST+REASON_DISCARD,e:GetHandler())
end
end
function Chikichikibanban.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
--special summon procedure(special)
function Chikichikibanban.reposcon(c,c_location,tg,op,con,etype,gategory,...)
local c_location=c_location
if not c_location then c_location=LOCATION_HAND end
local tg=tg
if not tg then tg=chiki.sptg end
local op=op
if not op then op=chiki.spop end
if not gategory then gategory=CATEGORY_SPECIAL_SUMMON end
if not etype then etype=EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O end
local limt={...}
local e1=Effect.CreateEffect(c)
e1:SetCategory(gategory)
e1:SetType(etype)
e1:SetCode(EVENT_RECOVER)
e1:SetRange(c_location)
if limt then
e1:SetCountLimit(limt)
end
if con then
e1:SetCondition(con)
end
e1:SetTarget(tg)
e1:SetOperation(op)
c:RegisterEffect(e1)
end
function Chikichikibanban.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function Chikichikibanban.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function Chikichikibanban.pocfilter(c)
return c:GetAttackAnnouncedCount()>0
end
function Chikichikibanban.poccon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Chikichikibanban.pocfilter,tp,LOCATION_MZONE,0,1,nil)
end
--tohand
function Chikichikibanban.thfilter(c,f)
return (not f or f(c)) and c:IsAbleToHand()
end
function Chikichikibanban.thtg(f)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Chikichikibanban.thfilter,tp,LOCATION_DECK,0,1,nil,f) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function Chikichikibanban.thop(f,op1,op2)
return function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Chikichikibanban.thfilter,tp,LOCATION_DECK,0,1,1,nil,f)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if op1 then op1(e,tp,eg,ep,ev,re,r,rp,1,e:GetHandler()) end
end
if op2 then op2(e,tp,eg,ep,ev,re,r,rp,1,e:GetHandler()) end
end
end
function Chikichikibanban.reposcost(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function Chikichikibanban.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function Chikichikibanban.tgsptg(self_location,opponent_location,op,controler,f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local minc=minc
if not minc then minc=1 end
local maxc=maxc
if not maxc then maxc=minc end
local controler=controler
if not controler then controler=tp end
local g=Duel.GetFieldGroup(tp,self_location,opponent_location)
local sg=g:Filter(Chikichikibanban.handspfilter,nil,e,controler,f)
if chkc then return chkc:IsControler(controler) and chkc:IsLocation(loc) and Chikichikibanban.handspfilter(chkc,e,tp,f) end
if chk==0 then return (not op or op(e,tp,eg,ep,ev,re,r,rp,0,e:GetHandler()))
and sg:CheckSubGroup(Chikichikibanban.SpecialSummonProcedureFreeGoal2,minc,maxc,controler,gf) end
local ft=maxc
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:SelectSubGroup(tp,Chikichikibanban.SpecialSummonProcedureFreeGoal2,false,minc,maxc,controler,gf)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,tg:GetCount(),0,0)
end
end
function Chikichikibanban.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function Chikichikibanban.tgspop1(op)
return function(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
if op then Duel.BreakEffect() op(e,tp,eg,ep,ev,re,r,rp,1,e:GetHandler()) end
end
end
end
function Chikichikibanban.tgspop2(op)
return function(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if g:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=g:Select(tp,ft,ft,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
if op then Duel.BreakEffect() op(e,tp,eg,ep,ev,re,r,rp,1,e:GetHandler()) end
end
end
end
......@@ -117,14 +117,6 @@ function c33200514.eqop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,33200503)
Duel.RegisterFlagEffect(tp,33200503,RESET_PHASE+PHASE_END,0,2)
end
if tc:GetOriginalCode()==33200505 and Duel.IsExistingMatchingCard(c33200505.thfilter,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_CARD,tp,33200505)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c33200505.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
if tc:GetOriginalCode()==33200511 and Duel.IsExistingMatchingCard(c33200511.thfilter,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_CARD,tp,33200511)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -84,6 +84,13 @@ function cm.AllGlobalCheck(c)
alle4:SetOperation(cm.OSCheck)
Duel.RegisterEffect(alle4,0)
end
if x>=53727004 and x<=53727007 then
local alle6=Effect.CreateEffect(c)
alle6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
alle6:SetCode(EVENT_CHAINING)
alle6:SetOperation(cm.CyberNSwitch)
Duel.RegisterEffect(alle6,0)
end
end
end
function cm.UpRegi(e,tp,eg,ep,ev,re,r,rp)
......@@ -455,7 +462,7 @@ function cm.ALCYakuActivate(code,atk,def,rac,att)
local list={e:GetLabel()}
local ct=1
if #list>1 then
Debug.Message("注:宣言的数字对应确认的卡的顺序(顺序与消息记录相同)")
Duel.Hint(24,tp,aux.Stringid(53702600,2))
ct=Duel.AnnounceLevel(tp,1,#list)
end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
......@@ -1921,3 +1928,108 @@ function cm.LinkMonstertoSpell(c,marker)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e2)
end
function cm.CyberNSwitch(c)
if Duel.GetFlagEffect(0,53727000)>0 then return end
Duel.RegisterFlagEffect(0,53727000,0,0,0)
Duel.Hint(HINT_OPSELECTED,0,aux.Stringid(53702500,8))
Duel.Hint(HINT_OPSELECTED,1,aux.Stringid(53702500,8))
Duel.SelectYesNo(0,aux.Stringid(53702600,1))
Duel.SelectYesNo(1,aux.Stringid(53702600,1))
if Duel.GetFlagEffect(0,53727097)==0 and not Duel.SelectYesNo(0,aux.Stringid(53702500,13)) then Duel.RegisterFlagEffect(0,53727097,0,0,0) end
if Duel.GetFlagEffect(1,53727097)==0 and not Duel.SelectYesNo(1,aux.Stringid(53702500,13)) then Duel.RegisterFlagEffect(1,53727097,0,0,0) end
if Duel.GetFlagEffect(0,53727097)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.CyberNCheck)
Duel.RegisterEffect(e1,0)
end
if Duel.GetFlagEffect(0,53727097)>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetOperation(cm.CyberNCheck)
Duel.RegisterEffect(e2,1)
end
end
function cm.CyberNCheck(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(53702500,9))
local sel=Duel.SelectOption(tp,aux.Stringid(53727004,6),aux.Stringid(53727005,6),aux.Stringid(53727006,6),aux.Stringid(53727007,6))
if sel==0 then
Duel.Hint(24,tp,aux.Stringid(53702601,Duel.GetFlagEffect(0,53727004)+1))
Duel.Hint(24,tp,aux.Stringid(53702602,Duel.GetFlagEffect(0,53727037)+3))
Duel.Hint(24,tp,aux.Stringid(53702603,Duel.GetFlagEffect(0,53727070)+6))
elseif sel==1 then
Duel.Hint(24,tp,aux.Stringid(53702604,Duel.GetFlagEffect(0,53727005)+1))
Duel.Hint(24,tp,aux.Stringid(53702605,Duel.GetFlagEffect(0,53727038)+3))
Duel.Hint(24,tp,aux.Stringid(53702606,Duel.GetFlagEffect(0,53727071)+5))
elseif sel==2 then
Duel.Hint(24,tp,aux.Stringid(53702607,Duel.GetFlagEffect(0,53727006)+1))
Duel.Hint(24,tp,aux.Stringid(53702608,Duel.GetFlagEffect(0,53727039)+3))
Duel.Hint(24,tp,aux.Stringid(53702609,Duel.GetFlagEffect(0,53727072)+5))
else
Duel.Hint(24,tp,aux.Stringid(53702610,Duel.GetFlagEffect(0,53727007)+1))
Duel.Hint(24,tp,aux.Stringid(53702611,Duel.GetFlagEffect(0,53727040)+3))
Duel.Hint(24,tp,aux.Stringid(53702612,Duel.GetFlagEffect(0,53727073)+5))
end
end
function cm.CyberNRecord(c)
if Duel.GetFlagEffect(0,53727099)>0 then return end
Duel.RegisterFlagEffect(0,53727099,0,0,0)
Duel.Hint(HINT_OPSELECTED,0,aux.Stringid(53702500,10))
Duel.Hint(HINT_OPSELECTED,1,aux.Stringid(53702500,10))
Duel.SelectYesNo(0,aux.Stringid(53702600,0))
Duel.SelectYesNo(1,aux.Stringid(53702600,0))
local check0,check1=false,false
if Duel.GetFlagEffect(0,53727097)==0 and not Duel.SelectYesNo(0,aux.Stringid(53702500,13)) then Duel.RegisterFlagEffect(0,53727097,0,0,0) end
if Duel.GetFlagEffect(1,53727097)==0 and not Duel.SelectYesNo(1,aux.Stringid(53702500,13)) then Duel.RegisterFlagEffect(1,53727097,0,0,0) end
if Duel.SelectYesNo(0,aux.Stringid(53702500,12)) then check0=true end
if Duel.SelectYesNo(1,aux.Stringid(53702500,12)) then check1=true end
if not check0 or not check1 then check0,check1=false,false end
if Duel.GetFlagEffect(0,53727097)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
if check0 then e1:SetOperation(cm.CyberNCode1) else e1:SetOperation(cm.CyberNCode2) end
Duel.RegisterEffect(e1,0)
end
if Duel.GetFlagEffect(1,53727097)>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FREE_CHAIN)
if check1 then e2:SetOperation(cm.CyberNCode1) else e2:SetOperation(cm.CyberNCode2) end
Duel.RegisterEffect(e2,1)
end
end
function cm.CyberNCode1(e,tp,eg,ep,ev,re,r,rp)
local t={}
local max=Duel.GetFlagEffect(0,53727001)
for i=1,max do
if Duel.GetFlagEffect(0,53777000+i)>0 then
local cd=Duel.GetFlagEffectLabel(0,53777000+i)
if not cm.IsInTable(cd,t) and cd~=114 then table.insert(t,cd) end
else break end
end
local g=Group.CreateGroup()
for i=1,#t do
local cre=Duel.CreateToken(1-tp,t[i])
g:AddCard(cre)
end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(53702500,14))
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(53702500,15))
end
function cm.CyberNCode2(e,tp,eg,ep,ev,re,r,rp)
local t={}
local max=Duel.GetFlagEffect(0,53727001)
for i=1,max do
if Duel.GetFlagEffect(0,53777000+i)>0 then
local cd=Duel.GetFlagEffectLabel(0,53777000+i)
if not cm.IsInTable(cd,t) and cd~=114 then table.insert(t,cd) end
else break end
end
local g=Group.CreateGroup()
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(53702500,14))
for i=1,#t do Duel.Hint(HINT_CARD,tp,t[i]) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(53702500,15))
end
......@@ -47,7 +47,8 @@ end
function c71400006.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
if not tc:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
......@@ -64,6 +65,8 @@ function c71400006.operation1(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
else
Duel.SpecialSummonComplete()
end
end
function c71400006.con2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -80,7 +80,8 @@ function c71400011.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
if not sc then return end
if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
......@@ -94,6 +95,8 @@ function c71400011.op2(e,tp,eg,ep,ev,re,r,rp)
local smg=mg:Select(tp,1,3,nil)
Duel.Overlay(sc,smg)
end
else
Duel.SpecialSummonComplete()
end
end
function c71400011.filter3(c)
......
......@@ -30,8 +30,9 @@ function c71400037.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c71400037.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
if not tc:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
......@@ -49,6 +50,6 @@ function c71400037.op1(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(1)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
Duel.SpecialSummonComplete()
end
\ No newline at end of file
......@@ -528,17 +528,12 @@
!setname 0x7f5 P.C.
!setname 0x37f5 L.P.
!setname 0x97f5 公主形态
!setname 0x7f6 苍空
!setname 0x17f6 星晶兽
!setname 0x37f6 天司
!setname 0xf7f6 堕天司
!setname 0x7f7 断绝之妖精
!setname 0x7f8 敢达
!setname 0x7fa 假面骑士
!setname 0x37fb 零一/Zero-one
!setname 0x47fb 亚克/Ark
!counter 0x7f3 调停指示物
#AddCodeList(17020120) 核心敢达卡名记述
#圣灵兽骑 643865567 180 0x6e0-0x6ef
!setname 0x36e1 调音
......
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