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,12 +68,11 @@ 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)
......@@ -84,24 +84,22 @@ function c51112.operation(e,tp,eg,ep,ev,re,r,rp)
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)
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)
......
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