Skip to content

Commit 82d9fde

Browse files
authored
Update "Red-Eyes Darkness Metal Dragon (Anime)"
-Is a full Nomi monster -Script modernization update
1 parent 435507c commit 82d9fde

1 file changed

Lines changed: 23 additions & 29 deletions

File tree

unofficial/c511000670.lua

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,62 @@
1+
--レッドアイズ・ダークネスメタルドラゴン (Anime)
12
--Red-Eyes Darkness Metal Dragon (Anime)
23
local s,id=GetID()
34
function s.initial_effect(c)
45
c:EnableReviveLimit()
5-
--special summon
6+
c:AddMustBeSpecialSummoned()
7+
--Special Summon this card by Tributing 1 "Red-Eyes Darkness Dragon" equipped with "Metal Plus"
68
local e2=Effect.CreateEffect(c)
79
e2:SetType(EFFECT_TYPE_FIELD)
810
e2:SetCode(EFFECT_SPSUMMON_PROC)
911
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
1012
e2:SetRange(LOCATION_HAND)
11-
e2:SetCondition(s.spcon)
12-
e2:SetTarget(s.sptg)
13-
e2:SetOperation(s.spop)
13+
e2:SetCondition(s.hspcon)
14+
e2:SetTarget(s.hsptg)
15+
e2:SetOperation(s.hspop)
1416
c:RegisterEffect(e2)
15-
--atkup
17+
--Gains 400 ATK for each Dragon-Type monster in your Graveyard
1618
local e3=Effect.CreateEffect(c)
1719
e3:SetType(EFFECT_TYPE_SINGLE)
1820
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
1921
e3:SetCode(EFFECT_UPDATE_ATTACK)
2022
e3:SetRange(LOCATION_MZONE)
21-
e3:SetValue(s.val)
23+
e3:SetValue(function(e,c) return Duel.GetMatchingGroupCount(Card.IsRace,c:GetControler(),LOCATION_GRAVE,0,nil,RACE_DRAGON)*400 end)
2224
c:RegisterEffect(e3)
23-
--negate
25+
--When a Spell Card or effect that targets this card is activated: You can negate that effect.
2426
local e4=Effect.CreateEffect(c)
2527
e4:SetDescription(aux.Stringid(id,0))
2628
e4:SetCategory(CATEGORY_DISABLE)
2729
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
28-
e4:SetCode(EVENT_CHAINING)
2930
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
31+
e4:SetCode(EVENT_CHAINING)
3032
e4:SetRange(LOCATION_MZONE)
3133
e4:SetCondition(s.discon)
3234
e4:SetTarget(s.distg)
33-
e4:SetOperation(s.disop)
35+
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end)
3436
c:RegisterEffect(e4)
35-
--Negate
37+
--When your opponent activates a Spell Card: You can discard 1 card; negate the activation, and if you do, destroy it.
3638
local e5=Effect.CreateEffect(c)
3739
e5:SetDescription(aux.Stringid(id,1))
3840
e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
39-
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
41+
e5:SetType(EFFECT_TYPE_QUICK_O)
4042
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
4143
e5:SetCode(EVENT_CHAINING)
4244
e5:SetRange(LOCATION_MZONE)
4345
e5:SetCondition(s.negcon)
44-
e5:SetCost(s.negcost)
46+
e5:SetCost(Cost.Discard())
4547
e5:SetTarget(s.negtg)
4648
e5:SetOperation(s.negop)
4749
c:RegisterEffect(e5)
4850
end
49-
s.listed_names={96561011,511000669}
50-
function s.val(e,c)
51-
return Duel.GetMatchingGroupCount(Card.IsRace,c:GetControler(),LOCATION_GRAVE,0,nil,RACE_DRAGON)*400
52-
end
51+
s.listed_names={96561011,511000669} --"Red-Eyes Darkness Dragon", "Metal Plus"
5352
function s.hspfilter(c,tp)
5453
return c:IsCode(96561011) and c:GetEquipGroup():IsExists(Card.IsCode,1,nil,511000669)
5554
end
56-
function s.spcon(e,c)
55+
function s.hspcon(e,c)
5756
if c==nil then return true end
5857
return Duel.CheckReleaseGroup(c:GetControler(),s.hspfilter,1,false,1,true,c,c:GetControler(),nil,false,nil)
5958
end
60-
function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
59+
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,c)
6160
local g=Duel.SelectReleaseGroup(tp,s.hspfilter,1,1,false,true,true,c,nil,nil,false,nil)
6261
if g then
6362
g:KeepAlive()
@@ -66,7 +65,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
6665
end
6766
return false
6867
end
69-
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
68+
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
7069
local g=e:GetLabelObject()
7170
if not g then return end
7271
Duel.Release(g,REASON_COST)
@@ -78,21 +77,16 @@ function s.discon(e,tp,eg,ep,ev,re,r,rp)
7877
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
7978
local loc,tg=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TARGET_CARDS)
8079
if not tg or not tg:IsContains(c) then return false end
81-
return re:IsActiveType(TYPE_SPELL) and Duel.IsChainDisablable(ev) and loc~=LOCATION_DECK
80+
return re:IsSpellEffect() and Duel.IsChainDisablable(ev) and loc~=LOCATION_DECK
8281
end
8382
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
8483
if chk==0 then return true end
8584
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
8685
end
87-
function s.disop(e,tp,eg,ep,ev,re,r,rp,chk)
88-
Duel.NegateEffect(ev)
89-
end
9086
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
91-
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_SPELL) and Duel.IsChainNegatable(ev) and rp~=tp
92-
end
93-
function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
94-
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
95-
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
87+
local c=e:GetHandler()
88+
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
89+
return re:IsSpellEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and rp==1-tp
9690
end
9791
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
9892
if chk==0 then return true end
@@ -107,4 +101,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp)
107101
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
108102
Duel.Destroy(eg,REASON_EFFECT)
109103
end
110-
end
104+
end

0 commit comments

Comments
 (0)