Skip to content

Commit f9d38fb

Browse files
authored
Update c3792766.lua
1 parent b51e37d commit f9d38fb

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

official/c3792766.lua

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,49 @@ function s.initial_effect(c)
55
c:EnableReviveLimit()
66
--Link Summon procedure: 2+ "Trickstar" monsters
77
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_TRICKSTAR),2)
8-
--Add banished "Trickstar" cards to your hand, and if you do, this card gains 1000 ATK for each card added
8+
--Add your banished "Trickstar" cards to your hand, up to the number of Link Monsters your opponent controls, and if you do, this card gains 1000 ATK for each card added, until the end of this turn
99
local e1=Effect.CreateEffect(c)
1010
e1:SetDescription(aux.Stringid(id,0))
1111
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_ATKCHANGE)
1212
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
13+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
1314
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
1415
e1:SetCondition(s.thcon)
1516
e1:SetTarget(s.thtg)
1617
e1:SetOperation(s.thop)
1718
c:RegisterEffect(e1)
1819
end
1920
s.listed_series={SET_TRICKSTAR}
20-
function s.lkfilter(c)
21-
return c:IsFaceup() and c:IsSetCard(SET_TRICKSTAR)
21+
function s.thconfilter(c)
22+
return c:IsSetCard(SET_TRICKSTAR) and c:IsFaceup() and c:IsMonster()
2223
end
2324
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
24-
return e:GetHandler():GetLinkedGroup():IsExists(s.lkfilter,1,nil)
25+
return e:GetHandler():GetLinkedGroup():IsExists(s.thconfilter,1,nil)
2526
end
26-
function s.filter(c)
27-
return c:IsFaceup() and c:IsSetCard(SET_TRICKSTAR) and c:IsAbleToHand()
27+
function s.thfilter(c)
28+
return c:IsSetCard(SET_TRICKSTAR) and c:IsFaceup() and c:IsAbleToHand()
2829
end
2930
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
30-
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc) end
31-
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,0,1,nil)
32-
and Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_LINK) end
33-
local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK)
31+
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.thfilter(chkc) end
32+
local ct=Duel.GetMatchingGroupCount(Card.IsLinkMonster,tp,0,LOCATION_MZONE,nil)
33+
if chk==0 then return ct>0 and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
3434
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
35-
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,0,1,ct,nil)
35+
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_REMOVED,0,1,ct,nil)
3636
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,tp,0)
3737
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,#g*1000)
3838
end
3939
function s.thop(e,tp,eg,ep,ev,re,r,rp)
4040
local c=e:GetHandler()
41-
local rg=Duel.GetTargetCards(e)
42-
Duel.SendtoHand(rg,nil,REASON_EFFECT)
43-
if c:IsRelateToEffect(e) and c:IsFaceup() then
41+
local tg=Duel.GetTargetCards(e)
42+
if Duel.SendtoHand(tg,nil,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
4443
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_HAND)
45-
if ct>0 then
46-
--This card gains 1000 ATK for each card added
47-
local e1=Effect.CreateEffect(c)
48-
e1:SetType(EFFECT_TYPE_SINGLE)
49-
e1:SetCode(EFFECT_UPDATE_ATTACK)
50-
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
51-
e1:SetValue(ct*1000)
52-
c:RegisterEffect(e1)
53-
end
44+
if ct==0 then return end
45+
--This card gains 1000 ATK for each card added, until the end of this turn
46+
local e1=Effect.CreateEffect(c)
47+
e1:SetType(EFFECT_TYPE_SINGLE)
48+
e1:SetCode(EFFECT_UPDATE_ATTACK)
49+
e1:SetValue(ct*1000)
50+
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
51+
c:RegisterEffect(e1)
5452
end
55-
end
53+
end

0 commit comments

Comments
 (0)