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)
end
--e3
function c72404101.costfilter(c,ft,tp)
return c:IsSetCard(0x720) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup())
function c72404101.costfilter(c,e,tp)
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)
end
function c72404101.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c72404101.costfilter,1,nil,ft,tp) end
local g=Duel.SelectReleaseGroup(tp,c72404101.costfilter,1,1,nil,ft,tp)
Duel.Release(g,REASON_COST)
if chk == 0 then
e:SetLabel(1)
return true
end
end
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)
end
function c72404101.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c72404101.spfilter(c,e,tp,tc)
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
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
local tc=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
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
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......@@ -64,7 +74,7 @@ end
--e4
function c72404101.costfilter2(c)
return c:IsRace(RACE_PLANT) and c:IsReleasable()
return c:IsRace(RACE_PLANT) and c:IsReleasable()
end
function c72404101.cost4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c72404101.costfilter2,tp,LOCATION_HAND,0,1,nil) 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