-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathc160010062.lua
34 lines (34 loc) · 998 Bytes
/
c160010062.lua
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
27
28
29
30
31
32
33
34
--へのかっぱ
--Kappa's Gas
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local atkr=Duel.GetAttacker()
local defr=Duel.GetAttackTarget()
return atkr and defr and atkr:IsControler(1-tp) and defr:IsControler(tp) and defr:IsPosition(POS_FACEDOWN)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
end