-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "Parallel Select (Anime)" #1051
Add "Parallel Select (Anime)" #1051
Conversation
unofficial/c511027651.lua
Outdated
--Activate | ||
local e1=Effect.CreateEffect(c) | ||
e1:SetType(EFFECT_TYPE_ACTIVATE) | ||
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not searching anything, so no CATEGORY_SEARCH
unofficial/c511027651.lua
Outdated
end | ||
function s.cfilter(c,tp) | ||
return c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_GRAVE) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) | ||
and c:IsMonster() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to check IsMonster since your are already checking if it is a Synchro, and it was previously in your Monster Zone
unofficial/c511027651.lua
Outdated
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) | ||
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) and Duel.IsPlayerCanDraw(tp,1) end | ||
Duel.SetTargetPlayer(tp) | ||
Duel.SetTargetParam(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 29 and 30, because this isn't a player target effect, you don't need to use SetTargetPlayer and SetTargetParam, consequently you also don't need Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) in the operation.
unofficial/c511027651.lua
Outdated
if #g>0 then | ||
if Duel.SendtoHand(g,tp,REASON_EFFECT)~=0 then | ||
Duel.ConfirmCards(1-tp,g) | ||
Duel.Draw(p,d,REASON_EFFECT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do #g>0
and Duel.SendtoHand(g,tp,REASON_EFFECT)
in the same line, also you need to check whether the card ends up in the hand before you can draw. So like
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil):GetFirst()
if tc and Duel.SendtoHand(tc,tp,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
Duel.Draw(tp,1,REASON_EFFECT)
end
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where have the card names gone? xD
unofficial/c511027651.lua
Outdated
--Activate | ||
local e1=Effect.CreateEffect(c) | ||
e1:SetType(EFFECT_TYPE_ACTIVATE) | ||
e1:SetCategory(CATEGORY_DRAW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still need CATEGORY_TOHAND since you are adding something to your hand other than via drawing
done |
https://yugipedia.com/wiki/Parallel_Select_(anime)
New card checklist
#card-scripting-101
.Supervising staff member(s): @larry126