Skip to content

Commit 4e3dc42

Browse files
authored
Update "Dark Spell Regeneration (Manga)"
-Missing condition for opponent attack declaration only
1 parent fa7df47 commit 4e3dc42

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

unofficial/c511600108.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function s.initial_effect(c)
88
local e1=Effect.CreateEffect(c)
99
e1:SetType(EFFECT_TYPE_ACTIVATE)
1010
e1:SetCode(EVENT_FREE_CHAIN)
11+
e1:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end)
1112
e1:SetTarget(s.target)
1213
e1:SetOperation(s.operation)
1314
c:RegisterEffect(e1)
@@ -29,7 +30,8 @@ function s.filter(c,e,tp,eg,ep,ev,re,r,rp,b)
2930
return false
3031
end
3132
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
32-
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_GRAVE,1,e:GetHandler(),e,tp,eg,ep,ev,re,r,rp,e:GetHandler():IsLocation(LOCATION_HAND)) end
33+
local b=e:GetHandler():IsLocation(LOCATION_HAND)
34+
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_GRAVE,1,e:GetHandler(),e,tp,eg,ep,ev,re,r,rp,b) end
3335
end
3436
function s.operation(e,tp,eg,ep,ev,re,r,rp)
3537
local b=e:GetHandler():IsLocation(LOCATION_HAND)
@@ -64,7 +66,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
6466
Duel.BreakEffect()
6567
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
6668
if g then
67-
for etc in aux.Next(g) do
69+
for etc in g:Iter() do
6870
etc:CreateEffectRelation(te)
6971
end
7072
end
@@ -77,19 +79,19 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
7779
end
7880
tc:ReleaseEffectRelation(te)
7981
if g then
80-
for etc in aux.Next(g) do
82+
for etc in g:Iter() do
8183
etc:ReleaseEffectRelation(te)
8284
end
8385
end
8486
local e1=Effect.CreateEffect(e:GetHandler())
8587
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
8688
e1:SetCode(EVENT_PHASE+PHASE_END)
87-
e1:SetReset(RESET_PHASE+PHASE_END)
8889
e1:SetCountLimit(1)
8990
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
9091
e1:SetLabelObject(tc)
9192
e1:SetCondition(s.rtcon)
9293
e1:SetOperation(s.rtop)
94+
e1:SetReset(RESET_PHASE|PHASE_END)
9395
Duel.RegisterEffect(e1,tp)
9496
end
9597
function s.rtcon(e,tp,eg,ep,ev,re,r,rp)
@@ -102,4 +104,4 @@ function s.rtop(e,tp,eg,ep,ev,re,r,rp)
102104
Duel.SendtoDeck(tc,nil,-2,REASON_EFFECT)
103105
end
104106
Duel.SendtoGrave(tc,REASON_EFFECT,1-tp)
105-
end
107+
end

0 commit comments

Comments
 (0)