Commit 03f9ec7e authored by Grajade's avatar Grajade

Update c74563033.lua

parent b100cf04
Pipeline #8946 passed with stage
in 1 minute and 11 seconds
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
function c74563033.initial_effect(c) function c74563033.initial_effect(c)
--effect --effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_RECOVER)
e1:SetDescription(aux.Stringid(74563033,0)) e1:SetDescription(aux.Stringid(74563033,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -11,32 +10,52 @@ function c74563033.initial_effect(c) ...@@ -11,32 +10,52 @@ function c74563033.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c74563033.ctfilter(c,e,tp) function c74563033.ctfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_LIGHT) and (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_FAIRY)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE+RACE_FAIRY) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c74563033.schfilter(c) function c74563033.schfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY) and c:IsLevelAbove(9) and c:IsAbleToHand() return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY) and c:IsLevelAbove(9) and c:IsAbleToHand()
end end
function c74563033.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c74563033.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c74563033.ctfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp)) or Duel.IsExistingMatchingCard(c74563033.schfilter,tp,LOCATION_DECK,0,1,nil) end local b1=Duel.IsExistingMatchingCard(c74563033.schfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(c74563033.ctfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=aux.Stringid(74563033,2)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(74563033,1)
opval[off-1]=2
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
if sel==1 then
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
end end
function c74563033.op(e,tp,eg,ep,ev,re,r,rp) function c74563033.op(e,tp,eg,ep,ev,re,r,rp)
local opt=0 local opt=e:GetLabel()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c74563033.ctfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c74563033.schfilter,tp,LOCATION_DECK,0,1,nil) then if opt==2 then
opt=Duel.SelectOption(tp,aux.Stringid(74563033,1),aux.Stringid(74563033,2))+1
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c74563033.ctfilter,tp,LOCATION_HAND,0,1,nil,e,tp) then opt=1
elseif Duel.IsExistingMatchingCard(c74563033.schfilter,tp,LOCATION_DECK,0,1,nil) then opt=2
end
if opt==1 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74563033.ctfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c74563033.ctfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and g:GetFirst():GetPreviousLocation()==LOCATION_HAND then if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local ct=g:GetFirst():GetLevel() local ct=g:GetFirst():GetLevel()
Duel.Recover(tp,ct*300,REASON_EFFECT) Duel.Recover(tp,ct*300,REASON_EFFECT)
end end
end end
elseif opt==2 then elseif opt==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74563033.schfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c74563033.schfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
......
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