Skip to content

Commit 247075c

Browse files
authored
Update "Number 95: Galaxy-Eyes Dark Matter Dragon (Manga)"
- ATK gain should be based on materials used for Summon, not materials currently attached. - Battle banish should behave at the start of the damage step, not after battling - General script polish/modernization
1 parent 28386ff commit 247075c

File tree

1 file changed

+54
-68
lines changed

1 file changed

+54
-68
lines changed

unofficial/c511000515.lua

Lines changed: 54 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,75 @@
1-
--Number 95: Galaxy Eyes Dark Matter Dragon
1+
--No.95 ギャラクシーアイズ・ダークマター・ドラゴン (Anime)
2+
--Number 95: Galaxy Eyes Dark Matter Dragon (Anime)
23
Duel.LoadCardScript("c58820923.lua")
34
local s,id=GetID()
45
function s.initial_effect(c)
5-
--xyz summon
6-
Xyz.AddProcedure(c,nil,9,3)
76
c:EnableReviveLimit()
8-
--banish
7+
--Xyz Summon procedure: 3 Level 9 monsters
8+
Xyz.AddProcedure(c,nil,9,3)
9+
--Cannot be destroyed by battle, except with "Number" monsters
910
local e1=Effect.CreateEffect(c)
10-
e1:SetDescription(aux.Stringid(id,0))
11-
e1:SetCategory(CATEGORY_REMOVE)
12-
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
13-
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
14-
e1:SetTarget(s.bantg)
15-
e1:SetOperation(s.banop)
11+
e1:SetType(EFFECT_TYPE_SINGLE)
12+
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
13+
e1:SetValue(aux.NOT(aux.TargetBoolFunction(Card.IsSetCard,SET_NUMBER)))
1614
c:RegisterEffect(e1)
17-
--atk
18-
local e2=Effect.CreateEffect(c)
19-
e2:SetType(EFFECT_TYPE_SINGLE)
20-
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
21-
e2:SetRange(LOCATION_MZONE)
22-
e2:SetCode(EFFECT_UPDATE_ATTACK)
23-
e2:SetValue(s.val)
24-
c:RegisterEffect(e2)
25-
--chain attack
15+
--When this card is Xyz Summoned, it gains ATK equal to the ATK of the materials used for its Xyz Summon
16+
local e2a=Effect.CreateEffect(c)
17+
e2a:SetType(EFFECT_TYPE_SINGLE)
18+
e2a:SetCode(EFFECT_MATERIAL_CHECK)
19+
e2a:SetValue(function(e,c) e:SetLabel(c:GetMaterial():GetSum(Card.GetTextAttack)) end)
20+
c:RegisterEffect(e2a)
21+
local e2b=Effect.CreateEffect(c)
22+
e2b:SetDescription(aux.Stringid(id,0))
23+
e2b:SetCategory(CATEGORY_ATKCHANGE)
24+
e2b:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
25+
e2b:SetCode(EVENT_SPSUMMON_SUCCESS)
26+
e2b:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end)
27+
e2b:SetOperation(function(e) e:GetHandler():UpdateAttack(e2a:GetLabel(),RESET_EVENT|RESETS_STANDARD_DISABLE,nil) end)
28+
c:RegisterEffect(e2b)
29+
--You banish Dragon monsters from your Deck, then your opponent banishes an equal number of monsters from their Deck
2630
local e3=Effect.CreateEffect(c)
2731
e3:SetDescription(aux.Stringid(id,1))
32+
e3:SetCategory(CATEGORY_REMOVE)
2833
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
29-
e3:SetCode(EVENT_DAMAGE_STEP_END)
30-
e3:SetCondition(s.atcon)
31-
e3:SetCost(Cost.DetachFromSelf(1))
32-
e3:SetOperation(s.atop)
34+
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
35+
e3:SetTarget(s.sprmvtg)
36+
e3:SetOperation(s.sprmvop)
3337
c:RegisterEffect(e3)
34-
--remove
38+
--This card can attack again in a row if it battles
3539
local e4=Effect.CreateEffect(c)
3640
e4:SetDescription(aux.Stringid(id,2))
37-
e4:SetCategory(CATEGORY_REMOVE)
3841
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
39-
e4:SetCode(EVENT_BATTLED)
40-
e4:SetTarget(s.target)
41-
e4:SetOperation(s.operation)
42+
e4:SetCode(EVENT_DAMAGE_STEP_END)
43+
e4:SetCondition(function(e) local c=e:GetHandler() return Duel.GetAttacker()==c and c:CanChainAttack() end)
44+
e4:SetCost(Cost.DetachFromSelf(1))
45+
e4:SetOperation(function() Duel.ChainAttack() end)
4246
c:RegisterEffect(e4)
43-
--battle indestructable
47+
--When this card battles an opponent's monster: You can banish that monster and this card
4448
local e5=Effect.CreateEffect(c)
45-
e5:SetType(EFFECT_TYPE_SINGLE)
46-
e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
47-
e5:SetValue(s.indes)
49+
e5:SetDescription(aux.Stringid(id,3))
50+
e5:SetCategory(CATEGORY_REMOVE)
51+
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
52+
e5:SetCode(EVENT_BATTLE_START)
53+
e5:SetTarget(s.batrmvtg)
54+
e5:SetOperation(s.batrmv)
4855
c:RegisterEffect(e5)
4956
end
57+
s.listed_series={SET_NUMBER}
5058
s.xyz_number=95
51-
function s.banfilter(c)
59+
function s.sprmvfilter(c)
5260
return c:IsRace(RACE_DRAGON) and c:IsAbleToRemove()
5361
end
54-
function s.banfilter2(c)
55-
return c:IsMonster() and c:IsAbleToRemove()
56-
end
57-
function s.bantg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
58-
if chk==0 then return Duel.IsExistingMatchingCard(s.banfilter,tp,LOCATION_DECK,0,1,nil) end
62+
function s.sprmvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
63+
if chk==0 then return Duel.IsExistingMatchingCard(s.sprmvfilter,tp,LOCATION_DECK,0,1,nil) end
5964
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
6065
end
61-
function s.banop(e,tp,eg,ep,ev,re,r,rp)
66+
function s.sprmvop(e,tp,eg,ep,ev,re,r,rp)
6267
local ct=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)
6368
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
64-
local g=Duel.SelectMatchingCard(tp,s.banfilter,tp,LOCATION_DECK,0,1,ct,nil)
69+
local g=Duel.SelectMatchingCard(tp,s.sprmvfilter,tp,LOCATION_DECK,0,1,ct,nil)
6570
if #g>0 then
6671
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT) then
67-
local sg=Duel.GetMatchingGroup(s.banfilter2,tp,0,LOCATION_DECK,nil)
72+
local sg=Duel.GetMatchingGroup(aux.AND(Card.IsMonster,Card.IsAbleToRemove),tp,0,LOCATION_DECK,nil)
6873
if #sg>=#g then
6974
Duel.ConfirmCards(tp,sg)
7075
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
@@ -80,42 +85,23 @@ function s.banop(e,tp,eg,ep,ev,re,r,rp)
8085
end
8186
end
8287
end
83-
function s.val(e,c)
84-
local g=e:GetHandler():GetOverlayGroup()
85-
local val=0
86-
for tc in g:Iter() do
87-
local atk=tc:IsMonster() and tc:GetAttack() or 0
88-
val=val+atk
89-
end
90-
return val
91-
end
92-
function s.atcon(e,tp,eg,ep,ev,re,r,rp)
93-
local c=e:GetHandler()
94-
return Duel.GetAttacker()==c and c:CanChainAttack()
95-
end
96-
function s.atop(e,tp,eg,ep,ev,re,r,rp)
97-
Duel.ChainAttack()
98-
end
99-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
88+
function s.batrmvtg(e,tp,eg,ep,ev,re,r,rp,chk)
10089
local c=e:GetHandler()
10190
local a=Duel.GetAttacker()
102-
local t=Duel.GetAttackTarget()
91+
local at=Duel.GetAttackTarget()
10392
if chk==0 then
104-
return (t==c and a:IsAbleToRemove())
105-
or (a==c and t~=nil and t:IsAbleToRemove())
93+
return (at==c and a:IsAbleToRemove())
94+
or (a==c and at~=nil and at:IsAbleToRemove())
10695
end
10796
local g=Group.CreateGroup()
10897
if a:IsRelateToBattle() then g:AddCard(a) end
109-
if t~=nil and t:IsRelateToBattle() then g:AddCard(t) end
98+
if at~=nil and at:IsRelateToBattle() then g:AddCard(at) end
11099
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
111100
end
112-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
101+
function s.batrmvop(e,tp,eg,ep,ev,re,r,rp)
113102
local a=Duel.GetAttacker()
114-
local d=Duel.GetAttackTarget()
115-
local g=Group.FromCards(a,d)
103+
local at=Duel.GetAttackTarget()
104+
local g=Group.FromCards(a,at)
116105
local rg=g:Filter(Card.IsRelateToBattle,nil)
117106
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
118107
end
119-
function s.indes(e,c)
120-
return not c:IsSetCard(SET_NUMBER)
121-
end

0 commit comments

Comments
 (0)