-
-
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
Changes from 1 commit
4c48084
e2aed53
0b069eb
7043c86
feb1c9c
709174f
0d49844
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
local s,id=GetID() | ||
function s.initial_effect(c) | ||
--Activate | ||
local e1=Effect.CreateEffect(c) | ||
e1:SetType(EFFECT_TYPE_ACTIVATE) | ||
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW) | ||
e1:SetCode(EVENT_DESTROYED) | ||
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) | ||
e1:SetCondition(s.condition) | ||
e1:SetTarget(s.target) | ||
e1:SetOperation(s.activate) | ||
c:RegisterEffect(e1) | ||
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 commentThe 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 |
||
end | ||
function s.condition(e,tp,eg,ep,ev,re,r,rp) | ||
return eg:IsExists(s.cfilter,1,nil,tp) | ||
end | ||
function s.filter(c) | ||
return c:IsFaceup() and c:IsSpell() and c:IsAbleToHand() | ||
end | ||
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 commentThe 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. |
||
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) | ||
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED) | ||
end | ||
function s.activate(e,tp,eg,ep,ev,re,r,rp) | ||
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) | ||
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil) | ||
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. You can do
|
||
end | ||
end | ||
end |
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