Commit 02c56a04 authored by POLYMER's avatar POLYMER

fix

parent 470e5be5
No preview for this file type
--大风起兮
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--activate cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCondition(s.accon)
e2:SetTarget(s.actarget)
e2:SetCost(s.accost)
e2:SetOperation(s.acop)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_FZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(s.sumlimit)
c:RegisterEffect(e3)
end
function s.accon(e)
s[0]=false
return true
end
function s.actarget(e,te)
local tc=te:GetHandler()
e:SetLabelObject(te)
return tc:IsLocation(LOCATION_ONFIELD) and not (tc:IsLocation(LOCATION_FZONE) or tc:IsLocation(LOCATION_PZONE))
end
function s.accost(e,te)
local tc=te:GetHandler()
local tp=tc:GetControler()
local seq=tc:GetSequence()
return tc:IsLocation(LOCATION_MZONE) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) or (seq==5 and Duel.CheckLocation(tp,LOCATION_MZONE,1)) or (seq==6 and Duel.CheckLocation(tp,LOCATION_MZONE,3))) or tc:IsLocation(LOCATION_SZONE) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp,LOCATION_SZONE,seq+1)))
end
function s.acop(e,eg,ep,ev,re,r,rp)
if s[0] then return end
local te=e:GetLabelObject()
local tc=te:GetHandler()
local tp=tc:GetControler()
local seq=tc:GetSequence()
local pos=tc:GetPosition()
local a=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
if tc:IsLocation(LOCATION_MZONE) and (seq==0 or seq==5) then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xfffd) end
if tc:IsLocation(LOCATION_MZONE) and seq==1 then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xfffa) end
if tc:IsLocation(LOCATION_MZONE) and seq==2 then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xfff5) end
if tc:IsLocation(LOCATION_MZONE) and seq==3 then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xffeb) end
if tc:IsLocation(LOCATION_MZONE) and (seq==4 or seq==6) then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xfff7) end
if tc:IsLocation(LOCATION_SZONE) and seq==0 then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xfdff) end
if tc:IsLocation(LOCATION_SZONE) and seq==1 then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xfaff) end
if tc:IsLocation(LOCATION_SZONE) and seq==2 then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xf5ff) end
if tc:IsLocation(LOCATION_SZONE) and seq==3 then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xebff) end
if tc:IsLocation(LOCATION_SZONE) and seq==4 then a=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xf7ff) end
local nseq=0
if not a then return end
if a==0x1 or a==0x100 then nseq=0
elseif a==0x2 or a==0x200 then nseq=1
elseif a==0x4 or a==0x400 then nseq=2
elseif a==0x8 or a==0x800 then nseq=3
elseif a==0x10 or a==0x1000 then nseq=4
else end
Duel.MoveSequence(tc,nseq)
s[0]=true
end
function s.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA)
end
\ No newline at end of file
--风起之时
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--移动
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_MOVE)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.condition)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.tg)
e2:SetOperation(s.op)
c:RegisterEffect(e2)
end
function s.filter(c)
return (aux.IsCodeListed(c,65812000) or c:IsCode(65812000)) and c:IsAbleToHand() and not c:IsCode(id)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
e:SetLabel(0)
local c=e:GetHandler()
if c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD) and (c:GetSequence()~=c:GetPreviousSequence() or c:GetLocation()~=c:GetPreviousLocation()) then e:SetLabel(114514) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if e:GetLabel()==114514 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,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 e:GetLabel()==114514
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function s.cfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.op(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_SOLVING)
e3:SetReset(RESET_PHASE+PHASE_END,2)
e3:SetOperation(s.negop)
Duel.RegisterEffect(e3,tp)
end
function s.filter1(c,e)
local tp=c:GetControler()
local seq=c:GetSequence()
if seq>4 or c:IsLocation(LOCATION_PZONE) then return false end
return (c:IsLocation(LOCATION_MZONE) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))) or c:IsLocation(LOCATION_SZONE) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp,LOCATION_SZONE,seq+1)))) and not c:IsImmuneToEffect(e)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
e:Reset()
Duel.Hint(HINT_CARD,0,id)
local g=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e)
local tc=g:GetFirst()
local seq=tc:GetSequence()
if seq>4 then return end
local flag=0
local p=tc:GetControler()
if tc:IsLocation(LOCATION_MZONE) then
if seq>0 and Duel.CheckLocation(p,LOCATION_MZONE,seq-1) then flag=flag|(1<<(seq-1)) end
if seq<4 and Duel.CheckLocation(p,LOCATION_MZONE,seq+1) then flag=flag|(1<<(seq+1)) end
end
if tc:IsLocation(LOCATION_SZONE) then
if seq>0 and Duel.CheckLocation(p,LOCATION_SZONE,seq-1) then flag=flag|(1<<(seq+7)) end
if seq<4 and Duel.CheckLocation(p,LOCATION_SZONE,seq+1) then flag=flag|(1<<(seq+9)) end
end
if flag==0 then return end
if p~=tp then flag=flag<<16 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectField(tp,1,LOCATION_ONFIELD,LOCATION_ONFIELD,~flag)
local a=s
if p~=tp then s=s>>16 end
if tc:IsLocation(LOCATION_SZONE) then s=s>>8 end
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
end
--狂风呼啸
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(s.excondition)
e0:SetDescription(aux.Stringid(id,2))
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
if not PNFL_LOCATION_CHECK then
PNFL_LOCATION_CHECK=true
local ge6=Effect.CreateEffect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_MOVE)
ge6:SetCondition(s.condition)
ge6:SetOperation(s.checkop6)
Duel.RegisterEffect(ge6,true)
end
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,5))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.locfilter,1,nil)
end
function s.checkop6(e,tp,eg,ep,ev,re,r,rp)
eg:IsExists(s.locfilter,1,nil)
local tg=Duel.GetMatchingGroup(s.locfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(65812010,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(65812010,3))
end
end
end
function s.locfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(65812010)==0
end
function s.exfilter(c)
return c:IsCode(65812000) and c:IsFaceup()
end
function s.excondition(e)
return Duel.IsExistingMatchingCard(s.exfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function s.filter(c)
return not c:IsLocation(LOCATION_FZONE) and not c:IsLocation(LOCATION_PZONE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function s.get(c,e)
return not c:IsImmuneToEffect(e) and c:GetSequence()<=4 and not c:IsLocation(LOCATION_PZONE)
end
function s.shfilter(c)
return c:GetFlagEffect(65812010)>0
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=aux.SelectFromOptions(tp,
{true,aux.Stringid(id,0)},
{true,aux.Stringid(id,1)})
local a=0
local rsg=0
if Duel.IsExistingMatchingCard(s.shfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then a=1 end
if op==2 then
local g=Duel.GetMatchingGroup(s.get,tp,LOCATION_MZONE,0,nil,e)
local num1=g:GetCount()
local g2=Duel.GetMatchingGroup(s.get,1-tp,LOCATION_MZONE,0,nil,e)
local num2=g2:GetCount()
local g3=Duel.GetMatchingGroup(s.get,tp,LOCATION_SZONE,0,nil,e)
local num3=g3:GetCount()
local g4=Duel.GetMatchingGroup(s.get,1-tp,LOCATION_SZONE,0,nil,e)
local num4=g4:GetCount()
for i=1,num1 do
local sg=g:Clone()
for tc in aux.Next(sg) do
local seq=tc:GetSequence()
if seq~=4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then
Duel.MoveSequence(tc,seq+1)
g:RemoveCard(tc)
rsg=rsg+1
end
end
end
for i=1,num2 do
local sg2=g2:Clone()
for tc in aux.Next(sg2) do
local seq=tc:GetSequence()
if seq~=4 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq+1) then
Duel.MoveSequence(tc,seq+1)
g2:RemoveCard(tc)
rsg=rsg+1
end
end
end
for i=1,num3 do
local sg3=g3:Clone()
for tc in aux.Next(sg3) do
local seq=tc:GetSequence()
if seq~=4 and Duel.CheckLocation(tp,LOCATION_SZONE,seq+1) then
Duel.MoveSequence(tc,seq+1)
g3:RemoveCard(tc)
rsg=rsg+1
end
end
end
for i=1,num4 do
local sg4=g4:Clone()
for tc in aux.Next(sg4) do
local seq=tc:GetSequence()
if seq~=4 and Duel.CheckLocation(1-tp,LOCATION_SZONE,seq+1) then
Duel.MoveSequence(tc,seq+1)
g4:RemoveCard(tc)
rsg=rsg+1
end
end
end
elseif op==1 then
local g=Duel.GetMatchingGroup(s.get,tp,LOCATION_MZONE,0,nil,e)
local num1=g:GetCount()
local g2=Duel.GetMatchingGroup(s.get,1-tp,LOCATION_MZONE,0,nil,e)
local num2=g2:GetCount()
local g3=Duel.GetMatchingGroup(s.get,tp,LOCATION_SZONE,0,nil,e)
local num3=g3:GetCount()
local g4=Duel.GetMatchingGroup(s.get,1-tp,LOCATION_SZONE,0,nil,e)
local num4=g4:GetCount()
for i=1,num1 do
local sg=g:Clone()
for tc in aux.Next(sg) do
local seq=tc:GetSequence()
if seq~=0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then
Duel.MoveSequence(tc,seq-1)
g:RemoveCard(tc)
rsg=rsg+1
end
end
end
for i=1,num2 do
local sg2=g2:Clone()
for tc in aux.Next(sg2) do
local seq=tc:GetSequence()
if seq~=0 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq-1) then
Duel.MoveSequence(tc,seq-1)
g2:RemoveCard(tc)
rsg=rsg+1
end
end
end
for i=1,num3 do
local sg3=g3:Clone()
for tc in aux.Next(sg3) do
local seq=tc:GetSequence()
if seq~=0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1) then
Duel.MoveSequence(tc,seq-1)
g3:RemoveCard(tc)
rsg=rsg+1
end
end
end
for i=1,num4 do
local sg4=g4:Clone()
for tc in aux.Next(sg4) do
local seq=tc:GetSequence()
if seq~=0 and Duel.CheckLocation(1-tp,LOCATION_SZONE,seq-1) then
Duel.MoveSequence(tc,seq-1)
g4:RemoveCard(tc)
rsg=rsg+1
end
end
end
end
if rsg>0 and a>0 and Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sc=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
if sc:IsFaceup() and sc:IsCanBeDisabledByEffect(e,false) then
Duel.NegateRelatedChain(sc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
sc:RegisterEffect(e2)
if sc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
sc:RegisterEffect(e3)
end
end
end
end
function s.cfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
local code1,code2=c:GetPreviousCodeOnField()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and (code1==65812000 or code2==65812000)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,se) and not eg:IsContains(e:GetHandler())
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
\ No newline at end of file
--大风扬积雪击落
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--增加卡名
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetCode(EFFECT_ADD_CODE)
e0:SetRange(0xff)
e0:SetValue(65812000)
c:RegisterEffect(e0)
--Activate
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(id,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_MOVE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.condition)
e2:SetTarget(s.tg)
e2:SetOperation(s.op)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
--炸卡
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_MOVE)
e6:SetCondition(s.condition1)
e6:SetOperation(s.checkop6)
Duel.RegisterEffect(e6,true)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetRange(LOCATION_SZONE)
e7:SetCode(EVENT_ADJUST)
e7:SetCondition(s.descon)
e7:SetOperation(s.op7)
c:RegisterEffect(e7)
end
function s.cfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local seq=c:GetSequence()
if chk==0 then return c:IsLocation(LOCATION_SZONE) and (seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1) or seq<4 and Duel.CheckLocation(tp,LOCATION_SZONE,seq+1)) and c:GetFlagEffect(id)==0 end
local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+ph,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local seq=c:GetSequence()
if seq>4 then return end
local flag=0
if c:IsLocation(LOCATION_SZONE) then
if seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1) then flag=flag|(1<<(seq+7)) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_SZONE,seq+1) then flag=flag|(1<<(seq+9)) end
end
local p=c:GetControler()
if flag==0 then return end
if p~=tp then flag=flag<<16 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectField(tp,1,LOCATION_ONFIELD,LOCATION_ONFIELD,~flag)
if p~=tp then s=s>>16 end
if c:IsLocation(LOCATION_SZONE) then s=s>>8 end
local nseq=math.log(s,2)
Duel.MoveSequence(c,nseq)
end
function s.condition1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(s.locfilter1,1,nil) and aux.IsInGroup(c,eg)
end
function s.checkop6(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id+1,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
end
function s.locfilter1(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(id+1)==0
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(id+1)>0
end
function s.op7(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=c:GetColumnGroup()
if tg:GetCount()>0 then
Duel.Hint(HINT_CARD,0,id)
Duel.Destroy(tg,REASON_EFFECT)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP)
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp
end
function s.spfilter(c,e,tp)
return aux.IsCodeListed(c,65812000) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsType(TYPE_MONSTER)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_REMOVED+LOCATION_GRAVE)
end
function s.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,s.spfilter,tp,LOCATION_HAND+LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
\ No newline at end of file
--风切之铎
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddEquipSpellEffect(c,true,true,Card.IsFaceup,nil)
aux.AddCodeList(c,65812000)
--装备
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--change code
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_ADD_CODE)
e5:SetValue(65812000)
c:RegisterEffect(e5)
--leave
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetOperation(s.desop)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e7:SetRange(LOCATION_SZONE)
e7:SetCode(EVENT_LEAVE_FIELD)
e7:SetCondition(s.descon2)
e7:SetOperation(s.desop2)
c:RegisterEffect(e7)
--回收
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(id,1))
e8:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e8:SetCode(EVENT_MOVE)
e8:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e8:SetProperty(EFFECT_FLAG_DELAY)
e8:SetCondition(s.condition)
e8:SetCost(s.thcost)
e8:SetTarget(s.thtg)
e8:SetOperation(s.thop)
c:RegisterEffect(e8)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,tp)
end
function s.filter(c,e,tp)
return c:IsFaceup()
end
function s.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:IsFaceup() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not c:IsForbidden() and c:CheckUniqueOnField(tp)
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>=0 and not tc:IsFacedown() and tc:IsLocation(LOCATION_MZONE) then
Duel.Equip(tp,c,tc)
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.descon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
function s.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
function s.cfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler())
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function s.filter2(c)
return (aux.IsCodeListed(c,65812000) or c:IsCode(65812000)) and c:IsAbleToDeck()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter2),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,3,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.IsPlayerCanDraw(tp,1)
and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==3
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--风起 云飞扬
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--放置
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(s.cost)
e1:SetTarget(s.tftg)
e1:SetOperation(s.tfop)
c:RegisterEffect(e1)
--特招
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.cost(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 s.tffilter(c,tp)
return c:IsCode(65812000) and not c:IsForbidden() and c:CheckUniqueOnField(tp) and c:IsType(TYPE_CONTINUOUS)
end
function s.tffilter1(c,tp)
return c:IsCode(65812000) and not c:IsForbidden() and c:CheckUniqueOnField(tp) and c:IsType(TYPE_FIELD)
end
function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.tffilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp)
or Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.tffilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp) end
end
function s.tfop(e,tp,eg,ep,ev,re,r,rp)
local g1=Group.CreateGroup()
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.tffilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp) end
g1:Merge(Duel.GetMatchingGroup(aux.NecroValleyFilter(s.tffilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=g1:Select(tp,1,1,nil):GetFirst()
if tc and tc:IsType(TYPE_CONTINUOUS) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end
if tc and tc:IsType(TYPE_FIELD) then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.Destroy(fc,REASON_RULE)
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
function s.cfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
local code1,code2=c:GetPreviousCodeOnField()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and (code1==65812000 or code2==65812000)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,se) and not eg:IsContains(e:GetHandler())
end
function s.settg(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)
or Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or (not c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)) then return end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
local toplayer=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1),tp},
{b2,aux.Stringid(id,2),1-tp})
if toplayer~=nil then
Duel.SpecialSummon(c,0,tp,toplayer,false,false,POS_FACEUP)
else
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then
Duel.SendtoGrave(c,REASON_RULE)
end
end
end
\ No newline at end of file
--风起 星天外
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--特招
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_CHAIN)
e1:SetTarget(s.tftg)
e1:SetOperation(s.tfop)
c:RegisterEffect(e1)
if not PNFL_LOCATION_CHECK then
PNFL_LOCATION_CHECK=true
local ge6=Effect.CreateEffect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_MOVE)
ge6:SetCondition(s.condition)
ge6:SetOperation(s.checkop6)
Duel.RegisterEffect(ge6,true)
end
--炸卡
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(s.spcon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.locfilter,1,nil)
end
function s.checkop6(e,tp,eg,ep,ev,re,r,rp)
eg:IsExists(s.locfilter,1,nil)
local tg=Duel.GetMatchingGroup(s.locfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(65812010,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(65812010,3))
end
end
end
function s.locfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(65812010)==0
end
function s.shfilter(c)
return c:GetFlagEffect(65812010)>0
end
function s.tffilter(c,e,tp)
return c:IsFaceupEx() and (c:IsLocation(LOCATION_HAND+LOCATION_ONFIELD) or (c:IsLocation(LOCATION_DECK) and Duel.IsExistingMatchingCard(s.shfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) and (aux.IsCodeListed(c,65812000) or c:IsCode(65812000)) and Duel.GetFlagEffect(tp,id)==0)) and Duel.GetMZoneCount(tp,c)>0
end
function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.tffilter,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK,0,1,c,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.tfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(s.tffilter,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK,0,1,c,tp) then return end
local tc=Duel.SelectMatchingCard(tp,s.tffilter,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK,0,1,1,c,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then Duel.RegisterFlagEffect(tp,id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) end
if Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_ONFIELD)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--风起 天衢引
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddLinkProcedure(c,nil,2,2,s.lcheck)
c:EnableReviveLimit()
c:SetSPSummonOnce(id)
aux.AddCodeList(c,65812000)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.setcon)
e1:SetCost(s.cost)
e1:SetTarget(s.settg)
e1:SetOperation(s.setop)
c:RegisterEffect(e1)
if not PNFL_LOCATION_CHECK then
PNFL_LOCATION_CHECK=true
local ge6=Effect.CreateEffect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_MOVE)
ge6:SetCondition(s.condition)
ge6:SetOperation(s.checkop6)
Duel.RegisterEffect(ge6,true)
end
end
function s.lfilter(c)
return aux.IsCodeListed(c,65812000)
end
function s.lcheck(g)
return g:IsExists(s.lfilter,1,nil)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.locfilter,1,nil)
end
function s.checkop6(e,tp,eg,ep,ev,re,r,rp)
eg:IsExists(s.locfilter,1,nil)
local tg=Duel.GetMatchingGroup(s.locfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(65812010,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(65812010,3))
end
end
end
function s.locfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(65812010)==0
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.tffilter1(c,tp)
return c:IsCode(65812000) and not c:IsForbidden() and c:CheckUniqueOnField(tp) and c:IsType(TYPE_FIELD)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.tffilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tffilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.Destroy(fc,REASON_RULE)
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
function s.tgfilter(c)
return (aux.IsCodeListed(c,65812000) or c:IsCode(65812000)) and c:IsAbleToGrave()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function s.spfilter(c,e,tp)
return aux.IsCodeListed(c,65812000) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.shfilter(c)
return c:GetFlagEffect(65812010)>0
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoGrave(g,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(s.shfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
\ No newline at end of file
--风起 铃空响
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.hdcon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,id+1)
c:RegisterEffect(e3)
--discard self deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+2)
e2:SetTarget(s.thtg2)
e2:SetOperation(s.thop2)
c:RegisterEffect(e2)
if not PNFL_LOCATION_CHECK1 then
PNFL_LOCATION_CHECK1=true
local ge6=Effect.CreateEffect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_MOVE)
ge6:SetCondition(s.condition)
ge6:SetOperation(s.checkop6)
Duel.RegisterEffect(ge6,true)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.locfilter,1,nil)
end
function s.checkop6(e,tp,eg,ep,ev,re,r,rp)
eg:IsExists(s.locfilter,1,nil)
local tg=Duel.GetMatchingGroup(s.locfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end
end
end
function s.locfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(id)==0
end
function s.hdcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function s.shfilter(c)
return c:GetFlagEffect(id)>0
end
function s.thfilter2(c)
return c:IsFaceupEx() and (c:IsCode(65812000) or Duel.IsExistingMatchingCard(s.shfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) and aux.IsCodeListed(c,65812000)) and c:IsAbleToHand()
end
function s.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--风起 浪滔天
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--特招
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_CHAIN)
e1:SetTarget(s.tftg)
e1:SetOperation(s.tfop)
c:RegisterEffect(e1)
if not PNFL_LOCATION_CHECK then
PNFL_LOCATION_CHECK=true
local ge6=Effect.CreateEffect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_MOVE)
ge6:SetCondition(s.condition)
ge6:SetOperation(s.checkop6)
Duel.RegisterEffect(ge6,true)
end
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,id+1+EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(s.actarget)
e4:SetOperation(s.negop)
c:RegisterEffect(e4)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.locfilter,1,nil)
end
function s.checkop6(e,tp,eg,ep,ev,re,r,rp)
eg:IsExists(s.locfilter,1,nil)
local tg=Duel.GetMatchingGroup(s.locfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(65812010,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(65812010,3))
end
end
end
function s.locfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(65812010)==0
end
function s.shfilter(c)
return c:GetFlagEffect(65812010)>0
end
function s.tffilter(c,e,tp)
return c:IsAbleToHand() and c:IsFaceupEx() and (c:IsControler(tp) and (aux.IsCodeListed(c,65812000) or c:IsCode(65812000)) or c:IsControler(1-tp) and Duel.IsExistingMatchingCard(s.shfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp)) and Duel.GetMZoneCount(tp,c)>0
end
function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.tffilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.tfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(s.tffilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,e,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local tc=Duel.SelectMatchingCard(tp,s.tffilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c,e,tp):GetFirst()
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
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_CANNOT_TRIGGER)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.cfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
local code1,code2=c:GetPreviousCodeOnField()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and (code1==65812000 or code2==65812000)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,se) and not eg:IsContains(e:GetHandler())
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
function s.cfilter1(c,e)
local tp=c:GetControler()
local seq=c:GetSequence()
if seq>4 or c:IsLocation(LOCATION_PZONE) then return false end
return (c:IsLocation(LOCATION_MZONE) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))) or c:IsLocation(LOCATION_SZONE) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp,LOCATION_SZONE,seq+1)))) and not c:IsImmuneToEffect(e)
end
function s.actarget(e,te)
local c=e:GetHandler()
local tc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT):GetHandler()
local g=c:GetColumnGroup():Filter(s.cfilter1,nil,e)
if not c or not g or not aux.IsInGroup(tc,g) then return end
e:SetLabelObject(tc)
return true
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
local tp1=tc:GetControler()
local seq=tc:GetSequence()
if (tc:IsLocation(LOCATION_MZONE) and ((seq>0 and Duel.CheckLocation(tp1,LOCATION_MZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp1,LOCATION_MZONE,seq+1))) or tc:IsLocation(LOCATION_SZONE) and ((seq>0 and Duel.CheckLocation(tp1,LOCATION_SZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp1,LOCATION_SZONE,seq+1)))) and not tc:IsImmuneToEffect(e) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
e:Reset()
Duel.Hint(HINT_CARD,0,id)
if seq>4 then return end
local flag=0
local p=tc:GetControler()
if tc:IsLocation(LOCATION_MZONE) then
if seq>0 and Duel.CheckLocation(p,LOCATION_MZONE,seq-1) then flag=flag|(1<<(seq-1)) end
if seq<4 and Duel.CheckLocation(p,LOCATION_MZONE,seq+1) then flag=flag|(1<<(seq+1)) end
end
if tc:IsLocation(LOCATION_SZONE) then
if seq>0 and Duel.CheckLocation(p,LOCATION_SZONE,seq-1) then flag=flag|(1<<(seq+7)) end
if seq<4 and Duel.CheckLocation(p,LOCATION_SZONE,seq+1) then flag=flag|(1<<(seq+9)) end
end
if flag==0 then return end
if p~=tp then flag=flag<<16 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectField(tp,1,LOCATION_ONFIELD,LOCATION_ONFIELD,~flag)
local a=s
if p~=tp then s=s>>16 end
if tc:IsLocation(LOCATION_SZONE) then s=s>>8 end
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
end
\ No newline at end of file
--风起 沙漫道
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--移动
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_MOVE)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(s.condition)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
--disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE)
e3:SetTargetRange(0,LOCATION_ONFIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.condition1)
e3:SetTarget(s.distg)
c:RegisterEffect(e3)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,id+1+EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
if not PNFL_LOCATION_CHECK then
PNFL_LOCATION_CHECK=true
local ge6=Effect.CreateEffect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_MOVE)
ge6:SetCondition(s.condition2)
ge6:SetOperation(s.checkop6)
Duel.RegisterEffect(ge6,true)
end
end
function s.cfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function s.filter(c)
return c:IsCode(65812000) and c:IsFaceup()
end
function s.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function s.distg(e,c)
return (c:IsType(TYPE_EFFECT+TYPE_SPELL+TYPE_TRAP) or c:GetOriginalType()&TYPE_EFFECT~=0) and e:GetHandler():GetColumnGroup():IsContains(c)
end
function s.cfilter1(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
local code1,code2=c:GetPreviousCodeOnField()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and (code1==65812000 or code2==65812000)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter1,1,nil,se) and not eg:IsContains(e:GetHandler())
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function s.shfilter(c)
return c:GetFlagEffect(65812010)>0
end
function s.shfilter1(c,e,tp)
return c:IsControler(1-tp) and c:IsControlerCanBeChanged() and not c:IsImmuneToEffect(e)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(s.shfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.shfilter1,tp,0,LOCATION_MZONE,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
local g=Duel.SelectMatchingCard(tp,s.shfilter1,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.HintSelection(g)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
tc:RegisterEffect(e1)
end
end
function s.condition2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.locfilter,1,nil)
end
function s.checkop6(e,tp,eg,ep,ev,re,r,rp)
eg:IsExists(s.locfilter,1,nil)
local tg=Duel.GetMatchingGroup(s.locfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(65812010,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(65812010,3))
end
end
end
function s.locfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(65812010)==0
end
\ No newline at end of file
--风起 烛影摇
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,65812000)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.tftg)
e1:SetOperation(s.tfop)
c:RegisterEffect(e1)
if not PNFL_LOCATION_CHECK1 then
PNFL_LOCATION_CHECK1=true
local ge6=Effect.CreateEffect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_MOVE)
ge6:SetCondition(s.condition)
ge6:SetOperation(s.checkop6)
Duel.RegisterEffect(ge6,true)
end
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e4:SetCountLimit(1,id+1+EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(s.lvcon)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
if not PNFL_LOCATION_CHECK then
PNFL_LOCATION_CHECK=true
local ge7=Effect.CreateEffect(c)
ge7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge7:SetCode(EVENT_MOVE)
ge7:SetCondition(s.condition1)
ge7:SetOperation(s.checkop7)
Duel.RegisterEffect(ge7,true)
end
end
function s.cost(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 s.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.shfilter(c)
return c:GetFlagEffect(65812040)>0
end
function s.tfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(s.shfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.sfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.sfilter2),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
else
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetOperation(s.effop)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
end
function s.sfilter2(c)
return (aux.IsCodeListed(c,65812000) or c:IsCode(65812000)) and c:IsAbleToHand()
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.sfilter2),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.locfilter,1,nil)
end
function s.checkop6(e,tp,eg,ep,ev,re,r,rp)
eg:IsExists(s.locfilter,1,nil)
local tg=Duel.GetMatchingGroup(s.locfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(65812040,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(65812040,1))
end
end
end
function s.locfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(65812040)==0
end
function s.lvcon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return ep==tp and (LOCATION_HAND)&loc~=0 and re:IsActiveType(TYPE_MONSTER) and aux.IsCodeListed(re:GetHandler(),65812000) and not eg:IsContains(e:GetHandler()) and not re:GetHandler():IsCode(id)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.shfilter1(c)
return c:GetFlagEffect(65812010)>0
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsAbleToHand() and Duel.IsExistingMatchingCard(s.shfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
else
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.condition1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.locfilter,1,nil)
end
function s.checkop7(e,tp,eg,ep,ev,re,r,rp)
eg:IsExists(s.locfilter,1,nil)
local tg=Duel.GetMatchingGroup(s.locfilter1,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(65812010,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(65812010,3))
end
end
end
function s.locfilter1(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_ONFIELD)
and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler() or c:GetPreviousLocation()~=c:GetLocation())
and c:GetFlagEffect(65812010)==0
end
\ No newline at end of file
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