Skip to content

Commit d556c41

Browse files
authored
Add files via upload (#1239)
Fixed a bug where monsters with effects that would trigger when sent to the GY while they were Equip Cards (e.g. "Parasite Paranoid") or where equipped to other monsters (e.g. "Cyberdark Claw") could trigger the effect even if they were sent to the GY while they were Continuous Spells on the field (e.g. due to the effect of "Sinful Spoils of Subversion - Snake-Eye").
1 parent 63859d3 commit d556c41

File tree

10 files changed

+177
-172
lines changed

10 files changed

+177
-172
lines changed

official/c14457896.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--Scripted by Eerie Code
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
--equip
6+
--Equip this card to 1 face-up monster on the field
77
local e1=Effect.CreateEffect(c)
88
e1:SetType(EFFECT_TYPE_QUICK_O)
99
e1:SetCode(EVENT_FREE_CHAIN)
@@ -14,7 +14,7 @@ function s.initial_effect(c)
1414
e1:SetTarget(s.eqtg)
1515
e1:SetOperation(s.eqop)
1616
c:RegisterEffect(e1)
17-
--to hand
17+
--Special Summon 1 Level 7 or higher Insect monster from your hand, ignoring its Summoning conditions
1818
local e2=Effect.CreateEffect(c)
1919
e2:SetDescription(aux.Stringid(id,1))
2020
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
@@ -50,21 +50,21 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp)
5050
e1:SetValue(s.eqlimit)
5151
e1:SetLabelObject(tc)
5252
c:RegisterEffect(e1)
53-
--race
53+
--The equipped monster becomes an Insect monster
5454
local e2=Effect.CreateEffect(c)
5555
e2:SetType(EFFECT_TYPE_EQUIP)
5656
e2:SetCode(EFFECT_CHANGE_RACE)
5757
e2:SetValue(RACE_INSECT)
5858
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
5959
c:RegisterEffect(e2)
60-
--cannot attack
60+
--The equipped monster cannot attack Insect monsters
6161
local e3=Effect.CreateEffect(c)
6262
e3:SetType(EFFECT_TYPE_EQUIP)
6363
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
6464
e3:SetValue(s.atlimit)
6565
e3:SetReset(RESET_EVENT|RESETS_STANDARD)
6666
c:RegisterEffect(e3)
67-
--disable
67+
--The equipped monster's effects that activate by targeting an Insect monster(s) are negated
6868
local e4=Effect.CreateEffect(c)
6969
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
7070
e4:SetCode(EVENT_CHAIN_SOLVING)
@@ -123,7 +123,8 @@ function s.resop(e,tp,eg,ep,ev,re,r,rp)
123123
e:Reset()
124124
end
125125
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
126-
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
126+
local c=e:GetHandler()
127+
return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousTypeOnField()&TYPE_EQUIP>0
127128
end
128129
function s.spfilter(c,e,tp)
129130
return c:IsRace(RACE_INSECT) and c:IsLevelAbove(7) and c:IsMonster() and c:IsCanBeSpecialSummoned(e,0,tp,true,false)

official/c21977828.lua

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--Inzektor Giga-Weevil
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--equip
5+
--Equip this card to 1 face-up "Inzektor" monster you control
66
local e1=Effect.CreateEffect(c)
77
e1:SetDescription(aux.Stringid(id,0))
88
e1:SetType(EFFECT_TYPE_IGNITION)
@@ -12,13 +12,13 @@ function s.initial_effect(c)
1212
e1:SetTarget(s.eqtg)
1313
e1:SetOperation(s.eqop)
1414
c:RegisterEffect(e1)
15-
--equip effect
15+
--While this card is equipped to a monster, that monster's original ATK becomes 2400
1616
local e2=Effect.CreateEffect(c)
1717
e2:SetType(EFFECT_TYPE_EQUIP)
1818
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
1919
e2:SetValue(2600)
2020
c:RegisterEffect(e2)
21-
--special summon
21+
--Special Summon 1 "Inzektor" monster in your GY
2222
local e3=Effect.CreateEffect(c)
2323
e3:SetDescription(aux.Stringid(id,1))
2424
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
@@ -32,15 +32,16 @@ function s.initial_effect(c)
3232
c:RegisterEffect(e3)
3333
end
3434
s.listed_series={SET_INZEKTOR}
35-
function s.filter(c)
35+
function s.eqfilter(c)
3636
return c:IsFaceup() and c:IsSetCard(SET_INZEKTOR)
3737
end
3838
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
39-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
39+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc) end
4040
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
41-
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
41+
and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
4242
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
43-
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
43+
Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
44+
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0)
4445
end
4546
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
4647
local c=e:GetHandler()
@@ -64,7 +65,7 @@ function s.eqlimit(e,c)
6465
end
6566
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
6667
local c=e:GetHandler()
67-
return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET)
68+
return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET)
6869
end
6970
function s.spfilter(c,e,tp)
7071
return c:IsSetCard(SET_INZEKTOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
@@ -75,7 +76,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
7576
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
7677
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
7778
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
78-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
79+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
7980
end
8081
function s.spop(e,tp,eg,ep,ev,re,r,rp)
8182
local tc=Duel.GetFirstTarget()

official/c36870345.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--Dragunity Aklys
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--equip
5+
--Special Summon 1 "Dragunity" monster from your hand, then equip it with this card.
66
local e1=Effect.CreateEffect(c)
77
e1:SetDescription(aux.Stringid(id,0))
88
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
@@ -11,7 +11,7 @@ function s.initial_effect(c)
1111
e1:SetTarget(s.sptg)
1212
e1:SetOperation(s.spop)
1313
c:RegisterEffect(e1)
14-
--destroy
14+
--Destroy 1 card on the field
1515
local e2=Effect.CreateEffect(c)
1616
e2:SetDescription(aux.Stringid(id,1))
1717
e2:SetCategory(CATEGORY_DESTROY)
@@ -24,20 +24,20 @@ function s.initial_effect(c)
2424
c:RegisterEffect(e2)
2525
end
2626
s.listed_series={SET_DRAGUNITY}
27-
function s.filter(c,e,tp)
27+
function s.spfilter(c,e,tp)
2828
return c:IsSetCard(SET_DRAGUNITY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
2929
end
3030
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
31-
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
32-
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
31+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
32+
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
33+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
3334
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
34-
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
35+
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0)
3536
end
3637
function s.spop(e,tp,eg,ep,ev,re,r,rp)
3738
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
3839
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
39-
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
40-
local tc=g:GetFirst()
40+
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
4141
if not tc then return end
4242
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
4343
local c=e:GetHandler()
@@ -59,14 +59,14 @@ function s.eqlimit(e,c)
5959
end
6060
function s.descon(e,tp,eg,ep,ev,re,r,rp)
6161
local c=e:GetHandler()
62-
return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET)
62+
return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET)
6363
end
6464
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
6565
if chkc then return chkc:IsOnField() end
6666
if chk==0 then return true end
6767
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
68-
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
69-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
68+
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
69+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
7070
end
7171
function s.desop(e,tp,eg,ep,ev,re,r,rp)
7272
local tc=Duel.GetFirstTarget()

official/c38450736.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--Inzektor Earwig
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--equip
5+
--Equip 1 "Inzektor" monster from your hand or GY to this card
66
local e1=Effect.CreateEffect(c)
77
e1:SetType(EFFECT_TYPE_IGNITION)
88
e1:SetDescription(aux.Stringid(id,0))
@@ -13,7 +13,7 @@ function s.initial_effect(c)
1313
e1:SetOperation(s.eqop)
1414
c:RegisterEffect(e1)
1515
aux.AddEREquipLimit(c,nil,s.eqval,s.equipop,e1)
16-
--equip effect
16+
--While this card is equipped to a monster, that monster gains ATK and DEF equal to this card's ATK and DEF
1717
local e2=Effect.CreateEffect(c)
1818
e2:SetType(EFFECT_TYPE_EQUIP)
1919
e2:SetCode(EFFECT_UPDATE_ATTACK)
@@ -24,7 +24,7 @@ function s.initial_effect(c)
2424
e3:SetCode(EFFECT_UPDATE_DEFENSE)
2525
e3:SetValue(1000)
2626
c:RegisterEffect(e3)
27-
--atkup
27+
--The monster this card was equipped to gains 1000 ATK
2828
local e3=Effect.CreateEffect(c)
2929
e3:SetDescription(aux.Stringid(id,1))
3030
e3:SetCategory(CATEGORY_ATKCHANGE)

official/c45078193.lua

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,66 @@
22
--Cyberdark Cannon
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--search
5+
--Draw 1 card
66
local e1=Effect.CreateEffect(c)
7-
e1:SetDescription(aux.Stringid(id,1))
8-
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
9-
e1:SetType(EFFECT_TYPE_IGNITION)
10-
e1:SetRange(LOCATION_HAND)
11-
e1:SetCountLimit(1,id)
12-
e1:SetCost(Cost.SelfDiscard)
13-
e1:SetTarget(s.target)
14-
e1:SetOperation(s.operation)
7+
e1:SetDescription(aux.Stringid(id,0))
8+
e1:SetCategory(CATEGORY_DRAW)
9+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
10+
e1:SetProperty(EFFECT_FLAG_DELAY)
11+
e1:SetCode(EVENT_TO_GRAVE)
12+
e1:SetCondition(s.drwcon)
13+
e1:SetTarget(s.drwtg)
14+
e1:SetOperation(s.drwop)
1515
c:RegisterEffect(e1)
16-
--send to grave
16+
--Add 1 Machine "Cyberdark" monster from your Deck to your hand
1717
local e2=Effect.CreateEffect(c)
18-
e2:SetDescription(aux.Stringid(id,2))
19-
e2:SetCategory(CATEGORY_TOGRAVE)
20-
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
21-
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
22-
e2:SetRange(LOCATION_SZONE)
23-
e2:SetCountLimit(1,{id,1})
24-
e2:SetCondition(s.gycon)
25-
e2:SetTarget(s.gytg)
26-
e2:SetOperation(s.gyop)
18+
e2:SetDescription(aux.Stringid(id,1))
19+
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
20+
e2:SetType(EFFECT_TYPE_IGNITION)
21+
e2:SetRange(LOCATION_HAND)
22+
e2:SetCountLimit(1,id)
23+
e2:SetCost(Cost.SelfDiscard)
24+
e2:SetTarget(s.thtg)
25+
e2:SetOperation(s.thop)
2726
c:RegisterEffect(e2)
28-
--draw
27+
--Send 1 monster from your Deck to the GY
2928
local e3=Effect.CreateEffect(c)
30-
e3:SetDescription(aux.Stringid(id,0))
31-
e3:SetCategory(CATEGORY_DRAW)
32-
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
33-
e3:SetProperty(EFFECT_FLAG_DELAY)
34-
e3:SetCode(EVENT_TO_GRAVE)
35-
e3:SetCondition(s.con)
36-
e3:SetTarget(s.tg)
37-
e3:SetOperation(s.op)
29+
e3:SetDescription(aux.Stringid(id,2))
30+
e3:SetCategory(CATEGORY_TOGRAVE)
31+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
32+
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
33+
e3:SetRange(LOCATION_SZONE)
34+
e3:SetCountLimit(1,{id,1})
35+
e3:SetCondition(s.tgcon)
36+
e3:SetTarget(s.tgtg)
37+
e3:SetOperation(s.tgop)
3838
c:RegisterEffect(e3)
3939
end
4040
s.listed_series={SET_CYBERDARK}
41-
function s.filter(c)
41+
function s.drwcon(e,tp,eg,ep,ev,re,r,rp)
42+
local c=e:GetHandler()
43+
return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET)
44+
end
45+
function s.drwtg(e,tp,eg,ep,ev,re,r,rp,chk)
46+
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
47+
Duel.SetTargetPlayer(tp)
48+
Duel.SetTargetParam(1)
49+
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
50+
end
51+
function s.drwop(e,tp,eg,ep,ev,re,r,rp)
52+
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
53+
Duel.Draw(p,d,REASON_EFFECT)
54+
end
55+
function s.thfilter(c)
4256
return c:IsSetCard(SET_CYBERDARK) and c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
4357
end
44-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
45-
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
58+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
59+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
4660
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
4761
end
48-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
62+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
4963
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
50-
local tg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
64+
local tg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
5165
if #tg>0 then
5266
Duel.SendtoHand(tg,nil,REASON_EFFECT)
5367
Duel.ConfirmCards(1-tp,tg)
@@ -56,32 +70,18 @@ end
5670
function s.tgfilter(c)
5771
return c:IsMonster() and c:IsAbleToGrave()
5872
end
59-
function s.gycon(e,tp,eg,ep,ev,re,r,rp)
73+
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
6074
local ec=e:GetHandler():GetEquipTarget()
6175
return ec and (ec==Duel.GetAttacker() or ec==Duel.GetAttackTarget())
6276
end
63-
function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk)
77+
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
6478
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
6579
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
6680
end
67-
function s.gyop(e,tp,eg,ep,ev,re,r,rp)
81+
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
6882
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
6983
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
7084
if #g>0 then
7185
Duel.SendtoGrave(g,REASON_EFFECT)
7286
end
73-
end
74-
function s.con(e,tp,eg,ep,ev,re,r,rp)
75-
local c=e:GetHandler()
76-
return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET)
77-
end
78-
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
79-
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
80-
Duel.SetTargetPlayer(tp)
81-
Duel.SetTargetParam(1)
82-
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
83-
end
84-
function s.op(e,tp,eg,ep,ev,re,r,rp)
85-
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
86-
Duel.Draw(p,d,REASON_EFFECT)
8787
end

official/c58257569.lua

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,22 @@ s.listed_series={SET_RED_EYES}
2828
function s.condition(e,tp,eg,ep,ev,re,r,rp)
2929
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
3030
end
31-
function s.filter(c,e,tp)
31+
function s.spfilter(c,e,tp)
3232
return c:IsSetCard(SET_RED_EYES) and c:IsLevelBelow(7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
3333
end
3434
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
3535
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
3636
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
37-
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
37+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
3838
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
39-
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
40-
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
39+
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0)
4140
end
4241
function s.operation(e,tp,eg,ep,ev,re,r,rp)
4342
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
4443
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
45-
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
46-
if #g>0 then
44+
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
45+
if tc then
4746
local c=e:GetHandler()
48-
local tc=g:GetFirst()
4947
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then
5048
Duel.Equip(tp,c,tc,true)
5149
local e1=Effect.CreateEffect(c)
@@ -55,7 +53,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5553
e1:SetValue(s.eqlimit)
5654
e1:SetLabelObject(tc)
5755
c:RegisterEffect(e1)
58-
--atkup
56+
--The equipped monster gains 300 ATK
5957
local e2=Effect.CreateEffect(c)
6058
e2:SetType(EFFECT_TYPE_EQUIP)
6159
e2:SetCode(EFFECT_UPDATE_ATTACK)
@@ -70,10 +68,10 @@ function s.eqlimit(e,c)
7068
end
7169
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
7270
local c=e:GetHandler()
73-
return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET)
71+
return c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousEquipTarget() and not c:IsReason(REASON_LOST_TARGET)
7472
end
7573
function s.thfilter(c)
76-
return c:IsRace(RACE_DRAGON) and c:GetLevel()==1 and c:IsAbleToHand()
74+
return c:IsRace(RACE_DRAGON) and c:IsLevel(1) and c:IsAbleToHand()
7775
end
7876
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
7977
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE|LOCATION_DECK,0,1,nil) end

0 commit comments

Comments
 (0)