Skip to content

Commit 05a07e6

Browse files
authored
Fix "Magikey Mechmortar - Garesglasser"
Wrong effect identifier for count limit/minor script modernization
1 parent ab4c771 commit 05a07e6

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

official/c45877457.lua

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
--魔鍵砲-ガレスヴェート
2-
--Magikey Cannon - Garesvet
3-
--scripted by Rundas
2+
--Magikey Mechmortar - Garesglasser
3+
--Scripted by Rundas
44
local s,id=GetID()
55
function s.initial_effect(c)
66
c:EnableReviveLimit()
7-
--ATK Up
7+
--Gains 300 ATK for each different Attribute in your GY
88
local e1=Effect.CreateEffect(c)
99
e1:SetType(EFFECT_TYPE_SINGLE)
1010
e1:SetCode(EFFECT_UPDATE_ATTACK)
1111
e1:SetValue(s.atkval)
1212
c:RegisterEffect(e1)
13-
--Negate
13+
--Negate the activation of an opponent's monster effect and destroy it
1414
local e2=Effect.CreateEffect(c)
1515
e2:SetDescription(aux.Stringid(id,0))
1616
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
@@ -23,33 +23,33 @@ function s.initial_effect(c)
2323
e2:SetTarget(s.negtg)
2424
e2:SetOperation(s.negop)
2525
c:RegisterEffect(e2)
26-
--Search
26+
--Add 1 "Magikey" monster from your Deck to your hand
2727
local e3=Effect.CreateEffect(c)
2828
e3:SetDescription(aux.Stringid(id,1))
2929
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
3030
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
3131
e3:SetCode(EVENT_TO_GRAVE)
3232
e3:SetProperty(EFFECT_FLAG_DELAY)
33-
e2:SetCountLimit(1,{id,1})
33+
e3:SetCountLimit(1,{id,1})
3434
e3:SetCondition(s.thcon)
3535
e3:SetTarget(s.thtg)
3636
e3:SetOperation(s.thop)
3737
c:RegisterEffect(e3)
3838
end
39-
s.listed_names={99426088}
40-
s.listed_series={0x167}
41-
--ATK Up
39+
s.listed_series={SET_MAGIKEY}
40+
--ATK value (300 for each different Attribute in your GY)
4241
function s.atkval(e,c)
4342
local g=Duel.GetMatchingGroup(Card.IsMonster,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
4443
return g:GetClassCount(Card.GetAttribute)*300
4544
end
46-
--Negate
45+
--Negate the activation of an opponent's monster effect
4746
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
47+
local g=Duel.GetMatchingGroup(Card.IsMonster,tp,LOCATION_GRAVE,0,nil)
4848
local c,rc,att=e:GetHandler(),re:GetHandler(),0
4949
local mat=c:GetMaterial()
50-
if re:IsActiveType(TYPE_MONSTER) and rp==1-tp and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
51-
and c:IsSummonType(SUMMON_TYPE_RITUAL) and mat:GetClassCount(Card.GetAttribute)>1 then
52-
for tc in Duel.GetMatchingGroup(Card.IsMonster,tp,LOCATION_GRAVE,0,nil):Iter() do
50+
if re:IsMonsterEffect() and rp==1-tp and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
51+
and c:IsRitualSummoned() and mat:GetClassCount(Card.GetAttribute)>1 then
52+
for tc in g:Iter() do
5353
att=att|tc:GetAttribute()
5454
end
5555
return rc:GetAttribute()&att>0
@@ -68,23 +68,23 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp)
6868
Duel.Destroy(eg,REASON_EFFECT)
6969
end
7070
end
71-
--Search
71+
--Add 1 "Magikey" monster from your Deck to your hand
7272
function s.thfilter(c)
73-
return c:IsSetCard(0x167) and c:IsMonster() and c:IsAbleToHand()
73+
return c:IsSetCard(SET_MAGIKEY) and c:IsMonster() and c:IsAbleToHand()
7474
end
7575
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
7676
local c=e:GetHandler()
77-
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL)
77+
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsRitualSummoned()
7878
end
7979
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
8080
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
8181
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
8282
end
8383
function s.thop(e,tp,eg,ep,ev,re,r,rp)
8484
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
85-
local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
86-
if #tc>0 then
85+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
86+
if #g>0 then
8787
Duel.SendtoHand(tc,nil,REASON_EFFECT)
8888
Duel.ConfirmCards(1-tp,tc)
8989
end
90-
end
90+
end

0 commit comments

Comments
 (0)