Skip to content

Commit e1b3082

Browse files
authored
Update "Zero Gazer"
-Should activate when an Attack Position monster you control is targeted for an attack -Should not be able to activate if the monster's ATK is currently 0 -Minor script polish
1 parent 6e9d4d5 commit e1b3082

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

unofficial/c511001586.lua

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
1+
--ゼロ・ゲイザー
12
--Zero Gazer
23
local s,id=GetID()
34
function s.initial_effect(c)
45
--Activate
56
local e1=Effect.CreateEffect(c)
7+
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DRAW)
68
e1:SetType(EFFECT_TYPE_ACTIVATE)
7-
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
9+
e1:SetCode(EVENT_BE_BATTLE_TARGET)
810
e1:SetCondition(s.condition)
911
e1:SetTarget(s.target)
1012
e1:SetOperation(s.activate)
1113
c:RegisterEffect(e1)
1214
end
1315
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)
1518
end
1619
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)
1924
end
2025
function s.activate(e,tp,eg,ep,ev,re,r,rp)
2126
local d=Duel.GetAttackTarget()
2227
if d and d:IsRelateToBattle() then
2328
local e1=Effect.CreateEffect(e:GetHandler())
2429
e1:SetType(EFFECT_TYPE_SINGLE)
25-
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
30+
e1:SetReset(RESET_EVENT|RESETS_STANDARD&~RESET_TOFIELD)
2631
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
2732
e1:SetValue(0)
2833
d:RegisterEffect(e1)
2934
local e2=Effect.CreateEffect(e:GetHandler())
3035
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
3136
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)
3439
Duel.RegisterEffect(e2,tp)
3540
end
3641
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

Comments
 (0)