Commit 270d3981 authored by POLYMER's avatar POLYMER

update 240805 wd

parent f6e00c40
......@@ -6051,6 +6051,32 @@
53797052 0
53797063 0
60153101 0
90701000 0
90701001 0
90701002 0
90701003 0
90701004 0
90701005 0
90701006 0
90701007 0
90701008 0
90701009 0
90701010 0
90701013 0
90701015 0
90701016 0
98933000 0
98933001 0
98933002 0
98933003 0
98933004 0
98933005 0
98933006 0
98933007 0
98933009 0
98933011 0
98933012 0
98933014 0
#limit
33403513 1
82204250 0
......
No preview for this file type
......@@ -12,23 +12,25 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function cm.mfilter(c)
return c:IsLinkRace(RACE_PSYCHO) and c:IsLinkAttribute(ATTRIBUTE_DARK)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsFacedown() then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local ct=Duel.GetTurnCount()
e:SetLabel(ct)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)~=0
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and e:GetHandler():GetFlagEffect(m)>0
end
function cm.spfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
local m=90701000
local cm=_G["c"..m]
cm.name="肆世坏=星命恐惧界"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(cm.atkval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e4:SetCondition(cm.descon1)
e4:SetTarget(cm.destg)
e4:SetOperation(cm.desop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(cm.descon2)
c:RegisterEffect(e5)
end
function cm.filter(c)
return ((c:IsSetCard(0x9316) and c:IsType(TYPE_MONSTER)) or c:IsCode(90701015)) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function cm.atkval(e)
return Duel.GetMatchingGroupCount(Card.IsDefensePos,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)*-100
end
function cm.descon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,nil)>=3
end
function cm.descon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPosition,1,nil,POS_DEFENSE)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
local m=90701001
local cm=_G["c"..m]
cm.name="四世坏·雷电犬"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.hspcon)
e1:SetValue(cm.hspval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(cm.exatkcon)
e2:SetTarget(cm.exatktg)
e2:SetValue(cm.exatkval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+100000000)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_SPSUMMON_PROC)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e4:SetCondition(cm.sprcon)
c:RegisterEffect(e4)
end
function cm.cfilter(c)
return c:IsSetCard(0x9316) and c:IsFaceup()
end
function cm.getzone(tp)
local zone=0
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
local seq=tc:GetSequence()
if seq==5 or seq==6 then
zone=zone|(1<<aux.MZoneSequence(seq))
else
if seq>0 then zone=zone|(1<<(seq-1)) end
if seq<4 then zone=zone|(1<<(seq+1)) end
end
end
return zone
end
function cm.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=cm.getzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function cm.hspval(e,c)
local tp=c:GetControler()
return 0,cm.getzone(tp)
end
function cm.deffilter(c)
return c:IsDefensePos() and c:IsSetCard(0x9316) and c:IsFaceup()
end
function cm.exatkcon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(cm.deffilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.exatktg(e,c)
return c:IsSetCard(0x9316) and c:GetSequence()>=5
end
function cm.exatkval(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.deffilter,tp,LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)-1
end
function cm.thfilter(c)
return c:IsSetCard(0x9316) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.sprfilter(c)
return c:IsFaceup() and c:IsCode(90701015)
end
function cm.sprcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
\ No newline at end of file
local m=90701002
local cm=_G["c"..m]
cm.name="四世坏·尖锐犬"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.hspcon)
e1:SetValue(cm.hspval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_PIERCE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.ptg)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+100000000)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_SPSUMMON_PROC)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e4:SetCondition(cm.sprcon)
c:RegisterEffect(e4)
end
function cm.cfilter(c)
return c:IsSetCard(0x9316) and c:IsFaceup()
end
function cm.getzone(tp)
local zone=0
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
local seq=tc:GetSequence()
if seq==5 or seq==6 then
zone=zone|(1<<aux.MZoneSequence(seq))
else
if seq>0 then zone=zone|(1<<(seq-1)) end
if seq<4 then zone=zone|(1<<(seq+1)) end
end
end
return zone
end
function cm.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=cm.getzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function cm.hspval(e,c)
local tp=c:GetControler()
return 0,cm.getzone(tp)
end
function cm.ptg(e,c)
return c:IsSetCard(0x9316) and c:GetSequence()>=5
end
function cm.thfilter(c)
return c:IsSetCard(0x9316) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.sprfilter(c)
return c:IsFaceup() and c:IsCode(90701015)
end
function cm.sprcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
\ No newline at end of file
local m=90701003
local cm=_G["c"..m]
cm.name="四世坏·高度犬"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.hspcon)
e1:SetValue(cm.hspval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.atktg)
e2:SetValue(cm.atkval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+100000000)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_SPSUMMON_PROC)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e4:SetCondition(cm.sprcon)
c:RegisterEffect(e4)
end
function cm.cfilter(c)
return c:IsSetCard(0x9316) and c:IsFaceup()
end
function cm.getzone(tp)
local zone=0
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
local seq=tc:GetSequence()
if seq==5 or seq==6 then
zone=zone|(1<<aux.MZoneSequence(seq))
else
if seq>0 then zone=zone|(1<<(seq-1)) end
if seq<4 then zone=zone|(1<<(seq+1)) end
end
end
return zone
end
function cm.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=cm.getzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function cm.hspval(e,c)
local tp=c:GetControler()
return 0,cm.getzone(tp)
end
function cm.atktg(e,c)
return c:IsSetCard(0x9316) and c:GetSequence()>=5
end
function cm.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsDefensePos,c:GetControler(),LOCATION_MZONE,0,nil)*300
end
function cm.thfilter(c)
return c:IsSetCard(0x9316) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.sprfilter(c)
return c:IsFaceup() and c:IsCode(90701015)
end
function cm.sprcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
\ No newline at end of file
local m=90701004
local cm=_G["c"..m]
cm.name="四世坏·帝国之心"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.hspcon)
e1:SetValue(cm.hspval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+100000000)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_SPSUMMON_PROC)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e4:SetCondition(cm.sprcon)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,0))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_HAND)
e5:SetCountLimit(1,m+200000000)
e5:SetCost(cm.tgcost)
e5:SetTarget(cm.target)
e5:SetOperation(cm.operation)
c:RegisterEffect(e5)
end
function cm.cfilter(c)
return c:IsSetCard(0x9316) and c:IsFaceup()
end
function cm.getzone(tp)
local zone=0
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
local seq=tc:GetSequence()
if seq==5 or seq==6 then
zone=zone|(1<<aux.MZoneSequence(seq))
else
if seq>0 then zone=zone|(1<<(seq-1)) end
if seq<4 then zone=zone|(1<<(seq+1)) end
end
end
return zone
end
function cm.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=cm.getzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function cm.hspval(e,c)
local tp=c:GetControler()
return 0,cm.getzone(tp)
end
function cm.thfilter(c)
return c:IsSetCard(0x9316) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsPlayerCanDraw(tp,1) and Duel.GetMatchingGroupCount(Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,nil)>=3 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function cm.sprfilter(c)
return c:IsFaceup() and c:IsCode(90701015)
end
function cm.sprcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.costfilter(c)
return c:IsAbleToGraveAsCost()
end
function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,c) and c:IsAbleToGraveAsCost() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.filter(c)
return c:IsCode(90701015) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetFirstMatchingCard(cm.filter,tp,LOCATION_DECK,0,nil)
if tg and Duel.SendtoHand(tg,nil,REASON_EFFECT)~=0 and Duel.ConfirmCards(1-tp,tg)~=0 and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
local m=90701005
local cm=_G["c"..m]
cm.name="四世坏·光明之心"
function cm.initial_effect(c)
aux.AddLinkProcedure(c,cm.mfilter,1,1)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(cm.sprcon)
c:RegisterEffect(e2)
end
function cm.mfilter(c)
return (c:IsLinkSetCard(0x9316) or c:IsLinkCode(90701015)) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and c:GetSequence()>4
end
function cm.thfilter(c)
return c:IsCode(90701000) 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
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.sprfilter(c)
return c:IsFaceup() and c:IsCode(90701015)
end
function cm.sprcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
\ No newline at end of file
local m=90701006
local cm=_G["c"..m]
cm.name="四世坏·三一之心"
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,3)
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.linklimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SET_POSITION)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetValue(POS_FACEUP_DEFENSE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.immval)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCountLimit(1)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.condition)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end
function cm.immval(e,re)
local rc=re:GetHandler()
local check1=re:IsActiveType(TYPE_MONSTER) and re:IsActivated() and re:GetActivateLocation()==LOCATION_MZONE
local check2=rc:IsRelateToEffect(re) and rc:IsAttackPos()
local check3=not rc:IsRelateToEffect(re) and rc:IsPreviousPosition(POS_ATTACK)
local check=check1 and (check2 or check3)
if re:GetOwnerPlayer()==e:GetHandlerPlayer() or check then return false end
return true
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSequence()>4
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x9316) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.thfilter(c)
return c:IsSetCard(0x9316) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g2:GetCount()>0 then
Duel.SendtoHand(g2,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c)
return not c:IsSetCard(0x9316) and not c:IsCode(90701015)
end
\ No newline at end of file
local m=90701007
local cm=_G["c"..m]
cm.name="四世坏·陆世坏"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.atktg)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(cm.disop)
c:RegisterEffect(e3)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DISABLE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetTarget(cm.distg)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_DISABLE_EFFECT)
e6:SetValue(RESET_TURN_SET)
c:RegisterEffect(e6)
end
function cm.rmfilter(c)
return c:IsSetCard(0x9316) and c:IsAbleToRemove()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,c) and Duel.GetFlagEffect(tp,m)==0 end
if Duel.GetTurnPlayer()==tp then Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.rmfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
if #g==0 then return end
local typ=g:GetFirst():GetType()
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)==0 then return end
local check_mon=c:IsAbleToHand() and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil)
local check_spe=Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
local check_trp=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,nil,tp,POS_FACEDOWN)
if typ&TYPE_MONSTER~=0 and check_mon and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
local tg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
tg:AddCard(c)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
if typ&TYPE_SPELL~=0 and check_spe and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
local tg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,5,nil)
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
if typ&TYPE_TRAP~=0 and check_trp and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
local tg=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=tg:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil,tp,POS_FACEDOWN)
if #sg>0 then
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
Duel.ShuffleExtra(1-tp)
end
end
function cm.atktg(e,c)
return c:IsSetCard(0x9316)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.AdjustInstantly(e:GetHandler())
end
function cm.disfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x9316) and c:IsControler(tp)
end
function cm.distg(e,c)
local fid=e:GetHandler():GetFieldID()
for _,flag in ipairs({c:GetFlagEffectLabel(id)}) do
if flag==fid then return true end
end
local bc=c:GetBattleTarget()
if c:IsRelateToBattle() and bc and cm.disfilter(bc,e:GetHandlerPlayer()) then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
return true
end
return false
end
\ No newline at end of file
local m=90701008
local cm=_G["c"..m]
cm.name="四世坏的新星"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
end
function cm.filter(c,e,tp)
return (c:IsSetCard(0x9316) or c:IsCode(90701015)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE+LOCATION_REMOVED,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.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x9316) and c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
\ No newline at end of file
local m=90701009
local cm=_G["c"..m]
cm.name="四世坏的牙掌突"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetTarget(cm.adatktg)
e2:SetOperation(cm.adatkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCost(cm.cost)
e3:SetTarget(cm.target)
e3:SetOperation(cm.activate)
c:RegisterEffect(e3)
end
function cm.filter(c,e,tp)
return (c:IsSetCard(0x9316) or c:IsCode(90701015)) and c:IsFaceup() and not c:IsType(TYPE_LINK)
end
function cm.adatktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetTurnPlayer()==tp and aux.bpcon(e,tp,eg,ep,ev,re,r,rp) and Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
end
function cm.adatkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(cm.adaval)
tc:RegisterEffect(e1)
end
function cm.adaval(e)
local c=e:GetHandler()
return c:GetAttack()>c:GetDefense() and 0 or 1
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function cm.actfilter(c)
return c:IsCode(90701015) and c:IsFaceup()
end
function cm.desfilter(c,check)
return check or c:IsAbleToRemove()
end
function cm.descfilter(c,tc,ec,check)
return cm.desfilter(c,check) and c:GetEquipTarget()~=tc and c~=ec
end
function cm.costfilter(c,ec,tp,check)
if not c:IsSetCard(0x9316) then return false end
return Duel.IsExistingTarget(cm.descfilter,tp,0,LOCATION_ONFIELD,2,c,c,ec,check)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local check=not Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_ONFIELD,0,1,nil)
if chkc then return chkc:IsOnField() and chkc~=c and cm.desfilter(chkc,check) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,cm.costfilter,1,c,c,tp,check)
else
return Duel.IsExistingTarget(cm.desfilter,tp,0,LOCATION_ONFIELD,2,c,check)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local sg=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,c,c,tp,check)
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,0,LOCATION_ONFIELD,2,2,c,check)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.Destroy(sg,REASON_EFFECT,LOCATION_REMOVED)
else
Duel.Destroy(sg,REASON_EFFECT)
end
end
\ No newline at end of file
local m=90701010
local cm=_G["c"..m]
cm.name="四世坏的继承"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_REMOVE)
e2:SetOperation(cm.rmop)
c:RegisterEffect(e2)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsSetCard(0x9316) or c:IsCode(90701015))
end
function cm.fselect(g,tp)
return Duel.IsExistingMatchingCard(cm.lkfilter,tp,LOCATION_EXTRA,0,1,nil,g)
end
function cm.lkfilter(c,g)
return c:IsSetCard(0x9316) and c:IsLinkSummonable(g,nil,g:GetCount(),g:GetCount())
end
function cm.chkfilter(c,tp)
return c:IsType(TYPE_LINK) and c:IsSetCard(0x9316) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local cg=Duel.GetMatchingGroup(cm.chkfilter,tp,LOCATION_EXTRA,0,nil,tp)
if #cg==0 then return false end
local _,maxlink=cg:GetMaxGroup(Card.GetLink)
if maxlink>ft then maxlink=ft end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
return g:CheckSubGroup(cm.fselect,1,maxlink,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
local cg=Duel.GetMatchingGroup(cm.chkfilter,tp,LOCATION_EXTRA,0,nil,tp)
local _,maxlink=cg:GetMaxGroup(Card.GetLink)
if ft>0 and maxlink then
if maxlink>ft then maxlink=ft end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,cm.fselect,false,1,maxlink,tp)
if not sg then return end
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
local og=Duel.GetOperatedGroup()
Duel.AdjustAll()
if og:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<sg:GetCount() then return end
local tg=Duel.GetMatchingGroup(cm.lkfilter,tp,LOCATION_EXTRA,0,nil,og)
if og:GetCount()==sg:GetCount() and tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rg=tg:Select(tp,1,1,nil)
Duel.LinkSummon(tp,rg:GetFirst(),og,nil,#og,#og)
end
end
end
function cm.cfilter(c)
return (c:IsSetCard(0x9316) or c:IsCode(90701015)) and c:IsFaceup()
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetMatchingGroupCount(cm.cfilter,tp,LOCATION_MZONE,0,nil)<3 or Duel.GetFlagEffect(tp,m)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_LIMIT_SPECIAL_SUMMON_POSITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return (sumpos&POS_ATTACK)>0
end
\ No newline at end of file
local m=90701013
local cm=_G["c"..m]
cm.name="四世坏的双牙"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.discon)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMING_DRAW_PHASE)
e2:SetCondition(cm.cacon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.catg)
e2:SetOperation(cm.caop)
c:RegisterEffect(e2)
end
function cm.exfilter(c)
return c:IsFaceup() and ((c:IsSetCard(0x9316) and c:GetSequence()>=5) or c:IsCode(90701015))
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainDisablable(ev) and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) and rp==1-tp
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function cm.cacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsLinkAbove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,3)
end
function cm.catg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
end
function cm.caop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.aclimit(e,re,tp)
local c=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_MZONE)
end
\ No newline at end of file
local m=90701015
local cm=_G["c"..m]
cm.name="界放=星霜"
function cm.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,m+100000000)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+200000000)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
end
function cm.tfilter(c,sc,tp)
return c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0 and not c:IsAttribute(sc:GetAttribute()) and not c:IsRace(sc:GetRace())
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.tfilter(chkc,c,tp) end
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(cm.tfilter,tp,LOCATION_MZONE,0,1,nil,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.tfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x9316) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.pfilter(c,tp)
return c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0x9316) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.pfilter,tp,LOCATION_DECK,0,1,nil,tp) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,cm.pfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end
end
\ No newline at end of file
local m=90701016
local cm=_G["c"..m]
cm.name="界放=星嚣"
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,90701015,cm.matfilter,1,true,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_ONFIELD+LOCATION_GRAVE,0,Duel.Remove,POS_FACEUP,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(cm.matcheck)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(cm.igcon)
e4:SetTarget(cm.igtg)
e4:SetOperation(cm.igop)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_NO_TURN_RESET)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(cm.discon)
e5:SetTarget(cm.distg)
e5:SetOperation(cm.disop)
e5:SetLabelObject(e3)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOEXTRA)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetCode(EVENT_PHASE+PHASE_STANDBY)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetCondition(cm.spcon)
e6:SetTarget(cm.sptg)
e6:SetOperation(cm.spop)
e6:SetLabelObject(e3)
c:RegisterEffect(e6)
end
function cm.matfilter(c)
return c:IsAttack(1500) and c:IsDefense(2100)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
local upval=tc:GetBaseAttack()
if tc:GetBaseAttack()<tc:GetBaseDefense() then
upval=tc:GetBaseDefense()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(upval/2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function cm.matcheck(e,c)
local g=c:GetMaterial()
local mat=0
local tc=g:GetFirst()
while tc do
mat=bit.bor(mat,tc:GetLocation())
tc=g:GetNext()
end
e:SetLabel(mat)
if bit.band(mat,LOCATION_GRAVE)~=0 then e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1)) end
if bit.band(mat,LOCATION_ONFIELD)~=0 then e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2)) end
if bit.band(mat,LOCATION_GRAVE)~=0 and bit.band(mat,LOCATION_GRAVE)~=0 then e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3)) end
end
function cm.igcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetLabelObject():GetLabel(),LOCATION_ONFIELD)~=0
end
function cm.igtg(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_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.igop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
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 bit.band(e:GetLabelObject():GetLabel(),LOCATION_GRAVE)~=0
end
function cm.dishintcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetLabelObject():GetLabel(),LOCATION_GRAVE)~=0
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetLabelObject():GetLabel(),LOCATION_ONFIELD)~=0 and bit.band(e:GetLabelObject():GetLabel(),LOCATION_GRAVE)~=0
end
function cm.spfilter(c,e,tp)
return c:IsLevelBelow(7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and e:GetHandler():IsAbleToExtra() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_EXTRA) and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--加把劲团长
function c98920273.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(nil),4,2)
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
......@@ -49,29 +49,45 @@ end
function c98920273.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98920273.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c98920273.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=sg:GetFirst()
if tc then
Duel.BreakEffect()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(98920273,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c98920273.descon)
e1:SetOperation(c98920273.desop)
Duel.RegisterEffect(e1,tp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetLabel(fid)
e3:SetLabelObject(tc)
e3:SetCondition(c98920273.descon)
e3:SetOperation(c98920273.desop)
e3:SetCountLimit(1)
Duel.RegisterEffect(e3,tp)
end
end
function c98920273.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(98920273)~=e:GetLabel() then
if tc:GetFlagEffectLabel(98920273)==e:GetLabel() then
return true
else
e:Reset()
return false
else return true end
end
end
function c98920273.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
......
--天外来客 异星陨石
function c98933000.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetRange(LOCATION_HAND)
e5:SetCondition(c98933000.spcon)
e5:SetTarget(c98933000.sptg)
e5:SetOperation(c98933000.spop)
c:RegisterEffect(e5)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c98933000.recon)
e2:SetOperation(c98933000.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(c98933000.recon)
e3:SetOperation(c98933000.reop)
c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
--disable special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98933000,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_SPSUMMON)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c98933000.discon)
e1:SetCost(c98933000.discost)
e1:SetTarget(c98933000.distg)
e1:SetOperation(c98933000.disop)
c:RegisterEffect(e1)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98933000,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c98933000.negop)
c:RegisterEffect(e4)
end
function c98933000.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,98933000)==0
end
function c98933000.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(c98933000.sop)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
end
function c98933000.sop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98933000,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c98933000.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c98933000.cfilter(c,syn)
return syn:IsSynchroSummonable(c)
end
function c98933000.scfilter(c,mg)
return mg:IsExists(c98933000.cfilter,1,nil,c)
end
function c98933000.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933000)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933001)==0
end
function c98933000.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x11b)
if chk==0 then return Duel.IsExistingMatchingCard(c98933000.filter,tp,LOCATION_HAND,0,1,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98933000.reop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c98933000.SSfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(98933000,0)) then
Duel.RegisterFlagEffect(tp,98933001,RESET_CHAIN,0,1)
local c=e:GetHandler()
Duel.ConfirmCards(1-tp,c)
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98933000.SSfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SpecialSummonRule(tp,tc,0)
end
end
end
function c98933000.SSfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsRace(RACE_BEAST) and not c:IsSummonableCard() and c:IsSpecialSummonable(0)
end
function c98933000.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c98933000.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c98933000.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c98933000.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(98933000,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c98933000.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c98933000.rfilter(c)
return c:IsReleasable(REASON_SPSUMMON)
end
function c98933000.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(c98933000.rfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
return rg:CheckSubGroup(aux.mzctcheck,1,1,tp)
end
function c98933000.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetMatchingGroup(c98933000.rfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheck,true,1,1,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c98933000.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON)
end
\ No newline at end of file
--天外来客 幽灵蠕虫
function c98933001.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetRange(LOCATION_HAND)
e5:SetCondition(c98933001.spcon)
e5:SetTarget(c98933001.sptg)
e5:SetOperation(c98933001.spop)
c:RegisterEffect(e5)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c98933001.recon)
e2:SetOperation(c98933001.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(c98933001.recon)
e3:SetOperation(c98933001.reop)
c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
--disable special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98933001,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_SPSUMMON)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c98933001.discon)
e1:SetCost(c98933001.discost)
e1:SetTarget(c98933001.distg)
e1:SetOperation(c98933001.disop)
c:RegisterEffect(e1)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98933001,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c98933001.negop)
c:RegisterEffect(e4)
end
function c98933001.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,98933001)==0
end
function c98933001.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(c98933001.sop)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
end
function c98933001.sop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98933001,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c98933001.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c98933001.cfilter(c,syn)
return syn:IsSynchroSummonable(c)
end
function c98933001.scfilter(c,mg)
return mg:IsExists(c98933001.cfilter,1,nil,c)
end
function c98933001.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933001)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933001)==0
end
function c98933001.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x11b)
if chk==0 then return Duel.IsExistingMatchingCard(c98933001.filter,tp,LOCATION_HAND,0,1,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98933001.reop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c98933001.SSfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(98933001,0)) then
Duel.RegisterFlagEffect(tp,98933001,RESET_CHAIN,0,1)
local c=e:GetHandler()
Duel.ConfirmCards(1-tp,c)
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98933001.SSfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SpecialSummonRule(tp,tc,0)
end
end
end
function c98933001.SSfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsRace(RACE_INSECT) and not c:IsSummonableCard() and c:IsSpecialSummonable(0)
end
function c98933001.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c98933001.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c98933001.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c98933001.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if g:GetCount()>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(98933001,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c98933001.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c98933001.rfilter(c)
return c:IsAbleToRemove()
end
function c98933001.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c98933001.rfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
end
function c98933001.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c98933001.rfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c98933001.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_SPSUMMON)
end
\ No newline at end of file
--天外来客 机械恶魔
function c98933002.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetRange(LOCATION_HAND)
e5:SetCondition(c98933002.spcon)
e5:SetTarget(c98933002.sptg)
e5:SetOperation(c98933002.spop)
c:RegisterEffect(e5)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c98933002.recon)
e2:SetOperation(c98933002.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(c98933002.recon)
e3:SetOperation(c98933002.reop)
c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
--disable special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98933002,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_SPSUMMON)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c98933002.discon)
e1:SetCost(c98933002.discost)
e1:SetTarget(c98933002.distg)
e1:SetOperation(c98933002.disop)
c:RegisterEffect(e1)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98933002,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c98933002.negop)
c:RegisterEffect(e4)
end
function c98933002.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,98933002)==0
end
function c98933002.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(c98933002.sop)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
end
function c98933002.sop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98933002,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c98933002.cfilter(c,syn)
return syn:IsSynchroSummonable(c)
end
function c98933002.scfilter(c,mg)
return mg:IsExists(c98933002.cfilter,1,nil,c)
end
function c98933002.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933002)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933002)==0
end
function c98933002.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x11b)
if chk==0 then return Duel.IsExistingMatchingCard(c98933002.filter,tp,LOCATION_HAND,0,1,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98933002.reop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c98933002.SSfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(98933002,0)) then
Duel.RegisterFlagEffect(tp,98933002,RESET_CHAIN,0,1)
local c=e:GetHandler()
Duel.ConfirmCards(1-tp,c)
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98933002.SSfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SpecialSummonRule(tp,tc,0)
end
end
end
function c98933002.SSfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsRace(RACE_MACHINE) and not c:IsSummonableCard() and c:IsSpecialSummonable(0)
end
function c98933002.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c98933002.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c98933002.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,LOCATION_REMOVED)
end
function c98933002.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if aux.NecroValleyNegateCheck(g) then return end
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(98933002,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c98933002.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c98933002.rfilter(c)
return c:IsAbleToRemove()
end
function c98933002.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c98933002.rfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil)
end
function c98933002.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c98933002.rfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c98933002.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
\ No newline at end of file
--天外来客 食人魔花
function c98933003.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetRange(LOCATION_HAND)
e5:SetCondition(c98933003.spcon)
e5:SetOperation(c98933003.spop)
c:RegisterEffect(e5)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c98933003.recon)
e2:SetOperation(c98933003.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(c98933003.recon)
e3:SetOperation(c98933003.reop)
c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
--disable special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98933003,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_SPSUMMON)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c98933003.discon)
e1:SetCost(c98933003.discost)
e1:SetTarget(c98933003.distg)
e1:SetOperation(c98933003.disop)
c:RegisterEffect(e1)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98933003,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c98933003.negop)
c:RegisterEffect(e4)
end
function c98933003.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,98933003)==0
end
function c98933003.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(c98933003.sop)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
end
function c98933003.sop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98933003,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c98933003.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c98933003.cfilter(c,syn)
return syn:IsSynchroSummonable(c)
end
function c98933003.scfilter(c,mg)
return mg:IsExists(c98933003.cfilter,1,nil,c)
end
function c98933003.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933003)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933001)==0
end
function c98933003.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x11b)
if chk==0 then return Duel.IsExistingMatchingCard(c98933003.filter,tp,LOCATION_HAND,0,1,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98933003.reop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c98933003.SSfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(98933003,0)) then
Duel.RegisterFlagEffect(tp,98933001,RESET_CHAIN,0,1)
local c=e:GetHandler()
Duel.ConfirmCards(1-tp,c)
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98933003.SSfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SpecialSummonRule(tp,tc,0)
end
end
end
function c98933003.SSfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsRace(RACE_PLANT) and not c:IsSummonableCard() and c:IsSpecialSummonable(0)
end
function c98933003.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c98933003.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c98933003.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
local g2=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local c1=g1:GetSum(Card.GetAttack)
local c2=g2:GetSum(Card.GetAttack)
if chk==0 then return c1>0 or c2>0 end
end
function c98933003.disop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
local g2=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local c1=g1:GetSum(Card.GetAttack)
local c2=g2:GetSum(Card.GetAttack)
local lp1=Duel.GetLP(tp)
local lp2=Duel.GetLP(1-tp)
if c1>0 or c2>0 then
Duel.SetLP(tp,lp1-math.floor(c2/2))
Duel.SetLP(1-tp,lp2-math.floor(c1/2))
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(98933003,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c98933003.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c98933003.rfilter(c)
return c:IsReleasable(REASON_SPSUMMON)
end
function c98933003.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.CheckLPCost(1-c:GetControler(),500)
end
function c98933003.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.PayLPCost(1-tp,500)
end
\ No newline at end of file
--天外来客 不灭亡灵
function c98933004.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetRange(LOCATION_HAND)
e5:SetCondition(c98933004.spcon)
e5:SetOperation(c98933004.spop)
c:RegisterEffect(e5)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c98933004.recon)
e2:SetOperation(c98933004.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(c98933004.recon)
e3:SetOperation(c98933004.reop)
c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
--disable special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98933004,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_SPSUMMON)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c98933004.discon)
e1:SetCost(c98933004.discost)
e1:SetTarget(c98933004.distg)
e1:SetOperation(c98933004.disop)
c:RegisterEffect(e1)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98933004,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c98933004.negop)
c:RegisterEffect(e4)
end
function c98933004.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,98933004)==0
end
function c98933004.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(c98933004.sop)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
end
function c98933004.sop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98933004,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c98933004.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c98933004.cfilter(c,syn)
return syn:IsSynchroSummonable(c)
end
function c98933004.scfilter(c,mg)
return mg:IsExists(c98933004.cfilter,1,nil,c)
end
function c98933004.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933004)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933001)==0
end
function c98933004.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x11b)
if chk==0 then return Duel.IsExistingMatchingCard(c98933004.filter,tp,LOCATION_HAND,0,1,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98933004.reop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c98933004.SSfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(98933004,0)) then
Duel.RegisterFlagEffect(tp,98933001,RESET_CHAIN,0,1)
local c=e:GetHandler()
Duel.ConfirmCards(1-tp,c)
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98933004.SSfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SpecialSummonRule(tp,tc,0)
end
end
end
function c98933004.SSfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsRace(RACE_ZOMBIE) and not c:IsSummonableCard() and c:IsSpecialSummonable(0)
end
function c98933004.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c98933004.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c98933004.rrfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsRace(RACE_ZOMBIE) and not c:IsSummonableCard()
end
function c98933004.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98933004.rrfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c98933004.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c98933004.rrfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(98933004,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c98933004.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c98933004.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>=1
end
function c98933004.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,1)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
\ No newline at end of file
--天外来客 异界陨星
function c98933005.initial_effect(c)
c:EnableReviveLimit()
--special summon
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(c98933005.spcon)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c98933005.recon1)
e2:SetOperation(c98933005.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(c98933005.recon)
e3:SetOperation(c98933005.reop)
c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98933005,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c98933005.negop)
c:RegisterEffect(e4)
--to deck
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(98933005,0))
e5:SetCategory(CATEGORY_TODECK)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetOperation(c98933005.operation)
c:RegisterEffect(e5)
end
function c98933005.cfilter(c)
return c:IsFacedown() or c:IsSummonableCard()
end
function c98933005.spcon(e,c)
local tp=e:GetHandler():GetControler()
if c==nil then return true end
return not Duel.IsExistingMatchingCard(c98933005.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c98933005.recon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,98933005)==0
end
function c98933005.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(c98933005.sop)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
end
function c98933005.sop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98933005,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c98933005.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c98933005.scfilter(c,mg)
return mg:IsExists(c98933005.cfilter,1,nil,c)
end
function c98933005.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933005)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933001)==0
end
function c98933005.reop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.SelectYesNo(tp,aux.Stringid(98933005,0)) then
Duel.RegisterFlagEffect(tp,98933001,RESET_CHAIN,0,1)
local c=e:GetHandler()
Duel.ConfirmCards(1-tp,c)
Duel.ShuffleHand(tp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if not tc:IsSummonableCard() and tc:IsType(TYPE_MONSTER) and tc:IsAbleToHand() then
Duel.DisableShuffleCheck()
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ShuffleHand(tp)
else
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
end
end
function c98933005.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98933005.SSfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SpecialSummonRule(tp,tc)
end
end
function c98933005.SSfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsSummonableCard() and c:IsSpecialSummonable()
end
function c98933005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c98933005.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
\ No newline at end of file
--天外来客 地狱之星
function c98933006.initial_effect(c)
c:SetUniqueOnField(1,0,98933006)
--xyz summon
aux.AddXyzProcedure(c,nil,10,3,c98933006.ovfilter,aux.Stringid(98933006,2),3,c98933006.xyzop)
c:EnableReviveLimit()
--spsummon limit
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.xyzlimit)
c:RegisterEffect(e1)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c98933006.discon)
e3:SetOperation(c98933006.disop)
c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98933006,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c98933006.negop)
c:RegisterEffect(e4)
if not c98933006.global_check then
c98933006.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetCondition(c98933006.reccon)
ge1:SetOperation(c98933006.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c98933006.ovfilter(c)
return c:IsFaceup() and not c:IsSummonableCard()
end
function c98933006.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,98933006)>=3 end
end
function c98933006.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),98933006,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
function c98933006.reccon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetOwner()
return eg:IsExists(c98933006.ecfilter,1,nil,tp)
end
function c98933006.ecfilter(c,tp)
return c:IsSummonPlayer(tp) and not c:IsSummonableCard() and c:IsSummonLocation(LOCATION_HAND)
end
function c98933006.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsChainDisablable(ev)
end
function c98933006.disop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(98933006,2)) then
Duel.Hint(HINT_CARD,0,98933006)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
end
function c98933006.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then
if g:IsExists(c98933006.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(98933006,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c98933006.thfilter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
end
Duel.ShuffleDeck(tp)
end
end
function c98933006.thfilter(c)
return not c:IsSummonableCard() and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
\ No newline at end of file
--天外来客 群星梦魇
function c98933007.initial_effect(c)
c:SetUniqueOnField(1,0,98933007)
--xyz summon
aux.AddXyzProcedure(c,nil,11,3)
c:EnableReviveLimit()
--
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(98933007,3))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c98933007.con)
e0:SetTarget(c98933007.tg)
e0:SetOperation(c98933007.op)
e0:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e0)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c98933007.efilter)
c:RegisterEffect(e1)
--X Material
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c98933007.discon)
e3:SetOperation(c98933007.disop)
c:RegisterEffect(e3)
if not c98933007.global_check then
c98933007.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetCondition(c98933007.reccon)
ge1:SetOperation(c98933007.checkop)
Duel.RegisterEffect(ge1,0)
end
if not c98933007.global_check2 then
c98933007.global_check2=true
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetCondition(c98933007.reccon2)
ge2:SetOperation(c98933007.checkop2)
Duel.RegisterEffect(ge2,0)
end
end
function c98933007.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c98933007.con(e,c)
local tp=e:GetHandler():GetOwner()
if c==nil then return true end
return Duel.IsExistingMatchingCard(c98933007.xyzfilter1,c:GetControler(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e) and Duel.GetFlagEffect(tp,98933007)>=13
end
function c98933007.xyzfilter1(c,e)
return c:IsCanBeXyzMaterial(e:GetHandler())
end
function c98933007.tg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local xg=g:Select(tp,1,1,nil)
xg:KeepAlive()
e:SetLabelObject(xg)
return true
else return false end
end
function c98933007.op(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
local mg=e:GetLabelObject()
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
function c98933007.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),98933007,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
function c98933007.reccon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetOwner()
return eg:IsExists(c98933007.ecfilter,1,nil,tp)
end
function c98933007.ecfilter(c,tp)
return c:IsSummonPlayer(tp) and not c:IsSummonableCard()
end
function c98933007.checkop2(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetOwner()
local tc=eg:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),98933017,0,0,1)
tc=eg:GetNext()
end
if Duel.GetFlagEffect(tp,98933017)>=5 then Duel.Win(tp,0x0) end
end
function c98933007.reccon2(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetOwner()
return eg:IsExists(c98933007.ecfilter2,1,nil,tp)
end
function c98933007.ecfilter2(c,tp)
return c:IsSummonPlayer(tp) and c:IsCode(98933007)
end
function c98933007.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function c98933007.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local c=e:GetHandler()
if rc:IsRelateToEffect(re) and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(98933007,2)) and c:IsType(TYPE_XYZ) then
Duel.Hint(HINT_CARD,0,98933007)
if rc:IsRelateToEffect(re) and rc:IsCanOverlay() then
if re:IsActiveType(TYPE_SPELL+TYPE_TRAP) then
rc:CancelToGrave()
Duel.Overlay(c,Group.FromCards(rc))
else
Duel.Overlay(c,Group.FromCards(rc))
end
if c:GetOverlayCount()>=5 then Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end
end
end
end
\ No newline at end of file
--天外来客 末日颂歌
function c98933009.initial_effect(c)
c:SetUniqueOnField(1,0,98933009)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_SPSUMMON+TYPE_FUSION+TYPE_RITUAL+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK),4)
c:EnableReviveLimit()
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98933009,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c98933009.sprcon)
e2:SetOperation(c98933009.sprop)
c:RegisterEffect(e2)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98933009,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c98933009.negop)
c:RegisterEffect(e4)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c98933009.recon)
e2:SetOperation(c98933009.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c98933009.recon)
e3:SetOperation(c98933009.reop)
c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
end
function c98933009.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>0 and Duel.IsExistingMatchingCard(c98933009.pfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,tp) and Duel.GetFieldCard(tp,LOCATION_FZONE,0)==nil
end
function c98933009.sprop(e,tp,eg,ep,ev,re,r,rp,c)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c98933009.pfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,tp):GetFirst()
if tc then Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) end
end
function c98933009.pfilter(c,tp)
return c:IsCode(98933011) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function c98933009.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then
if g:IsExists(c98933009.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(98933009,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c98933009.thfilter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
end
Duel.ShuffleDeck(tp)
end
end
function c98933009.thfilter(c)
return not c:IsSummonableCard() and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c98933009.recon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,98933009)==0
end
function c98933009.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(c98933009.sop)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
end
function c98933009.sop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98933009,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c98933009.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c98933009.scfilter(c,mg)
return mg:IsExists(c98933009.cfilter,1,nil,c)
end
function c98933009.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933009)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933001)==0
end
function c98933009.reop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
if e:GetHandler():IsExtraLinkState() then
local lp=Duel.GetLP(1-tp)
Duel.SetLP(1-tp,lp/2)
end
end
\ No newline at end of file
--噩梦之域
function c98933011.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c98933011.damcon)
e2:SetOperation(c98933011.damop)
c:RegisterEffect(e2)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCondition(c98933011.recon)
e4:SetOperation(c98933011.regop)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(c98933011.recon)
e3:SetOperation(c98933011.reop)
c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
--to deck
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(98933011,0))
e5:SetCategory(CATEGORY_TODECK)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetOperation(c98933011.operation)
c:RegisterEffect(e5)
end
function c98933011.cfilter2(c,tp)
return c:IsSummonPlayer(tp) and not c:IsSummonableCard()
end
function c98933011.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c98933011.cfilter2,1,nil,tp)
end
function c98933011.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,98933011)
Duel.Damage(1-tp,100,REASON_EFFECT)
end
function c98933011.recon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,98933011)==0
end
function c98933011.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(c98933011.sop)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
end
function c98933011.sop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98933011,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c98933011.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c98933011.scfilter(c,mg)
return mg:IsExists(c98933011.cfilter,1,nil,c)
end
function c98933011.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933011)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933001)==0
end
function c98933011.reop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
local tp=e:GetHandler():GetControler()
local b2=Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil)
if b2 and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.SelectYesNo(tp,aux.Stringid(98933011,0)) then
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g==0 then return end
Duel.HintSelection(g)
local tc=g:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if Duel.Destroy(tc,REASON_EFFECT) and rg:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoGrave(rg,REASON_EFFECT)
end
end
end
function c98933011.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
\ No newline at end of file
--通往毁灭之路
function c98933012.initial_effect(c)
c:SetUniqueOnField(1,0,98933012)
c:EnableCounterPermit(0xa9)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DRAW_PHASE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_DECK)
e2:SetCost(c98933012.cost)
c:RegisterEffect(e2)
--act in hand
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e3:SetCost(c98933012.cost)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCondition(c98933012.recon)
e4:SetOperation(c98933012.regop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetRange(LOCATION_SZONE)
e5:SetCondition(c98933012.recon)
e5:SetOperation(c98933012.reop)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EVENT_CHAIN_NEGATED)
c:RegisterEffect(e6)
--to deck
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_ADD_COUNTER+0xa9)
e7:SetCondition(c98933012.atkcon)
e7:SetOperation(c98933012.atkop)
c:RegisterEffect(e7)
if not c98933012.global_check then
c98933012.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c98933012.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c98933012.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local tp=e:GetHandler():GetOwner()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return ft>1 and Duel.GetFlagEffect(tp,98933012)>=1 end
if e:GetHandler():IsLocation(LOCATION_DECK) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function c98933012.checkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetOwner()
if re:GetCode()==EVENT_SPSUMMON and re:GetHandler():IsType(TYPE_MONSTER) then Duel.RegisterFlagEffect(tp,98933012,RESET_CHAIN,0,1) end
end
function c98933012.ecfilter(c,tp)
return c:IsSummonPlayer(tp) and not c:IsSummonableCard() and c:IsSummonLocation(LOCATION_HAND)
end
function c98933012.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(98933012)>0 or (e:GetCode()~=EVENT_CHAIN_NEGATED)) and Duel.GetFlagEffect(tp,98933012)==0
end
function c98933012.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0x11b)
if chk==0 then return Duel.IsExistingMatchingCard(c98933012.filter,tp,0xff-LOCATION_HAND,0,1,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98933012.reop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c98933012.SSfilter,tp,0xff-LOCATION_HAND,0,1,nil) and e:GetHandler():IsCanAddCounter(0xa9,1) and Duel.SelectYesNo(tp,aux.Stringid(98933012,0)) then
Duel.RegisterFlagEffect(tp,98933012,RESET_CHAIN,0,1)
local c=e:GetHandler()
c:AddCounter(0xa9,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98933012.SSfilter,tp,0xff-LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SpecialSummonRule(tp,tc)
end
end
end
function c98933012.SSfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsSummonableCard() and c:IsSpecialSummonable()
end
function c98933012.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0xa9)==10
end
function c98933012.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_RULE)
end
end
\ No newline at end of file
--招来的噩梦
function c98933014.initial_effect(c)
--Activate(Special Summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(c98933014.discon)
e1:SetTarget(c98933014.distg)
e1:SetOperation(c98933014.disop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_DECK)
e2:SetCost(c98933014.cost)
c:RegisterEffect(e2)
--act in hand
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e3:SetCost(c98933014.cost)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_GRAVE)
e4:SetCost(aux.bfgcost)
e4:SetTarget(c98933014.thtg)
e4:SetOperation(c98933014.thop)
c:RegisterEffect(e4)
end
function c98933014.discon(e,tp,eg,ep,ev,re,r,rp)
return tp==ep and aux.NegateSummonCondition()
end
function c98933014.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,eg:GetCount(),0,0)
end
function c98933014.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
if Duel.SendtoHand(eg,nil,REASON_EFFECT) and not Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil,TYPE_TRAP) and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(98933014,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c98933014.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
if g:GetFirst():IsLocation(LOCATION_HAND) or g:GetFirst():IsFacedown() then
Duel.ConfirmCards(1-tp,g)
end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
if e:GetHandler():IsLocation(LOCATION_DECK) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function c98933014.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=1 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c98933014.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if not tc:IsSummonableCard() and tc:IsType(TYPE_MONSTER) and tc:IsAbleToHand() then
Duel.DisableShuffleCheck()
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ShuffleHand(tp)
else
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
end
\ No newline at end of file
......@@ -69,6 +69,9 @@ function c98941049.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>ct
and (Duel.CheckReleaseGroupEx(tp,Card.IsReleasable,1,e:GetHandler()) or Duel.GetTurnPlayer()==tp)
end
function c98941049.rrfilter(c,e,tp)
return c:IsSetCard(0xb4) and c:IsType(TYPE_RITUAL) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true)
end
function c98941049.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
......@@ -77,16 +80,20 @@ function c98941049.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
c:CompleteProcedure()
else
local sg=Duel.SelectMatchingCard(tp,c98941049.rrfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
tc=sg:GetFirst()
if not tc then return false end
if ft>0 then
g=Duel.SelectReleaseGroupEx(tp,Card.IsReleasableByEffect,1,1,REASON_EFFECT,true,e:GetHandler())
g=Duel.SelectReleaseGroupEx(tp,Card.IsReleasableByEffect,1,1,REASON_EFFECT,true,tc)
else
g=Duel.SelectReleaseGroupEx(tp,c98941049.hspfilter,1,1,REASON_EFFECT,false,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
c:SetMaterial(g)
Duel.ReleaseRitualMaterial(g)
Duel.BreakEffect()
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
c:CompleteProcedure()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c98941049.spfilter(c,tp,re)
......@@ -137,24 +144,6 @@ function c98941049.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,sg)
end
end
--cannot attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c98941049.atklimitcon)
e3:SetTarget(c98941049.atklimittg)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
--check
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetOperation(c98941049.checkop)
e4:SetLabelObject(e3)
e4:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e4,tp)
end
function c98941049.eqlimit(e,c)
return c==e:GetLabelObject()
......
......@@ -69,6 +69,9 @@ function c98941050.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>ct
and (Duel.CheckReleaseGroupEx(tp,Card.IsReleasable,1,e:GetHandler()) or Duel.GetTurnPlayer()==tp)
end
function c98941050.rrfilter(c,e,tp)
return c:IsSetCard(0xb4) and c:IsType(TYPE_RITUAL) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true)
end
function c98941050.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
......@@ -77,16 +80,20 @@ function c98941050.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
c:CompleteProcedure()
else
local sg=Duel.SelectMatchingCard(tp,c98941050.rrfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
tc=sg:GetFirst()
if not tc then return false end
if ft>0 then
g=Duel.SelectReleaseGroupEx(tp,Card.IsReleasableByEffect,1,1,REASON_EFFECT,true,e:GetHandler())
g=Duel.SelectReleaseGroupEx(tp,Card.IsReleasableByEffect,1,1,REASON_EFFECT,true,tc)
else
g=Duel.SelectReleaseGroupEx(tp,c98941050.hspfilter,1,1,REASON_EFFECT,false,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
c:SetMaterial(g)
Duel.ReleaseRitualMaterial(g)
Duel.BreakEffect()
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
c:CompleteProcedure()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c98941050.spfilter(c,tp,re)
......@@ -150,24 +157,6 @@ function c98941050.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e0,tp)
end
end
--cannot attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c98941050.atklimitcon)
e3:SetTarget(c98941050.atklimittg)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
--check
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetOperation(c98941050.checkop)
e4:SetLabelObject(e3)
e4:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e4,tp)
end
function c98941050.thlimit(e,c,tp,re)
return c:IsCode(e:GetLabel()) and re and re:GetHandler():IsCode(98941050)
......
......@@ -581,6 +581,7 @@
!setname 0x4315 木灵
!setname 0x3316 圣域歌
!setname 0x6316 万感
!setname 0x9316 四世坏
!setname 0x0310 燧烽
!setname 0x3310 赤燧烽
!setname 0x5310 苍燧烽
......
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