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)
c:RegisterEffect(e2)
end
--ef1
function c51562801.thfilter(c,tc)
return c:IsSetCard(0x351a) and c:IsAbleToHand() and c:GetAttribute()==tc:GetAttribute()
function c51562801.thfilter(c)
return c:IsSetCard(0x351a) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
end
function c51562801.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
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)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
......@@ -39,32 +39,31 @@ function c51562801.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
c:RegisterEffect(e1)
end
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,c) end
if chk==0 then return Duel.IsExistingMatchingCard(c51562801.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c51562801.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetMatchingGroupCount(c51562801.thfilter,tp,LOCATION_DECK,0,nil,c)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c51562801.thfilter,tp,LOCATION_DECK,0,1,1,nil,c)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c51562801.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--ef2
function c51562801.tsfilter(c)
return c:IsSetCard(0x351a)
return c:IsSetCard(0x351a) and not c:IsForbidden()
end
function c51562801.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,tp,LOCATION_SZONE)
end
function c51562801.tsop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),tp,2,REASON_EFFECT)
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
local c=e:GetHandler()
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)
local tc=Duel.SelectMatchingCard(tp,c51562801.tsfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc then
......@@ -79,8 +78,3 @@ function c51562801.tsop(e,tp,eg,ep,ev,re,r,rp)
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