Commit 7d962d06 authored by REIKAI's avatar REIKAI 💬

update lua

parent 02a1af8a
Pipeline #20245 passed with stages
in 19 minutes and 45 seconds
...@@ -36,27 +36,37 @@ function c72404101.initial_effect(c) ...@@ -36,27 +36,37 @@ function c72404101.initial_effect(c)
end end
--e3 --e3
function c72404101.costfilter(c,ft,tp) function c72404101.costfilter(c,e,tp)
return c:IsSetCard(0x720) and c:IsType(TYPE_MONSTER) and c:IsFaceup() return c:IsSetCard(0x720) and c:IsType(TYPE_MONSTER) and c:IsLevelAbove(1) and Duel.GetMZoneCount(tp,c,tp)>0 and Duel.IsExistingMatchingCard(c72404101.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c)
and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup())
end end
function c72404101.cost3(e,tp,eg,ep,ev,re,r,rp,chk) function c72404101.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk == 0 then
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c72404101.costfilter,1,nil,ft,tp) end e:SetLabel(1)
local g=Duel.SelectReleaseGroup(tp,c72404101.costfilter,1,1,nil,ft,tp) return true
Duel.Release(g,REASON_COST) end
end end
function c72404101.target3(e,tp,eg,ep,ev,re,r,rp,chk) function c72404101.target3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c72404101.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then
if e:GetLabel()==1 then
return Duel.CheckReleaseGroup(tp,c72404101.costfilter,1,nil,e,tp)
else
return false
end
end
local g=Duel.SelectReleaseGroup(tp,c72404101.costfilter,1,1,nil,e,tp)
Duel.Release(g,REASON_COST)
e:SetLabel(0)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c72404101.spfilter(c,e,tp) function c72404101.spfilter(c,e,tp,tc)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevel(tc:GetLevel()) and not c:IsCode(tc:GetCode())
end end
function c72404101.operation3(e,tp,eg,ep,ev,re,r,rp) function c72404101.operation3(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c72404101.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c72404101.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
......
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