Skip to content

Commit faab733

Browse files
authored
Fix "Number 92: Heart-eartH Dragon (Anime)"
Updated card placement register to account for cards placed before this card is Special Summoned.
1 parent 61fa8e7 commit faab733

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

unofficial/c511000368.lua

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,20 @@ function s.initial_effect(c)
2929
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
3030
e3:SetRange(LOCATION_MZONE)
3131
e3:SetCountLimit(1)
32-
e3:SetCondition(function(e,tp) return Duel.GetTurnPlayer()~=tp end)
3332
e3:SetTarget(s.rmtg)
3433
e3:SetOperation(s.rmop)
3534
c:RegisterEffect(e3)
35+
--Register cards placed on your opponent's the field
36+
aux.GlobalCheck(s,function()
37+
local ge1=Effect.CreateEffect(c)
38+
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
39+
ge1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CANNOT_DISABLE)
40+
ge1:SetCode(EVENT_MOVE)
41+
ge1:SetRange(LOCATION_MZONE)
42+
ge1:SetCondition(s.chkcon)
43+
ge1:SetOperation(s.chkop)
44+
Duel.RegisterEffect(ge1,0)
45+
end)
3646
--Battle damage from battles involving this card becomes 0
3747
local e4=Effect.CreateEffect(c)
3848
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
@@ -97,16 +107,28 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp)
97107
end
98108
end
99109
end
110+
function s.chkfilter(c,tp)
111+
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
112+
end
113+
function s.chkcon(e,tp,eg,ep,ev,re,r,rp)
114+
return e:GetHandler():IsSpecialSummoned() and eg:IsExists(s.chkfilter,1,nil,1-tp)
115+
end
116+
function s.chkop(e,tp,eg,ep,ev,re,r,rp)
117+
local g=eg:Filter(s.chkfilter,nil,1-tp)
118+
for tc in g:Iter() do
119+
tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~RESET_TOFIELD,0,1)
120+
end
121+
end
100122
function s.rmfilter(c,turn)
101-
return c:IsAbleToRemove() and c:GetTurnID()~=turn
123+
return c:IsAbleToRemove() and c:HasFlagEffect(id,1)
102124
end
103125
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
104-
if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_ONFIELD,1,nil,Duel.GetTurnCount()) end
105-
local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD,nil,Duel.GetTurnCount())
126+
if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) end
127+
local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD,nil)
106128
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
107129
end
108130
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
109-
local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD,nil,Duel.GetTurnCount())
131+
local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD,nil)
110132
if #g>0 then
111133
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
112134
end

0 commit comments

Comments
 (0)