Commit a79dbd97 authored by Grajade's avatar Grajade

Update c74561013.lua

parent 07f319c0
......@@ -53,51 +53,77 @@ function cCardno.handcon(e)
return Duel.GetTurnCount() == 1
end
--Activate
function cCardno.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local lp = Duel.GetLP(tp)
e:SetLabel(lp)
Duel.SetChainLimit(aux.FALSE)
function cCardno.rfilter(c)
return c:IsSetCard(0x5208,0x6208) and c:IsAbleToRemove()
end
function cCardno.rfilter(c,tp)
return (c:IsSetCard(0x5208) or c:IsSetCard(0x6208)) and c:IsAbleToRemove(tp)
function cCardno.gfilter(c)
return not c:IsSetCard(0x5208,0x6208) and c:IsAbleToGrave()
end
function cCardno.gfilter(c,tp)
return not (c:IsSetCard(0x5208) or c:IsSetCard(0x6208)) and c:IsAbleToGrave(tp)
function cCardno.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cCardno.rfilter,tp,LOCATION_MZONE,0,1,nil) or Duel.IsExistingMatchingCard(cCardno.gfilter,tp,LOCATION_MZONE,0,1,nil) end
local lp=Duel.GetLP(tp)
e:SetLabel(lp)
Duel.SetChainLimit(aux.FALSE)
end
function cCardno.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(cCardno.rfilter,tp,LOCATION_MZONE,0,nil,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
local e2=e1:Clone()
--自己场上里侧除外
if Duel.Remove(g1,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 then
g1:KeepAlive()
e1:SetLabelObject(g1)
e1:SetOperation(cCardno.reop)
Duel.RegisterEffect(e1,tp)
end
--set lp
local lp = e:GetLabel()
e2:SetLabel(lp)
e2:SetOperation(cCardno.slop)
Duel.RegisterEffect(e2,tp)
--send to grave
local g2=Duel.GetMatchingGroup(cCardno.gfilter,tp,LOCATION_MZONE,0,nil,tp)
if g2 then Duel.SendtoGrave(g2,REASON_EFFECT) end
--damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetTargetRange(1,0)
e3:SetValue(0)
Duel.RegisterEffect(e3,tp)
local c=e:GetHandler()
local fid=c:GetFieldID()
local ag=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local cg=ag:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then Duel.ConfirmCards(1-tp,cg) end
local rg=ag:Filter(cCardno.rfilter,nil)
if Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)>0 then
rg:KeepAlive()
for tc in aux.Next(rg) do
tc:RegisterFlagEffect(74561013,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Cardno,3))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(rg)
e1:SetOperation(cCardno.reop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
local gg=ag:Filter(cCardno.gfilter,nil)
if gg:GetCount()>0 then Duel.SendtoGrave(gg,REASON_EFFECT) end
local lp=e:GetLabel()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(Cardno,4))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabel(lp)
e2:SetOperation(cCardno.slop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetTargetRange(1,0)
e3:SetValue(0)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cCardno.slop(e,tp,eg,ep,ev,re,r,rp)
local lp=e:GetLabel()
Duel.SetLP(tp,lp)
end
function cCardno.refilter(c,fid)
return c:GetFlagEffect(74561013)>0
and c:GetFlagEffectLabel(74561013)==fid
end
function cCardno.reop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local sg=g:Filter(cCardno.refilter,nil,e:GetLabel())
if sg:GetCount()<1 then return end
for tc in aux.Next(sg) do
Duel.ReturnToField(tc)
end
end
--battle damage
function cCardno.rdval(e,re,val,r,rp,rc)
......@@ -106,28 +132,4 @@ function cCardno.rdval(e,re,val,r,rp,rc)
else
return val
end
end
--set lp
function cCardno.slop(e,tp,eg,ep,ev,re,r,rp)
local lp = e:GetLabel()
Duel.SetLP(tp,lp)
end
--return
function cCardno.refilter(c)
--魔陷+非永续非场地+表侧表示
return ( c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP) ) and not ( c:IsType(TYPE_CONTINUOUS) or c:IsType(TYPE_FIELD) ) and c:IsPreviousPosition(POS_FACEUP)
end
function cCardno.reop(e,tp,eg,ep,ev,re,r,rp)
local g = e:GetLabelObject()
if g then
local tc=g:GetFirst()
while tc do
if cCardno.refilter(tc) then
Duel.SendtoGrave(tc,REASON_RULE)
else
Duel.ReturnToField(tc)
end
tc=g:GetNext()
end
end
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