Commit d30d2780 authored by songtongtong's avatar songtongtong

update 10.26

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