Skip to content

Commit c670c91

Browse files
authored
Update "Number 39: Utopia Roots (Anime)"
- Should only negate the attack if this card is attacking. - Slight script modernization update.
1 parent fcede76 commit c670c91

1 file changed

Lines changed: 27 additions & 28 deletions

File tree

unofficial/c511010039.lua

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,56 @@
33
Duel.LoadCardScript(84124261)
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
--xyz summon
7-
Xyz.AddProcedure(c,nil,1,2)
86
c:EnableReviveLimit()
9-
--disable attack
7+
--Xyz Summon procedure: 2 Level 1 monsters
8+
Xyz.AddProcedure(c,nil,1,2)
9+
--Cannot be destroyed by battle, except with "Number" monsters
1010
local e1=Effect.CreateEffect(c)
11-
e1:SetDescription(aux.Stringid(id,0))
12-
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
13-
e1:SetRange(LOCATION_MZONE)
14-
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
15-
e1:SetCondition(s.atkcon)
16-
e1:SetCost(Cost.DetachFromSelf(1,1,function(e,og) Duel.Overlay(e:GetHandler():GetBattleTarget(),og) end))
17-
e1:SetTarget(s.atktg)
18-
e1:SetOperation(s.atkop)
11+
e1:SetType(EFFECT_TYPE_SINGLE)
12+
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
13+
e1:SetValue(aux.NOT(aux.TargetBoolFunction(Card.IsSetCard,SET_NUMBER)))
1914
c:RegisterEffect(e1)
20-
--battle indestructable
15+
--Attach 1 Xyz Material from this card to 1 Xyz monster your opponent controls, then increase this card's ATK equal to the
2116
local e2=Effect.CreateEffect(c)
22-
e2:SetType(EFFECT_TYPE_SINGLE)
23-
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
24-
e2:SetValue(s.indes)
17+
e2:SetDescription(aux.Stringid(id,0))
18+
e2:SetCategory(CATEGORY_ATKCHANGE)
19+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
20+
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
21+
e2:SetRange(LOCATION_MZONE)
22+
e2:SetCondition(s.atkcon)
23+
e2:SetCost(Cost.DetachFromSelf(1,1,function(e,og) Duel.Overlay(e:GetHandler():GetBattleTarget(),og) end))
24+
e2:SetTarget(s.atktg)
25+
e2:SetOperation(s.atkop)
2526
c:RegisterEffect(e2)
2627
end
27-
s.listed_series={0x48}
28+
s.listed_series={SET_NUMBER}
2829
s.xyz_number=39
2930
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
3031
local c=e:GetHandler()
3132
local bc=c:GetBattleTarget()
32-
return bc and bc:IsType(TYPE_XYZ) and bc:IsFaceup() and bc:IsControler(1-tp)
33+
return bc and bc:IsXyzMonster() and bc:IsFaceup() and bc:IsControler(1-tp)
3334
end
3435
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
3536
if chk==0 then return true end
3637
Duel.SetTargetCard(e:GetHandler():GetBattleTarget())
3738
end
38-
function s.ofilter(c)
39-
return c:GetOverlayCount()~=0
39+
function s.overlayfilter(c)
40+
return c:GetOverlayCount()>0
4041
end
4142
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
4243
local c=e:GetHandler()
4344
local tc=Duel.GetFirstTarget()
44-
if Duel.NegateAttack() and c:IsRelateToEffect(e) and c:IsFaceup() then
45-
local to=Duel.SelectMatchingCard(tp,s.ofilter,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
46-
local toc=1
47-
local toc=to:GetOverlayCount()
48-
local atk=math.abs(((tc:GetRank()-c:GetRank())*100)*toc)
45+
if c:IsRelateToEffect(e) and c:IsFaceup() then
46+
if Duel.GetAttacker()==c then Duel.NegateAttack() end
47+
local to=Duel.SelectMatchingCard(tp,s.overlayfilter,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
48+
local toc=1
49+
local toc=to:GetOverlayCount()
50+
local atk=math.abs(((tc:GetRank()-c:GetRank())*100)*toc)
4951
local e1=Effect.CreateEffect(c)
5052
e1:SetType(EFFECT_TYPE_SINGLE)
5153
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
5254
e1:SetValue(atk)
53-
e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE+RESET_PHASE+PHASE_END)
55+
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
5456
c:RegisterEffect(e1)
5557
end
5658
end
57-
function s.indes(e,c)
58-
return not c:IsSetCard(SET_NUMBER)
59-
end

0 commit comments

Comments
 (0)