Home
News
FAQ
Forum
Ygopro
Search
Register
Login
YGOPRO Forum
Welcome Guest! To enable all features please try to register or login.
Forum
Active Topics
YGOPRO
»
YGOPRO
»
Projects
»
Card scripts
»
Special Summon effect
Special Summon effect -
won't activate
Options
Email this topic
Watch this topic
Print this topic
» Normal
Threaded
Previous Topic
Next Topic
DM999
#1
Posted :
Monday, January 04, 2021 5:23:57 AM(UTC)
Rank: Newbie
Joined: 12/1/2015(UTC)
Posts: 30
Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
I wanted to make a new card with an effect to tribute itself to special summon a monster from the hand, then draw 1 card, but it won't activate for me. I believe there's a mistake I made in the operation part, but I'm not sure how to fix it. Does anyone else know? Here's what the current script looks like:
function c17157036.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c17157036.spcost)
e1:SetTarget(c17157036.sptg)
e1:SetOperation(c17157036.spop)
c:RegisterEffect(e1)
end
function c17157036.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c17157036.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c17157036.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(c17157036.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c17157036.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c17157036.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_ONFIELD)
if ct==1 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
User Profile
View All Posts by User
View Thanks
Users browsing this topic
YGOPRO
»
YGOPRO
»
Projects
»
Card scripts
»
Special Summon effect
Forum Jump
YGOPRO
Ygopro.co
- News and Announcements
- Ygopro.co website discussion
YGOPRO
- YGOPro Discussion
- Support and Feedback
- Card rulings and card bugs
--- Anime cards
--- Beta cards
- Projects
--- Card scripts
- Duels
- AI section
Mobile
- Android Support and Feedback
- iOS Support and Feedback
Yu-Gi-Oh!
- Yu-Gi-Oh! Discussion
- Decks
Tournaments
- Tournaments
OTHER
- Off-Topic
You
cannot
post new topics in this forum.
You
cannot
reply to topics in this forum.
You
cannot
delete your posts in this forum.
You
cannot
edit your posts in this forum.
You
cannot
create polls in this forum.
You
cannot
vote in polls in this forum.
Powered by YAF
|
YAF © 2003-2021, Yet Another Forum.NET
Notification
Error
OK
Copyright © Ygopro.co