Skip to content
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

Conversation

idk-what-to-name-here
Copy link
Contributor

https://yugipedia.com/wiki/Parallel_Select_(anime)

New card checklist

--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
Copy link
Contributor

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

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()
Copy link
Contributor

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

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)
Copy link
Contributor

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.

if #g>0 then
if Duel.SendtoHand(g,tp,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
Duel.Draw(p,d,REASON_EFFECT)
Copy link
Contributor

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

@idk-what-to-name-here
Copy link
Contributor Author

done

Copy link
Contributor

@larry126 larry126 left a 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

--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_DRAW)
Copy link
Contributor

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

@idk-what-to-name-here
Copy link
Contributor Author

done

@larry126 larry126 merged commit 15e649a into ProjectIgnis:master Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants