Commit d30d2780 authored by songtongtong's avatar songtongtong

update 10.26

parent 93839bed
--砾岩玄陆-镇冥砾岩巨龟 --砾岩玄陆-镇冥砾岩巨龟
local m=33331712 local m=33331712
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit) e1:SetValue(cm.splimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.spcon) e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg) e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop) e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--flip --flip
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1)) e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_REMOVE) e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_FLIP) e3:SetCode(EVENT_FLIP)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetTarget(cm.destg) e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop) e3:SetOperation(cm.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.splimit(e,se,sp,st) function cm.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS) return se:IsHasType(EFFECT_TYPE_ACTIONS)
end end
function cm.cfilter(c,tp) function cm.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_DECK+LOCATION_HAND) and c:IsType(TYPE_MONSTER) and c:IsPreviousControler(tp) return c:IsPreviousLocation(LOCATION_DECK+LOCATION_HAND) and c:IsType(TYPE_MONSTER) and c:IsPreviousControler(tp)
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,1-tp) return eg:IsExists(cm.cfilter,1,nil,1-tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
end end
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,2,nil) local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,3,0,0)
local tc= g:GetFirst() local tc= g:GetFirst()
while tc do while tc do
Duel.SetChainLimit(cm.limit(tc)) Duel.SetChainLimit(cm.limit(tc))
tc=g:GetNext() tc=g:GetNext()
end end
end end
function cm.limit(c) function cm.limit(c)
return function (e,lp,tp) return function (e,lp,tp)
return e:GetHandler()~=c return e:GetHandler()~=c
end end
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
tc=g:GetNext() tc=g:GetNext()
end end
end end
end end
\ No newline at end of file
--五河士道 暴走形态 --五河士道 暴走形态
local m=33401309 local m=33401309
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcMix(c,false,true,cm.fusfilter1,cm.fusfilter2,cm.fusfilter2,cm.fusfilter2,cm.fusfilter5) aux.AddFusionProcMix(c,false,true,cm.fusfilter1,cm.fusfilter2,cm.fusfilter2,cm.fusfilter2,cm.fusfilter5)
--spsummon condition --spsummon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit) e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--activate from hand --activate from hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x341,0x340)) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x341,0x340))
e1:SetTargetRange(LOCATION_HAND,0) e1:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND) e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2) c:RegisterEffect(e2)
-- --
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1)) e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m) e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg) e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop) e3:SetOperation(cm.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--copy --copy
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_QUICK_O) e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetDescription(aux.Stringid(m,2)) e6:SetDescription(aux.Stringid(m,2))
e6:SetCode(EVENT_FREE_CHAIN) e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_MZONE) e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1,m+10000) e6:SetCountLimit(1,m+10000)
e6:SetTarget(cm.cptg) e6:SetTarget(cm.cptg)
e6:SetOperation(cm.cpop) e6:SetOperation(cm.cpop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function cm.fusfilter1(c) function cm.fusfilter1(c)
return c:IsSetCard(0xc342) return c:IsSetCard(0xc342)
end end
function cm.fusfilter2(c) function cm.fusfilter2(c)
return c:IsSetCard(0x341) and (c:IsFusionType(TYPE_SYNCHRO+TYPE_FUSION+TYPE_XYZ) or (c:IsLinkAbove(2) and c:IsFusionType(TYPE_LINK))) return c:IsSetCard(0x341) and (c:IsFusionType(TYPE_SYNCHRO+TYPE_FUSION+TYPE_XYZ) or (c:IsLinkAbove(2) and c:IsFusionType(TYPE_LINK)))
end end
function cm.fusfilter5(c) function cm.fusfilter5(c)
return c:IsSetCard(0x341) return c:IsSetCard(0x341)
end end
function cm.thfilter1(c) function cm.thfilter1(c)
return c:IsSetCard(0xc342) and c:IsAbleToHand() return c:IsSetCard(0xc342) and c:IsAbleToHand()
end end
function cm.thfilter2(c) function cm.thfilter2(c)
return c:IsSetCard(0x340) and c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_SPELL) and not c:IsForbidden() return c:IsSetCard(0x340) and c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_SPELL) and not c:IsForbidden()
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.thfilter1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
end end
if Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then if Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0))
local g=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if #g>0 then if #g>0 then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end end
end end
end
function cm.matfilter(c)
return c:IsOriginalSetCard(0x341) and c:IsType(TYPE_MONSTER) function cm.matfilter(c)
end return c:IsOriginalSetCard(0x341) and c:IsType(TYPE_MONSTER)
function cm.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.matfilter,tp,LOCATION_EXTRA+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end function cm.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end if chk==0 then return Duel.IsExistingMatchingCard(cm.matfilter,tp,LOCATION_EXTRA+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
function cm.cpop(e,tp,eg,ep,ev,re,r,rp) end
local c=e:GetHandler() function cm.cpop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local cg=Duel.SelectMatchingCard(tp,cm.matfilter,tp,LOCATION_EXTRA+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
if cg:GetCount()==0 then return end local cg=Duel.SelectMatchingCard(tp,cm.matfilter,tp,LOCATION_EXTRA+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.ConfirmCards(1-tp,cg) if cg:GetCount()==0 then return end
local code=cg:GetFirst():GetOriginalCode() Duel.ConfirmCards(1-tp,cg)
local e1=Effect.CreateEffect(c) local code=cg:GetFirst():GetOriginalCode()
e1:SetType(EFFECT_TYPE_SINGLE) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetLabel(tp) e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetLabel(tp)
c:RegisterEffect(e1) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:CopyEffect(code,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,1) c:RegisterEffect(e1)
c:RegisterFlagEffect(33401301,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) c:CopyEffect(code,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,1)
c:RegisterFlagEffect(33401301,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end end
\ No newline at end of file
--GGO 二刀流-桐子 --GGO 二刀流-桐子
local m=33500502 local m=33500502
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--negate --negate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
e1:SetCondition(cm.discon) e1:SetCondition(cm.discon)
e1:SetTarget(cm.distg) e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop) e1:SetOperation(cm.disop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon from szone --spsummon from szone
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m+10000) e2:SetCountLimit(1,m+10000)
e2:SetHintTiming(0,TIMING_MAIN_END) e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCondition(cm.spcon1) e2:SetCondition(cm.spcon1)
e2:SetTarget(cm.target) e2:SetTarget(cm.target)
e2:SetOperation(cm.operation) e2:SetOperation(cm.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
--e1 --e1
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and ep==1-tp return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and ep==1-tp
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_EXTRA,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_ONFIELD)
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then local g=Duel.SelectMatchingCard(tp,cm.exfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if g:GetCount()>0 then
local g=Duel.SelectMatchingCard(tp,cm.exfilter,tp,LOCATION_EXTRA,0,1,1,nil) if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
if g:GetCount()>0 then Duel.NegateActivation(ev)
-- Duel.HintSelection(g) end
-- Duel.Destroy(g,REASON_EFFECT) end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end
end function cm.exfilter(c)
end return c:IsSetCard(0x5a2) and c:IsAbleToRemove()
end end
function cm.exfilter(c) --e2
return c:IsSetCard(0x5a2) and c:IsAbleToRemove(POS_FACEUP) function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
end local ph=Duel.GetCurrentPhase()
--e2 return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp) end
local ph=Duel.GetCurrentPhase() function cm.filter(c)
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS return c:IsSetCard(0x5a2) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end end
function cm.filter(c) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsSetCard(0x5a2) and c:IsType(TYPE_MONSTER) and not c:IsForbidden() if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_REMOVED,0,1,nil)
end and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_REMOVED,0,1,nil) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end local c=e:GetHandler()
end if Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
function cm.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local c=e:GetHandler() local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_REMOVED,0,1,1,nil)
if Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then local tc=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) if tc then
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local tc=g:GetFirst() local e1=Effect.CreateEffect(c)
if tc then e1:SetCode(EFFECT_CHANGE_TYPE)
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) e1:SetType(EFFECT_TYPE_SINGLE)
local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) tc:RegisterEffect(e1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) end
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS) local bg=Duel.GetMatchingGroupCount(cm.tgfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil)*500
tc:RegisterEffect(e1) Duel.Damage(1-tp,bg,REASON_EFFECT)
end end
local bg=Duel.GetMatchingGroupCount(cm.tgfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil)*500 end
Duel.Damage(1-tp,bg,REASON_EFFECT) function cm.tgfilter(c)
end return c:IsSetCard(0x5a2)
end
function cm.tgfilter(c)
return c:IsSetCard(0x5a2)
end end
\ No newline at end of file
--祖先的最后仪式 --祖先的最后仪式
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,64800172) aux.AddCodeList(c,64800172)
--Activate --Activate
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES) e0:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN) e0:SetCode(EVENT_FREE_CHAIN)
e0:SetTarget(s.target) e0:SetTarget(s.target)
e0:SetOperation(s.activate) e0:SetOperation(s.activate)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--token --token
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetLabel(0) e1:SetLabel(0)
e1:SetCost(s.cost) e1:SetCost(s.cost)
e1:SetTarget(s.mtg) e1:SetTarget(s.mtg)
e1:SetOperation(s.mop) e1:SetOperation(s.mop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--MJspsm --MJspsm
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND) e2:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetLabel(1) e2:SetLabel(1)
e2:SetCost(s.cost) e2:SetCost(s.cost)
e2:SetTarget(s.stg) e2:SetTarget(s.stg)
e2:SetOperation(s.sop) e2:SetOperation(s.sop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
--e1 --e1
function s.cfilter(c,e,tp) function s.cfilter(c,e,tp)
return c:IsCode(64800172) return c:IsCode(64800172)
end end
function s.mfilter(c) function s.mfilter(c)
return c:IsCode(64800172) and c:IsAbleToGrave() return c:IsCode(64800172) and c:IsAbleToGrave()
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_DECK,0,nil):GetFirst() local mg2=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_DECK,0,nil):GetFirst()
local mg3=Duel.GetRitualMaterial(tp):Filter(Card.IsLevelBelow,nil,7) local mg3=Duel.GetRitualMaterial(tp):Filter(Card.IsLevelBelow,nil,7)
return Duel.IsExistingMatchingCard(s.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,nil,e,tp,mg1,mg2,Card.GetLevel,"Greater") or Duel.IsExistingMatchingCard(s.RitualUltimateFilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,s.cfilter,e,tp,mg3,nil,Card.GetLevel,"Greater") return Duel.IsExistingMatchingCard(s.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,nil,e,tp,mg1,mg2,Card.GetLevel,"Greater") or Duel.IsExistingMatchingCard(s.RitualUltimateFilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,s.cfilter,e,tp,mg3,nil,Card.GetLevel,"Greater")
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_DECK)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_DECK,0,nil) local mg2=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_DECK,0,nil)
local mg3=Duel.GetRitualMaterial(tp):Filter(Card.IsLevelBelow,nil,7) local mg3=Duel.GetRitualMaterial(tp):Filter(Card.IsLevelBelow,nil,7)
local g=Duel.GetMatchingGroup(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,nil,nil,e,tp,mg1,mg2,Card.GetLevel,"Greater") local g=Duel.GetMatchingGroup(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,nil,nil,e,tp,mg1,mg2,Card.GetLevel,"Greater")
local g1=Duel.GetMatchingGroup(s.RitualUltimateFilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,s.cfilter,e,tp,mg3,nil,Card.GetLevel,"Greater") local g1=Duel.GetMatchingGroup(s.RitualUltimateFilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,s.cfilter,e,tp,mg3,nil,Card.GetLevel,"Greater")
g:Merge(g1) g:Merge(g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst() local tc=g:Select(tp,1,1,nil):GetFirst()
if tc and tc:IsLocation(LOCATION_DECK) then if tc and tc:IsLocation(LOCATION_DECK) then
mg3=mg3:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg3=mg3:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then if tc.mat_filter then
mg3=mg3:Filter(tc.mat_filter,tc,tp) mg3=mg3:Filter(tc.mat_filter,tc,tp)
else else
mg3:RemoveCard(tc) mg3:RemoveCard(tc)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater") aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg3:SelectSubGroup(tp,s.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater") local mat=mg3:SelectSubGroup(tp,s.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
else else
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc) local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:AddCard(mg2) mg:Merge(mg2)
if tc.mat_filter then if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp) mg=mg:Filter(tc.mat_filter,tc,tp)
else else
mg:RemoveCard(tc) mg:RemoveCard(tc)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater") aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,s.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater") local mat=mg:SelectSubGroup(tp,s.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_DECK):Filter(s.mfilter,nil) local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_DECK):Filter(s.mfilter,nil)
mat:Sub(mat2) mat:Sub(mat2)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.SendtoGrave(mat2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL) Duel.SendtoGrave(mat2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
--e2 --e2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(id,e:GetLabel())) Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(id,e:GetLabel()))
end end
function s.thfilter1(c,ec) function s.thfilter1(c,ec)
local ce=c:GetReasonEffect() local ce=c:GetReasonEffect()
return c:IsAbleToHand() and ce and ce:GetHandler()==ec and c:IsType(TYPE_MONSTER) return c:IsAbleToHand() and ce and ce:GetHandler()==ec and c:IsType(TYPE_MONSTER)
end end
function s.mtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.mtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) and e:GetHandler():IsAbleToRemove() end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) and e:GetHandler():IsAbleToRemove() end
local g=Duel.GetMatchingGroup(s.thfilter1,tp,LOCATION_GRAVE,0,nil,e:GetHandler()) local g=Duel.GetMatchingGroup(s.thfilter1,tp,LOCATION_GRAVE,0,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end end
function s.mop(e,tp,eg,ep,ev,re,r,rp) function s.mop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) and Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT) then if Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) and Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,s.thfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
end end
end end
function s.thfilter2(c) function s.thfilter2(c)
return c:IsAbleToRemove() and c:IsType(TYPE_MONSTER) return c:IsAbleToRemove() and c:IsType(TYPE_MONSTER)
end end
function s.stg(e,tp,eg,ep,ev,re,r,rp,chk) function s.stg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_GRAVE,0,1,nil) and e:GetHandler():IsAbleToHand() end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_GRAVE,0,1,nil) and e:GetHandler():IsAbleToHand() end
local g=Duel.GetMatchingGroup(s.thfilter2,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(s.thfilter2,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function s.sop(e,tp,eg,ep,ev,re,r,rp) function s.sop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(g)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT) then if Duel.Remove(g,POS_FACEUP,REASON_EFFECT) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end end
end end
------------------------------------------------------------------------ ------------------------------------------------------------------------
function s.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk) function s.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c) local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
if m2 then if m2 then
mg:AddCard(m2) mg:AddCard(m2)
end end
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,c,tp) mg=mg:Filter(c.mat_filter,c,tp)
else else
mg:RemoveCard(c) mg:RemoveCard(c)
end end
local lv=level_function(c) local lv=level_function(c)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal) Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(Auxiliary.RitualCheck,1,lv,tp,c,lv,greater_or_equal) local res=mg:CheckSubGroup(Auxiliary.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
Auxiliary.GCheckAdditional=nil Auxiliary.GCheckAdditional=nil
return res return res
end end
function s.dcfilter(c) function s.dcfilter(c)
return c:IsCode(64800172) and c:IsLocation(LOCATION_DECK) return c:IsCode(64800172) and c:IsLocation(LOCATION_DECK)
end end
function s.RitualCheck(g,tp,c,lv,greater_or_equal) function s.RitualCheck(g,tp,c,lv,greater_or_equal)
return Auxiliary["RitualCheck"..greater_or_equal](g,c,lv) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp)) return Auxiliary["RitualCheck"..greater_or_equal](g,c,lv) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp))
and (not Auxiliary.RCheckAdditional or Auxiliary.RCheckAdditional(tp,g,c)) and (not Auxiliary.RCheckAdditional or Auxiliary.RCheckAdditional(tp,g,c))
and g:Filter(s.dcfilter,nil):GetCount()<=1 and g:Filter(s.dcfilter,nil):GetCount()<=1
end end
\ No newline at end of file
--梦见 --梦见
yume=yume or {} yume=yume or {}
yume.temp_card_field=yume.temp_card_field or {} yume.temp_card_field=yume.temp_card_field or {}
if c71400001 then if c71400001 then
function c71400001.initial_effect(c) function c71400001.initial_effect(c)
--Activate(nofield) --Activate(nofield)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400001,2)) e1:SetDescription(aux.Stringid(71400001,2))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c71400001.tg1) e1:SetTarget(c71400001.tg1)
e1:SetCost(c71400001.cost) e1:SetCost(c71400001.cost)
e1:SetOperation(c71400001.op1) e1:SetOperation(c71400001.op1)
e1:SetCountLimit(1,71400001+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,71400001+EFFECT_COUNT_CODE_OATH)
e1:SetCategory(0) e1:SetCategory(0)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c71400001.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c71400001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500) Duel.PayLPCost(tp,500)
end end
function c71400001.tg1(e,tp,eg,ep,ev,re,r,rp,chk) function c71400001.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=yume.YumeFieldCheck(tp,0,1) local b1=yume.YumeFieldCheck(tp,0,1)
local b2=yume.IsYumeFieldOnField(tp) and Duel.IsExistingMatchingCard(c71400001.filter,tp,LOCATION_DECK,0,1,nil) local b2=yume.IsYumeFieldOnField(tp) and Duel.IsExistingMatchingCard(c71400001.filter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
local op=0 local op=0
if b1 and b2 then if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(71400001,2),aux.Stringid(71400001,0)) op=Duel.SelectOption(tp,aux.Stringid(71400001,2),aux.Stringid(71400001,0))
elseif b1 then elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(71400001,2)) op=Duel.SelectOption(tp,aux.Stringid(71400001,2))
else else
op=Duel.SelectOption(tp,aux.Stringid(71400001,0))+1 op=Duel.SelectOption(tp,aux.Stringid(71400001,0))+1
end end
if op==0 then if op==0 then
e:SetCategory(0) e:SetCategory(0)
if not Duel.CheckPhaseActivity() then e:SetLabel(1,op) else e:SetLabel(0,op) end if not Duel.CheckPhaseActivity() then e:SetLabel(1,op) else e:SetLabel(0,op) end
else else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
end end
function c71400001.op1(e,tp,eg,ep,ev,re,r,rp) function c71400001.op1(e,tp,eg,ep,ev,re,r,rp)
local act,op=e:GetLabel() local act,op=e:GetLabel()
if op==0 then if op==0 then
yume.ActivateYumeField(e,tp,nil,1) yume.ActivateYumeField(e,tp,nil,1)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400001.filter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c71400001.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
end end
function c71400001.filter(c) function c71400001.filter(c)
return c:IsSetCard(0x714) and c:IsAbleToHand() and not c:IsCode(71400001) return c:IsSetCard(0x714) and c:IsAbleToHand() and not c:IsCode(71400001)
end end
end end
--global part --global part
table=require("table") table=require("table")
yume.RustFlag=false function yume.AddYumeSummonLimit(c,ssm)
function yume.AddYumeSummonLimit(c,ssm) --1=special summon monster, 0=non special summon monster
--1=special summon monster, 0=non special summon monster ssm=ssm or 0
ssm=ssm or 0 local el1=Effect.CreateEffect(c)
local el1=Effect.CreateEffect(c) el1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
el1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) el1:SetType(EFFECT_TYPE_SINGLE)
el1:SetType(EFFECT_TYPE_SINGLE) el1:SetCode(EFFECT_SPSUMMON_CONDITION)
el1:SetCode(EFFECT_SPSUMMON_CONDITION) el1:SetValue(yume.YumeCheck)
el1:SetValue(yume.YumeCheck) c:RegisterEffect(el1)
c:RegisterEffect(el1) if ssm==0 then
if ssm==0 then local el2=Effect.CreateEffect(c)
local el2=Effect.CreateEffect(c) el2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
el2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) el2:SetType(EFFECT_TYPE_SINGLE)
el2:SetType(EFFECT_TYPE_SINGLE) el2:SetCode(EFFECT_CANNOT_MSET)
el2:SetCode(EFFECT_CANNOT_MSET) el2:SetCondition(yume.YumeCheck2)
el2:SetCondition(yume.YumeCheck2) c:RegisterEffect(el2)
c:RegisterEffect(el2) local el3=el2:Clone()
local el3=el2:Clone() el3:SetCode(EFFECT_CANNOT_SUMMON)
el3:SetCode(EFFECT_CANNOT_SUMMON) c:RegisterEffect(el3)
c:RegisterEffect(el3) else
else c:EnableReviveLimit()
c:EnableReviveLimit() end
end end
end function yume.GetValueType(v)
function yume.GetValueType(v) local t=type(v)
local t=type(v) if t=="userdata" then
if t=="userdata" then local mt=getmetatable(v)
local mt=getmetatable(v) if mt==Group then return "G"
if mt==Group then return "G" elseif mt==Effect then return "E"
elseif mt==Effect then return "E" else return "C" end
else return "C" end else return t end
else return t end end
end function yume.YumeCheckFilter(c)
function yume.YumeCheckFilter(c) return c:IsFaceup() and c:IsSetCard(0x3714) and c:IsType(TYPE_FIELD)
return c:IsFaceup() and c:IsSetCard(0x3714) and c:IsType(TYPE_FIELD) end
end function yume.IsYumeFieldOnField(tp)
function yume.IsYumeFieldOnField(tp) local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) return fc and yume.YumeCheckFilter(fc)
return fc and yume.YumeCheckFilter(fc) end
end --[[
--[[ Yume SpSummon check
Yume SpSummon check v in effect = spsummon condition value(return true = can summon)
v in effect = spsummon condition value(return true = can summon) v in card = material filter generator(return true = can summon, se = set check)
v in card = material filter generator(return true = can summon, se = set check) --]]
--]] function yume.YumeCheck(v,se,sp)
function yume.YumeCheck(v,se,sp) local t=yume.GetValueType(v)
local t=yume.GetValueType(v) if t=="E" then
if t=="E" then return yume.IsYumeFieldOnField(sp)
return yume.IsYumeFieldOnField(sp) elseif t=="C" then
elseif t=="C" then if se==true then
if se==true then return function(c)
return function(c) return c:IsSetCard(0x714) and yume.IsYumeFieldOnField(v:GetControler())
return c:IsSetCard(0x714) and yume.IsYumeFieldOnField(v:GetControler()) end
end else return function(c)
else return function(c) return yume.IsYumeFieldOnField(v:GetControler())
return yume.IsYumeFieldOnField(v:GetControler()) end
end end
end end
end end
end --[[
--[[ Yume Link Material group filter generator
Yume Link Material group filter generator return true = can summon
return true = can summon --]]
--]] function yume.YumeLMGFilterFunction(c)
function yume.YumeLMGFilterFunction(c) return function(g) return yume.IsYumeFieldOnField(c:GetControler()) and g:IsExists(Card.IsLinkSetCard,1,nil,0x714) end
return function(g) return yume.IsYumeFieldOnField(c:GetControler()) and g:IsExists(Card.IsLinkSetCard,1,nil,0x714) end end
end --[[
--[[ Yume Summon/Set check
Yume Summon/Set check return true = cannot summon
return true = cannot summon --]]
--]] function yume.YumeCheck2(e)
function yume.YumeCheck2(e) return not yume.IsYumeFieldOnField(e:GetHandler():GetControler())
return not yume.IsYumeFieldOnField(e:GetHandler():GetControler()) end
end --Yume Condition
--Yume Condition function yume.YumeCon(e,tp)
function yume.YumeCon(e,tp) if not tp then tp=e:GetHandlerPlayer() end
if not tp then tp=e:GetHandlerPlayer() end return yume.IsYumeFieldOnField(tp)
return yume.IsYumeFieldOnField(tp) end
end function yume.nonYumeCon(e,tp,eg,ep,ev,re,r,rp)
function yume.nonYumeCon(e,tp,eg,ep,ev,re,r,rp) if not tp then tp=e:GetHandlerPlayer() end
if not tp then tp=e:GetHandlerPlayer() end return not yume.IsYumeFieldOnField(tp)
return not yume.IsYumeFieldOnField(tp) end
end function yume.RustCon(e,tp)
function yume.RustCon(e,tp) if not tp then tp=e:GetHandlerPlayer() end
if not tp then tp=e:GetHandlerPlayer() end return yume.IsRust(tp)
return yume.IsRust(tp) end
end function yume.nonRustCon(e,tp)
function yume.nonRustCon(e,tp) if not tp then tp=e:GetHandlerPlayer() end
if not tp then tp=e:GetHandlerPlayer() end return not yume.IsRust(tp)
return not yume.IsRust(tp) end
end function yume.IsRust(tp)
function yume.IsRust(tp) return Duel.GetFlagEffect(tp,71400038)>0
return Duel.GetFlagEffect(tp,71400038)>0 end
end --ft=field type, 0-All Yume 1-Visionary Yume 2-Structured Yume
--ft=field type, 0-All Yume 1-Visionary Yume 2-Structured Yume --loc=location
--loc=location function yume.AddYumeFieldGlobal(c,id,ft)
function yume.AddYumeFieldGlobal(c,id,ft) ft=ft or 0
ft=ft or 0 if not id then return end
if not id then return end yume.temp_card_field[c]=yume.temp_card_field[c] or {}
yume.temp_card_field[c]=yume.temp_card_field[c] or {} yume.temp_card_field[c].id=id
yume.temp_card_field[c].id=id yume.temp_card_field[c].ft=ft
yume.temp_card_field[c].ft=ft --Activate
--Activate local eac=Effect.CreateEffect(c)
local eac=Effect.CreateEffect(c) eac:SetType(EFFECT_TYPE_ACTIVATE)
eac:SetType(EFFECT_TYPE_ACTIVATE) eac:SetCode(EVENT_FREE_CHAIN)
eac:SetCode(EVENT_FREE_CHAIN) eac:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
eac:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) c:RegisterEffect(eac)
c:RegisterEffect(eac) --[[
--[[ --self to deck
--self to deck local esd1=Effect.CreateEffect(c)
local esd1=Effect.CreateEffect(c) esd1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
esd1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) esd1:SetCode(EVENT_CHAINING)
esd1:SetCode(EVENT_CHAINING) esd1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
esd1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) esd1:SetRange(LOCATION_FZONE)
esd1:SetRange(LOCATION_FZONE) esd1:SetOperation(aux.chainreg)
esd1:SetOperation(aux.chainreg) c:RegisterEffect(esd1)
c:RegisterEffect(esd1) local esd2=Effect.CreateEffect(c)
local esd2=Effect.CreateEffect(c) esd2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
esd2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) esd2:SetCode(EVENT_CHAIN_SOLVED)
esd2:SetCode(EVENT_CHAIN_SOLVED) esd2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
esd2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) esd2:SetRange(LOCATION_FZONE)
esd2:SetRange(LOCATION_FZONE) esd2:SetOperation(yume.SelfToDeckOp)
esd2:SetOperation(yume.SelfToDeckOp) c:RegisterEffect(esd2)
c:RegisterEffect(esd2) --]]
--]] --activate field
--activate field local efa=Effect.CreateEffect(c)
local efa=Effect.CreateEffect(c) efa:SetDescription(aux.Stringid(71400001,2))
efa:SetDescription(aux.Stringid(71400001,2)) efa:SetCategory(EFFECT_TYPE_ACTIVATE)
efa:SetCategory(EFFECT_TYPE_ACTIVATE) efa:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
efa:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) efa:SetCode(EVENT_LEAVE_FIELD)
efa:SetCode(EVENT_LEAVE_FIELD) efa:SetRange(LOCATION_FZONE)
efa:SetRange(LOCATION_FZONE) efa:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
efa:SetProperty(EFFECT_FLAG_DAMAGE_STEP) efa:SetCondition(yume.ActivateFieldCon)
efa:SetCondition(yume.ActivateFieldCon) efa:SetOperation(yume.ActivateFieldOp)
efa:SetOperation(yume.ActivateFieldOp) c:RegisterEffect(efa)
c:RegisterEffect(efa) end
end --[[
--[[ --Self To Deck
--Self To Deck function yume.SelfToDeckOp(e,tp,eg,ep,ev,re,r,rp)
function yume.SelfToDeckOp(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler()
local c=e:GetHandler() if not re:GetHandler():IsSetCard(0x714) and rp==tp and c:GetFlagEffect(1)>0 then
if not re:GetHandler():IsSetCard(0x714) and rp==tp and c:GetFlagEffect(1)>0 then Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.SendtoDeck(c,nil,2,REASON_EFFECT) end
end end
end --]]
--]] function yume.AddYumeWeaponGlobal(c)
function yume.AddYumeWeaponGlobal(c) --set
--set local e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(71400001,1))
e1:SetDescription(aux.Stringid(71400001,1)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_GRAVE)
e1:SetRange(LOCATION_GRAVE) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1)
e1:SetCountLimit(1) e1:SetCondition(yume.YumeCon)
e1:SetCondition(yume.YumeCon) e1:SetCost(yume.WeaponSetCost)
e1:SetCost(yume.WeaponSetCost) e1:SetTarget(yume.WeaponSetTg)
e1:SetTarget(yume.WeaponSetTg) e1:SetOperation(yume.WeaponSetOp)
e1:SetOperation(yume.WeaponSetOp) c:RegisterEffect(e1)
c:RegisterEffect(e1) end
end --activate field
--activate field function yume.WeaponSetCostFilter(c)
function yume.WeaponSetCostFilter(c) return c:IsSetCard(0x714) and c:IsDiscardable()
return c:IsSetCard(0x714) and c:IsDiscardable() end
end function yume.WeaponSetCost(e,tp,eg,ep,ev,re,r,rp,chk)
function yume.WeaponSetCost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(yume.WeaponSetCostFilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(yume.WeaponSetCostFilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,yume.WeaponSetCostFilter,1,1,REASON_COST+REASON_DISCARD)
Duel.DiscardHand(tp,yume.WeaponSetCostFilter,1,1,REASON_COST+REASON_DISCARD) end
end function yume.WeaponSetTg(e,tp,eg,ep,ev,re,r,rp,chk)
function yume.WeaponSetTg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsSSetable() end
if chk==0 then return e:GetHandler():IsSSetable() end Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end
end function yume.WeaponSetOp(e,tp,eg,ep,ev,re,r,rp)
function yume.WeaponSetOp(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler()
local c=e:GetHandler() if c:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) then Duel.SSet(tp,c)
Duel.SSet(tp,c) end
end end
end function yume.YumeFieldCheck(tp,id,ft,loc)
function yume.YumeFieldCheck(tp,id,ft,loc) ft=ft or 0
ft=ft or 0 id=id or 0
id=id or 0 loc=loc or LOCATION_DECK
loc=loc or LOCATION_DECK return Duel.IsExistingMatchingCard(yume.ActivateFieldFilter,tp,loc,0,1,nil,tp,id,ft)
return Duel.IsExistingMatchingCard(yume.ActivateFieldFilter,tp,loc,0,1,nil,tp,id,ft) end
end function yume.YumeFieldCheckTarget(id,ft,loc)
function yume.YumeFieldCheckTarget(id,ft,loc) return function(e,tp,eg,ep,ev,re,r,rp,chk)
return function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return yume.YumeFieldCheck(tp,id,ft,loc) end
if chk==0 then return yume.YumeFieldCheck(tp,id,ft,loc) end if not Duel.CheckPhaseActivity() then e:SetLabel(1) else e:SetLabel(0) end
if not Duel.CheckPhaseActivity() then e:SetLabel(1) else e:SetLabel(0) end end
end end
end function yume.ActivateYumeField(e,tp,id,ft,loc)
function yume.ActivateYumeField(e,tp,id,ft,loc) ft=ft or 0
ft=ft or 0 id=id or 0
id=id or 0 loc=loc or LOCATION_DECK
loc=loc or LOCATION_DECK local tc
local tc Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(71400001,3))
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(71400001,3)) if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,15248873,RESET_CHAIN,0,1) end
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,15248873,RESET_CHAIN,0,1) end if loc&LOCATION_GRAVE~=0 and loc~=LOCATION_GRAVE then
if loc&LOCATION_GRAVE~=0 and loc~=LOCATION_GRAVE then tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(yume.ActivateFieldFilter),tp,loc,0,1,1,nil,tp,id,ft):GetFirst()
tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(yume.ActivateFieldFilter),tp,loc,0,1,1,nil,tp,id,ft):GetFirst() else
else tc=Duel.SelectMatchingCard(tp,yume.ActivateFieldFilter,tp,loc,0,1,1,nil,tp,id,ft):GetFirst()
tc=Duel.SelectMatchingCard(tp,yume.ActivateFieldFilter,tp,loc,0,1,1,nil,tp,id,ft):GetFirst() end
end Duel.ResetFlagEffect(tp,15248873)
Duel.ResetFlagEffect(tp,15248873) if tc then
if tc then local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) if fc then
if fc then Duel.SendtoGrave(fc,REASON_RULE)
Duel.SendtoGrave(fc,REASON_RULE) Duel.BreakEffect()
Duel.BreakEffect() end
end Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) local te=tc:GetActivateEffect()
local te=tc:GetActivateEffect() te:UseCountLimit(tp,1,true)
te:UseCountLimit(tp,1,true) local tep=tc:GetControler()
local tep=tc:GetControler() local cost=te:GetCost()
local cost=te:GetCost() if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain()) return tc
return tc end
end return nil
return nil end
end function yume.ActivateFieldFilter(c,tp,id,ft)
function yume.ActivateFieldFilter(c,tp,id,ft) local flag=c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true) and not c:IsCode(id)
local flag=c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true) and not c:IsCode(id) if ft==0 then return flag and c:IsSetCard(0x3714)
if ft==0 then return flag and c:IsSetCard(0x3714) elseif ft==1 then return flag and c:IsSetCard(0xb714)
elseif ft==1 then return flag and c:IsSetCard(0xb714) elseif ft==2 then return flag and c:IsSetCard(0x7714)
elseif ft==2 then return flag and c:IsSetCard(0x7714) end
end end
end function yume.ActivateFieldCon(e,tp,eg,ep,ev,re,r,rp)
function yume.ActivateFieldCon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler()
local c=e:GetHandler() return c:IsReason(REASON_EFFECT) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
return c:IsReason(REASON_EFFECT) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD) end
end function yume.ActivateFieldOp(e,tp,eg,ep,ev,re,r,rp)
function yume.ActivateFieldOp(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler()
local c=e:GetHandler() local id=yume.temp_card_field[c].id
local id=yume.temp_card_field[c].id local ft=yume.temp_card_field[c].ft
local ft=yume.temp_card_field[c].ft yume.ActivateYumeField(e,tp,id,ft,LOCATION_DECK+LOCATION_HAND)
yume.ActivateYumeField(e,tp,id,ft,LOCATION_DECK+LOCATION_HAND) end
end --uniquify the same name
--uniquify the same name function yume.UniquifyCardName(g)
function yume.UniquifyCardName(g) local tc=g:GetFirst()
local tc=g:GetFirst() while tc do
while tc do g:Remove(Card.IsCode,tc,tc:GetCode())
g:Remove(Card.IsCode,tc,tc:GetCode()) tc=g:GetNext()
tc=g:GetNext() end
end
end end
\ No newline at end of file
--纪念日 森永Miu --纪念日 森永Miu
local m=81003036 local m=81003036
local cm=_G["c"..m] local cm=_G["c"..m]
Duel.LoadScript("c81000000.lua") Duel.LoadScript("c81000000.lua")
function cm.initial_effect(c) function cm.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,nil,4,2) aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit() c:EnableReviveLimit()
--set --set
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(cm.setcost) e1:SetCost(cm.setcost)
e1:SetTarget(cm.settg) e1:SetTarget(cm.settg)
e1:SetOperation(cm.setop) e1:SetOperation(cm.setop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+900) e2:SetCountLimit(1,m+900)
e2:SetCost(cm.thcost) e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg) e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop) e2:SetOperation(cm.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.setcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function cm.setfilter(c) function cm.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and c:IsFaceup() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and c:IsFaceup()
end end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOED) and cm.setfilter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and cm.setfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(cm.setfilter,tp,LOCATION_REMOED,0,1,nil) end and Duel.IsExistingTarget(cm.setfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_REMOED,0,1,1,nil) local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_REMOVED,0,1,1,nil)
end end
function cm.setop(e,tp,eg,ep,ev,re,r,rp) function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SSet(tp,tc) Duel.SSet(tp,tc)
if not tc:IsSetCard(0x817) then if not tc:IsSetCard(0x817) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit) e1:SetValue(cm.aclimit)
e1:SetLabel(tc:GetCode()) e1:SetLabel(tc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
end end
end end
function cm.aclimit(e,re,tp) function cm.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel()) return re:GetHandler():IsCode(e:GetLabel())
end end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost()
end end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_COST) Duel.Remove(tc,POS_FACEUP,REASON_COST)
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsSetCard(0x817) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x817) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
local e3=Effect.CreateEffect(e:GetHandler()) local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTargetRange(1,0) e3:SetTargetRange(1,0)
e3:SetTarget(cm.splimit) e3:SetTarget(cm.splimit)
e3:SetReset(RESET_PHASE+PHASE_END) e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
end end
function cm.splimit(e,c) function cm.splimit(e,c)
return not c:IsRace(RACE_CYBERSE) return not c:IsRace(RACE_CYBERSE)
end end
...@@ -77,7 +77,7 @@ function c98800213.splimit(e,c,sump,sumtype,sumpos,targetp,se) ...@@ -77,7 +77,7 @@ function c98800213.splimit(e,c,sump,sumtype,sumpos,targetp,se)
end end
function c98800213.thcon(e,tp,eg,ep,ev,re,r,rp) function c98800213.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
return ep==tp and Duel.GetTurnPlayer()==tp and eg:GetCount()==1 and tc:IsSummonPlayer(tp) and tc:IsFaceup() and tc:IsType(TYPE_XYZ) and c:IsSetCard(0xad2) return ep==tp and Duel.GetTurnPlayer()==tp and eg:GetCount()==1 and tc:IsSummonPlayer(tp) and tc:IsFaceup() and tc:IsType(TYPE_XYZ) and tc:IsSetCard(0xad2)
end end
function c98800213.thfilter(c) function c98800213.thfilter(c)
return c:IsSetCard(0x95) and c:IsAbleToHand() return c:IsSetCard(0x95) and c:IsAbleToHand()
......
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