|
3 | 3 | --Scripted by Lyris, modified by MLD |
4 | 4 | local s,id=GetID() |
5 | 5 | function s.initial_effect(c) |
6 | | - --Negate the activated effects of Spells/Traps |
| 6 | + --Negate the activated effects of Spells/Traps that target a Machine monster you control |
7 | 7 | local e1=Effect.CreateEffect(c) |
8 | 8 | e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) |
9 | 9 | e1:SetCode(EVENT_CHAIN_SOLVING) |
10 | 10 | e1:SetRange(LOCATION_MZONE) |
11 | | - e1:SetCondition(s.discon) |
| 11 | + e1:SetCondition(function(e) return e:GetHandler():IsAttackPos() end) |
12 | 12 | e1:SetOperation(s.disop) |
13 | 13 | c:RegisterEffect(e1) |
14 | | - --Draw 1 card |
| 14 | + --Draw 1 card when this card is destroyed and sent to the GY |
15 | 15 | local e2=Effect.CreateEffect(c) |
16 | 16 | e2:SetDescription(aux.Stringid(id,0)) |
17 | 17 | e2:SetCategory(CATEGORY_DRAW) |
18 | 18 | e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) |
19 | 19 | e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) |
20 | 20 | e2:SetCode(EVENT_TO_GRAVE) |
21 | 21 | e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_DESTROY) end) |
22 | | - e2:SetTarget(s.target) |
23 | | - e2:SetOperation(s.operation) |
| 22 | + e2:SetTarget(s.drtg) |
| 23 | + e2:SetOperation(s.drop) |
24 | 24 | c:RegisterEffect(e2) |
25 | | - --Double Snare |
26 | | - local e3=Effect.CreateEffect(c) |
27 | | - e3:SetType(EFFECT_TYPE_SINGLE) |
28 | | - e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE) |
29 | | - e3:SetRange(LOCATION_MZONE) |
30 | | - e3:SetCondition(s.discon) |
31 | | - e3:SetCode(3682106) |
32 | | - c:RegisterEffect(e3) |
33 | | -end |
34 | | -function s.discon(e) |
35 | | - return e:GetHandler():IsAttackPos() |
| 25 | + --Double Snare check |
| 26 | + aux.DoubleSnareValidity(c,LOCATION_MZONE) |
36 | 27 | end |
37 | 28 | function s.disfilter(c,p) |
38 | 29 | return c:IsControler(p) and c:IsFaceup() and c:IsRace(RACE_MACHINE) |
39 | 30 | end |
40 | 31 | function s.disop(e,tp,eg,ep,ev,re,r,rp) |
41 | | - if re:IsMonsterEffect() or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end |
| 32 | + if re:IsMonsterEffect() or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or not re:IsActivated() then return end |
42 | 33 | local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) |
43 | 34 | if g:IsExists(s.disfilter,1,nil,tp) and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,1)) then |
44 | 35 | Duel.NegateEffect(ev) |
45 | 36 | end |
46 | 37 | end |
47 | | -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) |
| 38 | +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) |
48 | 39 | if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end |
49 | 40 | Duel.SetTargetPlayer(tp) |
50 | 41 | Duel.SetTargetParam(1) |
51 | 42 | Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) |
52 | 43 | end |
53 | | -function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 44 | +function s.drop(e,tp,eg,ep,ev,re,r,rp) |
54 | 45 | local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) |
55 | 46 | Duel.Draw(p,d,REASON_EFFECT) |
56 | 47 | end |
0 commit comments