Skip to content

Commit 7e9b386

Browse files
authored
Update "Trap Eater (Anime)"
Should be able to proc destruction even if it wasn't on the field
1 parent 3fb72cf commit 7e9b386

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

unofficial/c511013002.lua

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function s.initial_effect(c)
2525
e3:SetCategory(CATEGORY_DESTROY)
2626
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
2727
e3:SetCode(EVENT_TO_GRAVE)
28-
e3:SetCondition(s.descon)
28+
e3:SetCondition(function(e) return e:GetHandler():IsReason(REASON_DESTROY) end)
2929
e3:SetTarget(s.destg)
3030
e3:SetOperation(s.desop)
3131
c:RegisterEffect(e3)
@@ -55,20 +55,13 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
5555
Duel.SendtoGrave(g,REASON_COST)
5656
g:DeleteGroup()
5757
end
58-
function s.descon(e,tp,eg,ep,ev,re,r,rp)
59-
local c=e:GetHandler()
60-
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD)
61-
end
62-
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
63-
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsDestructable() and chkc~=e:GetHandler() end
64-
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end
65-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
66-
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler())
67-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,1,0,0)
58+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,
59+
if chk==0 then return true end
60+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_SZONE)
6861
end
6962
function s.desop(e,tp,eg,ep,ev,re,r,rp)
70-
local tc=Duel.GetFirstTarget()
71-
if tc and tc:IsRelateToEffect(e) then
72-
Duel.Destroy(tc,REASON_EFFECT)
73-
end
63+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
64+
local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
65+
if #g==0 then return end
66+
Duel.Destroy(g:GetFirst(),REASON_EFFECT)
7467
end

0 commit comments

Comments
 (0)