Commit 9b4d07ce authored by 聖園ミカ's avatar 聖園ミカ 🐟

byd

parent d42796a7
Pipeline #28151 passed with stage
in 26 minutes and 6 seconds
No preview for this file type
--龙之遗骸
local m = 20232000
local cm = _G["c"..m]
function cm.initial_effect(c)
--To Hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(cm.setcon)
e2:SetTarget(cm.settg)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.thfilter(c)
return c:IsSetCard(0xdf0) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
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)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function cm.setfilter(c)
return c:IsSetCard(0xdf0) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
end
\ No newline at end of file
--梅柳齐娜
local m = 20232005
local cm = _G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.thfilter(c,tp)
return c:IsCode(20232010) 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,tp) end
local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil,tp)
if #mg1>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g= mg1:Select(tp,1,1,nil)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT) then
Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil)
if tc then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
end
--欧若拉
local m = 20232010
local cm = _G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.eqtg)
e1:SetOperation(cm.eqop)
e1:SetCountLimit(1,m)
c:RegisterEffect(e1)
--summon
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--get name
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_ADD_CODE)
e3:SetValue(20232005)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_PZONE)
e4:SetCountLimit(1,m+1)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
end
function cm.eqfilter(c,e,tp)
return c:IsCode(20232000)and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.eqfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectTarget(tp,cm.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.eqlimit(e,c)
return e:GetLabelObject()==c
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
if not Duel.Equip(tp,c,tc,false) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
end
function cm.thfilter(c)
return c:IsSetCard(0xdf0) and c:IsRace(RACE_DRAGON) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
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
local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if #mg1>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g= mg1:Select(tp,1,1,nil)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT) then
Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil)
if tc then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--妖精骑士兰斯洛特
local m = 20232015
local cm = _G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,cm.matfilter,4,2,cm.ovfilter,aux.Stringid(m,0))
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_COST)
e0:SetRange(LOCATION_EXTRA)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
e0:SetOperation(cm.ovop)
c:RegisterEffect(e0)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(cm.thcon)
e4:SetCost(cm.thcost)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
--synchro level
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(4)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(m)
e2:SetValue(aux.TRUE)
c:RegisterEffect(e2)
if not cm.check then
cm.check=true
cm[0]=Card.IsCanBeSynchroMaterial
Card.IsCanBeSynchroMaterial=function(tc,sc,...)
if tc:IsHasEffect(m) and tc:IsHasEffect(EFFECT_SYNCHRO_LEVEL) then
if tc:GetSynchroType()&TYPE_MONSTER==0 then return false end
if sc and tc:IsLocation(LOCATION_MZONE) and tc:GetControler()~=sc:GetControler() and not tc:IsHasEffect(EFFECT_SYNCHRO_MATERIAL) then return false end
if tc:IsStatus(STATUS_FORBIDDEN) then return false end
if tc:IsHasEffect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) then return false end
return true
else
return cm[0](tc,sc,...)
end
end
cm[1]=Card.GetSynchroLevel
Card.GetSynchroLevel=function(tc,sc)
local es={tc:IsHasEffect(EFFECT_SYNCHRO_LEVEL)}
local lev=0
for k,v in pairs(es) do
lev=v:GetValue(v)
break
end
if tc:IsHasEffect(m) and lev>0 then
return lev
else
return cm[1](tc,sc)
end
end
--[[
--for utility.lua load first before 2022.2.20
--now not available here
cm[2]=aux.AddSynchroProcedure
aux.AddSynchroProcedure=function(sc,f1,f2,min,max)
local maxc=max or 99
aux.AddSynchroMixProcedure(sc,f1,nil,nil,f2,min,maxc)
end
--]]
--fix for utility.lua load first 2022.2.20
--plan1
cm[3]=Duel.CheckTunerMaterial
Duel.CheckTunerMaterial=function(sc,smat,f1,f2,minc,maxc,mg1)
local f1=aux.Tuner(f1)
local tp=c:GetControler()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=Auxiliary.GetSynMaterials(tp,sc)
end
if smat~=nil then mg:AddCard(smat) end
return mg:IsExists(Auxiliary.SynMixFilter1,1,nil,f1,nil,nil,f2,minc,maxc,sc,mg,smat,nil,mgchk)
end
cm[4]=Duel.CheckSynchroMaterial
Duel.CheckSynchroMaterial=function(sc,f1,f2,minc,maxc,smat,mg1)
return Duel.CheckTunerMaterial(sc,smat,f1,f2,minc,maxc,mg1)
end
cm[5]=Duel.SelectTunerMaterial
Duel.SelectTunerMaterial=function(tp,sc,smat,f1,f4,minc,maxc,mg1)
local f1=aux.Tuner(f1)
local g=Group.CreateGroup()
local gc=nil
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=Auxiliary.GetSynMaterials(tp,sc)
end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c1=mg:FilterSelect(tp,Auxiliary.SynMixFilter1,1,1,nil,f1,nil,nil,f4,minc,maxc,sc,mg,smat,gc,mgchk):GetFirst()
g:AddCard(c1)
local g4=Group.CreateGroup()
for i=0,maxc-1 do
local mg2=mg:Clone()
if f4 then
mg2=mg2:Filter(f4,g,sc)
else
mg2:Sub(g)
end
local cg=mg2:Filter(Auxiliary.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,sc,g,smat,gc,mgchk)
if cg:GetCount()==0 then break end
local minct=1
if Auxiliary.SynMixCheckGoal(tp,g4,minc,i,sc,g,smat,gc,mgchk) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=cg:Select(tp,minct,1,nil)
if tg:GetCount()==0 then break end
g4:Merge(tg)
end
g:Merge(g4)
return g
end
cm[6]=Duel.SelectSynchroMaterial
Duel.SelectSynchroMaterial=function(tp,sc,f1,f2,minc,maxc,smat,mg1)
return Duel.SelectTunerMaterial(tp,sc,smat,f1,f2,minc,maxc,mg1)
end
--[[
--plan2
local tsg=Duel.GetMatchingGroup(Card.IsType,0,LOCATION_EXTRA,LOCATION_EXTRA,nil,TYPE_SYNCHRO)
for tsc in aux.Next(tsg) do
local esg={esc:IsHasEffect(EFFECT_SPSUMMON_PROC)}
end
--]]
end
end
function cm.xyzcost(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.ovfilter(c)
return c:IsFaceup() and c:IsCode(20232005)
end
function cm.oveqf(c,tp)
return not c:IsType(TYPE_TOKEN)and(c:IsControler(tp) or c:IsAbleToChangeControler())and c:GetSequence()<5 and c:IsType(TYPE_EQUIP) and c:IsSetCard(0xdf0)
end
function cm.ovop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.oveqf,tp,LOCATION_SZONE,0,1,nil,tp)then
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local g=Duel.SelectMatchingCard(tp,cm.oveqf,tp,LOCATION_SZONE,0,1,1,nil,tp)
e:GetHandler():SetMaterial(g)
Duel.Overlay(e:GetHandler(),g)
end
end
end
function cm.matfilter(c)
return c:IsRace(RACE_DRAGON)and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.thcon(e)
return e:GetHandler():GetOverlayGroup():IsExists(function(c)return c:IsCode(20232010)end,1,nil) and e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.thfilter(c)
return c:IsCode(20232020) 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_GRAVE+LOCATION_DECK,0,1,nil)end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
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_GRAVE+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--光之地平线
local m = 20232020
local cm = _G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetTarget(cm.acttg)
e1:SetCost(cm.actcost)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.gfilter(c,e,tp)
return c:IsSetCard(0xdf0) and c:IsLevel(8) and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.syncheck1(c,mg,tp)
return Duel.IsExistingMatchingCard(cm.syncheck2,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function cm.syncheck2(c,mg)
return c:IsSetCard(0xdf0) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO)
and ((mg and c:IsSynchroSummonable(nil,mg)) or c:IsSynchroSummonable(nil))
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
local mg2=Duel.GetMatchingGroup(cm.gfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
local mg3=Group.__add(mg1,mg2)
return mg1:CheckSubGroup(cm.syncheck1,1,#mg3,mg3,tp)
and Duel.IsExistingMatchingCard(cm.gfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.attg(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function cm.attg1(e,c)
return e:GetLabel()==c:GetFieldID()
end
function cm.atlimtcon(e,tp,eg,ep,ev,re,r,rp)
local ac=eg:GetFirst()
return ac:GetControler()==e:GetHandlerPlayer()
end
function cm.atlimtop1(e,tp,eg,ep,ev,re,r,rp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetLabel(e:GetLabelObject():GetFieldID())
e3:SetTarget(cm.attg1)
Duel.RegisterEffect(e3,tp)
end
function cm.atlimtop(e,tp,eg,ep,ev,re,r,rp)
local ac=eg:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabel(e:GetLabelObject():GetFieldID())
if e:GetLabelObject():GetFieldID()==ac:GetFieldID() then
e1:SetTarget(cm.attg)
else
e1:SetTarget(cm.attg1)
end
Duel.RegisterEffect(e1,tp)
end
--加速同调·全体攻击·攻击限制
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local gc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.gfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if Duel.SpecialSummon(gc,0,tp,tp,false,false,POS_FACEUP)~=1 then return end
local g=Duel.GetMatchingGroup(cm.syncheck2,tp,LOCATION_EXTRA,0,nil,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil):GetFirst()
if not sc then return end
--atk up
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_UPDATE_ATTACK)
e0:SetValue(1000)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
sc:RegisterEffect(e0)
--attack all
local e1=Effect.CreateEffect(sc)--e:GetHandler()
e1:SetDescription(aux.Stringid(m,0))
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
sc:RegisterEffect(e1)
--attack limit
local e2=Effect.CreateEffect(sc)--e:GetHandler()
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetLabelObject(sc)
e2:SetCondition(cm.atlimtcon)
e2:SetOperation(cm.atlimtop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
sc:RegisterEffect(e2)
if Duel.GetActivityCount(tp,ACTIVITY_ATTACK)~=0 then
local e3=Effect.CreateEffect(sc)--e:GetHandler()
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetLabelObject(sc)
e3:SetOperation(cm.atlimtop1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
sc:RegisterEffect(e3)
end
if not sc:IsType(TYPE_EFFECT) then
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ADD_TYPE)
e4:SetValue(TYPE_EFFECT)
e4:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
sc:RegisterEffect(e4,true)
end
Duel.SynchroSummon(tp,sc,nil)
end
end
--地平线之龙·梅柳齐娜
local m = 20232025
local cm = _G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,20232015)
c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,cm.sfilter,nil,nil,aux.NonTuner(Card.IsRace,RACE_DRAGON),1,99)
--[[ local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(cm.txtcon)
e0:SetOperation(cm.txtop)
c:RegisterEffect(e0)]]
--destor and damege
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.descon)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
--xyz summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+1)
e3:SetCost(cm.sccost)
e3:SetTarget(cm.sctg)
e3:SetOperation(cm.scop)
c:RegisterEffect(e3)
--redirect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCondition(cm.recon)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(LOCATION_DECK)
c:RegisterEffect(e4)
end
function cm.recon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE)
end
function cm.sfilter(c)
return (c:IsRace(RACE_DRAGON)and c:IsSynchroType(TYPE_TUNER)) or c:IsCode(20232015)
end
function cm.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
--[[function cm.txtcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.txtop(e,tp,eg,ep,ev,re,r,rp)
Debug.Message("终末余晖中最后的龙啊!")
Debug.Message("现在,贯穿无底的黑暗,")
Debug.Message("带来最为灼热的光芒!")
Debug.Message("同调召唤!现身吧!")
Debug.Message("地平线之龙·梅柳齐娜!")
end]]
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.destg(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
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local desc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil):GetFirst()
if not desc then return end
local ct=Duel.Destroy(desc,REASON_EFFECT)
if ct>0
and desc:GetPreviousControler()==tp
and desc:IsReason(REASON_DESTROY)
and desc:GetReasonEffect(e)
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) then
if Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local stgc=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
if Duel.SendtoGrave(stgc,REASON_EFFECT) then Duel.Damage(1-tp,1000,REASON_EFFECT) end
end
end
end
function cm.filter(c,e,tp)
return c:IsCode(20232015) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,e:GetHandler(),c)>0
end
function cm.filter0(c,e,tp,mc)
return c:IsCode(20232015) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,e:GetHandler(),c)>0 and mc:IsCanBeXyzMaterial(c)
end
function cm.mfilter(c,e,tp)
return c:IsSetCard(0xdf0) and c:IsRace(RACE_DRAGON) and c:IsLevel(8) and c:IsType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(cm.filter0,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.mfilter1(c,e,tp)
return c:IsCode(20232010) and Duel.IsExistingMatchingCard(cm.filter0,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) and
Duel.IsExistingMatchingCard(cm.mfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and
Duel.IsExistingMatchingCard(cm.mfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.scfilter(c,e,tp)
return c:IsCode(20232015) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.scop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.mfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.mfilter1),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local mg3=Group.__bor(mg1,mg2)
if mg1:GetCount()>0 and mg2:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.scfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
tc:SetMaterial(mg3)
Duel.Overlay(tc,mg3)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
--阿多尼斯
local m = 20232053
local cm = _G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,20232056)
--get effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.setcon)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.settg)
e1:SetOperation(cm.setop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+1)
e2:SetCost(cm.cost)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_XYZ) and c:IsCode(20232056)
end
function cm.setfilter(c)
return c:IsCode(20232062) and c:IsSSetable()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
a:RegisterEffect(e1)
if d then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_DAMAGE)
d:RegisterEffect(e2)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e3,tp)
end
\ No newline at end of file
--妖精骑士高文
local m = 20232056
local cm = _G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,function(c)return c:IsRace(RACE_BEASTWARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE)end,4,2)
c:EnableReviveLimit()
--atk limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(cm.atklimit)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.desreptg)
e3:SetValue(cm.desrepval)
e3:SetOperation(cm.desrepop)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1)
c:RegisterEffect(e4)
end
function cm.atklimit(e,c)
return c~=e:GetHandler()
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 c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) 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)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
Duel.Hint(HINT_CARD,0,m)
end
--巴格斯特
local m = 20232059
local cm = _G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,function(c)return c:IsRace(RACE_BEAST) and c:IsAttribute(ATTRIBUTE_FIRE)end,5,3)
c:EnableReviveLimit()
--xyzlimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(cm.xyzlimit)
c:RegisterEffect(e0)
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_INACTIVATE)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
--overlay
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.rmcon)
e3:SetCost(cm.rmcost)
e3:SetTarget(cm.rmtg)
e3:SetOperation(cm.rmop)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(cm.desreptg)
e4:SetValue(cm.desrepval)
e4:SetOperation(cm.desrepop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.xyzlimit(e,c)
if not c then return false end
return not c:IsSetCard(0xdf0)
end
function cm.atkval(e,c)
if c:GetOverlayCount()<1 then return 0
else
local mg=c:GetOverlayGroup()
local mc=mg:GetFirst()
local tmpatk=0
while (mc and mc:GetOriginalType()&TYPE_MONSTER)
do
if mc:GetAttack()>tmpatk then tmpatk=mc:GetAttack() end
mc=mg:GetNext()
end
return tmpatk+c:GetOverlayCount()*400
end
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
return true
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(cm.atkval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
end
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=Duel.GetBattleMonster(1-tp)
e:SetLabelObject(bc)
return c:IsRelateToBattle() and not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsStatus(STATUS_OPPO_BATTLE)
and bc and bc:IsOnField() and bc:IsRelateToBattle()
end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsCanOverlay() end
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=e:GetLabelObject()
if not c:IsRelateToEffect(e) then return end
if c:IsImmuneToEffect(e) or bc:IsImmuneToEffect(e) then return end
if bc and bc:IsOnField() and bc:IsRelateToBattle() then
local og=bc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.Overlay(c,og,false)
end
Duel.Overlay(c,Group.FromCards(bc))
end
local b1=0
if Duel.IsExistingMatchingCard(Card.IsCanOverlay,tp,0,LOCATION_HAND,1,nil) then b1=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3)) end
if b1==0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e3)
else
local hg=Duel.GetMatchingGroup(Card.IsCanOverlay,tp,0,LOCATION_HAND,nil):RandomSelect(tp,1)
Duel.Overlay(c,hg)
end
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 c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) 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)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
Duel.Hint(HINT_CARD,0,m)
end
\ No newline at end of file
--不再重复的那一天
local m = 20232062
local cm = _G["c"..m]
function cm.initial_effect(c)
---Rank up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.rucost)
e1:SetTarget(cm.rutg)
e1:SetOperation(cm.ruop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.rucost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.excheck(c,e,tp,mc)
return c:IsCode(20232059) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c,0xff)>0 and mc:IsCanBeXyzMaterial(c)
end
function cm.gcheck(c,e,tp)
return c:IsCode(20232056) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.excheck,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.rutg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.gcheck(chkc,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.gcheck,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local mc=Duel.SelectTarget(tp,cm.gcheck,tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,mc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.ruop(e,tp,eg,ep,ev,re,r,rp)
local mc=Duel.GetFirstTarget()
if mc and mc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if Duel.SpecialSummon(mc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.excheck,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mc):GetFirst()
if sc then
local mg=mc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(mc))
Duel.Overlay(sc,Group.FromCards(mc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
end
end
--濒死之女
local m = 20232100
local cm = _G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,20232103)
--Used as material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e1:SetCondition(cm.lkcon)
e1:SetOperation(cm.lkop)
c:RegisterEffect(e1)
--change cost
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD)
e2:SetCode(m)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.cccon)
e2:SetTargetRange(1,0)
e2:SetCountLimit(1,m)
c:RegisterEffect(e2)
end
function cm.lkcon(e,tp,eg,ep,ev,re,r,rp)
return r&0x103c0000~=0 and e:GetHandler():GetReasonCard():IsSetCard(0xdf0)
end
function cm.indval(e,re,rp)
return rp==1-e:GetOwnerPlayer()
end
function cm.lkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(cm.indval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
rc:RegisterEffect(e1)
end
function cm.cccon(e)
return e:GetHandler():IsCode(20232103)
end
\ No newline at end of file
--妖精骑士特里斯坦
local m = 20232103
local cm = _G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,function(c)return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_SPELLCASTER) end,4,2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.thfilter(c)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_SPELL) 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)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function cm.spcon(e)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==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 c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0xdf0)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,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 mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter1),tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,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_EXTRA,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()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabelObject(tc)
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
e1:SetCountLimit(1)
Duel.RegisterEffect(e1,tp)
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(m)~=0 then
return true
else
e:Reset()
return false
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
end
\ No newline at end of file
--芭万·希
local m = 20232106
local cm = _G["c"..m]
function cm.initial_effect(c)
aux.AddFusionProcCodeFun(c,20232103,aux.FilterBoolFunction(Card.IsSetCard,0xdf0),1,true,true)
c:EnableReviveLimit()
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--sps
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+1)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.spstg)
e2:SetOperation(cm.spsop)
c:RegisterEffect(e2)
end
function cm.spfilter1(c,e,tp)
return c:IsCode(20232109) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.spfilter2(c)
return c:IsType(TYPE_EFFECT) and c:IsFaceup() and not c:IsType(TYPE_TOKEN)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cm.spfilter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.spfilter2,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
Duel.SelectTarget(tp,cm.spfilter2,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc1=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter1),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if not tc2 then return end
if Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
if tc1:IsRelateToEffect(e) and tc1:IsFaceup() and not tc1:IsType(TYPE_TOKEN) then
local code=tc1:GetOriginalCodeRule()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
end
end
end
function cm.desfilter(c,e,tp)
return Duel.IsExistingMatchingCard(cm.spsfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp,c)
end
function cm.spsfilter(c,e,tp,rc)
return c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0xdf1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and
(
(c:IsLocation(LOCATION_GRAVE) and Duel.GetMZoneCount(tp,rc)>0) or
(c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,rc,c)>0)
)
end
function cm.mfilter(c)
return c:IsSetCard(0xdf0,0xdf1) and c:IsCanOverlay()
end
function cm.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.mfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
end
function cm.spsop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dc=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp):GetFirst()
if dc then Duel.Destroy(dc,REASON_EFFECT) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.spsfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,nil):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.mfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil):GetFirst()
if mc then Duel.Overlay(sc,Group.FromCards(mc)) end
end
end
--二重身
local m = 20232109
local cm = _G["c"..m]
function cm.initial_effect(c)
--atk limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(0,LOCATION_MZONE)
e0:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e0:SetTarget(cm.atltg)
e0:SetCondition(cm.atlcon)
e0:SetValue(cm.atlimit)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_LEAVE_FIELD_P)
e1:SetOperation(cm.damp)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(m,aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.descon)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(cm.destg)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetOperation(cm.desop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function cm.damp(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetHandler():GetCode()
e:SetLabel(code)
end
function cm.atlcon(e)
return e:GetHandler():IsFaceup()
end
function cm.atltg(e,c)
return c:IsOriginalCodeRule(e:GetHandler():GetCode())
end
function cm.atlimit(e,c)
return c~=e:GetHandler()
end
function cm.desfilter(c,e)
return c:IsCode(e:GetLabelObject():GetLabel())
end
function cm.descon(e)
return e:GetHandler():IsReason(REASON_BATTLE+REASON_EFFECT)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return cm.desfilter(chkc,e) and chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,0,LOCATION_MZONE,1,1,nil,e)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--外征妖精国骑士 布里托玛特
local m = 20232150
local cm = _G["c"..m]
function cm.initial_effect(c)
--link summon
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)
e1:SetCondition(cm.lkcon)
e1:SetTarget(cm.lktg)
e1:SetOperation(cm.lkop)
c:RegisterEffect(e1)
end
function cm.excheck(c,mc)
return c:IsLinkSummonable(nil,mc) and c:IsSetCard(0xdf0)
end
function cm.lkcon(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(cm.excheck,tp,LOCATION_EXTRA,0,1,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(cm.excheck,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.LinkSummon(tp,sg:GetFirst(),nil,c)
end
end
--布里托玛特
local m = 20232153
local cm = _G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,1,3,cm.lcheck)
c:EnableReviveLimit()
--set p
local e2=Effect.CreateEffect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.setpcon)
e2:SetTarget(cm.setptg)
e2:SetOperation(cm.setpop)
c:RegisterEffect(e2)
--sps
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCountLimit(1,m+2)
e3:SetCost(cm.spscost)
e3:SetLabelObject(e2)
e3:SetCondition(cm.spscon)
e3:SetTarget(cm.spstg)
e3:SetOperation(cm.spsop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.lcheck(g,lc)
return g:IsExists(Card.IsSetCard,1,nil,0xdf0)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.mfilter(c,tp)
return c:IsAbleToHand() and c:IsSetCard(0xdf0,0xdf1) and c:GetOwner()==tp
end
function cm.tgfilter(tp)
local mg=Duel.GetOverlayGroup(tp,LOCATION_MZONE,0):Filter(cm.mfilter,nil,tp)
return #mg>0
end
function cm.actfilter(c,tp)
return c:IsSetCard(0xdf0) and c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.spscost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.setpfilter(c)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden() and c:IsFaceup()
end
function cm.setpfilter1(c,e,tp)
return c:IsCode(20232150) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.setpcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function cm.setptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.setpfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) or ((Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(cm.setpfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil)) end
end
function cm.efilter(e,re)
return e:GetHandler()~=re:GetOwner()
end
function cm.setpop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
local b1=(Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(cm.setpfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(cm.setpfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp)
local b3=cm.tgfilter(tp)
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(m,0)},
{b2,aux.Stringid(m,1)},
{b3,aux.Stringid(m,2)})
local tc
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setpfilter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setpfilter1),tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
--direct attack
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
tc:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.efilter)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
elseif op==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local mg=Duel.GetOverlayGroup(tp,LOCATION_MZONE,0):FilterSelect(tp,cm.mfilter,1,1,nil,tp)
if #mg==1 then
Duel.SendtoHand(mg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,mg)
end
end
e:SetLabel(Duel.GetTurnCount()+1)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,2)
end
function cm.spscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0 and e:GetLabelObject():GetLabel()==Duel.GetTurnCount()
end
function cm.spstg(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,c,1,0,LOCATION_GRAVE)
end
function cm.spsop(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
--妖精国 伍德沃斯
local m = 20232156
local cm = _G["c"..m]
function c20232156.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,1,3,cm.lcheck)
c:EnableReviveLimit()
--summon limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(cm.regop)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--summon success
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(cm.sumsuc)
c:RegisterEffect(e2)
--sps
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.spscon)
e3:SetTarget(cm.spstg)
e3:SetOperation(cm.spsop)
c:RegisterEffect(e3)
--sps
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_GRAVE)
e4:SetTarget(cm.spstg)
e4:SetOperation(cm.spsop)
c:RegisterEffect(e4)
--atk limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e5:SetValue(cm.atklimit)
c:RegisterEffect(e5)
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_SPSUMMON_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()
local p1=false
local p2=false
while tc do
if not tc:IsSetCard(0xdf0) then
if tc:IsSummonPlayer(0) then p1=true else p2=true end
end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,m+1,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,m+1,RESET_PHASE+PHASE_END,0,1) end
end
function cm.lcheck(g,lc)
return g:IsExists(Card.IsSetCard,1,nil,0xdf0)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.sumlimit)
Duel.RegisterEffect(e1,tp)
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0xdf0)
end
function cm.splimit(e,se,sp,st,spos,tgp)
return Duel.GetFlagEffect(tgp,m+1)==0
end
function cm.sumsuc(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(cm.discon)
e1:SetOperation(cm.disop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.negfilter(c,e,tp)
return c:GetControler()==tp and c:IsSetCard(0xdf1) and c:IsOnField() and c:IsFaceup() and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return rp==1-tp and g:IsExists(cm.negfilter,1,nil,e,tp)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function cm.spsfilter(c)
return c:IsSetCard(0xdf1) and c:IsFaceup() and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.spscon(e,tp,eg,ep,ev,re,r,rp)
local ex,g,gc,dp,dv=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return re:IsHasCategory(CATEGORY_DESTROY) or ex
end
function cm.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local b
if Duel.GetFlagEffect(tp,m)>0 then
b=Duel.GetFlagEffect(tp,m)<2 and Duel.IsExistingMatchingCard(cm.spsfilter,tp,LOCATION_ONFIELD,0,1,nil)
else
b=Duel.GetFlagEffect(tp,m)<1
end
return b and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.linklimit(e,c)
return c:IsLinkAbove(4)
end
function cm.spsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--[[and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(cm.linklimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
end
Duel.SpecialSummonComplete()]]
end
function cm.atklimit(e,c)
return c:IsSetCard(0xdf1) and c:IsFaceup()
end
--泛人类史·摩根
local m = 20232200
local cm = _G["c"..m]
function cm.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
--xyz summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetCost(cm.xyzcost)
e2:SetTarget(cm.xyztg)
e2:SetOperation(cm.xyzop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.spfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdf0)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
return ct==0 or (ct==Duel.GetMatchingGroupCount(cm.spfilter,tp,LOCATION_MZONE,0,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
end
function cm.cfilter1(c)
return c:IsCode(m) and c:IsAbleToGraveAsCost()
end
function cm.xyzcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
Duel.Release(e:GetHandler(),REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.cfilter2(c,e,tp,rc)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_XYZ) and c:IsRank(7) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,rc,c)>0
end
function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) and aux.MustMaterialCheck(e:GetHandler(),tp,EFFECT_MUST_BE_XMATERIAL)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
end
end
end
\ No newline at end of file
--薇薇安
local m = 20232203
local cm = _G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,function(c)return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_WATER)end,7,2)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tftg)
e1:SetOperation(cm.tfop)
c:RegisterEffect(e1)
--TOGRAVE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.tgcon)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,m+2)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.tffilter(c,tp)
return c:IsCode(20232250)
and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function cm.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.tffilter,tp,LOCATION_DECK,0,1,nil,tp) end
end
function cm.tfop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tg=Duel.SelectMatchingCard(tp,cm.tffilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if #tg>0 then
local tc=tg:GetFirst()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function cm.tgfilter(c)
return c:IsSetCard(0xdf0,0xdf1) and c:IsAbleToGrave()
end
function cm.tgcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) and e:GetHandler():IsSetCard(0xdf1)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_SZONE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler()):GetFirst()
if tc and Duel.Destroy(tc,REASON_EFFECT)>0 and tc:GetPreviousControler()==tp and tc:IsReason(REASON_DESTROY) and tc:GetReasonEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsRelateToEffect(e) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end
end
--救世主梣
local m = 20232206
local cm = _G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
--xyz summon
aux.AddXyzProcedure(c,function(c)return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_WATER)end,8,2,function(c) return c:IsSetCard(0xdf1)and c:IsType(TYPE_XYZ)and c:IsRank(7)end,aux.Stringid(m,0))
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
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)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_EXTRA)
e2:SetCountLimit(1)
e2:SetCondition(cm.setcon)
e2:SetTarget(cm.settg)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
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_LEAVE_FIELD)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
--attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.atcon)
e3:SetTarget(cm.attg)
e3:SetOperation(cm.atop)
c:RegisterEffect(e3)
--setp
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,5))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_PZONE)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetCountLimit(1,m+2)
e4:SetTarget(cm.settg1)
e4:SetOperation(cm.setop1)
c:RegisterEffect(e4)
end
function cm.thfilter(c)
return c:IsSetCard(0xdf0,0xdf1) 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_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc
do
if tc:IsSetCard(0xdf1) and tc:GetOriginalType()&TYPE_MONSTER~=0 and tc:IsPreviousLocation(LOCATION_ONFIELD) and tc:IsReason(REASON_EFFECT)
then
Duel.RegisterFlagEffect(tc:GetPreviousControler(),m,RESET_PHASE+PHASE_END,0,1)
end
tc=eg:GetNext()
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0 and e:GetHandler():IsFaceup()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function cm.atcon(e,tp,eg,ep,ev,re,r,rp)
local tc=nil
if Duel.GetAttacker():IsControler(tp) then tc=Duel.GetAttacker()
else tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function cm.attg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=e:GetLabelObject()
local b2=Duel.GetAttacker():IsControler(1-tp)
if chk==0 then return true end
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,3))
else op=Duel.SelectOption(tp,aux.Stringid(m,4))+1 end
e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetLabelObject(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
else
e:SetCategory(CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
end
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Destroy(c,REASON_EFFECT)
if e:GetLabel()==0 then
local at=e:GetLabelObject()
if at:IsFaceup() and at:IsRelateToBattle() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(math.abs(Duel.GetLP(tp)-Duel.GetLP(1-tp)))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
at:RegisterEffect(e1)
end
else Duel.NegateAttack()
end
end
function cm.setfilter1(c)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden() and c:IsFaceup()
end
function cm.settg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_PZONE)
end
function cm.setop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_PZONE,0,1,1,nil):GetFirst()
if dc then Duel.Destroy(dc,REASON_EFFECT) end
if not (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter1),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end
end
\ No newline at end of file
--妖精国女王 摩根l
local m = 20232209
local cm = _G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,function(c)return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_WATER)end,9,3)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
--XyzSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_PZONE)
e3:SetCost(cm.xyzcost)
e3:SetCountLimit(1,m+1)
e3:SetTarget(cm.xyztg)
e3:SetOperation(cm.xyzop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e4)
--linkSummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,3))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_PZONE)
e5:SetCost(cm.xyzcost)
e5:SetCountLimit(1,m+1)
e5:SetTarget(cm.lktg)
e5:SetOperation(cm.lkop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetRange(LOCATION_GRAVE)
e7:SetType(EFFECT_TYPE_IGNITION)
e7:SetCountLimit(1,m)
e7:SetCondition(cm.setcon)
e7:SetTarget(cm.settg)
e7:SetOperation(cm.setop)
c:RegisterEffect(e7)
local e8=e7:Clone()
e7:SetRange(LOCATION_EXTRA)
c:RegisterEffect(e8)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsFaceup()
end
function cm.setfilter(c)
return c:IsSetCard(0xdf0) and not c:IsForbidden() and c:IsType(TYPE_PENDULUM) and c:IsFaceup()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.xyzcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.exfilter(c,e,tp,mc)
return aux.IsCodeListed(mc,c:GetCode()) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c,0xff)>0 and mc:IsCanBeXyzMaterial(c)
end
function cm.mfilter(c,e,tp)
return c:IsSetCard(0xdf0) and c:IsControler(tp) and c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.mfilter1(c,e,tp,eg)
return eg:Filter(cm.mfilter,nil,e,tp):IsContains(c)
end
function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and cm.mfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.mfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp,eg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,cm.mfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp,eg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
local mc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(mc,tp,EFFECT_MUST_BE_XMATERIAL)then return end
if not mc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.exfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mc):GetFirst()
if sc then
local og=mc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(sc,Group.FromCards(mc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
function cm.linkfilter(c)
return Card.IsLinkSummonable(c,nil) and c:IsSetCard(0xdf0)
end
function cm.lktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.linkfilter,tp,LOCATION_EXTRA,0,1,nil) 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()
local g=Duel.GetMatchingGroup(cm.linkfilter,tp,LOCATION_EXTRA,0,nil)
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)
end
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
\ No newline at end of file
--妖精国女王·摩根R
local m = 20232215
local cm = _G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,function(c)return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_WATER)end,9,3)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
--xyz limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(cm.xyzlimit)
c:RegisterEffect(e0)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(cm.tmtg)
e1:SetOperation(cm.tmop)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,m+2)
e2:SetHintTiming(0,0x1e0)
e2:SetCondition(cm.cpcon)
e2:SetCost(cm.cpcost)
e2:SetTarget(cm.cptg)
e2:SetOperation(cm.cpop)
c:RegisterEffect(e2)
--add xyzm
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.xmtg)
e3:SetOperation(cm.xmop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_PZONE)
e4:SetCountLimit(1,m+3)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
--scale
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CHANGE_LSCALE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_PZONE)
e5:SetCondition(cm.slcon)
e5:SetValue(9)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_CHANGE_RSCALE)
c:RegisterEffect(e6)
end
function cm.xyzlimit(e,c)
if not c then return false end
return not c:IsSetCard(0xdf1)
end
function cm.tmfilter(c)
return c:IsCanOverlay() and c:IsSetCard(0xdf1,0xdf0)
end
function cm.tmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tmfilter,tp,LOCATION_GRAVE,0,1,nil) end
end
function cm.tmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tc=Duel.SelectMatchingCard(tp,cm.tmfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then
Duel.Overlay(e:GetHandler(),tc)
end
end
function cm.cpfilter(c,e,tp,eg,ep,ev,re,r,rp)
local te=c:CheckActivateEffect(true,true,false)
if not (c:IsSetCard(0xdf0,0xdf1) and c:IsType(TYPE_SPELL) and c:IsType(TYPE_QUICKPLAY) and te and te:GetOperation()) then return false end
local tg=te:GetTarget()
return (not tg) or tg(e,tp,eg,ep,ev,re,r,rp,0,nil)
end
function cm.cpcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAbleToHandAsCost,1,nil)
end
function cm.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function cm.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,20232100)
local b1=fe
if fe then
local fc=fe:GetHandler()
b1=fe and fc and fc:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
local b2=c:GetOverlayGroup():IsExists(Card.IsAbleToHandAsCost,1,nil)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return (b1 or b2) and c:GetOverlayGroup():IsExists(cm.cpfilter,1,nil,e,tp,eg,ep,ev,re,r,rp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local mc=c:GetOverlayGroup():FilterSelect(tp,cm.cpfilter,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst()
if not mc then return end
if b1 and (not b2 or Duel.SelectYesNo(tp,fe:GetDescription())) then
Duel.Hint(HINT_CARD,0,20232100)
fe:UseCountLimit(tp)
fe:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=c:GetOverlayGroup():FilterSelect(tp,function(c)return c:IsAbleToHandAsCost() end,1,1,nil)
if not (Duel.SendtoHand(tc,nil,REASON_COST)>0) then return false end
end
local te,ceg,cep,cev,cre,cr,crp=mc:CheckActivateEffect(true,true,true)
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)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
end
function cm.cpop(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
Duel.BreakEffect()
if Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
local dc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if dc then Duel.Destroy(dc,REASON_EFFECT) end
end
end
function cm.xmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tmfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
end
function cm.xmop(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_XMATERIAL)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tmfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,2,nil)
if #tg<=2 then
Duel.Overlay(e:GetHandler(),tg)
end
Duel.Recover(tp,e:GetHandler():GetOverlayCount()*200,REASON_EFFECT)
end
function cm.spfilter(c,tp)
return c:IsCanOverlay() and c:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return cm.spfilter(chkc,tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_MZONE,0,1,nil,tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0) then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
end
end
function cm.slcon(e)
return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),20232209)
end
\ No newline at end of file
--自止境中归来
local m = 20232250
local cm = _G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--revive
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.spcon)
e2:SetCost(cm.spcost)
e2:SetOperation(cm.spop)
e2:SetCountLimit(1,m)
c:RegisterEffect(e2)
--act qp in hand
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xdf1))
e3:SetTargetRange(LOCATION_HAND,0)
e3:SetValue(1,m+1)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.confilter(c,tp)
return c:IsReason(REASON_EFFECT) and c:IsSetCard(0xdf1) and c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP)--and c:GetOriginalType()&TYPE_XYZ~=0
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,tp)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,20232100)
local b1=fe
if fe then
local fc=fe:GetHandler()
b1=fe and fc and fc:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
local b2=Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 and (b1 or b2) end
if b1 and (not b2 or Duel.SelectYesNo(tp,fe:GetDescription())) then
Duel.Hint(HINT_CARD,0,20232100)
fe:UseCountLimit(tp)
fe:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1)
e1:SetCondition(cm.spcon2)
e1:SetOperation(cm.spop2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.mcheck(c)
return c:IsCanOverlay() and c:IsSetCard(0xdf1)
end
function cm.spfilter1(c,e,tp,bool)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsSetCard(0xdf1) and (bool or Duel.IsExistingMatchingCard(cm.mcheck,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil)) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.spfilter2(c,e,tp,mc)
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and mc:IsCanBeXyzMaterial(c) and c:IsType(TYPE_XYZ) and c:IsSetCard(0xdf1) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_PZONE,0,1,nil,e,tp,false)
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc1=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_PZONE,0,1,1,nil,e,tp,true):GetFirst()
if sc1 and Duel.SpecialSummon(sc1,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.mcheck),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil):GetFirst()
if mc then
Duel.Overlay(sc1,Group.FromCards(mc))
if Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,sc1) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc2=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,sc1):GetFirst()
if sc2 then
local mg=sc1:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc2,mg)
end
sc2:SetMaterial(Group.FromCards(sc1))
Duel.Overlay(sc2,Group.FromCards(sc1))
Duel.SpecialSummon(sc2,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc2:CompleteProcedure()
end
end
end
end
end
end
\ No newline at end of file
--摩根魔法 棺
local m = 20232253
local cm = _G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP+TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetCondition(aux.dscon)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.cfilter(c,tp)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_XYZ) and c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:IsFaceup()
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,20232100)
local b1=fe
if fe then
local fc=fe:GetHandler()
b1=fe and fc and fc:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
local b2=Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil,tp)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 and (b1 or b2) end
if b1 and (not b2 or Duel.SelectYesNo(tp,fe:GetDescription())) then
Duel.Hint(HINT_CARD,0,20232100)
fe:UseCountLimit(tp)
fe:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
tc:RemoveOverlayCard(tp,1,1,REASON_COST)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetHandler():GetCode()==m then return chkc:IsLocation(LOCATION_MZONE) and aux.NegateMonsterFilter(chkc) and chkc~=e:GetHandler()
else return chkc:IsLocation(LOCATION_MZONE) and aux.NegateMonsterFilter(chkc) end
end
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local tg=Duel.SelectTarget(tp,aux.NegateEffectMonsterFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,tg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,tg,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,e:GetHandler()):Select(tp,1,1,nil):GetFirst()
Duel.Destroy(tc,REASON_EFFECT)
local tc2=Duel.GetFirstTarget()
if tc2:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsCanBeDisabledByEffect(e) then
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_UPDATE_ATTACK)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
e0:SetValue(-800)
tc2:RegisterEffect(e0)
if tc2: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)
tc2: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)
tc2:RegisterEffect(e2)
end
end
end
--摩根魔法 水镜
local m = 20232256
local cm = _G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.cfilter(c,tp)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_XYZ) and c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:IsFaceup()
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,20232100)
local b1=fe
if fe then
local fc=fe:GetHandler()
b1=fe and fc and fc:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
local b2=Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil,tp)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 and (b1 or b2) end
if b1 and (not b2 or Duel.SelectYesNo(tp,fe:GetDescription())) then
Duel.Hint(HINT_CARD,0,20232100)
fe:UseCountLimit(tp)
fe:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
tc:RemoveOverlayCard(tp,1,1,REASON_COST)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.desfilter(c)
return not c:IsCode(m)
end
function cm.remfilter(c,e)
return c:IsFaceup() and c:IsAbleToRemove()
end
function cm.remfilter1(c,e)
if e:GetHandler():GetCode()==m then return c:IsFaceup() and c:IsAbleToRemove() and c~=e:GetHandler()
else return c:IsFaceup() and c:IsAbleToRemove() end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetHandler():GetCode()==m then return chkc:IsLocation(LOCATION_ONFIELD) and cm.remfilter(chkc,e) and chkc~=e:GetHandler() else return chkc:IsLocation(LOCATION_ONFIELD) and cm.remfilter(chkc,e) end
end
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsExistingTarget(cm.remfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectTarget(tp,cm.remfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,e:GetHandler()):Select(tp,1,1,nil):GetFirst()
Duel.Destroy(tc,REASON_EFFECT)
local tc2=Duel.GetFirstTarget()
if tc2:IsRelateToEffect(e) then
Duel.Remove(tc2,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--摩根魔法 湖之加护
local m = 20232259
local cm = _G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.cfilter(c,tp)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_XYZ) and c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:IsFaceup()
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,20232100)
local b1=fe
if fe then
local fc=fe:GetHandler()
b1=fe and fc and fc:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
local b2=Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil,tp)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 and (b1 or b2) end
if b1 and (not b2 or Duel.SelectYesNo(tp,fe:GetDescription())) then
Duel.Hint(HINT_CARD,0,20232100)
fe:UseCountLimit(tp)
fe:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
tc:RemoveOverlayCard(tp,1,1,REASON_COST)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.remfilter(c,tp)
return c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and cm.remfilter(chkc,tp)and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(cm.remfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectTarget(tp,cm.remfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),tp):GetFirst()
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if Duel.SendtoHand(tc,nil,REASON_EFFECT) and tc:IsLocation(LOCATION_HAND) and tc:IsPreviousControler(tp) then
Duel.BreakEffect()
local op=0
local b1=Duel.IsPlayerCanDraw(tp,1)
local b2=Duel.IsExistingMatchingCard(nil,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,2))+1
else end
if op==0 then Duel.Draw(tp,1,REASON_EFFECT)
elseif op==1 then
local tg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,3,nil)
local tgc
if #tg>0 then tgc=tg:GetFirst()
while(tgc)
do
if tgc:GetLocation()==LOCATION_GRAVE then Duel.SendtoDeck(tgc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif tgc:GetLocation()==LOCATION_REMOVED then Duel.SendtoGrave(tgc,REASON_EFFECT)
else end
tgc=tg:GetNext()
end
end
else end
end
end
\ No newline at end of file
--妖精国传说
local m = 20232277
local cm = _G["c"..m]
function cm.initial_effect(c)
--SPECIAL_SUMMON
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target1)
e1:SetOperation(cm.activate1)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.filter1(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xdf0) and c:IsAttackBelow(1500) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,0))
else
op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
end
e:SetLabel(op)
if op==0 then
--Debug.Message(e:GetLabel())
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
else
--Debug.Message(e:GetLabel())
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(e:GetLabel())
if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter1),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g==1 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
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==1 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.filter2(c)
return c:IsSetCard(0xdf1) and c:IsAbleToHand()
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.activate2(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==1 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--伦蒂尼恩的惨剧
local m = 20232280
local cm = _G["c"..m]
function cm.initial_effect(c)
--xyz summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.xyzcon)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.xyztg)
e1:SetOperation(cm.xyzop)
c:RegisterEffect(e1)
--field spell
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.mcheck(c)
return c:IsCanOverlay() and c:IsSetCard(0xdf1)
end
function cm.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT+REASON_DESTROY)
end
function cm.refilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsReleasable() and Duel.IsExistingMatchingCard(cm.xyzfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function cm.xyzfilter(c,e,tp,rc)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xdf1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and
(
(c:IsLocation(LOCATION_GRAVE) and Duel.GetMZoneCount(tp,rc)>0) or
(c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,rc,c)>0)
)
end
function cm.xyzfilter1(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0xdf1) and c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsRankAbove(8)
end
function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_MZONE,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.xyzfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.mcheck,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil)end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rc=Duel.SelectMatchingCard(tp,cm.refilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
if Duel.Release(rc,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.xyzfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,nil):GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(sc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(sc)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.mcheck),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil):GetFirst()
if not mc then return end
Duel.Overlay(sc,Group.FromCards(mc))
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc1=Duel.SelectMatchingCard(tp,cm.xyzfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
local mg=sc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc1,mg)
end
sc1:SetMaterial(Group.FromCards(sc))
Duel.Overlay(sc1,Group.FromCards(sc))
Duel.SpecialSummon(sc1,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc1:CompleteProcedure()
end
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function cm.filter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
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,tp) end
if not Duel.CheckPhaseActivity() then e:SetLabel(1) else e:SetLabel(0) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1) end
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
Duel.ResetFlagEffect(tp,m)
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
--妖精国
local m = 20232300
local cm = _G["c"..m]
function cm.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCost(cm.spcost)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--atk down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(cm.atkcon)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xdf0))
e3:SetValue(-300)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetTarget(aux.TargetBoolFunction(function(c)return c:IsSetCard(0xdf1)and c:IsType(TYPE_XYZ) end))
e4:SetValue(cm.atkval)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0xdf0) 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)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>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.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,0x41)==0x41
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
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 c:IsLevelAbove(8) and c:IsSetCard(0xdf0) 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.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,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 mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter1),tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,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_EXTRA,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.atkfilter(c)
return c:IsSetCard(0xdf0) and c:IsType(TYPE_MONSTER)
end
function cm.atkval(e,c)
local ct=Duel.GetMatchingGroupCount(cm.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)*300
return ct
end
function cm.atkfilter1(c)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsRank(9)
end
function cm.atkcon(e)
return Duel.IsExistingMatchingCard(cm.atkfilter1,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
\ No newline at end of file
--奥克尼
local m = 20232303
local cm = _G["c"..m]
function cm.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.activate1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(m,1))
e3:SetCost(cm.cost2)
e3:SetTarget(cm.target2)
e3:SetOperation(cm.activate2)
c:RegisterEffect(e3)
--xyz summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m+1)
e4:SetCondition(cm.xyzcon)
e4:SetCost(cm.xyzcost)
e4:SetTarget(cm.xyztg)
e4:SetOperation(cm.xyzop)
c:RegisterEffect(e4)
--atk up
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xdf0))
e5:SetValue(300)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e6)
end
function cm.costfilter1(c)
return c:IsSetCard(0xdf1) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter1,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function cm.thfilter1(c)
return c:IsSetCard(0xdf0) and c:IsAbleToHand()
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter1,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
function cm.costfilter2(c)
return c:IsSetCard(0xdf0) and not c:IsSetCard(0xdf1) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter2,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.costfilter2,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function cm.thfilter2(c)
return c:IsSetCard(0xdf1) and c:IsAbleToHand()
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter2,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
function cm.xyzcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT+REASON_DESTROY)
end
function cm.xyzfilter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsRankBelow(8) and c:IsSetCard(0xdf1) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
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,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if sc then
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
--咒之灾厄 科尔努诺斯
local m = 20232350
local cm = _G["c"..m]
function cm.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
c:EnableCounterPermit(0xdf2)
--aux.AddFusionProcFunRep2(c,cm.ffilter,2,63,true)
aux.AddFusionProcFunFun(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xdf0),aux.FilterBoolFunction(Card.IsFusionType,TYPE_EFFECT),2,true)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.fuslimit)
c:RegisterEffect(e0)
--counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCost(cm.ctcost)
e1:SetCondition(cm.ctcon)
e1:SetTarget(cm.cttg)
e1:SetOperation(cm.ctop)
c:RegisterEffect(e1)
--mcheck
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(cm.valcheck)
c:RegisterEffect(e2)
--up atk
local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetLabelObject(e2)
e3:SetValue(cm.satkval)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
--counter and atk down
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,2))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e5:SetCost(cm.atkcost)
e5:SetOperation(cm.atkop)
c:RegisterEffect(e5)
--destroy replace
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetCode(EFFECT_DESTROY_REPLACE)
e6:SetRange(LOCATION_MZONE)
e6:SetTarget(cm.reptg)
e6:SetOperation(cm.repop)
c:RegisterEffect(e6)
--leave
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_LEAVE_FIELD_P)
e9:SetOperation(cm.damp)
c:RegisterEffect(e9)
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(m,4))
e10:SetCode(EVENT_LEAVE_FIELD)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetCategory(CATEGORY_TOEXTRA+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON)
e10:SetLabelObject(e9)
e10:SetCondition(cm.lfcon)
e10:SetTarget(cm.lftg)
e10:SetCountLimit(1,m)
e10:SetOperation(cm.lfop)
c:RegisterEffect(e10)
--add counter
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(m,6))
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_PHASE+PHASE_END)
e11:SetRange(LOCATION_MZONE)
e11:SetCountLimit(1,m+1)
e11:SetTarget(cm.cttg1)
e11:SetOperation(cm.ctop1)
c:RegisterEffect(e11)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
--[[function cm.ffilter(c,fc,sub,mg,sg)
return not sg or not sg:IsExists(Card.IsFusionCode,1,c,c:GetFusionCode())
end]]
function cm.counterfilter(c)
return c:IsSetCard(0xdf0)
end
function cm.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.splimit(e,c)
return not c:IsSetCard(0xdf0)
end
function cm.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanAddCounter(0xdf2,7) end
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(0xdf2,7)
end
end
function cm.valcheck(e,c)
local mg=c:GetMaterial()
local mg1=mg:Filter(Card.IsLocation,nil,LOCATION_ONFIELD)
e:SetLabel(#mg1)
end
function cm.satkval(e)
return (e:GetHandler():GetCounter(0xdf2)+e:GetLabelObject():GetLabel())*400
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m)==0 and c:IsCanRemoveCounter(tp,0xdf2,1,REASON_COST) end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
c:RemoveCounter(tp,0xdf2,1,REASON_COST)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-300)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
Duel.RegisterEffect(e2,tp)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
and c:IsCanRemoveCounter(tp,0xdf2,2,REASON_EFFECT)
end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveCounter(tp,0xdf2,2,REASON_EFFECT)
end
function cm.damp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0xdf2)
e:SetLabel(ct)
end
function cm.gcheck(c,e,tp,check)
return c:IsSetCard(0xdf0) and c:IsType(TYPE_MONSTER)
and (c:IsAbleToHand() or check and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function cm.lfcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT)
end
function cm.lftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.gcheck,tp,LOCATION_GRAVE,0,1,nil,e,tp,true) end
local ct=e:GetLabelObject():GetLabel()
if ct>0 then
e:SetCategory(CATEGORY_TOEXTRA+CATEGORY_RECOVER+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*300)
end
end
function cm.lfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsExtraDeckMonster() and Duel.SendtoDeck(c,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_EXTRA)) then return end
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.gcheck),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,check)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or not check
or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
local ct=e:GetLabelObject():GetLabel()
if ct>0 then
Duel.Recover(tp,ct*300,REASON_EFFECT)
end
end
function cm.cttg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanAddCounter(0xdf2,2) end
end
function cm.ctop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(0xdf2,2)
end
end
--女王的玉座
local m = 20232353
local cm = _G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.mat,1,1)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
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:SetCountLimit(1,m)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
--[[ --cannot be effect target
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(cm.etlimit)
e3:SetValue(cm.cnbtgval)
c:RegisterEffect(e3)]]
end
function cm.mat(c)
return c:IsLinkSetCard(0xdf0)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter(c)
return c:IsSetCard(0xdf0) 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)
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>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.etlimit(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c) and c:IsType(TYPE_XYZ) and c:IsSetCard(0xdf1) and c:IsType(TYPE_MONSTER)
end
function cm.cnbtgval(e,re,rp)
return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER)
end
function cm.efilter(e,te)
return te:IsActiveType(TYPE_SPELL)and te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
......@@ -414,14 +414,6 @@
!setname 0x9c92 枝江
!setname 0xc99 ReLive
#摆 1367757721 202 0xdf0-0xdff
!setname 0xdf0 妖精国
!setname 0xdf1 Morgan
#AddCodeList(20232015) 妖精国骑士 兰斯洛特卡名记述
#AddCodeList(20232056) 妖精国骑士 高文卡名记述
#AddCodeList(20232103) 妖精国骑士 特里斯坦卡名记述
!counter 0xdf2 咒层指示物
#演示白板 178434020 210 0x600-0x60f
!setname 0x601 道明寺歌鈴
!setname 0x602 神崎兰子
......
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