Commit 98f5a283 authored by 竹中千惠理's avatar 竹中千惠理

24.6.12

parent 176bc559
File added
{
"Lua.diagnostics.globals": [
"changefusion",
"tt",
"ttnum"
]
}
\ No newline at end of file
--红莲的冻结
local cm,m,o=GetID()
cm.name = "红莲的冻结"
function cm.initial_effect(c)
aux.AddCodeList(c,60002336,60002335)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+10000000)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function cm.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function cm.filter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function cm.filter2(c,e,tp,m,f,chkf)
return aux.IsCodeListed(c,60002336) and aux.IsCodeListed(c,60002335) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsType(TYPE_FUSION)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter1),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(mat,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end
function cm.thtg(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 cm.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
--被封印的双子·烈焰
local cm,m,o=GetID()
cm.name = "被封印的双子·烈焰"
function cm.initial_effect(c)
aux.AddCodeList(c,60002336,m)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--fusion
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.condition)
e2:SetTarget(cm.target)
e2:SetOperation(cm.activate)
c:RegisterEffect(e2)
end
function cm.tgfilter1(c)
return c:IsCode(60002334) and c:IsAbleToGrave()
end
function cm.tgfilter2(c)
return c:IsCode(60002336) and c:IsAbleToGrave()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter1,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(cm.tgfilter2,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK+LOCATION_HAND)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter1,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
g:Merge(Duel.SelectMatchingCard(tp,cm.tgfilter2,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil))
local num=#g:Filter(Card.IsLocation,nil,LOCATION_HAND)
if g:GetCount()>1 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function cm.filter0(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function cm.filter1(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and (not f or f(c)) and aux.IsCodeListed(c,60002336) and aux.IsCodeListed(c,60002335)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
local res=c:CheckFusionMaterial(m,e:GetHandler(),chkf)
return res
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL and e:GetHandler():IsReason(REASON_EFFECT)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local res=Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToChain() or c:IsImmuneToEffect(e) then return end
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter0),tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg,e:GetHandler(),chkf)
tc:SetMaterial(mat1)
if mat1:IsExists(cm.fdfilter,1,nil) then
local cg=mat1:Filter(cm.fdfilter,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat1:IsExists(cm.fdfilter2,1,nil) then
local cg=mat1:Filter(cm.fdfilter2,nil)
Duel.HintSelection(cg)
end
aux.PlaceCardsOnDeckBottom(tp,mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,e:GetHandler(),chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function cm.fdfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND)
end
function cm.fdfilter2(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)
end
--被封印的双子·琉璃
local cm,m,o=GetID()
cm.name = "被封印的双子·琉璃"
function cm.initial_effect(c)
aux.AddCodeList(c,60002335,m)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--fusion
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.condition)
e2:SetTarget(cm.target)
e2:SetOperation(cm.activate)
c:RegisterEffect(e2)
end
function cm.tgfilter1(c)
return c:IsCode(60002334) and c:IsAbleToGrave()
end
function cm.tgfilter2(c)
return c:IsCode(60002335) and c:IsAbleToGrave()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter1,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(cm.tgfilter2,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK+LOCATION_HAND)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter1,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
g:Merge(Duel.SelectMatchingCard(tp,cm.tgfilter2,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil))
local num=#g:Filter(Card.IsLocation,nil,LOCATION_HAND)
if g:GetCount()>1 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function cm.filter0(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function cm.filter1(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and (not f or f(c)) and aux.IsCodeListed(c,60002336) and aux.IsCodeListed(c,60002335)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
local res=c:CheckFusionMaterial(m,e:GetHandler(),chkf)
return res
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL and e:GetHandler():IsReason(REASON_EFFECT)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local res=Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToChain() or c:IsImmuneToEffect(e) then return end
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter0),tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg,e:GetHandler(),chkf)
tc:SetMaterial(mat1)
if mat1:IsExists(cm.fdfilter,1,nil) then
local cg=mat1:Filter(cm.fdfilter,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat1:IsExists(cm.fdfilter2,1,nil) then
local cg=mat1:Filter(cm.fdfilter2,nil)
Duel.HintSelection(cg)
end
aux.PlaceCardsOnDeckBottom(tp,mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,e:GetHandler(),chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function cm.fdfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND)
end
function cm.fdfilter2(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)
end
\ No newline at end of file
--双极生命·烈焰=琉璃
local cm,m,o=GetID()
cm.name = "双极生命·烈焰=琉璃"
function cm.initial_effect(c)
--fusion material
aux.AddCodeList(c,60002336,60002335)
aux.AddFusionProcCode2(c,60002336,60002335,true,true)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(0xff)
e1:SetValue(ATTRIBUTE_FIRE)
c:RegisterEffect(e1)
--fusion type
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetRange(0xff)
e1:SetValue(TYPE_FUSION)
c:RegisterEffect(e1)
--sp summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
--grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60001173,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.hstg)
e2:SetOperation(cm.hsop)
c:RegisterEffect(e2)
end
cm.is_fusion=true
if not changefusion then
changefusion=true
cm.is_type=Card.IsType
---@diagnostic disable-next-line: duplicate-set-field
Card.IsType=function(car,typ,...)
if typ&TYPE_FUSION>0 then
return cm.is_type(car,typ,...) or car.is_fusion
else
return cm.is_type(car,typ,...)
end
end
end
function cm.afil1(c)
return (c:IsCode(60002335) or c:IsCode(60002336)) and c:IsAbleToGrave()
end
function cm.tgtg(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 c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(cm.afil1,tp,LOCATION_HAND,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.afil1,tp,LOCATION_HAND,0,1,99,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
local qs=0
for i=1,#g do
local kt=g:GetFirst()
if kt:IsLocation(LOCATION_GRAVE) then
qs=qs+1
end
g:RemoveCard(kt)
end
if qs>=1 then
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
if qs>=2 then
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
end
function cm.afil2(c)
return aux.IsCodeListed(c,60002336) and aux.IsCodeListed(c,60002335) and c:IsAbleToHand()
end
function cm.hstg(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.afil1,tp,LOCATION_DECK,0,nil)
if chk==0 then return e:GetHandler():IsAbleToDeck() and g1:GetClassCount(Card.GetCode)>=2 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function cm.hsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ua=Duel.GetMatchingGroup(cm.afil1,tp,LOCATION_DECK,0,nil):GetClassCount(Card.GetCode)
local ub=Duel.GetMatchingGroup(cm.afil2,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil):GetCount()
if c:IsRelateToEffect(e) then
if Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then
local g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,60002336)
Duel.SendtoGrave(g:GetFirst(),REASON_EFFECT)
local gg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,60002335)
Duel.SendtoGrave(gg:GetFirst(),REASON_EFFECT)
end
end
end
\ No newline at end of file
--烈焰·琉璃
local cm,m,o=GetID()
cm.name = "烈焰`琉璃"
function cm.initial_effect(c)
--fusion material
aux.AddCodeList(c,60002336,60002335)
aux.AddFusionProcCode2(c,60002336,60002335,true,true)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(0xff)
e1:SetValue(ATTRIBUTE_FIRE)
c:RegisterEffect(e1)
--fusion type
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetRange(0xff)
e1:SetValue(TYPE_FUSION)
c:RegisterEffect(e1)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60001173,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.hstg)
e2:SetOperation(cm.hsop)
c:RegisterEffect(e2)
end
cm.is_fusion=true
if not changefusion then
changefusion=true
cm.is_type=Card.IsType
Card.IsType=function(car,typ,...)
if typ&TYPE_FUSION>0 then
return cm.is_type(car,typ,...) or car.is_fusion
else
return cm.is_type(car,typ,...)
end
end
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
if Duel.Destroy(sg,REASON_EFFECT)~=0 then
local dmg=e:GetHandler():GetAttack()
Duel.Damage(1-tp,dmg,REASON_EFFECT)
end
end
function cm.afil2(c)
return aux.IsCodeListed(c,60002336) and aux.IsCodeListed(c,60002335) and c:IsAbleToHand()
end
function cm.hstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.afil2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.hsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.afil2,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
end
end
\ No newline at end of file
--浑然的双极之烈焰·琉璃
local cm,m,o=GetID()
cm.name = "浑然的双极之烈焰·琉璃"
function cm.initial_effect(c)
--fusion material
aux.AddCodeList(c,60002336,60002335)
aux.AddFusionProcCode2(c,60002336,60002335,true,true)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(0xff)
e1:SetValue(ATTRIBUTE_FIRE)
c:RegisterEffect(e1)
--fusion type
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetRange(0xff)
e1:SetValue(TYPE_FUSION)
c:RegisterEffect(e1)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--tg
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(m,2))
e7:SetCategory(CATEGORY_SPECIAL_SUMMON)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e7:SetProperty(EFFECT_FLAG_DELAY)
e7:SetCode(EVENT_TO_GRAVE)
e7:SetCountLimit(1)
e7:SetCondition(cm.drcon)
e7:SetTarget(cm.drtg)
e7:SetOperation(cm.drop)
c:RegisterEffect(e7)
end
cm.is_fusion=true
if not changefusion then
changefusion=true
cm.is_type=Card.IsType
Card.IsType=function(car,typ,...)
if typ&TYPE_FUSION>0 then
return cm.is_type(car,typ,...) or car.is_fusion
else
return cm.is_type(car,typ,...)
end
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.thfilter(c)
return c:IsLevel(5) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,2,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Destroy(g:GetFirst(),REASON_EFFECT)
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
function cm.afil1(c,e,tp)
return (c:IsCode(60002335) or c:IsCode(60002336)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.fil1(c,e,tp)
return c:IsCode(60002335) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.fil2(c,e,tp)
return c:IsCode(60002336) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.afil1,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return g1:GetClassCount(Card.GetCode)>=2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.fil1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.fil2,tp,LOCATION_DECK+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
\ No newline at end of file
--奇术尊者 伽夜
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_ACTIVATING)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetRange(LOCATION_MZONE)
--e1:SetCondition(cm.spcon)
e1:SetOperation(cm.bkop)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer()
Duel.RegisterFlagEffect(0,m,RESET_CHAIN,0,1)
end
function cm.filter(c,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp)
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil))
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num)
local g=Duel.GetDecktopGroup(tp,num):Filter(Card.IsSetCard,nil,0x62a)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if sg:GetFirst():IsAbleToHand() then
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil)
if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil)
end
end
else
Duel.SendtoGrave(sg,REASON_RULE)
end
Duel.ShuffleDeck(tp)
else
Duel.ShuffleDeck(tp)
end
end
end
function cm.bkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
Duel.SendtoHand(e:GetHandler(),tp,REASON_EFFECT)
end
\ No newline at end of file
--奇术尊者 米兰
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_ACTIVATING)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetRange(LOCATION_MZONE)
--e1:SetCondition(cm.spcon)
e1:SetOperation(cm.bkop)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer()
Duel.RegisterFlagEffect(0,m,RESET_CHAIN,0,1)
end
function cm.filter(c,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp)
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil))
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num)
local g=Duel.GetDecktopGroup(tp,num):Filter(Card.IsSetCard,nil,0x62a)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if sg:GetFirst():IsAbleToHand() then
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil)
if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg)
end
end
else
Duel.SendtoGrave(sg,REASON_RULE)
end
Duel.ShuffleDeck(tp)
else
Duel.ShuffleDeck(tp)
end
end
end
function cm.bkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
Duel.SendtoHand(e:GetHandler(),tp,REASON_EFFECT)
end
\ No newline at end of file
--奇术尊者 优树
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_ACTIVATING)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetRange(LOCATION_MZONE)
--e1:SetCondition(cm.spcon)
e1:SetOperation(cm.bkop)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer()
Duel.RegisterFlagEffect(0,m,RESET_CHAIN,0,1)
end
function cm.filter(c,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp)
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil))
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num)
local g=Duel.GetDecktopGroup(tp,num):Filter(Card.IsSetCard,nil,0x62a)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if sg:GetFirst():IsAbleToHand() then
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil)
if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg)
end
end
else
Duel.SendtoGrave(sg,REASON_RULE)
end
Duel.ShuffleDeck(tp)
else
Duel.ShuffleDeck(tp)
end
end
end
function cm.bkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
Duel.SendtoHand(e:GetHandler(),tp,REASON_EFFECT)
end
\ No newline at end of file
--奇术尊者 达尔
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_ACTIVATING)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetRange(LOCATION_MZONE)
--e1:SetCondition(cm.spcon)
e1:SetOperation(cm.bkop)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer()
Duel.RegisterFlagEffect(0,m,RESET_CHAIN,0,1)
end
function cm.filter(c,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp)
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil))
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num)
local g=Duel.GetDecktopGroup(tp,num):Filter(Card.IsSetCard,nil,0x62a)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if sg:GetFirst():IsAbleToHand() then
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil)
if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg)
end
end
else
Duel.SendtoGrave(sg,REASON_RULE)
end
Duel.ShuffleDeck(tp)
else
Duel.ShuffleDeck(tp)
end
end
end
function cm.bkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
Duel.SendtoHand(e:GetHandler(),tp,REASON_EFFECT)
end
\ No newline at end of file
--奇术尊者 莱文
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_ACTIVATING)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetRange(LOCATION_MZONE)
--e1:SetCondition(cm.spcon)
e1:SetOperation(cm.bkop)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandlerPlayer()
Duel.RegisterFlagEffect(0,m,RESET_CHAIN,0,1)
end
function cm.filter(c,tp)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
return c:IsSynchroSummonable(nil,mg)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num)
--Debug.Message(tp)
--Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil))
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m)
if Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.ConfirmDecktop(tp,num)
local g=Duel.GetDecktopGroup(tp,num):Filter(Card.IsSetCard,nil,0x62a)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if sg:GetFirst():IsAbleToHand() then
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
local ssg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil)
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_MONSTER)
local spg=ssg:Select(tp,1,1,nil)
if Duel.GetMZoneCount(tp,c)>0 then
Duel.SynchroSummon(tp,spg:GetFirst(),nil,mg)
end
end
else
Duel.SendtoGrave(sg,REASON_RULE)
end
Duel.ShuffleDeck(tp)
else
Duel.ShuffleDeck(tp)
end
end
end
function cm.bkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
Duel.SendtoHand(e:GetHandler(),tp,REASON_EFFECT)
end
\ No newline at end of file
--Hello World!
--This is a library of mtc's cards.
--You can add QQ1252425371 to feedback bugs.
--You can view detailed usages below or in mtc's card.
--A few annotations in Chinese are noted below.
--Welcome to use mtc's library.
MTC=MTC or {}
MTC.loaded_metatable_list={}
-------------------------------------------------------------------------------------------------------------------------------------
--系列「传说天」相关函数
--「传说天」次数检定初始化函数
function MTC.LHini(c)
if not LHini==true then
LHini=true
local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(MTC.LHcon1)
e1:SetOperation(MTC.LHop1)
Duel.RegisterEffect(e1,tp)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(MTC.LHcon1)
e1:SetOperation(MTC.LHop1)
Duel.RegisterEffect(e1,tp)
end
end
function MTC.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function MTC.LHcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(MTC.LHfil1,1,nil,tp)
end
function MTC.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
--这个回合,自己把「传说天」怪兽召唤·特殊召唤的次数每有3次,返回值+1
function MTC.LHnum(tp)
local num=Duel.GetFlagEffect(tp,60010002)
local ti=0
while num>=3 do
num=num-3
ti=ti+1
end
return ti
end
-------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------
--系列「传说天」怪兽通用特招效果
--这张卡可以丢弃num张手卡从手卡特招
function MTC.LHSpS(c,num)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetLabel(num)
e1:SetCondition(MTC.LHcon2)
e1:SetOperation(MTC.LHop2)
c:RegisterEffect(e1)
end
function MTC.LHcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c==nil then return true end
local tp=c:GetControler()
local num=e:GetLabel()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,num,c)
end
function MTC.LHop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,num,num,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
-------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------
--「马纳历亚」次数检定初始化函数
--已废弃
-------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------
--!!暂时无法正常使用!!
--塔隆·血魔类效果初始化
--MTC.CheckEffectSetCode(所使用的表名称,所使用的识别名,不予记录的code,...) ...中记录所需记录效果的event
function MTC.CheckEffectSetCode(tablename,ccode,excode,...)
local tablename=_G[tablename]
local ccode=_G[ccode]
if not ccode then
ccode=true
tablename={}
local events={...}
local MTCcode=Effect.SetCode --为函数Effect.SetCode增加一段适用前的记录
Effect.SetCode=function(ue,code,...)
local tf=false
for i=1,#events do --是否包含...中的某个event
if code==events[i] then
tf=true
end
end
if tf==true and ue:GetOwner():GetCode()~=excode then --符合条件则记录
local uid=ue:GetOwner():GetCode()
tablename[uid]={}
local tf2=false
local u=1
while tf2==false do --使用循环记录寻找一个未记录的位置记录该效果
if not tablename[uid][u] then
tablename[uid][u]=ue
tf2=true
end
u=u+1
end
end
MTCcode(ue,code,...)
end
for tc in aux.Next(Duel.GetMatchingGroup(nil,tp,0x1ff,0x1ff,nil)) do --重载
local ini=MTC.initial_effect
MTC.initial_effect=function() end
tc:ReplaceEffect(m,0)
MTC.initial_effect=ini
if tc.initial_effect then tc.initial_effect(tc) end
end
end
end
function MTC.filterEffectSetCode(c,tablename)
local tablename=_G[tablename]
return tablename[c:GetCode()][1]~=nil
end
--获取区域内有某个event的组(必须先使用MTC.CheckEffectSetCode进行记录)
--MTC.GetGroupEffectSetcode(tp,所使用的表名称,fil,loc1,loc2,除了xxx之外,...)
function MTC.GetGroupEffectSetcode(tp,tablename,fil,loc1,loc2,ex,...) --获取符合条件的卡
local tablename=_G[tablename]
local g=Duel.GetMatchingGroup(fil,tp,loc1,loc2,ex,...)
local ac=g:GetFirst()
for i=1,#g do
if tablename[ac:GetCode()][1]==nil then
g:RemoveCard(ac)
end
ac=g:GetNext()
end
return g
end
--适用某张卡的某个event的效果
--MTC.ApplyEffectSetCode(调用该函数的e,调用该函数的tp,需要适用的c,所使用的表名称,...)
function MTC.ApplyEffectSetCode(e,tp,c,tablename,...)
local tablename=_G[tablename]
local tf=false
local i=1
while tf==false do --利用循环把每一项适用
if tablename[c:GetCode()][i] then
MTC.ActivateEffect(tablename[c:GetCode()][i],tp,e)
end
if not tablename[c:GetCode()][i+1] then
tf=true
end
i=i+1
end
end
--MTC.ActivateEffect(需要适用的e,调用该函数的tp,调用该函数的e)
--Thanks to lanpa
function MTC.ActivateEffect(e,tp,oe)
local c=e:GetHandler()
local cos,tg,op=e:GetCost(),e:GetTarget(),e:GetOperation()
if e and (not cos or cos(e,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)) then
oe:SetProperty(e:GetProperty())
local code=c:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
e:UseCountLimit(tp,1,true)
c:CreateEffectRelation(e)
if cos then cos(e,p,eg,ep,ev,re,r,rp,1) end
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(e)
tg=g:GetNext()
end
end
if op then op(e,tp,eg,ep,ev,re,r,rp) end
c:ReleaseEffectRelation(e)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(e)
tg=g:GetNext()
end
end
end
end
-------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------
--对于某个g里的每张卡片依次适用操作op
function MTC.CycleApplyOp(g,op,...)
local ac=g:GetFirst()
for i=1,#g do
local c=ac
if op then op(...) end
ac=g:GetNext()
end
end
--快速单张卡处理
--MTC.SEffect(c,id记述/code==0时无id效果,诱发事件,执行事件,区域,筛选,最小数量,最大数量)
--目前执行事件仅支持 加入手卡&送去墓地(加入手卡==1 送去墓地==2)
function MTC.SEffect(c,code,event,doing,loc,fil,minnum,maxnum)
local e1=Effect.CreateEffect(c)
if doing==1 then
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
elseif doing==2 then
e1:SetCategory(CATEGORY_TOGRAVE)
end
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(event)
if code~=0 then
e1:SetCountLimit(1,code)
end
if doing==1 then
e1:SetTarget(MTC.sitg1)
e1:SetOperation(MTC.sitg1)
elseif doing==2 then
e1:SetTarget(MTC.sitg2)
e1:SetOperation(MTC.sitg2)
end
e1:SetLabel(loc,fil,minnum,maxnum)
c:RegisterEffect(e1)
end
function MTC.sitg1(e,tp,eg,ep,ev,re,r,rp,chk)
local loc,fil,minnum,maxnum=e:GetLabel()
if chk==0 then return Duel.IsExistingMatchingCard(fil,tp,loc,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,loc)
end
function MTC.sitg1(e,tp,eg,ep,ev,re,r,rp)
local loc,fil,minnum,maxnum=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,fil,tp,loc,0,minnum,maxnum,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function MTC.sitg2(e,tp,eg,ep,ev,re,r,rp,chk)
local loc,fil,minnum,maxnum=e:GetLabel()
if chk==0 then return Duel.IsExistingMatchingCard(fil,tp,loc,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,loc)
end
function MTC.sitg2(e,tp,eg,ep,ev,re,r,rp)
local loc,fil,minnum,maxnum=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,fil,tp,loc,0,minnum,maxnum,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--「无色之白」的手续召唤
function MTC.WhiteSum(c,code,num)
--summon proc
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(60010000,0))
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SUMMON_PROC)
e0:SetLabel(num)
e0:SetCondition(MTC.Whitecon)
e0:SetOperation(MTC.Whiteop)
e0:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e0)
end
function MTC.Whitefil(c)
return c:IsSetCard(0x646) and not c:IsPublic()
end
function MTC.Whitecon(e,c)
local tp=e:GetHandler():GetControler()
local num=e:GetLabel()
return Duel.IsExistingMatchingCard(MTC.Whitefil,tp,LOCATION_HAND,0,num,c)
end
function MTC.Whiteop(e,tp,eg,ep,ev,re,r,rp,c)
local num=e:GetLabel()
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,MTC.Whitefil,tp,LOCATION_HAND,0,num,num,c)
local oc=g:GetFirst()
for i=1,num do
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60010000,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
oc:RegisterEffect(e1)
oc=g:GetNext()
end
end
--「无色之白」的效果回收
function MTC.WhiteBack(c,code)
Duel.AddCustomActivityCounter(code,ACTIVITY_CHAIN,MTC.Whitecf)
--back
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60010000,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,code+10000000)
e3:SetCost(MTC.WhiteZS)
e3:SetCondition(MTC.Whitecon2)
e3:SetTarget(MTC.Whitetg2)
e3:SetOperation(MTC.Whiteop2)
c:RegisterEffect(e3)
end
function MTC.Whitecf(re,tp,cid)
return re:GetHandler():IsSetCard(0x646)
end
function MTC.Whitefil2(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function MTC.Whitecon2(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(Card.IsPublic,tp,LOCATION_HAND,0,nil)
return eg:IsExists(MTC.Whitefil2,1,nil,tp)
end
function MTC.Whitetg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsPublic,tp,LOCATION_HAND,0,nil)
if chk==0 then return c:IsAbleToHand() and #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function MTC.Whiteop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT) then
local g=Duel.GetMatchingGroup(Card.IsPublic,tp,LOCATION_HAND,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sc=g:Select(tp,1,1,nil):GetFirst()
sc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local eset={sc:IsHasEffect(EFFECT_PUBLIC)}
if #eset>0 then
for _,ae in pairs(eset) do
if ae:IsHasType(EFFECT_TYPE_SINGLE) then
ae:Reset()
else
local tg=ae:GetTarget() or aux.TRUE
ae:SetTarget(function(e,c,...) return tg(e,c,...) and c:GetFlagEffect(m)==0 end)
end
end
end
end
end
function MTC.WhiteZS(e,tp,eg,ep,ev,re,r,rp,chk)
local code=e:GetHandler():GetCode()
if chk==0 then return Duel.GetCustomActivityCount(code,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(MTC.Whiteacl)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function MTC.Whiteacl(e,re,tp)
return not re:GetHandler():IsSetCard(0x646)
end
\ No newline at end of file
--基督代理魔人
local cm,m,o=GetID()
function cm.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
cm.toss_dice=true
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
for i=1,5 do
local d1=0
local d2=0
while d1==d2 do
d1,d2=Duel.TossDice(tp,1,1)
end
if d1<d2 then
Duel.Draw(1-tp,1,REASON_EFFECT)
else
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--奥特兰赛 传说之天
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+60010002)
e1:SetRange(LOCATION_FZONE)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.filter(c)
return c:IsSetCard(0x630) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,60010002)==3 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
Duel.Recover(tp,1000,REASON_EFFECT)
elseif Duel.GetFlagEffect(tp,60010002)==5 then
local ht=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ht<5 then
Duel.Draw(tp,5-ht,REASON_EFFECT)
end
elseif Duel.GetFlagEffect(tp,60010002)==7 and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter2,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
end
function cm.filter2(c)
return c:IsCode(60010003) and c:IsAbleToHand()
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--统领传说之天
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x630) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.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 g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
local ti=MTC.LHnum(tp)
Debug.Message(ti)
if ti~=0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) then
local ti=math.min(ti,Duel.GetLocationCount(tp,LOCATION_MZONE))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,0,ti,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
--传说天之光临
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x630) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.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 g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
local ti=MTC.LHnum(tp)
if ti~=0 and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK,1,nil) then
local ti=math.min(ti,Duel.GetFieldGroupCount(tp,0,LOCATION_DECK))
local g=Duel.GetDecktopGroup(1-tp,ti)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
end
end
end
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--格玛瑞 传说天之双华
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
MTC.LHSpS(c,2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.thfil(c)
return not c:IsCode(m) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfil,tp,LOCATION_ONFIELD,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfil,tp,LOCATION_ONFIELD,0,1,1,c)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local ti=MTC.LHnum(tp)*300
Duel.Recover(tp,ti,REASON_EFFECT)
end
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
--Debug.Message(Duel.GetFlagEffect(tp,60010002))
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--欧米特莉 传说天之回翼
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
MTC.LHSpS(c,2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.thfil(c)
return c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil):RandomSelect(tp,1)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local ti=MTC.LHnum(tp)*200
Duel.Damage(1-tp,ti,REASON_EFFECT)
end
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--简丝 传说天之剑岚
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
MTC.LHSpS(c,2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,c) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.thfil,tp,0,LOCATION_ONFIELD,1,1,c)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local ti=math.min(MTC.LHnum(tp),Duel.GetFieldGroupCount(tp,0,LOCATION_DECK))
local rg=Duel.GetDecktopGroup(1-tp,ti)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--塔斯汀娜 传说天之长岁
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
MTC.LHSpS(c,3)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.tdfilter(c)
return c:IsSetCard(0x630) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
--local tp=e:GetHandlerPlayer()
if chk==0 then
local num=Duel.GetFlagEffect(tp,60010002)
--Debug.Message(num)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<num then return false end
local g=Duel.GetDecktopGroup(tp,num)
local result=g:FilterCount(Card.IsAbleToHand,nil)>0
return result
end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(p,60010002)
Duel.ConfirmDecktop(p,num)
local g=Duel.GetDecktopGroup(p,num)
if not g or #g<num then return end
g=g:Filter(cm.tdfilter,nil)
local ct=num
if #g>0 and Duel.SelectYesNo(p,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sg=g:Select(p,1,1,nil)
Duel.DisableShuffleCheck()
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
Duel.ShuffleHand(p)
ct=ct-1
end
Duel.SortDecktop(p,p,ct)
for i=1,ct do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--尤娜 传说天之镜月
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
MTC.LHSpS(c,3)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
--e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)~=0 and Duel.IsPlayerCanDraw(tp) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local num=math.min(Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)*5,Duel.GetFlagEffect(tp,60010002))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local bg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_GRAVE,0,0,num,nil)
if Duel.SendtoDeck(bg,nil,2,REASON_EFFECT) then
local tb=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK):GetCount()
local ti=0
while tb>=5 do
tb=tb-5
ti=ti+1
end
if ti~=0 then
Duel.Draw(tp,ti,REASON_EFFECT)
end
end
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--伊莎贝尔 传说天之转界
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--MTC.LHini(c)
MTC.LHSpS(c,3)
--battle indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:GetCondition(cm.con)
e1:SetValue(1)
c:RegisterEffect(e1)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:GetCondition(cm.con)
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
if not cst==true then
cst=true
--local tp=c:GetOwner()
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
--spsm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.LHcon1)
e1:SetOperation(cm.LHop1)
Duel.RegisterEffect(e1,0)
end
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp,tc)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_FZONE,0,1,nil,60010002)
end
function cm.LHfil1(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x630)
end
function cm.LHcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=eg:GetFirst():GetOwner()
return eg:IsExists(cm.LHfil1,1,nil,tp)
end
function cm.LHop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if tc:IsSetCard(0x630) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),60010002,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010002,nil,0,tc:GetSummonPlayer(),tc:GetSummonPlayer(),0)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--恒久暗月永恒之人 藏匿心之恶兆烛影
local cm,m,o=GetID()
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_WATER+ATTRIBUTE_LIGHT),3)
c:EnableReviveLimit()
--battle
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x630) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.thop(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,cm.filter,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
\ No newline at end of file
--血煞天枢绝光之枪 镇守天海万古魔识
local cm,m,o=GetID()
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_WATER+ATTRIBUTE_LIGHT),3,99)
c:EnableReviveLimit()
--battle
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,1)
e2:SetValue(cm.aclimit)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.aclimit(e,re,tp)
local rc=re:GetHandler()
return rc:IsLocation(LOCATION_HAND) and re:IsActiveType(TYPE_MONSTER)
end
function cm.aclimit2(e,re,tp)
local loc=re:GetActivateLocation()
return (loc==LOCATION_GRAVE or loc==LOCATION_REMOVED) and re:IsActiveType(TYPE_MONSTER)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(1,1)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetValue(cm.aclimit)
Duel.RegisterEffect(e2,tp)
end
\ No newline at end of file
--『诗人』
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,cm.mfilter,cm.xyzcheck,2,2)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12744567,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m+10000000)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
MTC.CheckEffectSetCode(Poet,CheckPoet,m,EVENT_SPSUMMON_SUCCESS)
MTC.CheckEffectSetCode(Poet2,CheckPoet2,m,EVENT_TO_GRAVE,EVENT_BE_MATERIAL,EVENT_BATTLE_DESTROYED)
function cm.mfilter(c,xyzc)
return c:IsType(TYPE_MONSTER)
end
function cm.xyzcheck(g)
return g:GetClassCount(Card.GetLevel)==1
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetOverlayGroup()
local ac=g:GetFirst()
for i=1,#g do
if not Poet[ac:GetCode()][1] then
g:RemoveCard(ac)
ac=g:GetNext()
end
end
if chk==0 then return #g>0 end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetOverlayGroup()
local ac=g:GetFirst()
for i=1,#g do
if not Poet[ac:GetCode()][1] then
g:RemoveCard(ac)
ac=g:GetNext()
end
end
if #g==0 then return end
MTC.CycleApplyOp(g,cm.apply,e,tp,c,Poet)
end
function cm.apply(e,tp,c,tablename)
MTC.ApplyEffectSetCode(e,tp,c,tablename)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetOverlayCount()>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetOverlayGroup():Filter(MTC.filterEffectSetCode,nil,Poet2)
if chk==0 then return #g>0 end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetOverlayGroup():Filter(MTC.filterEffectSetCode,nil,Poet2)
if #g==0 then return end
MTC.CycleApplyOp(g,cm.apply,e,tp,c,Poet2)
end
--律龙械 安度西亚
local cm,m,o=GetID()
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSynchroType,TYPE_SYNCHRO),aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
c:EnableReviveLimit()
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.discon)
e2:SetCost(cm.discost)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 and Duel.GetFieldGroup(tp,LOCATION_DECK,0)>=4 end
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroup(tp,LOCATION_DECK,0)>=4 then
local lg=Duel.GetDecktopGroup(tp,4)
local g1=lg:Select(tp,1,1,nil):GetFirst()
local g2=lg:Select(1-tp,1,1,nil):GetFirst()
if g1==g2 then
Duel.NegateActivation(ev)
elseif g1~=g2 then
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
end
end
--归终遗忘之海
--Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SUMMON+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_FZONE)
e3:SetCost(cm.spcost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--to hand(self)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.thcon2)
e3:SetTarget(cm.thtg2)
e3:SetOperation(cm.thop2)
c:RegisterEffect(e3)
end
function cm.dfil(c)
return c:IsSetCard(0x631) and c:IsType(TYPE_MONSTER)
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsRace(RACE_FAIRY)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.dfil,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.dfil,1,1,REASON_COST+REASON_DISCARD)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
function cm.thcon2(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
return ec:IsControler(tp) and ec:IsRace(RACE_FAIRY)
end
function cm.thtg2(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 cm.thop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
\ No newline at end of file
--
Duel.LoadScript("c60010000.lua")
if not cm.t then
cm.t=true
local cm._summon=Duel.Summon
Duel.Summon=function(tp,ca,num,numm,...)
if Duel.GetFlagEffect(ca:GetOwner(),m)==0 ca:IsSetCard(0x631) and ca:IsLevelBelow(4) and Duel.IsExistingMatchingCard(Card.IsCode,ca:GetOwner(),LOCATION_EXTRA,0,1,nil,m) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local g=Duel.SelectMatchingCard(ca:GetOwner(),Card.IsCode,ca:GetOwner(),LOCATION_EXTRA,0,1,1,nil,m)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.RegisterFlagEffect(ca:GetOwner(),m,RESET_PHASE+PHASE_END,0,1)
else
cm._summon(tp,ca,num,numm,...)
end
end
end
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.ffilter,2,true)
end
function cm.ffilter(c)
return c:IsSetCard(0x631)
end
\ No newline at end of file
--匹诺康尼-盛会之星-
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.accon)
c:RegisterEffect(e1)
--disable spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
--e2:SetTarget(cm.srtg)
e2:SetOperation(cm.srop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,m+20000000)
e3:SetCondition(cm.con)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),m,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
function cm.accon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),m)==0
end
function cm.srop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(rp,m)==0 then
Duel.Draw(rp,1,REASON_EFFECT)
Duel.RegisterFlagEffect(rp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.GetType,tp,LOCATION_HAND,0,nil,TYPE_MONSTER)
return g:GetClassCount(Card.GetRace)==g:GetCount() and g:GetClassCount(Card.GetAttribute)==g:GetCount()
end
function cm.rcheck(c)
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(Card.GetType,tp,LOCATION_HAND,0,nil,TYPE_MONSTER)
local tf=false
if g:GetCount()>=3 then
g:AddCard(c)
if g:GetClassCount(Card.GetRace)==g:GetCount() and g:GetClassCount(Card.GetAttribute)==g:GetCount() then
tf=true
end
end
return tf
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rcheck,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local lg=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
Duel.ConfirmCards(1-tp,lg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(Card.GetType,tp,LOCATION_HAND,0,nil,TYPE_MONSTER)
local dg=Duel.GetMatchingGroup(Card.GetType,tp,LOCATION_DECK,0,nil,TYPE_MONSTER)
local ac=dg:GetFirst()
local cg=Group.CreateGroup()
for i=1,#dg do
g:AddCard(ac)
if g:GetClassCount(Card.GetRace)==g:GetCount() and g:GetClassCount(Card.GetAttribute)==g:GetCount() then
cg:AddCard(ac)
Debug.Message("1")
end
g:RemoveCard(ac)
ac=dg:GetNext()
end
local mg=cg:Select(tp,1,1,nil)
if mg:GetCount()>0 then
Duel.SendtoHand(mg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,mg)
end
end
\ No newline at end of file
--黑天鹅-镜映婆娑-
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--draw(spsummon)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.spcfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return eg:IsExists(cm.spcfilter,1,nil,tp)
end
function cm.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 c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.fil(c,race,attr)
return c:IsRace(race) and c:IsAttribute(attr)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,c,TYPE_MONSTER) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ag=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,0,c,TYPE_MONSTER):Select(tp,1,1,nil)
if Duel.SendtoGrave(ag,REASON_EFFECT)~=0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local race=ag:GetFirst():GetRace()
local attr=ag:GetFirst():GetAttribute()
local gg=Duel.GetMatchingGroup(cm.fil,tp,LOCATION_DECK,0,nil,race,attr):Select(tp,1,1,nil)
Duel.SendtoGrave(gg,REASON_EFFECT)
end
if Duel.IsExistingMatchingCard(cm.ffil,tp,LOCATION_FZONE,0,1,nil) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
end
end
function cm.ffil(c)
return c:IsCode(60010029) and c:IsFaceup()
end
--米莎-美梦华侍-
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m+10000000)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.cfilter(c,race,att)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and bit.band(race,c:GetOriginalRace())==0 and bit.band(att,c:GetOriginalAttribute())==0
end
function cm.tgfilter(c,ft)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and ((c:IsLocation(LOCATION_HAND) and ft>0) or c:IsLocation(LOCATION_MZONE))
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local ag=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local bg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil,e:GetHandler():GetOriginalRace(),e:GetHandler():GetOriginalAttribute())
return (g:GetCount()==0 or ag:GetCount()==bg:GetCount())
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,e:GetHandler(),ft) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,e:GetHandler(),ft)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.thfilter(c)
return c:IsCode(60010029)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) or (Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_FZONE,0,1,nil) and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil)) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_FZONE,0,1,nil) and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil):Select(tp,1,2,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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
end
\ No newline at end of file
--花火-焰锦游鱼-
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31755044,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.mattg)
e1:SetOperation(cm.matop)
c:RegisterEffect(e1)
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31755044,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.con)
e1:SetTarget(cm.mattg)
e1:SetOperation(cm.matop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.desreptg)
e2:SetValue(cm.desrepval)
e2:SetOperation(cm.desrepop)
c:RegisterEffect(e2)
end
function cm.matfilter(c,race,attr)
return c:IsFaceup() and not c:IsRace(race) and not c:IsAttribute(attr)
end
function cm.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local races=e:GetHandler():GetRace()
local attrs=e:GetHandler():GetAttribute()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.matfilter(chkc,races,attrs) end
if chk==0 then return Duel.IsExistingTarget(cm.matfilter,tp,LOCATION_MZONE,0,1,nil,races,attrs) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.matfilter,tp,LOCATION_MZONE,0,1,1,nil,races,attrs)
end
function cm.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local raceo=tc:GetRace()
local attro=tc:GetAttribute()
local races=e:GetHandler():GetRace()
local attrs=e:GetHandler():GetAttribute()
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
local i=0
while i<=0xffff do
if tc:IsSetCard(i) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_ADD_SETCODE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(i)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1)
end
i=i+1
end
if Duel.IsExistingMatchingCard(cm.spfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,raceo,attro,races,attrs) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local sc=Duel.GetMatchingGroup(cm.spfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,raceo,attro,races,attrs):Select(tp,1,1,nil)
Duel.BreakEffect()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.spfil(c,raceo,attro,races,attrs)
return not c:IsRace(raceo) and not c:IsAttribute(attro) and not c:IsRace(races) and not c:IsAttribute(attrs) and c:IsType(TYPE_MONSTER)
end
function cm.repfilter(c,tp,races,attrs)
return c:IsControler(tp) and c:IsOnField() and not c:IsAttribute(races) and not c:IsRace(attrs)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local races=e:GetHandler():GetRace()
local attrs=e:GetHandler():GetAttribute()
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp,races,attrs) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.desrepval(e,c)
local races=e:GetHandler():GetRace()
local attrs=e:GetHandler():GetAttribute()
return cm.repfilter(c,e:GetHandlerPlayer(),races,attrs)
end
function cm.desrepop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(e:GetHandlerPlayer(),m)<3 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
Duel.RegisterFlagEffect(e:GetHandlerPlayer(),m,RESET_PHASE+PHASE_END,0,1)
end
Duel.Hint(HINT_CARD,0,m)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_FZONE,0,1,nil,60010029) and Duel.GetTurnPlayer()~=tp
end
--血源猎手 永世的沉沦鲸梦
local cm,m,o=GetID()
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.otg)
e3:SetOperation(cm.oop)
c:RegisterEffect(e3)
end
cm.toss_dice=true
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_HAND) and e:GetHandler():IsAbleToRemove()
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)<=1 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
end
Duel.Readjust()
end
function cm.otg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_DECK,0)>0 end
end
function cm.oop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x=Duel.TossDice(tp,1)
Duel.Draw(tp,x,REASON_EFFECT)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):Select(tp,x,x,nil)
Duel.SendtoDeck(hg,tp,0,REASON_EFFECT)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
local fst=false
local scd=false
local trd=false
if hg:IsExists(Card.IsType,2,nil,TYPE_SPELL) then fst=true end
if hg:IsExists(Card.IsType,2,nil,TYPE_MONSTER) then scd=true end
if hg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) and hg:IsExists(Card.IsType,1,nil,TYPE_SPELL) and hg:IsExists(Card.IsType,1,nil,TYPE_TRAP) then trd=true end
if fst==true then
Duel.ConfirmDecktop(tp,x)
local g=Duel.GetDecktopGroup(tp,x)
if g:GetCount()>0 then
local gc=g:GetFirst()
for i=1,g:GetCount() do
if gc:IsType(TYPE_SPELL) and gc:CheckActivateEffect(false,false,false)~=nil then
local te=gc:GetActivateEffect()
if gc:IsType(TYPE_FIELD) then
Duel.MoveToField(gc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
Duel.RaiseEvent(gc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
else
Duel.MoveToField(gc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
te:UseCountLimit(tp,1,true)
cm.ActivateCard(gc,tp,e)
if not (gc:IsType(TYPE_CONTINUOUS) or gc:IsType(TYPE_FIELD) or gc:IsType(TYPE_EQUIP)) then
Duel.SendtoGrave(gc,REASON_RULE)
end
end
gc=g:GetNext()
end
end
end
if scd==true then
Duel.ConfirmDecktop(tp,x)
local g=Duel.GetDecktopGroup(tp,x)
if g:GetCount()>0 then
local gc=g:GetFirst()
for i=1,g:GetCount() do
if gc:IsType(TYPE_MONSTER) and gc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(gc,0,tp,tp,false,false,POS_FACEUP)
end
gc=g:GetNext()
end
end
end
if trd==true then
Duel.ConfirmDecktop(tp,x)
local hhg=Duel.GetDecktopGroup(tp,x)
local mth=math.min(hhg:Filter(Card.IsType,nil,TYPE_MONSTER):GetCount(),hhg:Filter(Card.IsType,nil,TYPE_SPELL):GetCount(),hhg:Filter(Card.IsType,nil,TYPE_TRAP):GetCount())
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg=g:Select(tp,1,mth,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
Duel.ShuffleHand(1-tp)
end
end
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_REMOVED) then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
function cm.ActivateCard(c,tp,oe)
local e=c:GetActivateEffect()
local cos,tg,op=e:GetCost(),e:GetTarget(),e:GetOperation()
if e and (not cos or cos(e,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)) then
oe:SetProperty(e:GetProperty())
local code=c:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
e:UseCountLimit(tp,1,true)
c:CreateEffectRelation(e)
if cos then cos(e,p,eg,ep,ev,re,r,rp,1) end
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(e)
tg=g:GetNext()
end
end
if op then op(e,tp,eg,ep,ev,re,r,rp) end
c:ReleaseEffectRelation(e)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(e)
tg=g:GetNext()
end
end
end
end
--血源猎手 碎裂的大洋涡流
local cm,m,o=GetID()
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.otg)
e3:SetOperation(cm.oop)
c:RegisterEffect(e3)
end
cm.toss_dice=true
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_HAND) and e:GetHandler():IsAbleToRemove()
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)<=1 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
end
Duel.Readjust()
end
function cm.otg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_DECK,0)>0 end
end
function cm.oop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x=Duel.TossDice(tp,1)
Duel.Draw(tp,x,REASON_EFFECT)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):Select(tp,x,x,nil)
Duel.SendtoDeck(hg,tp,0,REASON_EFFECT)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
local fst=false
local scd=false
local trd=false
if #Group.Filter(hg,Card.IsType,nil,TYPE_MONSTER)==1 and #Group.Filter(hg,Card.IsType,nil,TYPE_SPELL)==1 and #Group.Filter(hg,Card.IsType,nil,TYPE_TRAP)==1 then fst=true end
if not hg:IsExists(Card.IsType,1,nil,TYPE_SPELL+TYPE_TRAP) then scd=true end
if not hg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then trd=true end
if fst==true then
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_DECK,0,nil):Select(tp,x,x,nil)
local tc=dg:GetFirst()
while tc do
Duel.MoveSequence(tc,SEQ_DECKTOP)
tc=dg:GetNext()
end
Duel.SortDecktop(tp,tp,x)
end
if scd==true then
Duel.ConfirmDecktop(tp,x)
local hhg=Duel.GetDecktopGroup(tp,x)
local num=#hhg:Filter(Card.IsType,nil,TYPE_MONSTER)
if num~=0 then
local gg=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,num,nil,TYPE_SPELL+TYPE_TRAP)
Duel.Remove(gg,POS_FACEUP,REASON_EFFECT)
end
end
if trd==true then
Duel.ConfirmDecktop(tp,x)
local hhg=Duel.GetDecktopGroup(tp,x)
local num=#hhg:Filter(Card.IsType,nil,TYPE_SPELL+TYPE_TRAP)
if num~=0 then
local gg=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,num,nil,TYPE_MONSTER)
Duel.Remove(gg,POS_FACEUP,REASON_EFFECT)
end
end
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_REMOVED) then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
function cm.negop1(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:GetControler()~=tp and rc:IsType(TYPE_MONSTER) and Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.NegateEffect(ev)
Duel.RegisterFlagEffect(e:GetHandler(),m+10000000,RESET_PHASE+PHASE_END,0,1)
if Duel.GetFlagEffect(e:GetHandler(),m)==Duel.GetFlagEffect(e:GetHandler(),m+10000000) then
e:Reset()
end
end
end
function cm.negop2(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:GetControler()~=tp and (rc:IsType(TYPE_SPELL) or rc:IsType(TYPE_TRAP)) and Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.NegateEffect(ev)
Duel.RegisterFlagEffect(e:GetHandler(),m+30000000,RESET_PHASE+PHASE_END,0,1)
if Duel.GetFlagEffect(e:GetHandler(),m+20000000)==Duel.GetFlagEffect(e:GetHandler(),m+30000000) then
e:Reset()
end
end
end
\ No newline at end of file
--血源猎手 狂舞的血色波纹
local cm,m,o=GetID()
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.otg)
e3:SetOperation(cm.oop)
c:RegisterEffect(e3)
end
cm.toss_dice=true
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_HAND) and e:GetHandler():IsAbleToRemove()
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)<=1 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
end
Duel.Readjust()
end
function cm.otg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_DECK,0)>0 end
end
function cm.oop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x=Duel.TossDice(tp,1)
Duel.Draw(tp,x,REASON_EFFECT)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):Select(tp,x,x,nil)
Duel.SendtoDeck(hg,tp,0,REASON_EFFECT)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
local fst=false
local scd=false
local trd=false
if not hg:IsExists(Card.IsType,1,nil,TYPE_TRAP) then fst=true end
if not hg:IsExists(Card.IsType,1,nil,TYPE_SPELL) then scd=true end
if not hg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then trd=true end
if fst==true then
Duel.ConfirmDecktop(tp,x)
local hhg=Duel.GetDecktopGroup(tp,x)
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
local num=math.min(#Duel.GetOperatedGroup(),#hhg)
Duel.SendtoHand(hhg:Select(tp,num,num,nil),1-tp,REASON_EFFECT)
end
end
if scd==true then
Duel.ConfirmDecktop(tp,x)
local hhg=Duel.GetDecktopGroup(tp,x)
local num=hhg:Filter(Card.IsType,nil,TYPE_SPELL)
if num~=0 then
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g)
local rg=g:Select(tp,num,num,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
if trd==true then
local hg1=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
local hg2=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_HAND,nil)
if #hg1~=0 then
Duel.SendtoHand(hg1,1-tp,REASON_RULE)
end
if #hg2~-0 then
Duel.SendtoHand(hg2,tp,REASON_RULE)
end
local hg3=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
local hg4=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_HAND,nil)
if #hg3>7 then
local num1=#hg3-7
Duel.DiscardHand(tp,aux.TRUE,num1,num1,REASON_EFFECT,nil)
elseif #hg3<7 then
local num1=7-#hg3
Duel.Draw(tp,num1,REASON_EFFECT)
end
if #hg4>7 then
local num2=#hg4-7
Duel.DiscardHand(1-tp,aux.TRUE,num2,num2,REASON_EFFECT,nil)
elseif #hg4<7 then
local num2=7-#hg4
Duel.Draw(1-tp,num2,REASON_EFFECT)
end
end
end
--绚烂的时刻
local cm,m,o=GetID()
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
cm.toss_dice=true
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local ts=0
local tsnum=0
local x1=0
local x2=0
while ts==0 do
if tsnum<6 then
x1=Duel.TossDice(tp,1)
x2=Duel.TossDice(1-tp,1)
else
local a1,a2,a3,a4,a5,a6=Duel.TossDice(tp,6)
x1=a1+a2+a3+a4+a5+a6
local b1,b2,b3,b4,b5,b6=Duel.TossDice(1-tp,6)
x2=b1+b2+b3+b4+b5+b6
end
if x1==x2 then
ts=1
elseif x1>x2 then
Duel.PayLPCost(tp,x1*300)
local adg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_DECK,0,nil,TYPE_TRAP)
if #adg~=0 then
Duel.SendtoHand(adg:Select(tp,1,1,nil),nil,REASON_EFFECT)
else
Duel.Draw(tp,1,REASON_EFFECT)
end
Duel.Recover(1-tp,x1*200,REASON_EFFECT)
else
Duel.PayLPCost(1-tp,x1*300)
local adg=Duel.GetMatchingGroup(Card.IsType,1-tp,LOCATION_DECK,0,nil,TYPE_TRAP)
if #adg~=0 then
Duel.SendtoHand(adg:Select(1-tp,1,1,nil),nil,REASON_EFFECT)
else
Duel.Draw(1-tp,1,REASON_EFFECT)
end
Duel.Recover(tp,x1*200,REASON_EFFECT)
end
tsnum=tsnum+1
end
end
\ No newline at end of file
--拉比林斯迷宫之心
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cpfilter(c)
return c:GetType()==TYPE_TRAP and c:IsAbleToGraveAsCost() and c:IsSetCard(0x17e)
and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.cpfilter,tp,LOCATION_DECK,0,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cpfilter,tp,LOCATION_DECK,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(true,true,true)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te then
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
\ No newline at end of file
--白银之城的纤茶壶
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m+10000000)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--to hand or spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.tscon)
e2:SetTarget(cm.tstg)
e2:SetOperation(cm.tsop)
c:RegisterEffect(e2)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.tstg)
e2:SetOperation(cm.tsop)
c:RegisterEffect(e2)
end
function cm.cost(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 cm.stfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x17e) and c:IsSSetable()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.stfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local gg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if gg:GetFirst():IsFaceup() and gg:GetFirst():IsRelateToEffect(e) then
if Duel.ChangePosition(gg,POS_FACEDOWN_DEFENSE)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.stfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
end
end
end
function cm.tscon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
local rc=re:GetHandler()
return rp==tp and r&REASON_COST>0
and (rc:IsSetCard(0x17e) and not rc:IsCode(m) or re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc:GetType()==TYPE_TRAP)
and eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_HAND) and not eg:IsContains(e:GetHandler())
end
function cm.cfilter(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return re and rp==tp and re:IsActiveType(TYPE_TRAP) and re:GetHandler():GetOriginalType()==TYPE_TRAP
and eg:IsExists(cm.cfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function cm.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand()
or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)) end
end
function cm.tsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if aux.NecroValleyNegateCheck(c) then return end
if not aux.NecroValleyFilter()(c) then return end
local b1=c:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local op=aux.SelectFromOptions(tp,{b1,1190},{b2,1152})
if op==1 then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
if op==2 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--拉比林斯迷宫变形陷阱
function c60010041.initial_effect(c)
end
--此眼遍观浮世
function c60010042.initial_effect(c)
end
--天听
local cm,m,o=GetID()
function cm.initial_effect(c)
--random
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.sccost)
e1:SetOperation(cm.scop)
c:RegisterEffect(e1)
end
tt={}
ttnum=0
function cm.sccost(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 cm.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(0,m)==0 then
Duel.RegisterFlagEffect(0,m,RESET_PHASE+PHASE_END,0,2)
Duel.RegisterFlagEffect(1,m,RESET_PHASE+PHASE_END,0,2)
tt[1]={m}
ttnum=1
--activate cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetReset(RESET_PHASE+PHASE_END,2)
e2:SetCost(cm.costchk)
e2:SetTarget(cm.costtg)
e2:SetOperation(cm.costop)
Duel.RegisterEffect(e2,tp)
end
end
function cm.costchk(e,the,tp)
local tp=the:GetHandlerPlayer()
local dkg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_DECK,0,nil)
for i=1,ttnum do
dkg:Remove(Card.IsCode,nil,tt[i])
end
return #dkg>0
end
function cm.costtg(e,the,tp)
e:SetLabelObject(the)
return true
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local thec=e:GetLabelObject():GetHandler()
local tp=e:GetLabelObject():GetHandlerPlayer()
local dkg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_DECK,0,nil)
for i=1,ttnum do
dkg:Remove(Card.IsCode,nil,tt[i])
end
if #dkg>0 then
local lc=dkg:Select(tp,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,lc)
ttnum=ttnum+1
tt[ttnum]=lc:GetCode()
ttnum=ttnum+1
tt[ttnum]=thec:GetCode()
end
end
\ No newline at end of file
--砂金-囚石铸金-
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.discon)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
end
cm.toss_dice=true
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d1,d2,d3=Duel.TossDice(tp,3)
Debug.Message(d1)
Debug.Message(d2)
Debug.Message(d3)
local i=0
if d1==6 then
i=i+1
end
if d2==6 then
i=i+1
end
if d3==6 then
i=i+1
end
if i~=0 then
Duel.Draw(tp,i*2,REASON_EFFECT)
if i==3 then
Duel.SelectOption(tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.SelectOption(tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.SelectOption(tp,aux.Stringid(m,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
Duel.SelectOption(tp,aux.Stringid(m,3))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,3))
Duel.SelectOption(tp,aux.Stringid(m,4))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,4))
Duel.SelectOption(tp,aux.Stringid(m,5))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,5))
Duel.Hint(HINT_CARD,0,m+1)
--e:GetHandler():SetCardData(CARDDATA_CODE,m+1)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.destg)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
end
end
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,3)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c1,c2,c3=Duel.TossCoin(tp,3)
if c1+c2+c3==3 then
local bg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_HAND,nil)
Duel.SendtoDeck(bg,nil,2,REASON_EFFECT)
else
local bg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
if #bg~=0 then
if #bg==1 then
Duel.SendtoDeck(bg,nil,2,REASON_EFFECT)
else
Duel.SendtoDeck(bg:Select(tp,2,2,nil),nil,2,REASON_EFFECT)
end
end
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and Duel.IsChainNegatable(ev) and Duel.GetTurnPlayer()==1-tp
end
function cm.distg(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 cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) and Duel.IsExistingMatchingCard(cm.ffil,tp,LOCATION_FZONE,0,1,nil) then
Duel.Recover(tp,3000,REASON_EFFECT)
end
end
end
function cm.ffil(c)
return c:IsCode(60010029) and c:IsFaceup()
end
\ No newline at end of file
--黄泉-远辞畴昔-
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(cm.retcon)
e3:SetOperation(cm.retop1)
c:RegisterEffect(e3)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.ffil(c)
return c:IsCode(60010029) and c:IsFaceup()
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if rp==tp then
Duel.RegisterFlagEffect(rp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp,tc)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(tp,m)>=9 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetTurnPlayer()==tp and Duel.SelectYesNo(tp,aux.Stringid(m,2))
end
function cm.retop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if #g~=0 and Duel.IsExistingMatchingCard(cm.ffil,tp,LOCATION_FZONE,0,1,nil) then
Duel.SendtoGrave(g,REASON_EFFECT)
if #Duel.GetOperatedGroup()>=5 then
Duel.SelectOption(tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.SelectOption(tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
--e:GetHandler():SetCardData(CARDDATA_CODE,m+1)
end
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local ag=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
return ag:GetClassCount(Card.GetRace)==ag:GetCount() and ag:GetClassCount(Card.GetAttribute)==ag:GetCount()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(cm.indtg)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function cm.indtg(e,c)
return c:IsFaceup()
end
\ No newline at end of file
--愿母神三度为你阖眼
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x626,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_SZONE)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
if not cm.lblsz then
cm.lblsz=true
cm._tossdice=Duel.TossDice
Duel.TossDice=function (tp,a,b)
Duel.RaiseEvent(Duel.GetDecktopGroup(tp,1),EVENT_CUSTOM+m,nil,0,tp,tp,0)
if Duel.GetFlagEffect(tp,m+10000000)~=0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) then
local rg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil):Select(tp,1,2,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
Duel.ResetFlagEffect(tp,m+10000000)
end
if Duel.GetFlagEffect(tp,m)==0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,m) and Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,m):RandomSelect(tp,1):IsAbleToHand(tp) then
Duel.RegisterFlagEffect(tp,m,0,0,1)
local ag=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,m):Select(tp,1,1,nil)
Duel.SendtoHand(ag,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,ag)
local rt={}
local c=a
if b then
c=c+b
end
for i=1,c do
table.insert(rt,4)
end
return table.unpack(rt)
else
return cm._tossdice(tp,a,b)
end
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x626,3)
end
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x626,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x626,1,REASON_COST)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(p,m+10000000,RESET_PHASE+PHASE_END,0,1)
end
end
--加拉赫-猎犬-
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--special summon
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(m,1))
e11:SetCategory(CATEGORY_SPECIAL_SUMMON)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e11:SetRange(LOCATION_HAND)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetCountLimit(1,m+10000000)
e11:SetCondition(cm.spcon)
e11:SetTarget(cm.sptg)
e11:SetOperation(cm.spop)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(cm.spcon2)
c:RegisterEffect(e2)
end
function cm.thfilter(c)
return (c:IsCode(60010029) or aux.IsCodeListed(c,60010029)) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.cfilter(c,tp,race,attr)
return c:IsSummonPlayer(tp) and c:GetRace()~=race and c:GetAttribute()~=attr
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(cm.cfilter,1,nil,tp,c:GetRace(),c:GetAttribute())
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ag=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
return eg:IsExists(cm.cfilter,1,nil,tp,c:GetRace(),c:GetAttribute()) and ag:GetClassCount(Card.GetRace)==ag:GetCount() and ag:GetClassCount(Card.GetAttribute)==ag:GetCount()
end
function cm.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 cm.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
\ No newline at end of file
--游梦华
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,1))
e2:SetCost(cm.cost2)
e2:SetCondition(cm.tcon)
e2:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
c:RegisterEffect(e2)
end
cm={}
if not cm.ymh then
cm.ymh=true
cm._registereffect=Card.RegisterEffect
Card.RegisterEffect=function (card,eff)
cm._registereffect(card,eff)
if eff:IsHasType(EFFECT_TYPE_TRIGGER_O) then
local neff=eff:Clone()
neff:SetType(eff:GetType()-EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_TRIGGER_F)
--neff:SetLabelObject(eff)
if eff:GetCondition()~=nil then
neff:SetCondition(cm.ncon)
else
neff:SetCondition(cm.ncon2)
end
if eff:GetTarget()~=nil then
neff:SetTarget(cm.ntg)
end
card:RegisterEffect(neff)
cm[neff]=eff
end
end
end
function cm.ncon(e,tp,eg,ep,ev,re,r,rp)
local oc=cm[e]:GetCondition()
return oc(e,tp,eg,ep,ev,re,r,rp) and Duel.GetFlagEffect(0,m)~=0
end
function cm.ncon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(0,m)~=0
end
function cm.ntg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local otg=cm[e]:GetTarget()
if chkc then return otg(e,tp,eg,ep,ev,re,r,rp,1,1) end
if chk==0 then return true end
otg(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function cm.tcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(0,m,RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.aclimit(e,re,tp)
return re:GetType()&EFFECT_TYPE_TRIGGER_O>0
end
\ No newline at end of file
--无色之白的霞梦姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,2)
MTC.WhiteBack(c,m)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.thfilter(c)
return c:IsSetCard(0x646) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,0,0,0)
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsSetCard(0x646)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
end
--无色之白的览月姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,2)
MTC.WhiteBack(c,m)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsSetCard(0x646)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
if Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
--无色之白的清华姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,2)
MTC.WhiteBack(c,m)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,5)
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsSetCard(0x646)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetDecktopGroup(tp,5)
Duel.DisableShuffleCheck()
--if g:GetCount()>0 then
--Duel.SendtoHand(g,nil,REASON_EFFECT)
--Duel.ConfirmCards(1-tp,g)
if Duel.SendtoGrave(g1,REASON_EFFECT)~=0 and g1:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) and Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
--end
end
--无色之白的巡光姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,3)
MTC.WhiteBack(c,m)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsSetCard(0x646)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
\ No newline at end of file
--无色之白的耀阳姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,3)
MTC.WhiteBack(c,m)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
--atkdown
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_ATKCHANGE)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EVENT_SUMMON_SUCCESS)
e8:SetTarget(cm.atktg)
e8:SetOperation(cm.atkop)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function cm.atkfilter(c,tp)
return c:IsControler(tp) and c:IsPosition(POS_FACEUP_ATTACK)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.atkfilter,1,e:GetHandler(),1-tp) end
local g=eg:Filter(cm.atkfilter,e:GetHandler(),1-tp)
Duel.SetTargetCard(g)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain():Filter(Card.IsFaceup,nil)
local dg=Group.CreateGroup()
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if preatk~=0 and tc:IsAttack(0) then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
end
\ No newline at end of file
--无色之白的绘彩姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,3)
MTC.WhiteBack(c,m)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
--summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function cm.filter(c)
return c:IsSetCard(0x646) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,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
--无色之白的绝印姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,2)
MTC.WhiteBack(c,m)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.thfilter(c)
return c:IsSetCard(0x646) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsSetCard(0x646)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
if Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
--无色之白的残刃姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,2)
MTC.WhiteBack(c,m)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsSetCard(0x646)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
if Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
\ No newline at end of file
--无色之白的化云姬
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteSum(c,m,2)
MTC.WhiteBack(c,m)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.thfilter(c)
return c:IsSetCard(0x646) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,0,0,0)
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsSetCard(0x646)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
end
--无色之白的游弋
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
MTC.WhiteBack(c,m)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.atktg)
e2:SetValue(500)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsSetCard(0x646) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function cm.atktg(e,c)
return c:IsSetCard(0x646)
end
\ No newline at end of file
--无色之白的风雨
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:IsSetCard(0x646) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,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
--无色之白的蜕幻
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,m)
e1:SetCost(MTC.WhiteZS)
e1:SetCondition(cm.condition)
e1:SetTarget(aux.nbtg)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x646) and c:IsType(TYPE_MONSTER)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--无色之白的对反
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(cm.handcon)
c:RegisterEffect(e2)
--Normal Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41215808,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCost(MTC.WhiteZS)
e1:SetTarget(cm.sumtg)
e1:SetOperation(cm.sumop)
c:RegisterEffect(e1)
end
function cm.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
end
function cm.sumfilter(c)
return c:IsSetCard(0x646) and c:IsType(TYPE_MONSTER) and c:IsSummonable(true,nil)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
\ No newline at end of file
--无色之白的罪身
Duel.LoadScript("c60010000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,m)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and eg:GetFirst():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--星-同谐-
local cm,m,o=GetID()
function cm.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1,m)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.con)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
atkall=0
atkchange=0
function cm.adfilter(c,f)
return math.max(f(c),0)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local c=e:GetHandler()
if atkall~=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(cm.adfilter,Card.GetAttack) then
atkchange=math.abs(atkall-Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(cm.adfilter,Card.GetAttack))
atkall=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(cm.adfilter,Card.GetAttack)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,tp,tp,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_FZONE,0,1,nil)
end
function cm.target(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 cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
--negate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetCondition(cm.lvcon)
e2:SetOperation(cm.lvop)
c:RegisterEffect(e2)
end
end
function cm.lvfil(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_LINK)
end
function cm.lvcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and e:GetHandler():IsLevelBelow(12)
end
function cm.lvop(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_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
if Duel.IsExistingMatchingCard(cm.lvfil,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local tc=Duel.GetMatchingGroup(cm.lvfil,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-500)
tc:RegisterEffect(e1)
end
end
function cm.defil(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not c:IsDefense(0) and not c:IsType(TYPE_LINK)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)<e:GetHandler():GetLevel()
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetHandler():GetFlagEffect(m+10000000)~=0 then
if Duel.IsExistingMatchingCard(cm.defil,tp,0,LOCATION_MZONE,1,nil) then
local tc=Duel.GetMatchingGroup(cm.defil,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(-atkchange)
tc:RegisterEffect(e1)
else
Duel.Damage(1-tp,atkchange,REASON_EFFECT)
end
Duel.RegisterFlagEffect(e:GetHandlerPlayer(),m,RESET_PHASE+PHASE_END,0,1)
else
e:GetHandler():RegisterFlagEffect(m+10000000,RESET_PHASE+PHASE_END,0,1)
end
end
--穹-同谐-
local cm,m,o=GetID()
function cm.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1,m)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.con)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
atkall=0
atkchange=0
function cm.adfilter(c,f)
return math.max(f(c),0)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local c=e:GetHandler()
if atkall~=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(cm.adfilter,Card.GetAttack) then
atkchange=math.abs(atkall-Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(cm.adfilter,Card.GetAttack))
atkall=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(cm.adfilter,Card.GetAttack)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,tp,tp,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_FZONE,0,1,nil)
end
function cm.target(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 cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
--negate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetCondition(cm.lvcon)
e2:SetOperation(cm.lvop)
c:RegisterEffect(e2)
end
end
function cm.lvfil(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_LINK)
end
function cm.lvcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and e:GetHandler():IsLevelBelow(12)
end
function cm.lvop(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_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
if Duel.IsExistingMatchingCard(cm.lvfil,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local tc=Duel.GetMatchingGroup(cm.lvfil,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-500)
tc:RegisterEffect(e1)
end
end
function cm.defil(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not c:IsDefense(0) and not c:IsType(TYPE_LINK)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)<e:GetHandler():GetLevel()
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(m+10000000)~=0 then
if Duel.IsExistingMatchingCard(cm.defil,tp,0,LOCATION_MZONE,1,nil) then
local tc=Duel.GetMatchingGroup(cm.defil,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-atkchange)
tc:RegisterEffect(e1)
else
Duel.Damage(1-tp,atkchange,REASON_EFFECT)
end
Duel.RegisterFlagEffect(e:GetHandlerPlayer(),m,RESET_PHASE+PHASE_END,0,1)
else
e:GetHandler():RegisterFlagEffect(m+10000000,RESET_PHASE+PHASE_END,0,1)
end
end
--知更鸟-翼声纯律-
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--special summon
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(m,1))
e11:SetCategory(CATEGORY_SPECIAL_SUMMON)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e11:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetCountLimit(1,m+10000000)
e11:SetCondition(cm.spcon)
e11:SetTarget(cm.sptg)
e11:SetOperation(cm.spop)
c:RegisterEffect(e11)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,4))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.thcon)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.cfilter(c,tp)
return c:IsSummonPlayer(1-tp) and c:IsPreviousLocation(LOCATION_EXTRA)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.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 cm.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 cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ag=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
return ag:GetClassCount(Card.GetRace)==ag:GetCount() and ag:GetClassCount(Card.GetAttribute)==ag:GetCount()
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local count=Duel.AnnounceNumber(tp,1,2,3,4,5,6,7,8,9,10,11,12)
local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local mc=mg:GetFirst()
for i=1,#mg do
if not mc:IsLevel(count) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(count)
e1:SetReset(RESET_EVENT+0xff0000)
mc:RegisterEffect(e1)
end
mc=mg:GetNext()
end
if Duel.IsExistingMatchingCard(cm.ffil,tp,LOCATION_FZONE,0,1,nil) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m+20000000)
e1:SetCondition(cm.con)
e1:SetTarget(cm.lktg)
e1:SetOperation(cm.lkop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+30000000)
e3:SetCondition(cm.con)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+40000000)
e3:SetCondition(cm.con)
e3:SetTarget(cm.xyztg)
e3:SetOperation(cm.xyzop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+50000000)
e3:SetCondition(cm.con)
e3:SetTarget(cm.pftg)
e3:SetOperation(cm.pfop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
end
end
function cm.ffil(c)
return c:IsCode(60010029) and c:IsFaceup()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function cm.lktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.lkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,nil,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.LinkSummon(tp,sg:GetFirst(),nil,c)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
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(),c)
end
end
function cm.xyzfilter(c)
return c:IsXyzSummonable(nil)
end
function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.xyzfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.xyzfilter,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=g:Select(tp,1,1,nil)
Duel.XyzSummon(tp,tg:GetFirst(),nil)
end
end
function cm.pffilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function cm.pffilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_DRAGON) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.pftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(cm.pffilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.pffilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.pfop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.pffilter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.pffilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.pffilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
\ No newline at end of file
--波提欧-扬尘孤星-
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m+10000000)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local xl=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil):GetFirst()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetLabel(xl:GetCode())
e2:SetCondition(cm.discon)
e2:SetOperation(cm.disop)
e2:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e2)
end
function cm.defil(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not c:IsDefense(0) and not c:IsType(TYPE_LINK)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsCode(e:GetLabel())
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(cm.defil,tp,0,LOCATION_MZONE,1,nil) then
local tg=Duel.GetMatchingGroup(cm.defil,tp,0,LOCATION_MZONE,nil)
local tc=tg:GetFirst()
for i=1,#tg do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(-1000)
tc:RegisterEffect(e1)
tc=tg:GetNext()
end
else
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
function cm.spcfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsCode(60010029)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return eg:IsExists(cm.spcfilter,1,nil,tp)
end
function cm.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 c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.filter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
end
--枢机神女·澈
local cm,m,o=GetID()
function cm.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(78080961,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
if not cm.num then
cm.num=0
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return #g==0
end
function cm.thfilter(c)
return c:IsSetCard(0x647) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,3,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hg=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
if #hg~=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,3,3,nil)
if g:GetCount()>2 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local mg=Duel.GetOperatedGroup()
local tc=mg:GetFirst()
for i=1,#mg do
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
tc=mg:GetNext()
end
cm.num=#Duel.GetOperatedGroup()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return cm.num~=#g
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
cm.num=#g
Duel.Readjust()
if cm.num==0 then e:Reset() end
end
function cm.ffil(c,tp)
return c:IsCode(60010084) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.ffil2(c)
return c:IsCode(60010084) and c:IsFaceup()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return #Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)>=5
end
function cm.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 cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and not Duel.IsExistingMatchingCard(cm.ffil2,tp,LOCATION_FZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ffil,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local tc=Duel.SelectMatchingCard(tp,cm.ffil2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
--枢机神侍·烈风之绿
local cm,m,o=GetID()
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon2)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(cm.con)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.con2)
c:RegisterEffect(e4)
end
if not cm.num then
cm.num=0
end
function cm.spfilter(c)
return c:IsFaceup() and ((c:IsCode(60010079) and c:IsLocation(LOCATION_MZONE)) or (c:IsCode(60010084) and c:IsLocation(LOCATION_FZONE)))
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_MZONE+LOCATION_FZONE,0,1,nil)
end
function cm.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerAffectedByEffect(tp,60010084)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_MZONE+LOCATION_FZONE,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return (c:IsSetCard(0x647) or c:IsRace(RACE_MACHINE)) and c:IsAbleToHand()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return #g==0 and not Duel.IsPlayerAffectedByEffect(tp,60010091)
end
function cm.con2filter(c)
return c:IsSetCard(0x647) and c:GetOriginalType()==TYPE_EQUIP and not c:IsDisabled()
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
local eg=e:GetHandler():GetEquipGroup()
return #g==0 and Duel.IsPlayerAffectedByEffect(tp,60010091) and eg:IsExists(cm.con2filter,1,nil)
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,2,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
e:SetLabel(#Duel.GetOperatedGroup())
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hg=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
if #hg~=0 then return end
local num=e:GetLabel()*2
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,num,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local mg=Duel.GetOperatedGroup()
local tc=mg:GetFirst()
for i=1,#mg do
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
tc=mg:GetNext()
end
cm.num=#Duel.GetOperatedGroup()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return cm.num~=#g
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
cm.num=#g
Duel.Readjust()
if cm.num==0 then e:Reset() end
end
--枢机神侍·狱火之赤
local cm,m,o=GetID()
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon2)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(cm.con)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.con2)
c:RegisterEffect(e4)
end
if not cm.num then
cm.num=0
end
function cm.spfilter(c)
return c:IsFaceup() and ((c:IsCode(60010079) and c:IsLocation(LOCATION_MZONE)) or (c:IsCode(60010084) and c:IsLocation(LOCATION_FZONE)))
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_MZONE+LOCATION_FZONE,0,1,nil)
end
function cm.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerAffectedByEffect(tp,60010084)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_MZONE+LOCATION_FZONE,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return (c:IsSetCard(0x647) or c:IsType(TYPE_EQUIP)) and c:IsAbleToHand()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return #g==0 and not Duel.IsPlayerAffectedByEffect(tp,60010091)
end
function cm.con2filter(c)
return c:IsSetCard(0x647) and c:GetOriginalType()==TYPE_EQUIP and not c:IsDisabled()
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
local eg=e:GetHandler():GetEquipGroup()
return #g==0 and Duel.IsPlayerAffectedByEffect(tp,60010091) and eg:IsExists(cm.con2filter,1,nil)
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,2,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
e:SetLabel(#Duel.GetOperatedGroup())
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hg=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
if #hg~=0 then return end
local num=e:GetLabel()*2
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,num,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local mg=Duel.GetOperatedGroup()
local tc=mg:GetFirst()
for i=1,#mg do
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
tc=mg:GetNext()
end
cm.num=#Duel.GetOperatedGroup()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return cm.num~=#g
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
cm.num=#g
Duel.Readjust()
if cm.num==0 then e:Reset() end
end
--枢机神侍·霜冻之蓝
local cm,m,o=GetID()
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon2)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.con)
c:RegisterEffect(e4)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,5,nil)
end
function cm.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerAffectedByEffect(tp,60010084)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,5,nil)
end
function cm.con2filter(c)
return c:IsSetCard(0x647) and c:GetOriginalType()==TYPE_EQUIP and not c:IsDisabled()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
local eg=e:GetHandler():GetEquipGroup()
return #g==0 and Duel.IsPlayerAffectedByEffect(tp,60010091) and eg:IsExists(cm.con2filter,1,nil)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,2,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
e:SetLabel(#Duel.GetOperatedGroup())
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,PLAYER_ALL,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=e:GetLabel()*2
Duel.Draw(tp,num,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
Duel.Draw(1-tp,num,REASON_EFFECT)
g:Merge(Duel.GetOperatedGroup())
Duel.SendtoGrave(g:Filter(cm.tgfil,nil),REASON_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.con2)
e1:SetTarget(cm.tg2)
e1:SetOperation(cm.op2)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.tgfil(c)
return not c:IsSetCard(0x647)
end
function cm.con2(e, tp, eg, ep, ev, re, r, rp)
local ch = Duel.GetCurrentChain(true) - 1
if ch <= 0 then return false end
local cplayer = Duel.GetChainInfo(ch, CHAININFO_TRIGGERING_CONTROLER)
local ceff = Duel.GetChainInfo(ch, CHAININFO_TRIGGERING_EFFECT)
if re:GetHandler():IsDisabled() or not Duel.IsChainDisablable(ev) then return false end
return ep == 1 - tp and cplayer == tp and (ceff:GetHandler():IsSetCard(0xfefd) or ceff:GetHandler():IsSetCard(0xfd))
end
function cm.tg2(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return true end
Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
end
end
function cm.op2(e, tp, eg, ep, ev, re, r, rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg, REASON_EFFECT)
end
end
--枢机神侍·曜岩之黑
local cm,m,o=GetID()
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon2)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.con)
c:RegisterEffect(e4)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,5,nil)
end
function cm.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerAffectedByEffect(tp,60010084)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,5,nil)
end
function cm.con2filter(c)
return c:IsSetCard(0x647) and c:GetOriginalType()==TYPE_EQUIP and not c:IsDisabled()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
local eg=e:GetHandler():GetEquipGroup()
return #g==0 and Duel.IsPlayerAffectedByEffect(tp,60010091) and eg:IsExists(cm.con2filter,1,nil)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,2,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
e:SetLabel(#Duel.GetOperatedGroup())
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=e:GetLabel()*2
local thg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil):Select(tp,1,num,nil)
if #thg~=0 then
Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg)
if #Duel.GetOperatedGroup():Filter(Card.IsSetCard,nil,0x647)==#Duel.GetOperatedGroup() and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local nnum=#Duel.GetOperatedGroup()
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil):Select(tp,1,nnum,nil)
Duel.Destroy(dg,REASON_EFFECT)
Duel.Draw(tp,nnum,REASON_EFFECT)
end
end
end
--枢机神域
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.atktg)
e2:SetValue(500)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.atktg)
e2:SetValue(1)
e2:SetRange(LOCATION_FZONE)
c:RegisterEffect(e2)
end
function cm.atktg(e,c)
return c:IsSetCard(0x647)
end
function cm.filter(c,e,tp)
return c:IsCode(60010079) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.mfilter(c)
return c:IsFaceup() and c:IsCode(60010079)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local b1=false
local b2=false
if Duel.GetFlagEffect(tp,m)==0 then b1=true end
if not Duel.IsExistingMatchingCard(cm.mfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) then b2=true end
if b1==false then return end
if b2==true then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,60010079))
e1:SetValue(cm.efilter)
if Duel.GetCurrentPhase()==PHASE_MAIN1 then
e1:SetReset(RESET_PHASE+PHASE_MAIN1)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_MAIN1,0,1)
else
e1:SetReset(RESET_PHASE+PHASE_MAIN2)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_MAIN2,0,1)
end
Duel.RegisterEffect(e1,tp)
end
function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
\ No newline at end of file
--枢机神官·哀悼之灰
local cm,m,o=GetID()
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,cm.lcheck)
c:EnableReviveLimit()
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m+10000000)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--shuffle and draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.tdtg)
e2:SetOperation(cm.tdop)
c:RegisterEffect(e2)
end
if not cm.num then
cm.num=0
end
function cm.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x647)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and #g==0
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) end
local ht=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(5-ht)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,5-ht)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hg=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
if #hg~=0 then return end
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ht=Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if ht<5 then
if Duel.Draw(p,5-ht,REASON_EFFECT)~=0 then
local mg=Duel.GetOperatedGroup()
local tc=mg:GetFirst()
for i=1,#mg do
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
tc=mg:GetNext()
end
cm.num=#Duel.GetOperatedGroup()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return cm.num~=#g
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
cm.num=#g
Duel.Readjust()
if cm.num==0 then e:Reset() end
end
function cm.tdfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_LINK) and c:IsAbleToDeck()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end
if tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--枢机神官·奥秘之青
local cm,m,o=GetID()
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,cm.lcheck)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.descon)
e1:SetCost(cm.descost)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m+10000000)
e3:SetCost(cm.spcost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.tgfilter(c)
return c:IsDisabled() and c:IsAbleToGraveAsCost()
end
function cm.lcheck(g,lc)
return g:GetClassCount(Card.GetLinkCode)==g:GetCount()
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e,false) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_COST)
end
function cm.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 cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function cm.splimit(e,c)
return not c:IsRace(RACE_MACHINE)
end
\ No newline at end of file
--枢机神官·傀儡之紫
local cm,m,o=GetID()
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_MACHINE),2,2)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(cm.thcon)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
if chk==0 then return #hg>5 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=hg:Select(tp,hg-5,hg-5,nil)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local ng=Duel.GetOperatedGroup()
local m=0
if #ng:Filter(Card.IsSetCard,nil,0x647)>=3 then
m=1
end
e:SetLabel(#ng,m)
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_ONFIELD)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local num,ty=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,num,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 and ty==1 then
local rg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_HAND,nil):RandomSelect(tp,1)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
end
\ No newline at end of file
--枢机神降·澄澈之末
local cm,m,o=GetID()
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),4,2,nil,nil,99,nil)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.con)
c:RegisterEffect(e4)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(5041348,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.rmcon)
e1:SetTarget(cm.rmtg)
e1:SetOperation(cm.rmop)
c:RegisterEffect(e1)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.filter(c,tp)
return c:IsType(TYPE_EQUIP) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
and c:IsSetCard(0x647) and Duel.GetMatchingGroupCount(cm.eqfilter,tp,LOCATION_MZONE,0,nil,c)>0
end
function cm.eqfilter(c,ec)
return c:IsFaceup() and ec:CheckEquipTarget(c)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE+LOCATION_GRAVE,0,1,nil,tp) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE+LOCATION_GRAVE,0,nil,tp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and tc:IsRelateToEffect(e) then
Duel.Equip(tp,tc,c)
end
end
function cm.con2filter(c)
return c:IsSetCard(0x647) and c:GetOriginalType()==TYPE_EQUIP and not c:IsDisabled()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
local eg=e:GetHandler():GetEquipGroup()
return #g==0 and Duel.IsPlayerAffectedByEffect(tp,60010091) and eg:IsExists(cm.con2filter,1,nil)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,2,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
e:SetLabel(#Duel.GetOperatedGroup())
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ag=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,tp)
local num=math.min(e:GetLabel(),Duel.GetLocationCount(tp,LOCATION_SZONE),#ag)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,num,nil,tp)
local tc=g:GetFirst()
for i=1,#g do
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and tc:IsRelateToEffect(e) and Duel.GetMatchingGroupCount(cm.eqfilter,tp,LOCATION_MZONE,0,nil,tc)>0 then
local ec=Duel.GetMatchingGroup(cm.eqfilter,tp,LOCATION_MZONE,0,nil,tc):Select(tp,1,1,nil):GetFirst()
Duel.Equip(tp,tc,ec)
end
tc=g:GetNext()
end
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
if chk==0 then return rc:IsRelateToEffect(re) and rc:IsAbleToRemove() and not rc:IsLocation(LOCATION_REMOVED) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,0,0)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) then
if Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)~=0 and not Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,5,nil) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
--枢机神降·实界之刃
local cm,m,o=GetID()
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
c:RegisterEffect(e1)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.thfilter(c)
return c:IsSetCard(0x647) and c:IsAbleToHand() and c:IsType(TYPE_EQUIP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK,1,nil) and #g==0 and Duel.GetFlagEffect(tp,m)<10
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetDecktopGroup(1-tp,1):GetFirst()
if Duel.SendtoHand(tc,tp,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESETS_STANDARD,0,1)
end
-- Duel.Readjust()
end
--枢机神降·虚界之刃
local cm,m,o=GetID()
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.desreptg)
e2:SetValue(cm.desrepval)
e2:SetOperation(cm.desrepop)
c:RegisterEffect(e2)
end
if not cm.tab then
cm.tab={}
end
if not cm.num then
cm.num=0
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.thfilter(c)
return c:IsSetCard(0x647) and c:IsAbleToHand() and c:IsType(TYPE_EQUIP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.ablefil(c)
local ub=true
local ableg=Group.FromCards(table.unpack(cm.tab))
local ablec=ableg:GetFirst()
for i=1,#ableg do
if c:IsCode(ablec:GetCode()) then
ub=false
end
ablec=ableg:GetNext()
end
return c:IsSetCard(0x647) and ub==true and c:IsType(TYPE_MONSTER)
end
function cm.repfilter(c,tp)
return c:IsControler(tp) and c:IsOnField()
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(cm.ablefil,tp,LOCATION_DECK,0,1,nil) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.desrepval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.ablefil,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
table.insert(cm.tab,g:GetFirst())
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
cm.num=cm.num+1
if cm.eff then cm.eff:Reset() end
local e100=Effect.CreateEffect(c)
e100:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e100:SetCode(EVENT_ADJUST)
e100:SetCondition(cm.rcon)
e100:SetOperation(cm.rop)
Duel.RegisterEffect(e100,tp)
cm.eff=e100
end
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return cm.num~=#g
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
cm.num=#g
Duel.Readjust()
if cm.num==0 then e:Reset() end
end
\ No newline at end of file
--枢机神典·战争残响
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(cm.eqlimit)
c:RegisterEffect(e2)
--90351981
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(60010091)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetTarget(cm.target2)
e4:SetOperation(cm.operation2)
c:RegisterEffect(e4)
end
function cm.eqlimit(e,c)
return c:IsSetCard(0x647)
end
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0x647)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function cm.filter2(c)
return c:IsSetCard(0x647) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and c:GetEquipTarget() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleDeck(tp)
end
end
\ No newline at end of file
--枢机神典·咒术囹圄
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(cm.eqlimit)
c:RegisterEffect(e2)
--90351981
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(60010091)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetTarget(cm.drtg)
e4:SetOperation(cm.drop)
c:RegisterEffect(e4)
end
function cm.eqlimit(e,c)
return c:IsSetCard(0x647)
end
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0x647)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function cm.filter2(c)
return c:IsPublic()
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND,0,nil)
if chk==0 then return #g>0 and Duel.IsPlayerCanDraw(tp,#g) and c:GetEquipTarget() end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(#g)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,#g)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND,0,nil)
if Duel.GetFlagEffect(p,m)<10 then
local num=math.min(#g,10-Duel.GetFlagEffect(p,m))
Duel.Draw(p,num,REASON_EFFECT)
for i=1,num do
Duel.RegisterFlagEffect(p,m,RESET_PHASE+PHASE_END,0,1)
end
end
end
--枢机神典·武装回环
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(cm.eqlimit)
c:RegisterEffect(e2)
--90351981
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(60010091)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetTarget(cm.drtg)
e4:SetOperation(cm.drop)
c:RegisterEffect(e4)
end
function cm.eqlimit(e,c)
return c:IsSetCard(0x647)
end
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0x647)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function cm.tdfilter(c)
return c:IsSetCard(0x647) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) and c:GetEquipTarget() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,LOCATION_GRAVE,0,1,99,nil)
local ct=#g
if ct>0 then
Duel.HintSelection(g)
end
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==0 then return end
if #g>5 then
local d=math.floor(#g/5)
Duel.Draw(tp,d,REASON_EFFECT)
end
end
\ No newline at end of file
--枢机神谕·希冀
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
if not cm.num then
cm.num=0
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return #g==0
end
function cm.filter(c)
return c:IsSetCard(0x647) and c:IsAbleToHand() and not c:IsCode(60010094)
end
function cm.filter2(c)
return c:IsFaceup() and (c:IsCode(60010079) or c:IsCode(60010084))
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsPlayerCanDraw(tp,3) then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hg=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
if #hg~=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,2,REASON_EFFECT)
end
local mg=Duel.GetOperatedGroup()
mg:Merge(g)
local tc=mg:GetFirst()
for i=1,#mg do
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
tc=mg:GetNext()
end
cm.num=#Duel.GetOperatedGroup()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return cm.num~=#g
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
cm.num=#g
Duel.Readjust()
if cm.num==0 then e:Reset() end
end
\ No newline at end of file
--奥法集装士『万物生灵』
local cm,m,o=GetID()
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(36521307,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetTarget(c36521307.sptg)
e1:SetOperation(c36521307.spop)
c:RegisterEffect(e1)
end
function c36521307.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 c36521307.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--奥法集装士『燃灯火』
function c60010104.initial_effect(c)
end
--升阶魔法-格拉默之力
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.filter1(c,e,tp)
local lv=c:GetLevel()
return c:IsFaceup() and lv
and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,lv)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.filter2(c,e,tp,mc,rk)
return c:IsRank(rk) and c:IsRace(RACE_MACHINE+RACE_INSECT+RACE_PYRO) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
function cm.thfilter(c)
return c:IsLevel(1) and c:IsAttackAbove(3000) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,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
--奇术尊者 罗森克鲁兹之心
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetDescription(1164)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(cm.SynMixCondition(aux.Tuner(Card.IsSetCard,0x62a),nil,nil,aux.NonTuner(nil),1,99,gc))
e0:SetTarget(cm.SynMixTarget(aux.Tuner(Card.IsSetCard,0x62a),nil,nil,aux.NonTuner(nil),1,99,gc))
e0:SetOperation(cm.SynMixOperation(aux.Tuner(Card.IsSetCard,0x62a),nil,nil,aux.NonTuner(nil),1,99,gc))
e0:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetRange(LOCATION_MZONE)
e1:SetLabelObject(e33)
e1:SetOperation(cm.bkop)
c:RegisterEffect(e1)
--level
local e33=Effect.CreateEffect(c)
e33:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e33:SetCode(EVENT_SPSUMMON_SUCCESS)
e33:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e33:SetCountLimit(1)
e33:SetCondition(cm.lvcon)
e33:SetOperation(cm.lvop)
c:RegisterEffect(e33)
end
function cm.SynMixCondition(f1,f2,f3,f4,minc,maxc,gc)
return function(e,c,smat,mg1,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 tp=c:GetControler()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=Auxiliary.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
return mg:IsExists(cm.SynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk)
end
end
function cm.SynMixTarget(f1,f2,f3,f4,minc,maxc,gc)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,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=Group.CreateGroup()
local mg
if mg1 then
mg=mg1
else
mg=aux.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c1=mg:FilterSelect(tp,cm.SynMixFilter1,1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc):GetFirst()
g:AddCard(c1)
if f2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c2=mg:FilterSelect(tp,cm.SynMixFilter2,1,1,c1,f2,f3,f4,minc,maxc,c,mg,smat,c1,gc):GetFirst()
g:AddCard(c2)
if f3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c3=mg:FilterSelect(tp,cm.SynMixFilter3,1,1,Group.FromCards(c1,c2),f3,f4,minc,maxc,c,mg,smat,c1,c2,gc):GetFirst()
g:AddCard(c3)
end
end
local g4=Group.CreateGroup()
local i=0
--while i==0 do
local mg2=mg:Clone()
mg2=mg2:Filter(f4,g,c)
local cg=mg2:Filter(cm.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,c,g,smat,gc)
--if cg:GetCount()==0 then break end
local minct=1
if g4:GetCount()~=0 then minct=0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=cg:Select(tp,minct,99,nil)
--if tg:GetCount()==0 then break end
g4:Merge(tg)
--end
g:Merge(g4)
if g:GetCount()>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function cm.SynMixOperation(f1,f2,f3,f4,minct,maxc,gc)
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()
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
end
end
function cm.SynMixFilter1(c,f1,f2,f3,f4,minc,maxc,syncard,mg,smat,gc,mgchk)
return (not f1 or f1(c,syncard)) and mg:IsExists(cm.SynMixFilter2,1,c,f2,f3,f4,minc,maxc,syncard,mg,smat,c,gc,mgchk)
end
function cm.SynMixFilter2(c,f2,f3,f4,minc,maxc,syncard,mg,smat,c1,gc,mgchk)
if f2 then
return f2(c,syncard,c1) and mg:IsExists(cm.SynMixFilter3,1,Group.FromCards(c1,c),f3,f4,minc,maxc,syncard,mg,smat,c1,c,gc,mgchk)
else
return mg:IsExists(cm.SynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk)
end
end
function cm.SynMixFilter3(c,f3,f4,minc,maxc,syncard,mg,smat,c1,c2,gc,mgchk)
if f3 then
return f3(c,syncard,c1,c2) and mg:IsExists(cm.SynMixFilter4,1,Group.FromCards(c1,c2,c),f4,minc,maxc,syncard,mg,smat,c1,c2,c,gc,mgchk)
else
return mg:IsExists(cm.SynMixFilter4,1,Group.FromCards(c1,c2),f4,minc,maxc,syncard,mg,smat,c1,c2,nil,gc,mgchk)
end
end
function cm.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgchk)
if f4 and not f4(c,syncard,c1,c2,c3) then return false end
local sg=Group.FromCards(c1,c)
sg:AddCard(c1)
if c2 then sg:AddCard(c2) end
if c3 then sg:AddCard(c3) end
local mg=mg1:Clone()
if f4 then
mg=mg:Filter(f4,sg,syncard)
else
mg:Sub(sg)
end
return cm.SynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,gc,mgchk)
end
function cm.SynMixCheck(mg,sg1,minc,maxc,syncard,smat,gc,mgchk)
local tp=syncard:GetControler()
local sg=Group.CreateGroup()
if minc==0 and cm.SynMixCheckGoal(tp,sg1,0,0,syncard,sg,smat,gc,mgchk) then return true end
if maxc==0 then return false end
return mg:IsExists(cm.SynMixCheckRecursive,1,nil,tp,sg,mg,0,minc,maxc,syncard,sg1,smat,gc,mgchk)
end
function cm.SynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk)
sg:AddCard(c)
ct=ct+1
local res=cm.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
or (ct<maxc and mg:IsExists(cm.SynMixCheckRecursive,1,sg,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk))
sg:RemoveCard(c)
ct=ct-1
return res
end
function cm.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
if ct<minc then return false end
local g=sg:Clone()
g:Merge(sg1)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if gc and not gc(g) then return false end
if smat and not g:IsContains(smat) 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 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.rmfil(c,lv)
return c:IsType(TYPE_SYNCHRO) and c:IsLevelBelow(lv-1) and c:IsAbleToRemove()
end
function cm.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) and e:GetHandler():GetFlagEffect(m)~=0
end
function cm.ttlv(c)
return c:GetOriginalLevel()
end
function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial()
local xlv=g:GetSum(cm.ttlv)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(xlv)
c:RegisterEffect(e1)
if Duel.IsExistingMatchingCard(cm.rmfil,tp,LOCATION_EXTRA,0,1,nil,xlv) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local rg=Duel.GetMatchingGroup(cm.rmfil,tp,LOCATION_EXTRA,0,nil,xlv):Select(tp,1,1,nil)
if rg and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) then
local rmvg=Duel.GetOperatedGroup()
e:SetLabelObject(rmvg)
rmvg:KeepAlive()
local code=rmvg:GetFirst():GetCode()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
c:RegisterEffect(e1)
c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_DISABLE)
end
end
end
function cm.mgfilter(c,sync)
return c:IsControler(tp) and not c:IsFacedown()
and bit.band(c:GetReason(),0x80008)==0x80008 and c:GetReasonCard()==sync
and c:IsAbleToHand()
end
function cm.bkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local bg=e:GetLabelObject():GetLabelObject()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
local a=#Duel.GetOperatedGroup()
Duel.SendtoDeck(bg,nil,2,REASON_EFFECT)
local b=#Duel.GetOperatedGroup()
local mg=e:GetHandler():GetMaterial()
--if a~=0 and b~=0 and #mg~=0 and mg:FilterCount(aux.NecroValleyFilter(cm.mgfilter),nil,e:GetHandler)==#mg and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
-- Duel.BreakEffect()
-- local mc=mg:Select(tp,1,1,nil)
-- Duel.SendtoHand(mc,nil,REASON_EFFECT)
--end
end
\ No newline at end of file
--奇术士 凯恩斯之瞳
local cm,m,o=GetID()
function cm.initial_effect(c)
--search
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(m,1))
e11:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_TODECK)
e11:SetType(EFFECT_TYPE_QUICK_O)
e11:SetCode(EVENT_FREE_CHAIN)
e11:SetRange(LOCATION_HAND)
e11:SetCountLimit(1,m)
e11:SetTarget(cm.thtg)
e11:SetOperation(cm.thop)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,m+10000000)
c:RegisterEffect(e2)
local e3=e11:Clone()
e3:SetDescription(aux.Stringid(m,3))
e3:SetCondition(cm.thcon)
e3:SetCountLimit(1,m+20000000)
c:RegisterEffect(e3)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(cm.con)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(m,0))
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
end
function cm.thfilter(c)
return c:IsSetCard(0x62a) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleDeck(tp)
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT)
end
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>=3
end
\ No newline at end of file
--虚无之终点
local cm,m,o=GetID()
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,g,#g,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
cm.IXOperation(e,g)
end
function cm.IXOperation(e,ng)
for c in aux.Next(ng) do
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(c,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_TO_GRAVE)
e7:SetCountLimit(1)
e7:SetCondition(cm.drcon)
e7:SetOperation(cm.drop)
e7:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e7)
end
end
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(1-tp,1,REASON_EFFECT)~=0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,nil) then
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,nil)
cm.IXOperation(g)
end
end
\ No newline at end of file
!setname 0x611 逆魔刃
!setname 0x612 大地见闻
!setname 0x621 灵代
!setname 0x622 钢铁律命
!setname 0x623 TUB
!setname 0x624 岚术姬
!setname 0x625 迷石宫
!setname 0x1625 风海帆
!setname 0x626 黄昏
!setname 0x3626 黄昏之骑士
!setname 0x627 咏叹调
!setname 0x628 哈伊瓦纳斯 Haiiwanas
!setname 0x629 时光酒桌
!setname 0x62a 奇术尊者
!setname 0x62b Roaring Flare
!setname 0x62c 大剑喻
!setname 0x62d Re:SURGUM
!setname 0x62e 圣兽装骑
!setname 0x362e 圣兽装骑·鲸
!setname 0x562e 圣兽装骑·鲨
!setname 0x662e 圣兽装骑·蜂
!setname 0x962e 圣兽装骑·骸
!setname 0x62f -LIGHT-
!setname 0x630 传说天
!setname 0x631 遗忘海
!setname 0x632 奥法集装士
!setname 0x6a0 机凯种
!setname 0x6a2 大世环
!setname 0x6a5 天灯
!setname 0x6a6 财宝
!setname 0x6a7 辉谕
!setname 0x6a8 水晶国度
!setname 0x6a9 创造物
!setname 0x6ac 瀚海晏霞
!setname 0x6ad 十天众
!setname 0x642 伊兹尼亚
!setname 0x643 埃亚隆
!setname 0x644 那塔拉
!setname 0x645 玛纳
!setname 0x647 枢机神
0x626 指示物(愿母神三度为你阖眼)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment