Last active
March 24, 2016 11:49
-
-
Save windikite/7760e5ce1d9ee8b66dea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Charmer's Last resort | |
function c13713702.initial_effect(c) | |
--Activate | |
local e1=Effect.CreateEffect(c) | |
e1:SetDescription(aux.Stringid(13713702,0)) | |
e1:SetCategory(CATEGORY_DRAW) | |
e1:SetType(EFFECT_TYPE_ACTIVATE) | |
e1:SetCode(EVENT_FREE_CHAIN) | |
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) | |
e1:SetCost(c13713702.cost) | |
e1:SetTarget(c13713702.target) | |
e1:SetOperation(c13713702.activate) | |
c:RegisterEffect(e1) | |
end | |
--check for charmer or familiar-possessed card | |
function c13713702.cfilter(c,e,tp) | |
return (c:IsSetCard(0xc0) or c:IsSetCard(0xbf)) | |
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) | |
end | |
--discard that card | |
function c13713702.cost(e,tp,eg,ep,ev,re,r,rp,chk) | |
if chk==0 then return Duel.IsExistingMatchingCard(c13713702.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end | |
Duel.DiscardHand(tp,c13713702.cfilter,1,1,REASON_COST,nil) | |
end | |
--draw 2 | |
function c13713702.target(e,tp,eg,ep,ev,re,r,rp,chk) | |
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end | |
Duel.SetTargetPlayer(tp) | |
Duel.SetTargetParam(2) | |
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) | |
end | |
function c13713702.activate(e,tp,eg,ep,ev,re,r,rp) | |
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) | |
Duel.Draw(p,d,REASON_EFFECT) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment