Skip to content

Commit 410500a

Browse files
authored
Update "Black-Winged Dragon (Anime)"
1 parent 8a32e4f commit 410500a

File tree

1 file changed

+29
-32
lines changed

1 file changed

+29
-32
lines changed

unofficial/c511027112.lua

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,53 @@
33
--Scripted by Rundas
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
--synchro summon
7-
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
86
c:EnableReviveLimit()
9-
--damage negation battle
7+
--Synchro Summon procedure: 1 Tuner + 1 or more non-Tuner monsters
8+
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
9+
--If you would take damage, except from a battle involving this card, you can make this card lose that much ATK instead. (Battle damage register)
1010
local e1=Effect.CreateEffect(c)
1111
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
1212
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
1313
e1:SetRange(LOCATION_MZONE)
14-
e1:SetCondition(s.con1)
15-
e1:SetTarget(s.tg1)
16-
e1:SetOperation(s.op1)
14+
e1:SetCondition(function(e) return Duel.GetBattleDamage(e:GetHandlerPlayer())>0 end)
15+
e1:SetTarget(s.batdamtg)
16+
e1:SetOperation(s.batdamop)
1717
c:RegisterEffect(e1)
18-
--damage negation card effect
18+
--If you would take damage, except from a battle involving this card, you can make this card lose that much ATK instead. (Effect damage register)
1919
local e2=Effect.CreateEffect(c)
2020
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
2121
e2:SetCode(EVENT_CHAIN_SOLVING)
2222
e2:SetRange(LOCATION_MZONE)
23-
e2:SetCondition(s.con2)
24-
e2:SetTarget(s.tg2)
25-
e2:SetOperation(s.op2)
23+
e2:SetCondition(s.effdamcon)
24+
e2:SetTarget(s.effdamtg)
25+
e2:SetOperation(s.effdamop)
2626
c:RegisterEffect(e2)
27-
--attack down
27+
--This card loses ATK equal to the damage you would have taken
2828
local e3=Effect.CreateEffect(c)
2929
e3:SetType(EFFECT_TYPE_SINGLE)
3030
e3:SetRange(LOCATION_MZONE)
3131
e3:SetCode(EFFECT_UPDATE_ATTACK)
3232
e3:SetValue(s.flagval)
3333
c:RegisterEffect(e3)
34-
--regain atk + atkdown
34+
--Make the ATK lost from the above effect 0 and if you do, monsters your opponent controls lose ATK equal to the ATK gained
3535
local e4=Effect.CreateEffect(c)
3636
e4:SetDescription(aux.Stringid(id,0))
3737
e4:SetType(EFFECT_TYPE_IGNITION)
3838
e4:SetCode(EVENT_FREE_CHAIN)
3939
e4:SetRange(LOCATION_MZONE)
4040
e4:SetCountLimit(1)
41-
e4:SetTarget(s.tg3)
42-
e4:SetOperation(s.op3)
41+
e4:SetTarget(s.atktg)
42+
e4:SetOperation(s.atkop)
4343
c:RegisterEffect(e4)
4444
end
45-
--damage negation battle
46-
function s.con1(e,tp,eg,ep,ev,re,r,rp)
47-
return Duel.GetBattleDamage(tp)>0
48-
end
49-
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
45+
function s.batdamtg(e,tp,eg,ep,ev,re,r,rp,chk)
5046
local c=e:GetHandler()
5147
if chk==0 then return c:GetAttack()>=Duel.GetBattleDamage(tp) and not c:IsRelateToBattle() end
5248
end
53-
function s.op1(e,tp,eg,ep,ev,re,r,rp)
49+
function s.batdamop(e,tp,eg,ep,ev,re,r,rp)
5450
if Duel.GetFlagEffect(tp,id)~=0 then return end
5551
local c=e:GetHandler()
56-
if c:GetFlagEffect(id)==0 then c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,0) end
52+
if c:GetFlagEffect(id)==0 then c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,0) end
5753
if Duel.SelectEffectYesNo(tp,c) then
5854
Duel.HintSelection(Group.FromCards(c))
5955
Duel.Hint(HINT_CARD,1-tp,id)
@@ -62,8 +58,7 @@ function s.op1(e,tp,eg,ep,ev,re,r,rp)
6258
Duel.ChangeBattleDamage(tp,0)
6359
end
6460
end
65-
--damage negation card effect
66-
function s.con2(e,tp,eg,ep,ev,re,r,rp)
61+
function s.effdamcon(e,tp,eg,ep,ev,re,r,rp)
6762
local e1=Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DAMAGE)
6863
local e2=Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_RECOVER)
6964
local rd=e1 and not e2
@@ -82,13 +77,13 @@ function s.con2(e,tp,eg,ep,ev,re,r,rp)
8277
return false
8378
end
8479
end
85-
function s.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
80+
function s.effdamtg(e,tp,eg,ep,ev,re,r,rp,chk)
8681
if chk==0 then return e:GetHandler():GetAttack()>=e:GetLabel() end
8782
end
88-
function s.op2(e,tp,eg,ep,ev,re,r,rp)
83+
function s.effdamop(e,tp,eg,ep,ev,re,r,rp)
8984
if Duel.GetFlagEffect(tp,id)~=0 then return end
9085
local c=e:GetHandler()
91-
if c:GetFlagEffect(id)==0 then c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,0) end
86+
if c:GetFlagEffect(id)==0 then c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,0) end
9287
if Duel.SelectEffectYesNo(tp,c) then
9388
Duel.HintSelection(Group.FromCards(c))
9489
Duel.Hint(HINT_CARD,1-tp,id)
@@ -113,23 +108,25 @@ function s.refcon(e,re,val,r,rp,rc)
113108
if cid==e:GetLabel() then return 0
114109
else return val end
115110
end
116-
--attack down
111+
--Value registration for lowering this card's ATK
117112
function s.flagval(e,c)
118113
return e:GetHandler():GetFlagEffectLabel(id) and -e:GetHandler():GetFlagEffectLabel(id) or 0
119114
end
120-
--regain atk + atkdown
121-
function s.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
115+
--This card gains ATK equal to the ATK lost, then monsters your opponent controls lose ATK equal to the ATK gained
116+
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
122117
if chk==0 then return e:GetHandler():GetFlagEffectLabel(id) and e:GetHandler():GetFlagEffectLabel(id)>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
123118
end
124-
function s.op3(e,tp,eg,ep,ev,re,r,rp)
119+
function s.atk(e,tp,eg,ep,ev,re,r,rp)
125120
local c=e:GetHandler()
126121
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
127-
for tc in aux.Next(Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)) do
122+
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
123+
for tc in g:Iter() do
128124
local e1=Effect.CreateEffect(c)
129125
e1:SetType(EFFECT_TYPE_SINGLE)
130126
e1:SetCode(EFFECT_UPDATE_ATTACK)
131127
e1:SetValue(-c:GetFlagEffectLabel(id))
128+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
132129
tc:RegisterEffect(e1)
133130
end
134131
c:SetFlagEffectLabel(id,0)
135-
end
132+
end

0 commit comments

Comments
 (0)