Commit 4508febc authored by GuGu's avatar GuGu

Update c51111.lua 翻新

parent 0de7e5db
Pipeline #21228 passed with stage
in 1 minute and 10 seconds
......@@ -17,7 +17,6 @@ function c51111.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c51111.cost)
e2:SetCountLimit(1)
e2:SetTarget(c51111.target)
......@@ -31,6 +30,7 @@ function c51111.initial_effect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,51111)
e3:SetCost(c51111.spcost)
e3:SetTarget(c51111.sptg)
e3:SetOperation(c51111.spop)
c:RegisterEffect(e3)
......@@ -55,7 +55,7 @@ function c51111.condition(e)
return e:GetHandler():GetFlagEffect(51112)>0
end
function c51111.costfilter(c)
return c:IsCode(51107) and c:IsAbleToRemoveAsCost()
return c:IsCode(51107) and c:IsAbleToDeckAsCost()
end
function c51111.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c51111.costfilter,tp,LOCATION_HAND,0,1,nil) end
......@@ -66,11 +66,14 @@ function c51111.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c51111.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck()
end
function c51111.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_SZONE,1,nil) end
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c51111.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51111.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_SZONE,1,1,nil)
local g=Duel.SelectTarget(tp,c51111.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c51111.operation(e,tp,eg,ep,ev,re,r,rp)
......@@ -80,34 +83,33 @@ function c51111.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c51111.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_EFFECT)
end
function c51111.spfilter(c,e,tp)
return c:IsCode(51112) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsCode(51112) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c51111.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(c51111.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c51111.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c51111.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(c51111.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(51111,RESET_EVENT+0x1fe0000,0,0)
Duel.SpecialSummonComplete()
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c51111.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(51111,RESET_EVENT+0x1fe0000,0,0)
Duel.SpecialSummonComplete()
end
end
end
function c51111.sccon(e)
return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),51112)
......
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