I'm trying to script a pendulum monster for an older version of YGOPRO with an effect that says "once per turn, you can add 1 pendulum monster from your deck to your hand, except this card, then destroy 1 card in your pendulum zone", but I'm having some trouble with it. The search went off fine but it won't destroy in my pendulum zone after that. This is what it looks like:
function c(id).thfilter(c)
return c:IsSetCard(xxxx) and c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and c:IsAbleToHand()
end
function c(id).desfilter(c)
return (c:GetSequence()==6 or c:GetSequence()==7)
end
function c(id).thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c(id).desfilter,tp,LOCATION_SZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c(id).thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c(id).thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c(id).thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c(id).desfilter,LOCATION_SZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
Question
DM999
I'm trying to script a pendulum monster for an older version of YGOPRO with an effect that says "once per turn, you can add 1 pendulum monster from your deck to your hand, except this card, then destroy 1 card in your pendulum zone", but I'm having some trouble with it. The search went off fine but it won't destroy in my pendulum zone after that. This is what it looks like:
function c(id).thfilter(c)
return c:IsSetCard(xxxx) and c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and c:IsAbleToHand()
end
function c(id).desfilter(c)
return (c:GetSequence()==6 or c:GetSequence()==7)
end
function c(id).thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c(id).desfilter,tp,LOCATION_SZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c(id).thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c(id).thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c(id).thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c(id).desfilter,LOCATION_SZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
Is there something I missed?
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.