Commit b9b2aafd authored by GuGu's avatar GuGu

Update c51112.lua 翻新

parent 9c98d788
Pipeline #21230 passed with stage
in 2 minutes and 19 seconds
......@@ -33,6 +33,7 @@ function c51112.initial_effect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,51112)
e3:SetCost(c51112.spcost)
e3:SetTarget(c51112.sptg)
e3:SetOperation(c51112.spop)
c:RegisterEffect(e3)
......@@ -67,51 +68,48 @@ function c51112.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c51112.filter(c)
return c:IsType(TYPE_MONSTER)
return c:IsAbleToGrave()
end
function c51112.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c51112.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51112.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c51112.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c51112.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function c51112.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c51112.spfilter(c,e,tp)
return c:IsCode(51111) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsCode(51111) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c51112.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsReleasable()
and Duel.IsExistingMatchingCard(c51112.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,e:GetHandler(),1,0,0)
if chk==0 then return Duel.IsExistingMatchingCard(c51112.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c51112.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.Release(c,nil,2,REASON_EFFECT)~=0 then
local tc=Duel.GetFirstMatchingCard(c51112.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3,true)
tc:RegisterFlagEffect(51112,RESET_EVENT+0x1fe0000,0,0)
Duel.SpecialSummonComplete()
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c51112.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3,true)
tc:RegisterFlagEffect(51112,RESET_EVENT+0x1fe0000,0,0)
Duel.SpecialSummonComplete()
end
end
end
function c51112.sccon(e)
return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),51111)
......
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