Skip to content

Commit a2f3065

Browse files
authored
fix "Alien Shocktrooper M-Frame"
was placing only 1 counter regardless of the level of the discarded monster if there is only 1 face-up monster on the field
1 parent c445c9f commit a2f3065

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

official/c74974229.lua

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
local s,id=GetID()
55
function s.initial_effect(c)
66
c:EnableReviveLimit()
7+
--Link Summon procedure: 2 Reptile monsters
78
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_REPTILE),2,2)
8-
--Place A-Counters equal to the original Level of a discarded monster on face-up monster(s) on the field
9+
--(Quick Effect): You can discard 1 monster; place A-Counters equal to its original Level on face-up monster(s) on the field, distributed as you wish
910
local e1=Effect.CreateEffect(c)
1011
e1:SetDescription(aux.Stringid(id,0))
1112
e1:SetCategory(CATEGORY_COUNTER)
@@ -18,7 +19,7 @@ function s.initial_effect(c)
1819
e1:SetTarget(s.target)
1920
e1:SetOperation(s.operation)
2021
c:RegisterEffect(e1)
21-
--Special Summon non-Link Reptile monsters with different names from your GY, up to the number of monsters your opponent controls with A-Counters
22+
--If this card is destroyed by battle or card effect and sent to the GY: You can Special Summon non-Link Reptile monsters with different names from your GY, up to the number of monsters your opponent controls with A-Counters
2223
local e2=Effect.CreateEffect(c)
2324
e2:SetDescription(aux.Stringid(id,1))
2425
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
@@ -39,19 +40,20 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
3940
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil) end
4041
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
4142
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil)
42-
e:SetLabel(g:GetFirst():GetOriginalLevel())
4343
Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD)
44+
e:GetChainData().discarded_level=g:GetFirst():GetOriginalLevel()
4445
end
4546
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
4647
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
4748
end
4849
function s.operation(e,tp,eg,ep,ev,re,r,rp)
4950
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
5051
if #g==0 then return end
52+
local cd=e:GetChainData()
5153
if #g==1 then
52-
g:GetFirst():AddCounter(COUNTER_A,1)
54+
g:GetFirst():AddCounter(COUNTER_A,cd.discarded_level)
5355
else
54-
for i=1,e:GetLabel() do
56+
for i=1,cd.discarded_level do
5557
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
5658
local tc=g:Select(tp,1,1,nil):GetFirst()
5759
tc:AddCounter(COUNTER_A,1)
@@ -76,11 +78,14 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
7678
end
7779
function s.spop(e,tp,eg,ep,ev,re,r,rp)
7880
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
81+
if ft==0 then return end
7982
local ct=Duel.GetMatchingGroupCount(s.acfilter,tp,0,LOCATION_MZONE,nil)
83+
if ct==0 then return end
8084
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
81-
if ft<1 or ct<1 or #g==0 then return end
82-
ct=math.min(ft,ct)
83-
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ct=1 end
85+
if #g==0 then return end
86+
ct=Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and 1 or math.min(ft,ct)
8487
local sg=aux.SelectUnselectGroup(g,e,tp,1,ct,aux.dncheck,1,tp,HINTMSG_SPSUMMON)
85-
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
86-
end
88+
if #sg>0 then
89+
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
90+
end
91+
end

0 commit comments

Comments
 (0)