Skip to content

Commit 2ba05dd

Browse files
authored
Unofficial card script fixes
- Attachment Dragon: Changing the monster's battle position should be part of the equipping effect. - Dark Psycho Eye: Also check that the target is face-up on resolution + the effect shouldn't be considered an effect that would change control if there's no appropriate target. - Greedy Venom Fusion Dragon (Anime): Shouldn't be able to target a monster with 0 ATK that already has its effects negated. Fixed an issue when the negation effect targets itself. Should also destroy itself if it's back on the field on resolution. Don't break timing if the total ATK of both players' destroyed monsters is 0. Treat the damage dealt as simultaneous. The gained effect shouldn't be usable in the Damage Step. Apply the restriction even if you don't successfully Special Summon. The gained effect should also check that it was "Greedy Venom Fusion Dragon" on the field. - Judgment of Anubis (Anime): Shouldn't count the ATK of any monster that wasn't destroyed or that was face-down when destroyed. - Master and Servant's Resolve: Prevent a script error. General script overhaul. Use the monsters' ATK on field before being destroyed. Snapshot the ATK values when this effect activates rather than referencing them on resolution. Treat the damage as simultaneous if both players take damage at the same time. - Orichalcos Gigas: The "cannot draw" effect is a separate effect that is applied while the card is face-up in the Monster Zone. - Plasma Eel: The equipping effect should trigger on summon. - Refracting Prism: Handle aliased cards + divide the ATK/DEF by the number you're going to summon + remove the original in the process of splitting. - Zero Gazer: Draw 1 card when this effect resolves, not after damage calculation + draw regardless of what happens to the monster.
1 parent 6cc0b33 commit 2ba05dd

File tree

11 files changed

+394
-455
lines changed

11 files changed

+394
-455
lines changed

official/c21848500.lua

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
local s,id=GetID()
55
function s.initial_effect(c)
66
c:EnableReviveLimit()
7-
--Link materials: 3 monsters, including a "Maliss" monster
7+
--Link Summon procedure: 3 monsters, including a "Maliss" monster
88
Link.AddProcedure(c,nil,3,3,s.lcheck)
99
--Shuffle 1 of your banished "Maliss" monsters into the Deck, and if you do, banish 1 card on the field
1010
local e1=Effect.CreateEffect(c)
@@ -31,15 +31,15 @@ function s.initial_effect(c)
3131
ge2:SetCode(EFFECT_CANNOT_DISEFFECT)
3232
Duel.RegisterEffect(ge2,0)
3333
end)
34-
--Special Summon this card
34+
--Special Summon this card and double its ATK
3535
local e2=Effect.CreateEffect(c)
3636
e2:SetDescription(aux.Stringid(id,1))
3737
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
3838
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
3939
e2:SetProperty(EFFECT_FLAG_DELAY)
4040
e2:SetCode(EVENT_REMOVE)
4141
e2:SetCountLimit(1,{id,1})
42-
e2:SetCost(aux.PayLPCost(900))
42+
e2:SetCost(Cost.PayLP(900))
4343
e2:SetTarget(s.sptg)
4444
e2:SetOperation(s.spop)
4545
c:RegisterEffect(e2)
@@ -84,17 +84,14 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
8484
end
8585
function s.spop(e,tp,eg,ep,ev,re,r,rp)
8686
local c=e:GetHandler()
87-
if c:IsRelateToEffect(e) then
88-
local atk=c:GetAttack()*2
89-
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
90-
--Its ATK becomes doubled
91-
local e1=Effect.CreateEffect(c)
92-
e1:SetType(EFFECT_TYPE_SINGLE)
93-
e1:SetCode(EFFECT_SET_ATTACK)
94-
e1:SetValue(atk)
95-
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
96-
c:RegisterEffect(e1,true)
97-
end
98-
Duel.SpecialSummonComplete()
87+
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
88+
--Its ATK becomes doubled
89+
local e1=Effect.CreateEffect(c)
90+
e1:SetType(EFFECT_TYPE_SINGLE)
91+
e1:SetCode(EFFECT_SET_ATTACK)
92+
e1:SetValue(c:GetAttack()*2)
93+
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
94+
c:RegisterEffect(e1,true)
9995
end
96+
Duel.SpecialSummonComplete()
10097
end

unofficial/c100000033.lua

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@
22
--Dark Psycho Eye
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Gain control of 1 opponent's face-up monster until the End Phase
5+
--Take control of 1 face-up monster your opponent controls until the End Phase
66
local e1=Effect.CreateEffect(c)
77
e1:SetCategory(CATEGORY_CONTROL)
88
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
99
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
1010
e1:SetCode(EVENT_DESTROYED)
11-
e1:SetTarget(s.target)
12-
e1:SetOperation(s.operation)
11+
e1:SetTarget(s.ctrltg)
12+
e1:SetOperation(s.ctrlop)
1313
c:RegisterEffect(e1)
1414
end
15-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
15+
function s.ctrltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
1616
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged() end
1717
if chk==0 then return true end
1818
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
1919
local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsControlerCanBeChanged),tp,0,LOCATION_MZONE,1,1,nil)
20-
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
20+
if #g>0 then
21+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,tp,0)
22+
end
2123
end
22-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
24+
function s.ctrlop(e,tp,eg,ep,ev,re,r,rp)
2325
local tc=Duel.GetFirstTarget()
24-
if tc and tc:IsRelateToEffect(e) and tc:IsControlerCanBeChanged() then
26+
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
2527
Duel.GetControl(tc,tp,PHASE_END,1)
2628
end
27-
end
29+
end

unofficial/c170000171.lua

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,54 @@
1+
--オレイカルコス・ギガース
12
--Orichalcos Gigas
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--special summon
5-
local e1=Effect.CreateEffect(c)
6-
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
7-
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
8-
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
9-
e1:SetCode(EVENT_DESTROYED)
10-
e1:SetCost(s.cost)
11-
e1:SetTarget(s.target)
12-
e1:SetOperation(s.operation)
13-
e1:SetLabel(0)
14-
c:RegisterEffect(e1)
5+
--While this card is face-up on the field, you cannot draw a card(s)
6+
local e1a=Effect.CreateEffect(c)
7+
e1a:SetType(EFFECT_TYPE_FIELD)
8+
e1a:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
9+
e1a:SetCode(EFFECT_CANNOT_DRAW)
10+
e1a:SetRange(LOCATION_MZONE)
11+
e1a:SetTargetRange(1,0)
12+
c:RegisterEffect(e1a)
13+
local e1b=e1a:Clone()
14+
e1b:SetCode(EFFECT_DRAW_COUNT)
15+
e1b:SetValue(0)
16+
c:RegisterEffect(e1b)
17+
--Special Summon this card, but it cannot attack this turn
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,0))
20+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
21+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
22+
e2:SetCode(EVENT_DESTROYED)
23+
e2:SetTarget(s.sptg)
24+
e2:SetOperation(s.spop)
25+
c:RegisterEffect(e2)
26+
--This card gains 500 ATK x the number of times it was Special Summoned by its own effect during this Duel
1527
local e3=Effect.CreateEffect(c)
1628
e3:SetType(EFFECT_TYPE_SINGLE)
1729
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
18-
e3:SetRange(LOCATION_MZONE)
1930
e3:SetCode(EFFECT_UPDATE_ATTACK)
20-
e3:SetValue(s.val)
21-
e3:SetLabelObject(e1)
31+
e3:SetRange(LOCATION_MZONE)
32+
e3:SetValue(function(e,c) return e2:GetLabel()*500 end)
2233
c:RegisterEffect(e3)
2334
end
24-
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
25-
if chk==0 then return true end
26-
local e1=Effect.CreateEffect(e:GetHandler())
27-
e1:SetType(EFFECT_TYPE_FIELD)
28-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_PLAYER_TARGET)
29-
e1:SetTargetRange(1,0)
30-
e1:SetCode(EFFECT_SKIP_DP)
31-
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_DRAW then
32-
e1:SetLabel(Duel.GetTurnCount())
33-
e1:SetCondition(s.skipcon)
34-
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN,2)
35-
else
36-
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
37-
end
38-
Duel.RegisterEffect(e1,tp)
39-
end
40-
function s.skipcon(e)
41-
return Duel.GetTurnCount()~=e:GetLabel()
42-
end
43-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
35+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
36+
local c=e:GetHandler()
4437
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
45-
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
46-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
38+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
39+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
4740
end
48-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
41+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
4942
local c=e:GetHandler()
50-
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
51-
if c:IsRelateToEffect(e) then
52-
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
43+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
5344
e:SetLabel(e:GetLabel()+1)
45+
--It cannot attack this turn
5446
local e1=Effect.CreateEffect(c)
47+
e1:SetDescription(3206)
5548
e1:SetType(EFFECT_TYPE_SINGLE)
49+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
5650
e1:SetCode(EFFECT_CANNOT_ATTACK)
57-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
58-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
51+
e1:SetReset(RESETS_STANDARD_PHASE_END)
5952
c:RegisterEffect(e1)
6053
end
61-
end
62-
function s.val(e,c)
63-
return e:GetLabelObject():GetLabel()*500
64-
end
54+
end

unofficial/c511000163.lua

Lines changed: 62 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,97 +2,85 @@
22
--Plasma Eel
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--equip
5+
--This card cannot be destroyed by battle
66
local e1=Effect.CreateEffect(c)
7-
e1:SetDescription(aux.Stringid(id,0))
8-
e1:SetCategory(CATEGORY_EQUIP)
9-
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
10-
e1:SetType(EFFECT_TYPE_QUICK_O)
11-
e1:SetCode(EVENT_FREE_CHAIN)
12-
e1:SetRange(LOCATION_MZONE)
13-
e1:SetCondition(s.eqcon)
14-
e1:SetTarget(s.eqtg)
15-
e1:SetOperation(s.eqop)
7+
e1:SetType(EFFECT_TYPE_SINGLE)
8+
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
9+
e1:SetValue(1)
1610
c:RegisterEffect(e1)
17-
--indes battle
11+
--Equip this card to a monster on your opponent's side of the field as an Equip Card
1812
local e2=Effect.CreateEffect(c)
19-
e2:SetType(EFFECT_TYPE_SINGLE)
20-
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
21-
e2:SetValue(1)
13+
e2:SetDescription(aux.Stringid(id,0))
14+
e2:SetCategory(CATEGORY_EQUIP+CATEGORY_ATKCHANGE)
15+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
16+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
17+
e2:SetCode(EVENT_SUMMON_SUCCESS)
18+
e2:SetRange(LOCATION_MZONE)
19+
e2:SetTarget(s.eqtg)
20+
e2:SetOperation(s.eqop)
2221
c:RegisterEffect(e2)
23-
end
24-
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
25-
return not e:GetHandler():IsStatus(STATUS_CHAINING)
22+
local e3=e2:Clone()
23+
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
24+
c:RegisterEffect(e3)
25+
local e4=e2:Clone()
26+
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
27+
c:RegisterEffect(e4)
2628
end
2729
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
2830
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
2931
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
3032
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
31-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
33+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
3234
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
33-
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
34-
end
35-
function s.eqlimit(e,c)
36-
return e:GetOwner()==c
35+
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0)
3736
end
3837
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
3938
local c=e:GetHandler()
40-
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
39+
if not c:IsRelateToEffect(e) then return end
4140
local tc=Duel.GetFirstTarget()
42-
if c:IsRelateToEffect(e) and c:IsFaceup() then
43-
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
44-
Duel.Equip(tp,c,tc,true)
45-
--Add Equip limit
46-
local e1=Effect.CreateEffect(tc)
47-
e1:SetType(EFFECT_TYPE_SINGLE)
48-
e1:SetCode(EFFECT_EQUIP_LIMIT)
49-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
50-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
51-
e1:SetValue(s.eqlimit)
52-
c:RegisterEffect(e1)
53-
local e2=Effect.CreateEffect(tc)
54-
e2:SetType(EFFECT_TYPE_EQUIP)
55-
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
56-
e2:SetValue(1)
57-
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
58-
c:RegisterEffect(e2)
59-
local e3=e2:Clone()
60-
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
61-
c:RegisterEffect(e3)
62-
--atkdown
63-
local e4=Effect.CreateEffect(c)
64-
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
65-
e4:SetCode(EVENT_PHASE+PHASE_END)
66-
e4:SetRange(LOCATION_SZONE)
67-
e4:SetCountLimit(1)
68-
e4:SetCondition(s.atkcon)
69-
e4:SetOperation(s.atkop)
70-
c:RegisterEffect(e4)
71-
else
72-
Duel.SendtoGrave(c,REASON_EFFECT)
73-
end
41+
if not (tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then
42+
return Duel.SendtoGrave(c,REASON_RULE)
7443
end
75-
end
76-
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
77-
return Duel.GetTurnPlayer()==1-tp
78-
end
79-
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
80-
local c=e:GetHandler()
81-
if c:GetFlagEffect(id)==0 then
44+
if Duel.Equip(tp,c,tc) then
45+
--Equip limit
46+
local e0=Effect.CreateEffect(c)
47+
e0:SetType(EFFECT_TYPE_SINGLE)
48+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
49+
e0:SetCode(EFFECT_EQUIP_LIMIT)
50+
e0:SetValue(function(e,c) return c==tc end)
51+
e0:SetReset(RESET_EVENT|RESETS_STANDARD)
52+
c:RegisterEffect(e0)
53+
--The equipped monster cannot be Tributed
8254
local e1=Effect.CreateEffect(c)
8355
e1:SetType(EFFECT_TYPE_EQUIP)
84-
e1:SetCode(EFFECT_UPDATE_ATTACK)
85-
e1:SetValue(-500)
86-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
56+
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
57+
e1:SetValue(1)
58+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
8759
c:RegisterEffect(e1)
88-
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
89-
e:SetLabelObject(e1)
90-
e:SetLabel(2)
91-
else
92-
local ct=e:GetLabel()
93-
e:SetLabel(ct+1)
94-
local pe=e:GetLabelObject()
95-
if not pe or e:GetLabelObject():IsDeleted() then return end
96-
pe:SetValue(ct*-500)
60+
local e2=e1:Clone()
61+
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
62+
c:RegisterEffect(e2)
63+
--The equipped monster loses 500 ATK during each of your opponent's End Phases
64+
local e3=Effect.CreateEffect(c)
65+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
66+
e3:SetCode(EVENT_PHASE+PHASE_END)
67+
e3:SetRange(LOCATION_SZONE)
68+
e3:SetCountLimit(1)
69+
e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end)
70+
e3:SetOperation(s.atkop)
71+
e3:SetReset(RESET_EVENT|RESETS_STANDARD)
72+
c:RegisterEffect(e3)
9773
end
9874
end
75+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
76+
Duel.Hint(HINT_CARD,0,id)
77+
local c=e:GetHandler()
78+
--The equipped monster loses 500 ATK
79+
local e1=Effect.CreateEffect(c)
80+
e1:SetType(EFFECT_TYPE_SINGLE)
81+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
82+
e1:SetCode(EFFECT_UPDATE_ATTACK)
83+
e1:SetValue(-500)
84+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
85+
c:GetEquipTarget():RegisterEffect(e1)
86+
end

0 commit comments

Comments
 (0)