Commit ac05a606 authored by 竹中千惠理's avatar 竹中千惠理

24.6.21 追月神·水月

parent 81906bdc
No preview for this file type
File added
--机锋的罪人 卡特斯罗特
local cm,m,o=GetID()
function cm.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_TO_HAND)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetOperation(cm.op0)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.con1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(cm.cos5)
e5:SetTarget(cm.tg5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
end
--e0
function cm.op0(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFieldID()<=172 then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
--e1
function cm.con1(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and c:GetFlagEffect(m)>0
end
--e2
function cm.con2(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
g=Duel.SelectTribute(tp,c,1,Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE))
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
--e3
function cm.op3f1(c,mc)
return not aux.IsCodeListed(c,mc:GetCode())
end
function cm.op3con1f(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and (c:IsReason(REASON_COST) or c:IsReason(REASON_SUMMON+REASON_MATERIAL))
end
function cm.op3con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.op3con1f,1,nil,tp)
end
function cm.op3op1(e,tp,eg,ep,ev,re,r,rp)
if #eg-1<=0 then return end
Duel.Draw(tp,#eg-1,REASON_EFFECT)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local c,g=e:GetHandler(),Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.ConfirmCards(1-tp,g)
g=g:Filter(cm.op3f1,nil,c)
if g:GetClassCount(Card.GetCode)==#g then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_RELEASE)
e1:SetCondition(cm.op3con1)
e1:SetOperation(cm.op3op1)
Duel.RegisterEffect(e1,tp)
end
end
--e5
function cm.cos5f1(c)
return c:GetFlagEffect(m)>0 and (c:IsAbleToDeckAsCost() or c:IsAbleToExtraAsCost())
end
function cm.cos5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cos5f1,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cos5f1,tp,LOCATION_GRAVE,0,2,99,nil)
e:SetLabel(Duel.SendtoDeck(g,tp,2,REASON_COST))
end
function cm.tg5(e,tp,eg,ep,ev,re,r,rp,chk)
local dam=e:GetLabel()>2 and 4000 or 2000
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local dam=e:GetLabel()>2 and 4000 or 2000
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(dam)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e:GetHandler():RegisterEffect(e1)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--万物的见证者·洁蒂丝
local m=60002226
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,60002223)
c:EnableCounterPermit(0x624,LOCATION_ONFIELD)
c:EnableCounterPermit(0x625,LOCATION_ONFIELD)
--race
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetRange(0xff)
e1:SetValue(0xfffffff)
c:RegisterEffect(e1)
--爆能强化
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
--进化
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW+CATEGORY_RECOVER)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(cm.cos5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.spcost)
e1:SetCondition(cm.spcon2)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.con2(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
g=Duel.SelectTribute(tp,c,1,Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE))
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.cos5f1(c)
return c:GetFlagEffect(m)>0 and (c:IsAbleToDeckAsCost() or c:IsAbleToExtraAsCost())
end
function cm.cos5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cos5f1,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cos5f1,tp,LOCATION_GRAVE,0,1,99,nil)
e:SetLabel(Duel.SendtoDeck(g,tp,2,REASON_COST))
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local dam=e:GetLabel()
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
if dam>=1 then
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.xfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Destroy(g:GetFirst(),REASON_EFFECT)
end
if dam>=2 then
Duel.Draw(tp,1,REASON_EFFECT)
if dam>=3 then
Duel.Recover(tp,1000,REASON_EFFECT)
if dam>=4 then
--avoid damage
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetTargetRange(1,0)
e4:SetValue(cm.damval)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,70002169,RESET_PHASE+PHASE_END,0,2)
Duel.RegisterEffect(e4,tp)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e4:SetTargetRange(1,0)
e4:SetValue(cm.damval)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,70002169,RESET_PHASE+PHASE_END,0,2)
Duel.RegisterEffect(e4,tp)
end
end
end
end
end
function cm.damval(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then return 0 end
return val
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local sg=g:Filter(Card.IsFaceup,nil)
return sg and sg:GetClassCount(Card.GetRace)>=2
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,0,0,0)
end
function cm.thfilter(c,e,tp)
return c:IsSetCard(0x6a9)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Summon(tp,c,true,nil)
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local sg=g:Filter(Card.IsFaceup,nil)
return sg and sg:GetClassCount(Card.GetRace)>=2 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,60002223)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x6a9) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.xfilter(c)
return c:IsType(TYPE_MONSTER)
end
--熔铁亲信
local m=60002227
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,60002223)
--爆能强化
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
--进化
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(cm.cos5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.con2(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
g=Duel.SelectTribute(tp,c,1,Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE))
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.cos5f1(c)
return c:GetFlagEffect(m)>0 and (c:IsAbleToDeckAsCost() or c:IsAbleToExtraAsCost())
end
function cm.cos5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cos5f1,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cos5f1,tp,LOCATION_GRAVE,0,1,99,nil)
e:SetLabel(Duel.SendtoDeck(g,tp,2,REASON_COST))
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local dam=e:GetLabel()
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
if dam>=1 then
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if tc:GetAttack()==0 then
Duel.Destroy(tc,REASON_EFFECT)
end
tc=g:GetNext()
end
if dam>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
end
function cm.thfilter(c)
return c:IsCanHaveCounter(0x624) and Duel.IsCanAddCounter(tp,0x624,1,c) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thfilter2(c)
return c:IsLevel(1) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if not g:GetFirst():IsCode(60002223) and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,g)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.sumlimit)
e1:SetLabel(g:GetFirst():GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetValue(cm.aclimit)
Duel.RegisterEffect(e4,tp)
end
end
end
function cm.sumlimit(e,c)
return c:IsCode(e:GetLabel())
end
function cm.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel()) and re:IsActiveType(TYPE_MONSTER)
end
\ No newline at end of file
--镀黑小卒
local m=60002228
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,60002223)
--爆能强化
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
--进化
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(cm.cos5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.con2(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
g=Duel.SelectTribute(tp,c,1,Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE))
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.cos5f1(c)
return c:GetFlagEffect(m)>0 and (c:IsAbleToDeckAsCost() or c:IsAbleToExtraAsCost())
end
function cm.cos5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cos5f1,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cos5f1,tp,LOCATION_GRAVE,0,1,99,nil)
e:SetLabel(Duel.SendtoDeck(g,tp,2,REASON_COST))
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local dam=e:GetLabel()
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
if dam==1 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if dam>=2 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,2,2,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
local g1=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
local tc=g1:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1000)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1000)
tc:RegisterEffect(e1)
tc=g1:GetNext()
end
end
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,0,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Summon(tp,c,true,nil)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,60002223) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--精炼保镳
local m=60002229
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,60002223)
--爆能强化
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
--进化
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DRAW+CATEGORY_RECOVER)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(cm.cos5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_RECOVER+CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.cost)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.con2(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
g=Duel.SelectTribute(tp,c,1,Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE))
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.cos5f1(c)
return c:GetFlagEffect(m)>0 and (c:IsAbleToDeckAsCost() or c:IsAbleToExtraAsCost())
end
function cm.cos5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cos5f1,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cos5f1,tp,LOCATION_GRAVE,0,2,2,nil)
e:SetLabel(Duel.SendtoDeck(g,tp,2,REASON_COST))
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
Duel.Draw(tp,2,REASON_EFFECT)
Duel.Recover(tp,2000,REASON_EFFECT)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,60002223) then
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Recover(tp,1000,REASON_EFFECT)
end
end
end
\ No newline at end of file
--冲沙滑板手
local m=60002230
local cm=_G["c"..m]
function cm.initial_effect(c)
--爆能强化
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
--进化
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DAMAGE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(cm.cos5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
end
function cm.con2(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
g=Duel.SelectTribute(tp,c,1,Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE))
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.xfilter(c)
return c:IsType(TYPE_MONSTER)
end
function cm.cos5f1(c)
return c:GetFlagEffect(m)>0 and (c:IsAbleToDeckAsCost() or c:IsAbleToExtraAsCost())
end
function cm.cos5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cos5f1,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cos5f1,tp,LOCATION_GRAVE,0,2,2,nil)
e:SetLabel(Duel.SendtoDeck(g,tp,2,REASON_COST))
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.xfilter,tp,LOCATION_MZONE,,1,1,nil)
local dmg=g:GetFirst():GetAttack()
Duel.Damage(1-tp,dmg,REASON_EFFECT)
end
\ No newline at end of file
--宣告的天使
local m=60002231
local cm=_G["c"..m]
function cm.initial_effect(c)
--爆能强化
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
--进化
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DAMAGE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(cm.cos5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
end
function cm.con2(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
g=Duel.SelectTribute(tp,c,1,Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE))
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.xfilter(c)
return c:IsType(TYPE_MONSTER)
end
function cm.cos5f1(c)
return c:GetFlagEffect(m)>0 and (c:IsAbleToDeckAsCost() or c:IsAbleToExtraAsCost())
end
function cm.cos5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cos5f1,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cos5f1,tp,LOCATION_GRAVE,0,2,2,nil)
e:SetLabel(Duel.SendtoDeck(g,tp,2,REASON_COST))
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e:GetHandler():RegisterEffect(e1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e:GetHandler():RegisterEffect(e1)
Duel.Damage(1-tp,2000,REASON_EFFECT)
end
--喷射炮手
local m=60002232
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,60002223)
--爆能强化
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
--进化
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(cm.cos5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
end
function cm.con2(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
g=Duel.SelectTribute(tp,c,1,Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE))
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.cos5f1(c)
return c:GetFlagEffect(m)>0 and (c:IsAbleToDeckAsCost() or c:IsAbleToExtraAsCost())
end
function cm.cos5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cos5f1,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cos5f1,tp,LOCATION_GRAVE,0,2,99,nil)
e:SetLabel(Duel.SendtoDeck(g,tp,2,REASON_COST))
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local dam=e:GetLabel()
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsFaceup() then return end
if dam==2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e:GetHandler():RegisterEffect(e1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(1600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e:GetHandler():RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e2:SetValue(1)
c:RegisterEffect(e2)
end
if dam>=3 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(3200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e:GetHandler():RegisterEffect(e1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(3200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e:GetHandler():RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e2:SetValue(2)
c:RegisterEffect(e2)
end
end
\ No newline at end of file
......@@ -358,6 +358,7 @@ function MTC.Whiteop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT) then
local g=Duel.GetMatchingGroup(Card.IsPublic,tp,LOCATION_HAND,0,nil)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sc=g:Select(tp,1,1,nil):GetFirst()
sc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
......
--黄泉-远辞畴昔-
local cm,m,o=GetID()
local m=60010053
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,60010029)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(cm.retcon)
e3:SetOperation(cm.retop1)
c:RegisterEffect(e3)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
--e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.retg1)
e1:SetOperation(cm.retop1)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,aux.FALSE)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
......@@ -39,9 +44,9 @@ function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp,tc)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(tp,m)>=9 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2))
function cm.retg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)>=9 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.retop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -54,24 +59,22 @@ function cm.retop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.SelectOption(tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
--e:GetHandler():SetCardData(CARDDATA_CODE,m+1)
end
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local ag=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
return ag:GetClassCount(Card.GetRace)==ag:GetCount() and ag:GetClassCount(Card.GetAttribute)==ag:GetCount()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
Duel.BreakEffect()
......@@ -89,4 +92,4 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
end
function cm.indtg(e,c)
return c:IsFaceup()
end
\ No newline at end of file
end
--追月神·水月
local cm,m,o=GetID()
function cm.initial_effect(c)
end
\ No newline at end of file
c:EnableCounterPermit(0x628)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.tg4)
e1:SetOperation(cm.op4)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CUSTOM+60010111)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.con)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60461804,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,m)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,2,0,0x628)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x628,2)
for i=60010120,60010122 do
local rg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,i):Filter(Card.IsAbleToRemove,nil)
if Duel.GetFlagEffect(tp,i)~=0 and #rg>0 then
Duel.Remove(rg:GetFirst(),POS_FACEUP,REASON_EFFECT)
end
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return ((e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsCanHaveCounter(0x628)
and Duel.IsCanAddCounter(tp,0x628,1,e:GetHandler())) or (Duel.GetFlagEffect(tp,60010119)~=0))
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil)
end
function cm.pfil(c,tp)
return c:IsCanHaveCounter(0x628)
and Duel.IsCanAddCounter(tp,0x628,1,c)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.GetFlagEffect(tp,60010119)==0 then
e:GetHandler():AddCounter(0x628,1)
elseif Duel.IsExistingMatchingCard(cm.pfil,tp,LOCATION_MZONE,0,1,nil,tp) then
local ng=Duel.GetMatchingGroup(cm.pfil,tp,LOCATION_MZONE,0,nil,tp)
for c in aux.Next(ng) do
c:AddCounter(0x628,1)
end
end
local rg=Duel.GetDecktopGroup(tp,1)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function cm.spfilter(c,e,tp)
return c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -15,6 +15,26 @@ function cm.initial_effect(c)
e1:SetTarget(cm.tg4)
e1:SetOperation(cm.op4)
c:RegisterEffect(e1)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CUSTOM+60010111)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.con)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60461804,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,m)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
end
function cm.ovfilter(c)
return c:IsFaceup() and c:IsCode(60010111) and c:IsLevel(4)
......@@ -72,4 +92,88 @@ function cm.op4(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return ((e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsCanHaveCounter(0x628)
and Duel.IsCanAddCounter(tp,0x628,1,e:GetHandler())) or (Duel.GetFlagEffect(tp,60010119)~=0))
and (Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil)
or (Duel.IsExistingMatchingCard(cm.rmfil,tp,LOCATION_REMOVED,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_REMOVED,0,6,nil)))
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.GetFlagEffect(tp,60010119)==0 then
e:GetHandler():AddCounter(0x628,1)
elseif Duel.IsExistingMatchingCard(cm.pfil,tp,LOCATION_MZONE,0,1,nil,tp) then
local ng=Duel.GetMatchingGroup(cm.pfil,tp,LOCATION_MZONE,0,nil,tp)
for c in aux.Next(ng) do
c:AddCounter(0x628,1)
end
end
if Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_REMOVED,0,6,nil) then
local gc=Duel.GetMatchingGroup(cm.rmfil,tp,LOCATION_REMOVED,0,nil):Select(tp,1,1,nil):GetFirst()
local te=gc:GetActivateEffect()
Duel.MoveToField(gc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=gc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
gc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
gc:ReleaseEffectRelation(te)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
end
end
Duel.SendtoDeck(gc,nil,2,REASON_RULE)
else
local rg=Duel.GetDecktopGroup(tp,1)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function cm.spfilter(c,e,tp)
return c:IsCode(60010111) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--携月
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010111)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.con)
c:RegisterEffect(e2)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.confil(c)
return c:IsCode(60010111) and c:IsFaceup()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confil,tp,LOCATION_MZONE,0,1,nil)
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_COST)
end
function cm.adfil(c)
return aux.IsCodeListed(c,60010111) and not c:IsCode(m)
end
function cm.rmfil2(c)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemove()
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.adfil,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(cm.rmfil,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.rmfil(c)
return c:IsFaceup() and c:IsType(TYPE_QUICKPLAY) and c:IsType(TYPE_SPELL)
and c:CheckActivateEffect(false,false,false)~=nil
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(tp,60010111,0,0,1)
local ag=Duel.GetMatchingGroup(cm.adfil,tp,LOCATION_DECK,0,nil)
local num=math.min(3,#ag)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.GetMatchingGroup(cm.rmfil2,tp,LOCATION_HAND,0,nil):Select(tp,1,num,nil)
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)~=0 then
local adnum=#Duel.GetOperatedGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local a2g=ag:Select(tp,1,adnum,nil)
if a2g:GetCount()>0 then
Duel.SendtoHand(a2g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,a2g)
local gc=Duel.GetMatchingGroup(cm.rmfil,tp,LOCATION_REMOVED,0,nil):Select(tp,1,1,nil):GetFirst()
local te=gc:GetActivateEffect()
Duel.MoveToField(gc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=gc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
gc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
gc:ReleaseEffectRelation(te)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
end
end
Duel.SendtoDeck(gc,nil,2,REASON_RULE)
end
end
Duel.RaiseEvent(c,EVENT_CUSTOM+60010111,e,0,tp,tp,0)
end
\ No newline at end of file
--映月
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010111)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.con)
c:RegisterEffect(e2)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.confil(c)
return c:IsCode(60010111) and c:IsFaceup()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confil,tp,LOCATION_MZONE,0,1,nil)
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_SZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_SZONE)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(tp,60010111,0,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_SZONE,nil):Select(tp,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
if c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsPreviousLocation(LOCATION_HAND) then
Duel.BreakEffect()
c:CancelToGrave()
Duel.Remove(c,POS_FACEUP,REASON_RULE)
end
Duel.RaiseEvent(c,EVENT_CUSTOM+60010111,e,0,tp,tp,0)
end
\ No newline at end of file
--罪月
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010111)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.con)
c:RegisterEffect(e2)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.con1)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.confil(c)
return c:IsCode(60010111) and c:IsFaceup()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confil,tp,LOCATION_MZONE,0,1,nil)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,60010111)>=2
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(tp,60010111,0,0,1)
local op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
if op==0 then
local dg=Duel.GetMatchingGroup(Card.IsAttackBelow,tp,0,LOCATION_MZONE,nil,2000)
Duel.Destroy(dg,REASON_EFFECT)
elseif op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_RULE)
end
if c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsPreviousLocation(LOCATION_HAND) then
Duel.BreakEffect()
c:CancelToGrave()
Duel.Remove(c,POS_FACEUP,REASON_RULE)
end
Duel.RaiseEvent(c,EVENT_CUSTOM+60010111,e,0,tp,tp,0)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsCode(60010111) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_EFFECT) then
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_EFFECT)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
\ No newline at end of file
--引月
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010111)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.con)
c:RegisterEffect(e2)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.con1)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.confil(c)
return c:IsCode(60010111) and c:IsFaceup()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confil,tp,LOCATION_MZONE,0,1,nil)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,60010111)>=2
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(tp,60010111,0,0,1)
local op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
if op==0 then
local dg=Duel.GetMatchingGroup(Card.IsAttackBelow,tp,0,LOCATION_MZONE,nil,2000)
Duel.Destroy(dg,REASON_EFFECT)
elseif op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_RULE)
end
if c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsPreviousLocation(LOCATION_HAND) then
Duel.BreakEffect()
c:CancelToGrave()
Duel.Remove(c,POS_FACEUP,REASON_RULE)
end
Duel.RaiseEvent(c,EVENT_CUSTOM+60010111,e,0,tp,tp,0)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsCode(60010111) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_EFFECT) then
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_EFFECT)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
\ No newline at end of file
--对月歌
local cm,m,o=GetID()
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2,cm.ovfilter,aux.Stringid(m,0),4,cm.xyzop)
c:EnableReviveLimit()
--code
aux.EnableChangeCode(c,60010111,LOCATION_MZONE)
c:EnableCounterPermit(0x628)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.tg4)
e1:SetOperation(cm.op4)
c:RegisterEffect(e1)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CUSTOM+60010111)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.con)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60461804,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,m)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
end
function cm.ovfilter(c)
return c:IsFaceup() and c:IsCode(60010111) and c:IsLevel(4)
end
function cm.xyzop(e,tp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_REMOVED,0,12,nil) end
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,2,0,0x628)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x628,2)
end
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function cm.spfilter(c,e,tp)
return c:IsCode(60010111) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return (e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsCanHaveCounter(0x628)
and Duel.IsCanAddCounter(tp,0x628,1,e:GetHandler())) or (Duel.GetFlagEffect(tp,60010119)~=0)
end
function cm.pfil(c,tp)
return c:IsCanHaveCounter(0x628)
and Duel.IsCanAddCounter(tp,0x628,1,c)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.GetFlagEffect(tp,60010119)==0 then
e:GetHandler():AddCounter(0x628,1)
elseif Duel.IsExistingMatchingCard(cm.pfil,tp,LOCATION_MZONE,0,1,nil,tp) then
local ng=Duel.GetMatchingGroup(cm.pfil,tp,LOCATION_MZONE,0,nil,tp)
for c in aux.Next(ng) do
c:AddCounter(0x628,1)
end
end
local rg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)~=0 then
local cg=Duel.GetOperatedGroup()
local num=#cg+1
for c in aux.Next(cg) do
Card.RegisterFlagEffect(c,m,0,0,1)
end
local ag=Duel.GetMatchingGroup(cm.adfil,tp,LOCATION_REMOVED,0,nil)
local tag=Group.CreateGroup()
if num<=#ag then
tag=ag:RandomSelect(tp,num)
else
local fg=Duel.GetMatchingGroup(cm.adfil2,tp,LOCATION_REMOVED,0,nil)
local snum=math.min(#fg,num)
tag=fg:RandomSelect(tp,snum)
end
Duel.SendtoHand(tag,nil,REASON_EFFECT)
local ug=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND+LOCATION_REMOVED,0,nil)
for c in aux.Next(ug) do
Card.ResetFlagEffect(c,m)
end
end
end
function cm.adfil(c)
return c:IsAbleToHand() and c:IsFaceup() and Card.GetFlagEffect(c,m)==0
end
function cm.adfil2(c)
return c:IsAbleToHand() and c:IsFaceup()
end
--飞彩凝辉
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010111)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.con)
c:RegisterEffect(e2)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.con1)
--e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.confil(c)
return c:IsCode(60010111) and c:IsFaceup()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confil,tp,LOCATION_MZONE,0,1,nil)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.rmfil(c)
return c:IsFaceup() and c:IsType(TYPE_QUICKPLAY) and c:IsType(TYPE_SPELL)
and c:CheckActivateEffect(false,false,false)~=nil
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,60010111)>=4
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfil,tp,LOCATION_REMOVED,0,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(tp,60010111,0,0,1)
if not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_REMOVED,0,12,nil) then
local num=12-Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_REMOVED,0,nil)
local rg=Duel.GetDecktopGroup(tp,num)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
local gc=Duel.GetMatchingGroup(cm.rmfil,tp,LOCATION_REMOVED,0,nil):Select(tp,1,1,nil):GetFirst()
local te=gc:GetActivateEffect()
Duel.MoveToField(gc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=gc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
gc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
gc:ReleaseEffectRelation(te)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
end
end
Duel.SendtoDeck(gc,nil,2,REASON_RULE)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010111,e,0,tp,tp,0)
end
function cm.thfilter(c)
return c:IsCode(60010111) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_EFFECT) then
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_EFFECT)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
\ No newline at end of file
--流晖濯明
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010111)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.con)
c:RegisterEffect(e2)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.con1)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--to deck
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_PHASE+PHASE_STANDBY)
e7:SetCountLimit(1)
e7:SetRange(LOCATION_REMOVED)
e7:SetCondition(cm.tdcon)
e7:SetOperation(cm.tdop)
c:RegisterEffect(e7)
end
function cm.confil(c)
return c:IsCode(60010111) and c:IsFaceup()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confil,tp,LOCATION_MZONE,0,1,nil)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsCode(60010111) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_EFFECT) then
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_EFFECT)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,60010111)>=4
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(tp,60010111,0,0,1)
Duel.RegisterFlagEffect(tp,60010119,0,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.atktg)
e1:SetValue(1000)
Duel.RegisterEffect(e1,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+60010111,e,0,tp,tp,0)
end
function cm.atktg(e,c)
return c:IsCode(60010111)
end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and e:GetHandler():IsFaceup()
and e:GetHandler():CheckActivateEffect(false,false,false)~=nil
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:CheckActivateEffect(false,false,false)~=nil
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local gc=c
local te=gc:GetActivateEffect()
Duel.MoveToField(gc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=gc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
gc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
gc:ReleaseEffectRelation(te)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
end
end
Duel.SendtoDeck(gc,nil,2,REASON_RULE)
end
end
\ No newline at end of file
--日诫
local cm,m,o=GetID()
function cm.initial_effect(c)
--cannot set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SSET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(1,0)
e2:SetLabelObject(c)
e2:SetTarget(cm.tg)
c:RegisterEffect(e2)
--cannot trigger
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_HAND)
e3:SetTargetRange(1,0)
e3:SetLabelObject(c)
e3:SetTarget(cm.tg)
c:RegisterEffect(e3)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tg(e,c)
return c==e:GetLabelObject()
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x628,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x628,1,REASON_COST)
end
function cm.rmfil(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsSummonLocation(LOCATION_EXTRA)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfil,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsPlayerCanDraw(1-tp,1) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetMatchingGroup(cm.rmfil,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil):GetFirst()
if tc then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--月诫
local cm,m,o=GetID()
function cm.initial_effect(c)
--cannot set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SSET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(1,0)
e2:SetLabelObject(c)
e2:SetTarget(cm.tg)
c:RegisterEffect(e2)
--cannot trigger
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_HAND)
e3:SetTargetRange(1,0)
e3:SetLabelObject(c)
e3:SetTarget(cm.tg)
c:RegisterEffect(e3)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tg(e,c)
return c==e:GetLabelObject()
end
function cm.rmfil(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsSummonLocation(LOCATION_EXTRA)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,800,REASON_EFFECT)
Duel.SortDecktop(tp,tp,3)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function cm.tgfilter(c)
return c:IsCode(m) and c:IsAbleToRemove()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel()
and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_HAND,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
\ No newline at end of file
--星诫
local cm,m,o=GetID()
function cm.initial_effect(c)
--cannot set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SSET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(1,0)
e2:SetLabelObject(c)
e2:SetTarget(cm.tg)
c:RegisterEffect(e2)
--cannot trigger
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_HAND)
e3:SetTargetRange(1,0)
e3:SetLabelObject(c)
e3:SetTarget(cm.tg)
c:RegisterEffect(e3)
--activated
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tg(e,c)
return c==e:GetLabelObject()
end
function cm.rmfil(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfil,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,800,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.GetMatchingGroup(cm.rmfil,tp,0,LOCATION_MZONE,nil):Select(tp,1,1,nil):GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-800)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-800)
tc:RegisterEffect(e1)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function cm.tgfilter(c)
return c:IsCode(m) and c:IsAbleToRemove()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel()
and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_HAND,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
\ No newline at end of file
--镜想歌 遐
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
--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(aux.FALSE)
c:RegisterEffect(e1)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_DECK)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
e1:SetValue(SUMMON_VALUE_SELF)
c:RegisterEffect(e1)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
c:RegisterEffect(e1)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.spfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_ONFIELD,0,1,nil) and c:IsFaceup()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_GRAVE) and e:GetHandler():IsAbleToDeck()
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoDeck(c,nil,1,REASON_EFFECT)~=0 then
c:ReverseInDeck()
if Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)<=2 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
end
end
Duel.Readjust()
end
function cm.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:CheckActivateEffect(false,false,false)~=nil
and c:GetActivateEffect():IsHasProperty(EFFECT_FLAG_CARD_TARGET)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local gc=g:GetFirst()
local te=gc:GetActivateEffect()
Duel.MoveToField(gc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=gc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
gc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
--Duel.ClearTargetCard()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if #g==1 then
g=Group.FromCards(c)
--Duel.ChangeTargetCard(0,g)
elseif #g>1 then
Group.RemoveCard(g,Group.RandomSelect(g,tp,1):GetFirst())
Group.AddCard(g,c)
--Duel.ChangeTargetCard(0,g)
end
if g and #g~=0 then
local fg=g:GetFirst()
while fg do
fg:CreateEffectRelation(te)
fg=g:GetNext()
end
end
if g then Duel.ChangeTargetCard(0,g) end --Duel.SetTargetCard(g)
if op then op(te,tp,eg,ep,ev,re,r,rp,1,g) end
gc:ReleaseEffectRelation(te)
if g then
local fg=g:GetFirst()
while fg do
fg:ReleaseEffectRelation(te)
fg=g:GetNext()
end
end
end
Duel.SendtoGrave(gc,REASON_RULE)
end
end
\ No newline at end of file
......@@ -26,6 +26,7 @@
!setname 0x630 传说天
!setname 0x631 遗忘海
!setname 0x632 奥法集装士
!setname 0x633 镜想
!setname 0x6a0 机凯种
!setname 0x6a2 大世环
......
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