Commit c47b06a4 authored by Huangnan's avatar Huangnan

fix S:P Little Night

parent ba6f5b0d
Pipeline #22970 passed with stages
in 25 minutes and 23 seconds
--coded by Lyris --S:Pリトルナイト
--S:P Little Night --S:P Little Night
--coded by Lyris
local s, id, o = GetID() local s, id, o = GetID()
function s.initial_effect(c) function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
...@@ -17,24 +18,29 @@ function s.initial_effect(c) ...@@ -17,24 +18,29 @@ function s.initial_effect(c)
e1:SetTarget(s.srmtg) e1:SetTarget(s.srmtg)
e1:SetOperation(s.srmop) e1:SetOperation(s.srmop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--banish 2 cards
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCategory(CATEGORY_REMOVE) e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetLabelObject(e1)
e2:SetCode(EVENT_CHAINING) e2:SetValue(s.mchk)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(s.drmcon)
e2:SetTarget(s.drmtg)
e2:SetOperation(s.drmop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--banish 2 cards
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(s.drmcon)
e3:SetTarget(s.drmtg)
e3:SetOperation(s.drmop)
c:RegisterEffect(e3)
end end
function s.srmcon(e,tp,eg,ep,ev,re,r,rp) function s.srmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) return c:IsSummonType(SUMMON_TYPE_LINK) and e:GetLabel()==1
and c:GetMaterial():IsExists(Card.IsType,1,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
end end
function s.srmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.srmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsAbleToRemove() end
...@@ -54,8 +60,13 @@ function s.srmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,8 +60,13 @@ function s.srmop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function s.mchk(e,c)
if c:GetMaterial():IsExists(Card.IsType,1,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) then
e:GetLabelObject():SetLabel(1)
else e:GetLabelObject():SetLabel(0) end
end
function s.drmcon(e,tp,eg,ep,ev,re,r,rp) function s.drmcon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp return rp==1-tp
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return c:IsAbleToRemove() and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) return c:IsAbleToRemove() and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
...@@ -105,4 +116,4 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,4 +116,4 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do for tc in aux.Next(g) do
Duel.ReturnToField(tc) Duel.ReturnToField(tc)
end 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