-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc8131171.lua
More file actions
26 lines (26 loc) · 940 Bytes
/
c8131171.lua
File metadata and controls
26 lines (26 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--Sinister Serpent (pre-errata)
function c8131171.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_GRAVE)
e1:SetDescription(aux.Stringid(8131171,0))
e1:SetCondition(c8131171.condition)
e1:SetTarget(c8131171.target)
e1:SetOperation(c8131171.operation)
c:RegisterEffect(e1)
end
function c8131171.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,8131171)
end
function c8131171.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c8131171.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end