Commit c14f286f authored by Grajade's avatar Grajade

Update c51562801.lua

parent 343e10f3
Pipeline #6866 passed with stages
in 27 minutes and 49 seconds
...@@ -23,12 +23,12 @@ function c51562801.initial_effect(c) ...@@ -23,12 +23,12 @@ function c51562801.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
--ef1 --ef1
function c51562801.thfilter(c,tc) function c51562801.thfilter(c)
return c:IsSetCard(0x351a) and c:IsAbleToHand() and c:GetAttribute()==tc:GetAttribute() return c:IsSetCard(0x351a) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
end end
function c51562801.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c51562801.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c51562801.thfilter,tp,LOCATION_DECK,0,1,nil,c) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c51562801.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
...@@ -39,32 +39,31 @@ function c51562801.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,32 +39,31 @@ function c51562801.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c51562801.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c51562801.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(c51562801.thfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c51562801.thfilter,tp,LOCATION_DECK,0,1,nil,c) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c51562801.thop(e,tp,eg,ep,ev,re,r,rp) function c51562801.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
if Duel.GetMatchingGroupCount(c51562801.thfilter,tp,LOCATION_DECK,0,nil,c)>0 then local g=Duel.SelectMatchingCard(tp,c51562801.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) if g:GetCount()>0 then
local g=Duel.SelectMatchingCard(tp,c51562801.thfilter,tp,LOCATION_DECK,0,1,1,nil,c) Duel.SendtoHand(g,nil,REASON_EFFECT)
if g:GetCount()>0 then Duel.ConfirmCards(1-tp,g)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end end
end end
--ef2 --ef2
function c51562801.tsfilter(c) function c51562801.tsfilter(c)
return c:IsSetCard(0x351a) return c:IsSetCard(0x351a) and not c:IsForbidden()
end end
function c51562801.tstg(e,tp,eg,ep,ev,re,r,rp,chk) function c51562801.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,tp,LOCATION_SZONE) Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,tp,LOCATION_SZONE)
end end
function c51562801.tsop(e,tp,eg,ep,ev,re,r,rp) function c51562801.tsop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),tp,2,REASON_EFFECT) local c=e:GetHandler()
if Duel.IsExistingMatchingCard(c51562801.tsfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(51562801,1)) then if not c:IsRelateToEffect(e) then return end
if Duel.SendtoDeck(c,nil,2,REASON_EFFECT)>0
and Duel.IsExistingMatchingCard(c51562801.tsfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(51562801,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c51562801.tsfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,c51562801.tsfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc then if tc then
...@@ -79,8 +78,3 @@ function c51562801.tsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,8 +78,3 @@ function c51562801.tsop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
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