Skip to content

Commit 6bcaa28

Browse files
authored
Update the Link Summoning procedure to support checking for an additional summoning condition
1 parent e2ce7c3 commit 6bcaa28

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

official/c10019086.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ local s,id=GetID()
55
function s.initial_effect(c)
66
c:EnableReviveLimit()
77
--Link Summon Procedure: 3+ Beast, Beast-Warrior, and/or Winged Beast monsters
8-
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACES_BEAST_BWARRIOR_WINGB),3,5)
9-
--Special Summon restriction
8+
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACES_BEAST_BWARRIOR_WINGB),3,5,nil,nil,s.splimit)
9+
--Special Summon condition
1010
local e0=Effect.CreateEffect(c)
1111
e0:SetType(EFFECT_TYPE_SINGLE)
12-
e0:SetCode(EFFECT_SPSUMMON_COST)
13-
e0:SetCost(s.spcost)
12+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
13+
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
14+
e0:SetValue(s.splimit)
1415
c:RegisterEffect(e0)
1516
--Opponent cannot activate cards or effects on Special Summon
1617
local e1=Effect.CreateEffect(c)
@@ -45,8 +46,8 @@ s.listed_series={SET_TRI_BRIGADE}
4546
function s.spcostfilter(c)
4647
return c:IsSetCard(SET_TRI_BRIGADE) and c:IsSpellTrap()
4748
end
48-
function s.spcost(e,c,sp,st)
49-
return not c:IsLocation(LOCATION_EXTRA) or Duel.GetMatchingGroupCount(s.spcostfilter,sp,LOCATION_GRAVE,0,nil)>2
49+
function s.splimit(e,se,sp,st)
50+
return not e:GetHandler():IsLocation(LOCATION_EXTRA) or Duel.IsExistingMatchingCard(s.spcostfilter,sp,LOCATION_GRAVE,0,3,nil)
5051
end
5152
function s.sucop(e,tp,eg,ep,ev,re,r,rp)
5253
if eg:IsExists(Card.IsSummonPlayer,1,nil,tp) then

proc_link.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if not Link then
66
Link = aux.LinkProcedure
77
end
88
--Link Summon
9-
function Link.AddProcedure(c,f,min,max,specialchk,desc)
9+
function Link.AddProcedure(c,f,min,max,specialchk,desc,spcon)
1010
local e1=Effect.CreateEffect(c)
1111
e1:SetType(EFFECT_TYPE_FIELD)
1212
if desc then
@@ -18,7 +18,7 @@ function Link.AddProcedure(c,f,min,max,specialchk,desc)
1818
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
1919
e1:SetRange(LOCATION_EXTRA)
2020
if max==nil then max=c:GetLink() end
21-
e1:SetCondition(Link.Condition(f,min,max,specialchk))
21+
e1:SetCondition(Link.Condition(f,min,max,specialchk,spcon))
2222
e1:SetTarget(Link.Target(f,min,max,specialchk))
2323
e1:SetOperation(Link.Operation(f,min,max,specialchk))
2424
e1:SetValue(SUMMON_TYPE_LINK)
@@ -104,11 +104,14 @@ function Link.CheckGoal(tp,sg,lc,minc,f,specialchk,filt)
104104
return #sg>=minc and sg:CheckWithSumEqual(Link.GetLinkCount,lc:GetLink(),#sg,#sg)
105105
and (not specialchk or specialchk(sg,lc,SUMMON_TYPE_LINK|MATERIAL_LINK,tp)) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
106106
end
107-
function Link.Condition(f,minc,maxc,specialchk)
107+
function Link.Condition(f,minc,maxc,specialchk,spcon)
108108
return function(e,c,must,g,min,max)
109109
if c==nil then return true end
110110
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
111111
local tp=c:GetControler()
112+
if spcon and not spcon(e,e,tp,SUMMON_TYPE_LINK) then
113+
return false
114+
end
112115
if not g then
113116
g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
114117
end

0 commit comments

Comments
 (0)