Commit ba6f5b0d authored by Huangnan's avatar Huangnan

fix T.G. Glaive Blaster

parent 5e7771e2
Pipeline #22969 passed with stages
in 26 minutes and 13 seconds
--coded by Lyris
--TG グレイヴ・ブラスター
--T.G. Glaive Blaster
--coded by Lyris
local s, id, o = GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
......@@ -24,6 +25,12 @@ function s.initial_effect(c)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetLabelObject(e2)
e3:SetValue(s.matchk)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
......@@ -36,19 +43,6 @@ function s.initial_effect(c)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(s.matcon)
e5:SetOperation(s.matop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_MATERIAL_CHECK)
e6:SetLabelObject(e5)
e6:SetValue(s.matchk)
c:RegisterEffect(e6)
aux.RegisterMergedDelayedEvent(c,id,EVENT_REMOVE)
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -60,9 +54,7 @@ function s.filter(c)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and c:GetFlagEffect(id)<c:GetFlagEffectLabel(id+id) end
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
......@@ -72,11 +64,14 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end
end
function s.matchk(e,c)
local ef=e:GetLabelObject()
local ct=c:GetMaterial():FilterCount(Card.IsType,nil,TYPE_SYNCHRO)-1
e:GetLabelObject():SetLabel(ct)
if ct<0 then ct=0 end
ef:SetCountLimit(ct)
end
function s.sfilter(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsCanBeEffectTarget(e) and c:IsType(TYPE_MONSTER)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
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,chkc)
local g=eg:Filter(s.sfilter,nil,e,tp)
......@@ -90,10 +85,4 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP) end
end
function s.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) and e:GetLabel()>0
end
function s.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id+id,RESET_EVENT+RESETS_STANDARD,0,1,e:GetLabel())
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