Commit 3eac67be authored by POLYMER's avatar POLYMER

fix

parent 4198ffb5
No preview for this file type
--方舟骑士-灰喉·归巢
c29000461.named_with_Arknight=1
local m=29000461
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--synchro summon rule
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(cm.syrcon)
e1:SetTarget(cm.syrtg)
e1:SetOperation(cm.syrop)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
--synchro level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SYNCHRO_LEVEL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED)
e2:SetValue(cm.slevel)
c:RegisterEffect(e2)
--to deck
local e21=Effect.CreateEffect(c)
e21:SetDescription(aux.Stringid(m,0))
e21:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e21:SetProperty(EFFECT_FLAG_CARD_TARGET)
e21:SetType(EFFECT_TYPE_IGNITION)
e21:SetRange(LOCATION_MZONE)
e21:SetCountLimit(1,m)
e21:SetTarget(cm.tdtg)
e21:SetOperation(cm.tdop)
c:RegisterEffect(e21)
end
--
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.tdfilter(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
if g:GetCount()>0 then Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--
function cm.slevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
return (5<<16)+lv
end
--synchro summon rule filter
function cm.syf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
local loccheck=c:GetLocation()~=LOCATION_MZONE or c:IsFaceup()
return loccheck and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
function cm.ckf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
return c:IsLocation(LOCATION_GRAVE+LOCATION_HAND) and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
--synchro summon rule
function cm.syrcon(e,c,smat,mg1,min,max)
if c==nil then return true end
local loc=LOCATION_GRAVE+LOCATION_HAND
--if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
--loc=loc+LOCATION_HAND
--end
local tp=c:GetControler()
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
return mg:CheckSubGroup(cm.syrcheck,2,2,minc,maxc,tp,c,smat,mgchk)
end
function cm.syrtg(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local loc=LOCATION_GRAVE+LOCATION_HAND
--if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
--loc=loc+LOCATION_HAND
--end
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local matg=mg:SelectSubGroup(tp,cm.syrcheck,true,2,2,minc,maxc,tp,c,smat,mgchk)
if matg then
matg:KeepAlive()
e:SetLabelObject(matg)
return true
else return false end
end
function cm.syrop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
if #g==0 then return end
if Duel.GetFlagEffect(tp,m)==0 and g:FilterCount(cm.ckf,nil,c)>0 then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
c:SetMaterial(g)
local _SendtoGrave=Duel.SendtoGrave
Duel.SendtoGrave=function(g,r)
if r==REASON_MATERIAL+REASON_SYNCHRO then
local tg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_GRAVE)
local rg=tg:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
g:Sub(rg)
_SendtoGrave(g,r)
Duel.Remove(rg,POS_FACEUP,r)
Duel.SendtoGrave=_SendtoGrave
else
_SendtoGrave(g,r)
end
end
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
function cm.syrcheck(g,min,max,tp,syncard,smat,mgchk)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),min,max,syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
if smat and not g:IsContains(smat) then return false end
if not g:IsExists(cm.ckf1,1,nil,syncard,g) then return false end
if g:FilterCount(cm.ckf,nil,syncard)>1 then return false end
if not aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),tp,LOCATION_MZONE,0,1,nil) and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end
function cm.ckf1(c,syncard,g)
return c:IsType(TYPE_TUNER) and g:IsExists(cm.syf,1,c,syncard)
end
\ No newline at end of file
--方舟骑士-提丰
c29002369.named_with_Arknight=1
function c29002369.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSynchroType,TYPE_SYNCHRO),c29002369.syf,1)
c:EnableReviveLimit()
--synchro level
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c29002369.slevel)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(4,29002369)
e2:SetTarget(c29002369.seqtg)
e2:SetOperation(c29002369.seqop)
c:RegisterEffect(e2)
end
c29002369.material_type=TYPE_SYNCHRO
function c29002369.syf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
return setcard and c:IsSynchroType(TYPE_SYNCHRO)
end
function c29002369.slevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
return (6<<16)+lv
end
function c29002369.desfilter(c)
return c:GetSequence()<5
end
function c29002369.seqfilter(c,seq)
local loc=LOCATION_MZONE
if seq>=8 then
loc=LOCATION_SZONE
seq=seq-8
end
if seq>=5 then return false end
local cseq=c:GetSequence()
local cloc=c:GetLocation()
return cseq==seq and cloc==loc
end
function c29002369.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29002369.desfilter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.GetFlagEffect(tp,29002370)==0 end
local filter=0
for i=0,15 do
if not Duel.IsExistingMatchingCard(c29002369.seqfilter,tp,0,LOCATION_ONFIELD,1,nil,i) then
filter=filter|1<<(i+16)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local flag=Duel.SelectField(tp,1,0,LOCATION_ONFIELD,filter)
Duel.Hint(HINT_ZONE,tp,flag)
Duel.Hint(HINT_ZONE,1-tp,flag>>16)
Duel.Hint(HINT_ZONE,tp,flag)
Duel.Hint(HINT_ZONE,1-tp,flag>>16)
Duel.Hint(HINT_ZONE,tp,flag)
Duel.Hint(HINT_ZONE,1-tp,flag>>16)
local seq=math.log(flag>>16,2)
e:SetLabel(seq)
Duel.RegisterFlagEffect(tp,29002370,RESET_CHAIN,0,1)
end
function c29002369.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.RegisterFlagEffect(tp,29002369,RESET_PHASE+PHASE_END,0,1)
local seq=e:GetLabel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c29002369.desop)
e1:SetLabel(Duel.GetFlagEffect(tp,29002369),seq)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1,true)
end
function c29002369.desop(e,tp,eg,ep,ev,re,r,rp)
local flag,seq=e:GetLabel()
local g=Duel.GetMatchingGroup(c29002369.seqfilter,tp,0,LOCATION_ONFIELD,nil,seq)
if Duel.GetFlagEffect(tp,29002369)==flag and g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--方舟骑士-夜刀
c29005188.named_with_Arknight=1
function c29005188.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c29005188.lcheck)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,29005188)
e1:SetCondition(c29005188.spcon)
e1:SetTarget(c29005188.sptg)
e1:SetOperation(c29005188.spop)
c:RegisterEffect(e1)
end
function c29005188.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x87af) or g:IsExists(c29005188.filter,1,nil)
end
function c29005188.filter(c)
return c:IsLinkSetCard(0x87af) or (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c29005188.spcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c29005188.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29005188.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--方舟骑士-黑
c29010024.named_with_Arknight=1
local m=29010024
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--synchro summon rule
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(cm.syrcon)
e1:SetTarget(cm.syrtg)
e1:SetOperation(cm.syrop)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_PIERCE)
e2:SetTargetRange(LOCATION_MZONE,0)
c:RegisterEffect(e2)
--synchro level
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SYNCHRO_LEVEL)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED)
e4:SetValue(cm.slevel)
c:RegisterEffect(e4)
--atk
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetCondition(cm.atkcon)
e5:SetTarget(cm.atktg)
e5:SetValue(700)
c:RegisterEffect(e5)
end
--
function cm.atktg(e,c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_TUNER)
end
function cm.atkfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function cm.atkcon(e)
return Duel.IsExistingMatchingCard(cm.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end
--
function cm.slevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
return (6<<16)+lv
end
function cm.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
--synchro summon rule filter
function cm.syf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
local loccheck=c:GetLocation()~=LOCATION_MZONE or c:IsFaceup()
return loccheck and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
function cm.ckf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
return c:IsLocation(LOCATION_GRAVE+LOCATION_HAND) and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
--synchro summon rule
function cm.syrcon(e,c,smat,mg1,min,max)
if c==nil then return true end
local loc=LOCATION_GRAVE+LOCATION_HAND
--if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
--loc=loc+LOCATION_HAND
--end
local tp=c:GetControler()
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
return mg:CheckSubGroup(cm.syrcheck,2,2,minc,maxc,tp,c,smat,mgchk)
end
function cm.syrtg(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local loc=LOCATION_GRAVE+LOCATION_HAND
--if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
--loc=loc+LOCATION_HAND
--end
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local matg=mg:SelectSubGroup(tp,cm.syrcheck,true,2,2,minc,maxc,tp,c,smat,mgchk)
if matg then
matg:KeepAlive()
e:SetLabelObject(matg)
return true
else return false end
end
function cm.syrop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
if #g==0 then return end
if Duel.GetFlagEffect(tp,m)==0 and g:FilterCount(cm.ckf,nil,c)>0 then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
c:SetMaterial(g)
local _SendtoGrave=Duel.SendtoGrave
Duel.SendtoGrave=function(g,r)
if r==REASON_MATERIAL+REASON_SYNCHRO then
local tg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_GRAVE)
local rg=tg:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
g:Sub(rg)
_SendtoGrave(g,r)
Duel.Remove(rg,POS_FACEUP,r)
Duel.SendtoGrave=_SendtoGrave
else
_SendtoGrave(g,r)
end
end
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
function cm.syrcheck(g,min,max,tp,syncard,smat,mgchk)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),min,max,syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
if smat and not g:IsContains(smat) then return false end
if not g:IsExists(cm.ckf1,1,nil,syncard,g) then return false end
if g:FilterCount(cm.ckf,nil,syncard)>1 then return false end
if not aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),tp,LOCATION_MZONE,0,1,nil) and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end
function cm.ckf1(c,syncard,g)
return c:IsType(TYPE_TUNER) and g:IsExists(cm.syf,1,c,syncard)
end
\ No newline at end of file
--方舟骑士协同
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--counter
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(s.ctcon)
e1:SetTarget(s.cttg)
e1:SetOperation(s.ctop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
s.named_with_Arknight=1
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
local code=0
if re then code=re:GetHandler():GetCode() end
return code~=id
end
function s.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x87af) and c:IsType(TYPE_TUNER) and c:IsCanBeEffectTarget(e)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
function s.spfilter(c,e,tp,code)
return c:IsSetCard(0x87af) and c:IsType(TYPE_TUNER) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x87af) and c:IsType(TYPE_TUNER) and c:IsLevelAbove(1)
end
function s.fselect(g)
return g:GetClassCount(Card.GetLevel)==#g
end
function s.scfilter(c)
return c:IsSetCard(0x87af) and c:IsSynchroSummonable(nil)
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,0,nil)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFlagEffect(tp,id)==0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp)
local b2=g:CheckSubGroup(s.fselect,2,2) and Duel.GetFlagEffect(tp,id+1)==0
local b3=Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_EXTRA,0,1,nil) and Duel.GetFlagEffect(tp,id+2)==0
if chkc then return false end
if chk==0 then return b1 or b2 or b3 or b4 end
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=aux.Stringid(id,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(id,1)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(id,2)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
if sel==1 then
s.sptg(e,tp,eg,ep,ev,re,r,rp,1,chkc)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
elseif sel==2 then
s.lvtg(e,tp,eg,ep,ev,re,r,rp,1,chkc)
Duel.RegisterFlagEffect(tp,id+1,RESET_PHASE+PHASE_END,0,1)
else
e:SetProperty(EFFECT_FLAG_DELAY)
Duel.RegisterFlagEffect(tp,id+2,RESET_PHASE+PHASE_END,0,1)
s.sctg(e,tp,eg,ep,ev,re,r,rp,1)
end
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local sel=e:GetLabel()
if sel==1 then
s.spop(e,tp,eg,ep,ev,re,r,rp)
elseif sel==2 then
s.lvop(e,tp,eg,ep,ev,re,r,rp)
else
s.scop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.filter1(c,tp)
local lv=c:GetLevel()
return lv>0 and c:IsFaceup() and c:IsSetCard(0x87af)
and Duel.IsExistingTarget(s.filter2,tp,LOCATION_MZONE,0,1,c,lv)
end
function s.filter2(c,lv)
return not c:IsLevel(lv) and c:IsLevelAbove(1) and c:IsFaceup() and c:IsSetCard(0x87af)
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g1=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc1=g1:GetFirst()
e:SetLabelObject(tc1)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(26864586,0))
local g2=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_MZONE,0,1,1,tc1,tc1:GetLevel())
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc1=e:GetLabelObject()
local tc2=g:GetFirst()
if tc1==tc2 then tc2=g:GetNext() end
local lv=tc1:GetLevel()
if tc2:IsLevel(lv) then return end
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end
local code=tc:GetCode()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,code)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_EXTRA,0,1,nil,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.scfilter,tp,LOCATION_EXTRA,0,nil,nil)
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)
end
end
--方舟骑士-红云
c29021764.named_with_Arknight=1
local m=29021764
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--synchro summon rule
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(cm.syrcon)
e1:SetTarget(cm.syrtg)
e1:SetOperation(cm.syrop)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
--attack twice
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_EXTRA_ATTACK)
e4:SetValue(1)
c:RegisterEffect(e4)
--synchro level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SYNCHRO_LEVEL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED)
e2:SetValue(cm.slevel)
c:RegisterEffect(e2)
--syn
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_BE_MATERIAL)
e5:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e5:SetCondition(cm.con5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
end
--e5
function cm.con5(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,0))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e:GetHandler():GetReasonCard():RegisterEffect(e1,true)
end
function cm.slevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
return (4<<16)+lv
end
--synchro summon rule filter
function cm.syf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
local loccheck=c:GetLocation()~=LOCATION_MZONE or c:IsFaceup()
return loccheck and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
function cm.ckf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
return c:IsLocation(LOCATION_GRAVE+LOCATION_HAND) and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
--synchro summon rule
function cm.syrcon(e,c,smat,mg1,min,max)
if c==nil then return true end
local loc=LOCATION_GRAVE+LOCATION_HAND
--if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
--loc=loc+LOCATION_HAND
--end
local tp=c:GetControler()
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
return mg:CheckSubGroup(cm.syrcheck,2,2,minc,maxc,tp,c,smat,mgchk)
end
function cm.syrtg(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local loc=LOCATION_GRAVE+LOCATION_HAND
--if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
--loc=loc+LOCATION_HAND
--end
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local matg=mg:SelectSubGroup(tp,cm.syrcheck,true,2,2,minc,maxc,tp,c,smat,mgchk)
if matg then
matg:KeepAlive()
e:SetLabelObject(matg)
return true
else return false end
end
function cm.syrop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
if #g==0 then return end
if Duel.GetFlagEffect(tp,m)==0 and g:FilterCount(cm.ckf,nil,c)>0 then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
c:SetMaterial(g)
local _SendtoGrave=Duel.SendtoGrave
Duel.SendtoGrave=function(g,r)
if r==REASON_MATERIAL+REASON_SYNCHRO then
local tg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_GRAVE)
local rg=tg:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
g:Sub(rg)
_SendtoGrave(g,r)
Duel.Remove(rg,POS_FACEUP,r)
Duel.SendtoGrave=_SendtoGrave
else
_SendtoGrave(g,r)
end
end
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
function cm.syrcheck(g,min,max,tp,syncard,smat,mgchk)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),min,max,syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
if smat and not g:IsContains(smat) then return false end
if not g:IsExists(cm.ckf1,1,nil,syncard,g) then return false end
if g:FilterCount(cm.ckf,nil,syncard)>1 then return false end
if not aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),tp,LOCATION_MZONE,0,1,nil) and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end
function cm.ckf1(c,syncard,g)
return c:IsType(TYPE_TUNER) and g:IsExists(cm.syf,1,c,syncard)
end
\ No newline at end of file
--方舟骑士-四月
c29035174.named_with_Arknight=1
function c29035174.initial_effect(c)
--special summon (hand)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29035174,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_MAIN_END+TIMING_BATTLE_START+TIMING_BATTLE_END)
e1:SetCountLimit(1,29035174)
e1:SetCondition(c29035174.spcon)
e1:SetTarget(c29035174.sptg)
e1:SetOperation(c29035174.spop)
c:RegisterEffect(e1)
end
function c29035174.cfilter1(c)
return c:IsFaceup() and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_TUNER)
end
function c29035174.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.IsExistingMatchingCard(c29035174.cfilter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
end
function c29035174.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29035174.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--方舟骑士-白雪
local m=29047427
local cm=_G["c"..m]
cm.named_with_Arknight=1
function cm.initial_effect(c)
c:EnableReviveLimit()
--synchro summon rule
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(cm.syrcon)
e1:SetTarget(cm.syrtg)
e1:SetOperation(cm.syrop)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
--direct attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(cm.pakcon)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x87af))
c:RegisterEffect(e2)
--synchro level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SYNCHRO_LEVEL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED)
e2:SetValue(cm.slevel)
c:RegisterEffect(e2)
end
function cm.slevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
return (4<<16)+lv
end
--synchro summon rule filter
function cm.syf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
local loccheck=c:GetLocation()~=LOCATION_MZONE or c:IsFaceup()
return loccheck and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
function cm.ckf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
return c:IsLocation(LOCATION_GRAVE+LOCATION_HAND) and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
--direct attack
function cm.pakcon(e)
local g=Duel.GetMatchingGroup(cm.pkf,e:GetHandlerPlayer(),0,LOCATION_MZONE,nil,e:GetHandler())
return #g==0
end
function cm.pkf(c,ac)
return c:IsFaceup() and c:GetAttack()>=ac:GetAttack()
end
--synchro summon rule
function cm.syrcon(e,c,smat,mg1,min,max)
if c==nil then return true end
local loc=LOCATION_GRAVE
if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
loc=loc+LOCATION_HAND
end
local tp=c:GetControler()
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
return mg:CheckSubGroup(cm.syrcheck,2,2,minc,maxc,tp,c,smat,mgchk)
end
function cm.syrtg(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local loc=LOCATION_GRAVE
if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
loc=loc+LOCATION_HAND
end
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local matg=mg:SelectSubGroup(tp,cm.syrcheck,true,2,2,minc,maxc,tp,c,smat,mgchk)
if matg then
matg:KeepAlive()
e:SetLabelObject(matg)
return true
else return false end
end
function cm.syrop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
if #g==0 then return end
if Duel.GetFlagEffect(tp,m)==0 and g:FilterCount(cm.ckf,nil,c)>0 then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
c:SetMaterial(g)
local _SendtoGrave=Duel.SendtoGrave
Duel.SendtoGrave=function(g,r)
if r==REASON_MATERIAL+REASON_SYNCHRO then
local tg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_GRAVE)
local rg=tg:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
g:Sub(rg)
_SendtoGrave(g,r)
Duel.Remove(rg,POS_FACEUP,r)
Duel.SendtoGrave=_SendtoGrave
else
_SendtoGrave(g,r)
end
end
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
function cm.syrcheck(g,min,max,tp,syncard,smat,mgchk)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),min,max,syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
if smat and not g:IsContains(smat) then return false end
if not g:IsExists(cm.ckf1,1,nil,syncard,g) then return false end
if g:FilterCount(cm.ckf,nil,syncard)>1 then return false end
if not aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),tp,LOCATION_MZONE,0,1,nil) and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end
function cm.ckf1(c,syncard,g)
return c:IsType(TYPE_TUNER) and g:IsExists(cm.syf,1,c,syncard)
end
\ No newline at end of file
--方舟骑士-空弦
c29048479.named_with_Arknight=1
local m=29048479
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--synchro summon rule
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(cm.syrcon)
e1:SetTarget(cm.syrtg)
e1:SetOperation(cm.syrop)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
--Effect 1
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(cm.immcon)
e3:SetOperation(cm.immop)
c:RegisterEffect(e3)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(cm.val)
c:RegisterEffect(e2)
local e12=e2:Clone()
e12:SetValue(cm.tval)
c:RegisterEffect(e12)
--synchro level
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SYNCHRO_LEVEL)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED)
e4:SetValue(cm.slevel)
c:RegisterEffect(e4)
end
function cm.slevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
return (6<<16)+lv
end
--synchro summon rule filter
function cm.syf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
return c:GetSynchroLevel(syc)>0 and setcard and c:IsCanBeSynchroMaterial(syc)
end
--Effect 1
function cm.immcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
end
function cm.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCountLimit(1)
e1:SetValue(cm.val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetValue(cm.tval)
rc:RegisterEffect(e2,true)
end
--Effect 2
function cm.val(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function cm.tval(e,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0
end
--synchro summon rule
function cm.syrcon(e,c,smat,mg1,min,max)
if c==nil then return true end
local loc=LOCATION_GRAVE
if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
loc=loc+LOCATION_HAND
end
local tp=c:GetControler()
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
return mg:CheckSubGroup(cm.syrcheck,2,2,minc,maxc,tp,c,smat,mgchk)
end
function cm.syrtg(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local loc=LOCATION_GRAVE
if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
loc=loc+LOCATION_HAND
end
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local matg=mg:SelectSubGroup(tp,cm.syrcheck,true,2,2,minc,maxc,tp,c,smat,mgchk)
if matg then
matg:KeepAlive()
e:SetLabelObject(matg)
return true
else return false end
end
function cm.syrop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
if #g==0 then return end
if Duel.GetFlagEffect(tp,m)==0 and g:FilterCount(cm.ckf,nil,c)>0 then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
c:SetMaterial(g)
local _SendtoGrave=Duel.SendtoGrave
Duel.SendtoGrave=function(g,r)
if r==REASON_MATERIAL+REASON_SYNCHRO then
local tg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_GRAVE)
local rg=tg:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
g:Sub(rg)
_SendtoGrave(g,r)
Duel.Remove(rg,POS_FACEUP,r)
Duel.SendtoGrave=_SendtoGrave
else
_SendtoGrave(g,r)
end
end
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
function cm.syrcheck(g,min,max,tp,syncard,smat,mgchk)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),min,max,syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
if smat and not g:IsContains(smat) then return false end
if not g:IsExists(cm.ckf1,1,nil,syncard,g) then return false end
if g:FilterCount(cm.ckf,nil,syncard)>1 then return false end
if not aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),tp,LOCATION_MZONE,0,1,nil) and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end
function cm.ckf1(c,syncard,g)
return c:IsType(TYPE_TUNER) and g:IsExists(cm.syf,1,c,syncard)
end
function cm.ckf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
return c:IsLocation(LOCATION_GRAVE+LOCATION_HAND) and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
\ No newline at end of file
--方舟骑士-梅
c29051189.named_with_Arknight=1
function c29051189.initial_effect(c)
--announce
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29051189,2))
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,29051189)
e3:SetTarget(c29051189.actg)
e3:SetOperation(c29051189.acop)
c:RegisterEffect(e3)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMONS)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,29051190)
e2:SetCondition(c29051189.thcon)
e2:SetTarget(c29051189.sptg)
e2:SetOperation(c29051189.spop)
c:RegisterEffect(e2)
end
--
function c29051189.spfilter(c,e,tp)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and c:IsType(TYPE_TUNER)
end
function c29051189.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29051189.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c29051189.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE+LOCATION_HAND)
end
function c29051189.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29051189.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c29051189.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) and Duel.GetDecktopGroup(tp,5):FilterCount(Card.IsAbleToGrave,nil)>0 end
local g=Duel.GetDecktopGroup(tp,5)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c29051189.filter(c,code)
return c:IsCode(code)
end
function c29051189.thfilter(c)
return c:IsAbleToHand()
end
function c29051189.tgfilter(c)
return c:IsAbleToGrave()
end
function c29051189.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if Duel.IsPlayerCanDiscardDeck(tp,5) then
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5)
if g:GetCount()>0 then
if g:IsExists(c29051189.filter,1,nil,ac) and g:IsExists(c29051189.thfilter,1,nil) then
if Duel.SelectYesNo(tp,aux.Stringid(29051189,1)) then
Duel.DisableShuffleCheck()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c29051189.thfilter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:FilterSelect(tp,c29051189.tgfilter,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
end
--方舟骑士-陈·游龙
c29065553.named_with_Arknight=1
function c29065553.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c29065553.splimit)
c:RegisterEffect(e0)
--add
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c29065553.adcon)
e1:SetOperation(c29065553.adop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c29065553.dscon)
e2:SetOperation(c29065553.dsop)
c:RegisterEffect(e2)
end
c29065553.assault_name=29065508
function c29065553.splimit(e,se,sp,st)
local sc=se:GetHandler()
return (sc:IsSetCard(0x87af) or (_G["c"..sc:GetCode()] and _G["c"..sc:GetCode()].named_with_Arknight))
end
function c29065553.adcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsCanAddCounter(0x10af,1) and rp==1-tp
end
function c29065553.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:AddCounter(0x10af,1)
end
function c29065553.dscon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
local c=e:GetHandler()
return c:IsCanRemoveCounter(tp,0x10af,3,REASON_EFFECT) and rp==1-tp and (LOCATION_HAND+LOCATION_ONFIELD)&loc~=0
end
function c29065553.dsfil(c,s,p)
local seq=c:GetSequence()
return s<5 and seq<5 and math.abs(seq-s)==1 and c:IsControler(p)
end
function c29065553.dsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
Duel.Hint(HINT_CARD,0,29065553)
if not c:IsCanRemoveCounter(tp,0x10af,3,REASON_EFFECT) then return end
c:RemoveCounter(tp,0x10af,3,REASON_EFFECT)
local g=Group.CreateGroup()
if rc:IsOnField() then
local seq=rc:GetSequence()
local p=rc:GetControler()
g=Duel.GetMatchingGroup(c29065553.dsfil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,seq,p)
end
Duel.Destroy(rc,REASON_EFFECT)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--方舟骑士异格
c29065554.named_with_Arknight=1
function c29065554.initial_effect(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c29065554.cost)
e1:SetTarget(c29065554.target)
e1:SetOperation(c29065554.activate)
c:RegisterEffect(e1)
end
function c29065554.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c29065554.filter1(c,e,tp)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c29065554.filter2,tp,LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp,c:GetCode())
end
function c29065554.filter2(c,e,tp,tcode)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_RITUAL) and c.assault_name==tcode and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false,POS_FACEUP)
end
function c29065554.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c29065554.filter1,tp,LOCATION_EXTRA+LOCATION_DECK+LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,e,tp)
end
local rg=Duel.SelectMatchingCard(tp,c29065554.filter1,tp,LOCATION_EXTRA+LOCATION_DECK+LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetCode())
Duel.SendtoGrave(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_HAND)
end
function c29065554.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c29065554.filter2,tp,LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp,e:GetLabel()):GetFirst()
if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
end
end
\ No newline at end of file
--方舟骑士-灰喉
c29065559.named_with_Arknight=1
function c29065559.initial_effect(c)
aux.AddCodeList(c,29065500)
--summon
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(6616912,0))
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SUMMON_PROC)
e0:SetCondition(c29065559.ntcon)
e0:SetOperation(c29065559.ntop)
c:RegisterEffect(e0)
--
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,29065559)
e2:SetTarget(c29065559.rctg)
e2:SetOperation(c29065559.rcop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
c29065559.summon_effect=e2
end
function c29065559.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c29065559.ntop(e,tp,eg,ep,ev,re,r,rp,c)
--change base attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function c29065559.rcfilter(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c29065559.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29065559.rcfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c29065559.amyfilter(c)
return c:IsFaceup() and c:IsCode(29065500)
end
function c29065559.rcop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29065559.rcfilter),tp,LOCATION_GRAVE,0,1,1,nil)
local c=g:GetFirst()
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c29065559.amyfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectOption(tp,1190,1152)==1 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--方舟骑士-陈·游龙
c29065564.named_with_Arknight=1
function c29065564.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c29065564.splimit)
c:RegisterEffect(e0)
--add
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c29065564.adcon)
e1:SetOperation(c29065564.adop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c29065564.dscon)
e2:SetOperation(c29065564.dsop)
c:RegisterEffect(e2)
end
c29065564.assault_name=29065508
function c29065564.splimit(e,se,sp,st)
local sc=se:GetHandler()
return (sc:IsSetCard(0x87af) or (_G["c"..sc:GetCode()] and _G["c"..sc:GetCode()].named_with_Arknight))
end
c29065564.assault_name=29065508
function c29065564.adcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsCanAddCounter(0x10af,1) and rp==1-tp
end
function c29065564.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:AddCounter(0x10af,1)
end
function c29065564.dscon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
local c=e:GetHandler()
return c:IsCanRemoveCounter(tp,0x10af,3,REASON_EFFECT) and rp==1-tp and (LOCATION_HAND+LOCATION_ONFIELD)&loc~=0
end
function c29065564.dsfil(c,s,p)
local seq=c:GetSequence()
return s<5 and seq<5 and math.abs(seq-s)==1 and c:IsControler(p)
end
function c29065564.dsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
Duel.Hint(HINT_CARD,0,29065564)
if not c:IsCanRemoveCounter(tp,0x10af,3,REASON_EFFECT) then return end
c:RemoveCounter(tp,0x10af,3,REASON_EFFECT)
local g=Group.CreateGroup()
if rc:IsOnField() then
local seq=rc:GetSequence()
local p=rc:GetControler()
g=Duel.GetMatchingGroup(c29065564.dsfil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,seq,p)
end
Duel.Destroy(rc,REASON_EFFECT)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--方舟骑士-流星
c29066399.named_with_Arknight=1
function c29066399.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29066399,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,29066399)
e2:SetTarget(c29066399.sptg)
e2:SetOperation(c29066399.spop)
c:RegisterEffect(e2)
--change atk/def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(c29066399.discon)
e3:SetOperation(c29066399.disop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e4)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_SET_ATTACK_FINAL)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(0,LOCATION_MZONE)
e6:SetTarget(c29066399.distg)
e6:SetValue(c29066399.atkval)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_SET_DEFENSE_FINAL)
e7:SetValue(c29066399.defval)
c:RegisterEffect(e7)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_BE_MATERIAL)
e5:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e5:SetCondition(c29066399.con5)
e5:SetOperation(c29066399.op5)
c:RegisterEffect(e5)
end
function c29066399.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29066399.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
--e5
function c29066399.con5(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
end
function c29066399.op5(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(29066399,0))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(c29066399.discon)
e1:SetOperation(c29066399.disop)
e:GetHandler():GetReasonCard():RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e:GetHandler():GetReasonCard():RegisterEffect(e2,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(c29066399.distg)
e3:SetValue(c29066399.atkval)
e:GetHandler():GetReasonCard():RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
e4:SetValue(c29066399.defval)
e:GetHandler():GetReasonCard():RegisterEffect(e4,true)
end
function c29066399.atkval(e,c)
return math.ceil(c:GetAttack()/2)
end
function c29066399.defval(e,c)
return math.ceil(c:GetDefense()/2)
end
function c29066399.cfilter(c,tp)
return c:IsFaceup() and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsControler(tp)
end
function c29066399.discon(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget()
if not c then return false end
if c:IsControler(1-tp) then c=Duel.GetAttacker() end
return c and c29066399.cfilter(c,tp)
end
function c29066399.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttackTarget()
if tc:IsControler(tp) then tc=Duel.GetAttacker() end
tc:RegisterFlagEffect(29066399,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE,0,1)
end
function c29066399.distg(e,c)
return c:GetFlagEffect(29066399)~=0
end
function c29066399.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c29066399.thfilter(c)
return not c:IsCode(29066399) and c:IsLevelBelow(4) and c:IsAbleToHand() and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_TUNER)
end
function c29066399.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c29066399.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c29066399.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c29066399.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--方舟骑士-夜刀·麒麟X(Incomplete)
local m=29083691
local cm=_G["c"..m]
cm.named_with_Arknight=1
function cm.initial_effect(c)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.ritlimit)
c:RegisterEffect(e1)
if not Auxiliary.PendulumChecklist then
Auxiliary.PendulumChecklist=0
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(Auxiliary.PendulumReset)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1163)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(cm.PendConditionArcKnight())
e1:SetOperation(cm.PendOperationArcKnight())
e1:SetValue(SUMMON_TYPE_PENDULUM)
c:RegisterEffect(e1)
--register by default
if reg==nil or reg then
local e2=Effect.CreateEffect(c)
e2:SetDescription(1160)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e2)
end
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e4:SetOperation(cm.ctlop)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e5:SetCondition(function(e,tp) return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) and c:IsLocation(LOCATION_MZONE) end)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetValue(LOCATION_HAND)
c:RegisterEffect(e5)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
if not Pcheck_ArkKnight then
Pcheck_ArkKnight = true
Auxiliary.PendCondition = cm.PendConditionArcKnight
Auxiliary.PendOperation = cm.PendOperationArcKnight
end
end
c29083691.assault_name=29005188
function cm.spfilter(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_PENDULUM) and not c:IsCode(m) and c:IsAbleToHand()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.desf(c)
return c:GetSequence()==5 or c:GetSequence()==6
end
function cm.ctlop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetColumnGroup():Filter(Card.IsControler,nil,1-e:GetHandlerPlayer())
local cg = g:Filter(cm.desf,nil)
local dg = g:Filter(Card.IsType,nil,TYPE_MONSTER)
if g:GetCount()>0 then
if #g == 1 then
Duel.Destroy(g,REASON_EFFECT)
elseif cg:GetCount()>0 then
Duel.Destroy(cg,REASON_EFFECT)
else
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
function cm.PConditionFilterArcKnight(c,e,tp,lscale,rscale,f,tc,eset)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
local bool=aux.PendulumSummonableBool(c)
return lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and (Auxiliary.PendulumChecklist &(0x1<<tp)==0 or aux.PConditionExtraFilter(c,e,tp,lscale,rscale,eset))
and not c:IsForbidden() and (not f or f(c,tc))
end
function cm.GetPendulumCard(tp,seq)
return Duel.GetFieldCard(tp,LOCATION_PZONE,seq)
end
function cm.SetForceExtra(tp,res)
if forced_to_extra then
forced_to_extra[tp]=res
end
end
function cm.PendConditionArcKnight()
return function(e,c,og,exfilter,flag)
if c==nil then return true end
local tp=c:GetControler()
if not exfilter then exfilter = aux.TRUE end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if Auxiliary.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 and not flag then return false end
local rpz=cm.GetPendulumCard(tp,1)
if rpz==nil or c==rpz then return false end
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetUsableMZoneCount(tp)
if ft<=0 then return false end
local mft=Duel.GetMZoneCount(tp)
cm.SetForceExtra(tp,true)
local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
cm.SetForceExtra(tp,false)
local g=nil
if og then
g=og:Filter(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
else
g=Duel.GetMatchingGroup(aux.PConditionFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp,lscale,rscale,eset)
end
local ext1={c:IsHasEffect(29036036)}
local ext2={rpz:IsHasEffect(29036036)}
for i,te in pairs(ext1) do
local location,filter,maxcount=te:GetValue()()
if (location==LOCATION_EXTRA and eft>0) or (location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterArcKnight,tp,location,0,nil,e,tp,lscale,rscale,filter,te:GetHandler(),eset)
g:Merge(exg)
end
end
for i,te in pairs(ext2) do
local location,filter,maxcount=te:GetValue()()
if (location==LOCATION_EXTRA and eft>0) or (location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterArcKnight,tp,location,0,nil,e,tp,lscale,rscale,filter,te:GetHandler(),eset)
g:Merge(exg)
end
end
if mft<=0 then g=g:Filter(Card.IsLocation,nil,LOCATION_EXTRA) end
if eft<=0 then g:Remove(Card.IsLocation,nil,LOCATION_EXTRA) end
if exfilter then
g = g:Filter(exfilter,nil)
end
return #g>0
end
end
function cm.PendCheckAdditionalArcKnight(mft,maxlist)
return function(g)
if mft>0 and g:IsExists(Card.IsLocation,mft+1,nil,0xbf) then return false end
for loc,lct in pairs(maxlist) do
if lct>0 and g:IsExists(Card.IsLocation,lct+1,nil,loc) then return false end
end
return true
end
end
function cm.PendOperationArcKnight()
return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og,exfilter,flag)
local rpz=cm.GetPendulumCard(tp,1)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if not exfilter then exfilter = ArkEffect_Pend_filter or aux.TRUE end
if lscale>rscale then lscale,rscale=rscale,lscale end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local ft=Duel.GetUsableMZoneCount(tp)
local mft=Duel.GetMZoneCount(tp)
cm.SetForceExtra(tp,true)
local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
cm.SetForceExtra(tp,false)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
mft=math.min(1,mft)
mft=math.min(1,eft)
ft=1
end
local tg=nil
local maxlist={}
if og then
tg=og:Filter(aux.PConditionFilter,1,nil,e,tp,lscale,rscale)
else
tg=Duel.GetMatchingGroup(aux.PConditionFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp,lscale,rscale,eset)
end
local ext1={c:IsHasEffect(29036036)}
local ext2={rpz:IsHasEffect(29036036)}
for i,te in pairs(ext1) do
local location,filter,maxcount=te:GetValue()()
if (location==LOCATION_EXTRA and eft>0) or (location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterArcKnight,tp,location,0,nil,e,tp,lscale,rscale,filter,te:GetHandler(),eset)
tg:Merge(exg)
local mct=maxcount
if mct and mct>0 and mct<ft then
maxlist[location]=mct
end
end
end
for i,te in pairs(ext2) do
local location,filter,maxcount=te:GetValue()()
if (location==LOCATION_EXTRA and eft>0) or (location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterArcKnight,tp,location,0,nil,e,tp,lscale,rscale,filter,te:GetHandler(),eset)
tg:Merge(exg)
local mct=maxcount
if mct and mct>0 and mct<ft then
maxlist[location]=mct
end
end
end
if mft<=0 then tg=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA) end
if eft<=0 then tg:Remove(Card.IsLocation,nil,LOCATION_EXTRA) end
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and math.min(c29724053[tp],eft) or eft
local left=maxlist[LOCATION_EXTRA]
if left then
maxlist[LOCATION_EXTRA]=math.min(left,ect)
else
maxlist[LOCATION_EXTRA]=ect
end
local ce=nil
local b1=Auxiliary.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0
if b1 and b2 then
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
if ce then
tg=tg:Filter(aux.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,ce)
end
if exfilter then
tg = tg:Filter(exfilter,nil)
end
Auxiliary.GCheckAdditional=cm.PendCheckAdditionalArcKnight(mft,maxlist)
Duel.Hint(tp,HINT_SELECTMSG,desc)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,ft)
Auxiliary.GCheckAdditional=nil
if not g then return end
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset()
elseif ArkEffect_Pend then
ArkEffect_Pend = false
else
Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp)
end
sg:Merge(g)
Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
cm.SetForceExtra(tp,true)
end
end
function cm.ArcKnightPCardFilter(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_PENDULUM)
end
function cm.ArcKnightPCardCheck(e)
return Duel.IsExistingMatchingCard(cm.ArcKnightPCardFilter,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler())
end
--方舟骑士-杰西卡
local s,id,o=GetID()
s.named_with_Arknight=1
function s.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(s.indcon)
e3:SetOperation(s.indop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(12196873,1))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetCountLimit(1,id+1)
e4:SetRange(LOCATION_REMOVED)
e4:SetCondition(s.rthcon)
e4:SetTarget(s.rthtg)
e4:SetOperation(s.rthop)
c:RegisterEffect(e4)
--tohand
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_REMOVE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetOperation(s.regop)
c:RegisterEffect(e6)
end
function s.thfilter(c)
return ((c:IsType(TYPE_TUNER) and c:IsSetCard(0x87af)) or c:IsCode(29017089)) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroup(tp,LOCATION_HAND,0)~=0
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local g2=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
local rt=math.min(#g1,#g2,2)
if rt==0 then return false end
local ct=Duel.DiscardHand(tp,nil,1,rt,REASON_EFFECT+REASON_DISCARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg2=g2:Select(tp,ct,ct,nil)
Duel.SendtoHand(sg2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg2)
end
function s.indcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
end
function s.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
end
function s.rthcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetTurnPlayer()==tp and c:GetFlagEffect(id)>0
and (Duel.GetTurnCount()>e:GetHandler():GetTurnID()+1 or Duel.GetTurnCount()==e:GetHandler():GetTurnID()+2)
end
function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.rthop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsPreviousLocation(LOCATION_GRAVE) then return false end
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
end
\ No newline at end of file
--方舟骑士-埃拉托
local m=29090391
local cm=_G["c"..m]
cm.named_with_Arknight=1
function cm.initial_effect(c)
c:EnableReviveLimit()
--synchro summon rule
local e01=Effect.CreateEffect(c)
e01:SetDescription(1164)
e01:SetType(EFFECT_TYPE_FIELD)
e01:SetCode(EFFECT_SPSUMMON_PROC)
e01:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e01:SetRange(LOCATION_EXTRA)
e01:SetCondition(cm.syrcon)
e01:SetTarget(cm.syrtg)
e01:SetOperation(cm.syrop)
e01:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e01)
--Effect 1
local e51=Effect.CreateEffect(c)
e51:SetDescription(aux.Stringid(m,0))
e51:SetCategory(CATEGORY_POSITION)
e51:SetType(EFFECT_TYPE_QUICK_O)
e51:SetCode(EVENT_FREE_CHAIN)
e51:SetRange(LOCATION_MZONE)
e51:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e51:SetCountLimit(1,m)
e51:SetTarget(cm.postg)
e51:SetOperation(cm.posop)
c:RegisterEffect(e51)
--synchro level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SYNCHRO_LEVEL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.slevel)
c:RegisterEffect(e2)
end
function cm.slevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
return (5<<16)+lv
end
--synchro summon rule filter
function cm.syf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
local loccheck=c:GetLocation()~=LOCATION_MZONE or c:IsFaceup()
return loccheck and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
function cm.ckf(c,syc)
local setcard=(c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
return c:IsLocation(LOCATION_GRAVE+LOCATION_HAND) and c:GetSynchroLevel(syc)>0 and setcard and c:IsSynchroType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syc)
end
--synchro summon rule
function cm.syrcon(e,c,smat,mg1,min,max)
if c==nil then return true end
local loc=LOCATION_GRAVE+LOCATION_HAND
--if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
--loc=loc+LOCATION_HAND
--end
local tp=c:GetControler()
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
return mg:CheckSubGroup(cm.syrcheck,2,2,minc,maxc,tp,c,smat,mgchk)
end
function cm.syrtg(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local loc=LOCATION_GRAVE+LOCATION_HAND
--if not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),c:GetControler(),LOCATION_MZONE,0,1,nil) then
--loc=loc+LOCATION_HAND
--end
local excheck=Duel.GetFlagEffect(tp,m)==0
local exg=Duel.GetMatchingGroup(cm.syf,tp,loc,0,nil,c)
local minc=2
local maxc=99
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
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c)
end
if excheck and #exg>0 and mgchk==false then mg:Merge(exg) end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local matg=mg:SelectSubGroup(tp,cm.syrcheck,true,2,2,minc,maxc,tp,c,smat,mgchk)
if matg then
matg:KeepAlive()
e:SetLabelObject(matg)
return true
else return false end
end
function cm.syrop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
if #g==0 then return end
if Duel.GetFlagEffect(tp,m)==0 and g:FilterCount(cm.ckf,nil,c)>0 then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
c:SetMaterial(g)
local _SendtoGrave=Duel.SendtoGrave
Duel.SendtoGrave=function(g,r)
if r==REASON_MATERIAL+REASON_SYNCHRO then
local tg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_GRAVE)
local rg=tg:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
g:Sub(rg)
_SendtoGrave(g,r)
Duel.Remove(rg,POS_FACEUP,r)
Duel.SendtoGrave=_SendtoGrave
else
_SendtoGrave(g,r)
end
end
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
function cm.syrcheck(g,min,max,tp,syncard,smat,mgchk)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),min,max,syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
if smat and not g:IsContains(smat) then return false end
if not g:IsExists(cm.ckf1,1,nil,syncard,g) then return false end
if g:FilterCount(cm.ckf,nil,syncard)>1 then return false end
if not aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.GetHandSynchro),tp,LOCATION_MZONE,0,1,nil) and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end
function cm.ckf1(c,syncard,g)
return c:IsType(TYPE_TUNER) and g:IsExists(cm.syf,1,c,syncard)
end
--Effect 1
function cm.pf(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.pf,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,1-tp,LOCATION_MZONE)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.pf,tp,0,LOCATION_MZONE,nil)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tag=g:Select(tp,1,1,nil)
if #tag==0 then return end
Duel.HintSelection(tag)
--local tc=tag:GetFirst()
Duel.ChangePosition(tag,POS_FACEDOWN_DEFENSE)
end
--Effect 2
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsFacedown() and bc:IsDefensePos()
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle() and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_CARD,0,m)
Duel.Destroy(bc,REASON_EFFECT)
end
end
......@@ -143,9 +143,9 @@ function c51924009.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetOperation(c51924009.retop)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(51924009,0))
Duel.SpecialSummonComplete()
end
end
Duel.SpecialSummonComplete()
end
function c51924009.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKTOP,REASON_EFFECT)
......
......@@ -57,7 +57,7 @@ function c51924013.setfilter(c)
end
function c51924013.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c51924013.setfilter,tp,LOCATION_ONFIELD,0,1,nil) and
Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c51924013.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
......
......@@ -54,7 +54,7 @@ end
function c67201253.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
local tg=g:Filter(c67201253.disfilter,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
......
......@@ -31,7 +31,7 @@ function c67201256.tdfilter(c,tp)
end
function c67201256.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c67201256.tdfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
if chk==0 then return Duel.IsExistingTarget(c67201256.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c67201256.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......
......@@ -55,7 +55,7 @@ function c98920000.initial_effect(c)
c:RegisterEffect(e7)
end
function c98920000.spfilter(c,e,tp)
return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
return c:IsSetCard(0x1019) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c98920000.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -83,7 +83,7 @@ function c98920000.eftg(e,c)
return c:IsCode(48156348,90957527)
end
function c98920000.filter0(c,ft)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x19) and (c:IsAbleToExtraAsCost() or c:IsAbleToDeck())
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1019) and (c:IsAbleToExtraAsCost() or c:IsAbleToDeck())
end
function c98920000.filter1(c)
return c:IsCode(98920000) and c:IsAbleToRemoveAsCost()
......
......@@ -41,7 +41,7 @@ function c98920153.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.BreakEffect()
if tc:IsType(TYPE_MONSTER) and tc:IsSetCard(0x19) then
if tc:IsSetCard(0x1019) then
Duel.Draw(tp,1,REASON_EFFECT)
end
Duel.ShuffleHand(tp)
......@@ -67,7 +67,7 @@ function c98920153.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c98920153.filter(c,e,tp)
return c:IsSetCard(0x19) and not c:IsCode(98920153) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_GLADIATOR,tp,false,false)
return c:IsSetCard(0x1019) and not c:IsCode(98920153) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_GLADIATOR,tp,false,false)
end
function c98920153.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
......
......@@ -29,7 +29,7 @@ function c98920635.initial_effect(c)
c:RegisterEffect(e2)
end
function c98920635.spgfilter(c,e,tp)
return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_GLADIATOR,tp,false,false) and not Duel.IsExistingMatchingCard(c98920635.filter1,tp,LOCATION_MZONE,0,1,c,c:GetRace())
return c:IsSetCard(0x1019) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_GLADIATOR,tp,false,false) and not Duel.IsExistingMatchingCard(c98920635.filter1,tp,LOCATION_MZONE,0,1,c,c:GetRace())
end
function c98920635.filter1(c,race)
return c:IsFaceup() and c:IsRace(race)
......@@ -58,7 +58,7 @@ function c98920635.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c98920635.filter(c,e,tp)
return not c:IsCode(98920635) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_GLADIATOR,tp,false,false)
return not c:IsCode(98920635) and c:IsSetCard(0x1019) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_GLADIATOR,tp,false,false)
end
function c98920635.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
......
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