|
| 1 | +--ゼロ・ゲイザー |
1 | 2 | --Zero Gazer |
2 | 3 | local s,id=GetID() |
3 | 4 | function s.initial_effect(c) |
4 | 5 | --Activate |
5 | 6 | local e1=Effect.CreateEffect(c) |
| 7 | + e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DRAW) |
6 | 8 | e1:SetType(EFFECT_TYPE_ACTIVATE) |
7 | | - e1:SetCode(EVENT_ATTACK_ANNOUNCE) |
| 9 | + e1:SetCode(EVENT_BE_BATTLE_TARGET) |
8 | 10 | e1:SetCondition(s.condition) |
9 | 11 | e1:SetTarget(s.target) |
10 | 12 | e1:SetOperation(s.activate) |
11 | 13 | c:RegisterEffect(e1) |
12 | 14 | end |
13 | 15 | function s.condition(e,tp,eg,ep,ev,re,r,rp) |
14 | | - return Duel.GetAttacker():IsControler(1-tp) |
| 16 | + local d=Duel.GetAttackTarget() |
| 17 | + return d and d:IsAttackPos() and d:IsControler(tp) |
15 | 18 | end |
16 | 19 | function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
17 | | - local tg=Duel.GetAttackTarget() |
18 | | - if chk==0 then return tg and tg:IsOnField() and tg:GetAttack()>0 and tg:IsFaceup() and Duel.IsPlayerCanDraw(tp,1) end |
| 20 | + local d=Duel.GetAttackTarget() |
| 21 | + if chk==0 then return d and d:IsOnField() and d:IsControler(tp) |
| 22 | + and d:HasNonZeroAttack() and d:IsAttackPos() and Duel.IsPlayerCanDraw(tp,1) end |
| 23 | + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) |
19 | 24 | end |
20 | 25 | function s.activate(e,tp,eg,ep,ev,re,r,rp) |
21 | 26 | local d=Duel.GetAttackTarget() |
22 | 27 | if d and d:IsRelateToBattle() then |
23 | 28 | local e1=Effect.CreateEffect(e:GetHandler()) |
24 | 29 | e1:SetType(EFFECT_TYPE_SINGLE) |
25 | | - e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD) |
| 30 | + e1:SetReset(RESET_EVENT|RESETS_STANDARD&~RESET_TOFIELD) |
26 | 31 | e1:SetCode(EFFECT_SET_ATTACK_FINAL) |
27 | 32 | e1:SetValue(0) |
28 | 33 | d:RegisterEffect(e1) |
29 | 34 | local e2=Effect.CreateEffect(e:GetHandler()) |
30 | 35 | e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) |
31 | 36 | e2:SetCode(EVENT_BATTLED) |
32 | | - e2:SetOperation(s.drop) |
33 | | - e2:SetReset(RESET_PHASE+PHASE_DAMAGE) |
| 37 | + e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.Draw(tp,1,REASON_EFFECT) end) |
| 38 | + e2:SetReset(RESET_PHASE|PHASE_DAMAGE) |
34 | 39 | Duel.RegisterEffect(e2,tp) |
35 | 40 | end |
36 | 41 | end |
37 | | -function s.drop(e,tp,eg,ep,ev,re,r,rp) |
38 | | - Duel.Draw(tp,1,REASON_EFFECT) |
39 | | -end |
|
0 commit comments