Commit da4091b1 authored by mercury233's avatar mercury233 Committed by GitHub

update EFFECT_EXTRA_LINK_MATERIAL (#1507)

parent b4f5ccca
...@@ -28,8 +28,9 @@ end ...@@ -28,8 +28,9 @@ end
function c2347477.exmfilter(c) function c2347477.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(2347477) return c:IsLocation(LOCATION_HAND) and c:IsCode(2347477)
end end
function c2347477.matval(e,c,mg) function c2347477.matval(e,lc,mg,c,tp)
return c:IsSetCard(0x101) and mg:IsExists(c2347477.mfilter,1,nil) and not mg:IsExists(c2347477.exmfilter,1,nil) if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(c2347477.mfilter,1,nil) and not mg:IsExists(c2347477.exmfilter,1,nil)
end end
function c2347477.thcon(e,tp,eg,ep,ev,re,r,rp) function c2347477.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -28,8 +28,9 @@ end ...@@ -28,8 +28,9 @@ end
function c30114823.exmfilter(c) function c30114823.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(30114823) return c:IsLocation(LOCATION_HAND) and c:IsCode(30114823)
end end
function c30114823.matval(e,c,mg) function c30114823.matval(e,lc,mg,c,tp)
return c:IsSetCard(0x101) and mg:IsExists(c30114823.mfilter,1,nil) and not mg:IsExists(c30114823.exmfilter,1,nil) if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(c30114823.mfilter,1,nil) and not mg:IsExists(c30114823.exmfilter,1,nil)
end end
function c30114823.tdcon(e,tp,eg,ep,ev,re,r,rp) function c30114823.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -28,8 +28,9 @@ end ...@@ -28,8 +28,9 @@ end
function c37119142.exmfilter(c) function c37119142.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(37119142) return c:IsLocation(LOCATION_HAND) and c:IsCode(37119142)
end end
function c37119142.matval(e,c,mg) function c37119142.matval(e,lc,mg,c,tp)
return c:IsSetCard(0x101) and mg:IsExists(c37119142.mfilter,1,nil) and not mg:IsExists(c37119142.exmfilter,1,nil) if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(c37119142.mfilter,1,nil) and not mg:IsExists(c37119142.exmfilter,1,nil)
end end
function c37119142.thcon(e,tp,eg,ep,ev,re,r,rp) function c37119142.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -29,8 +29,9 @@ end ...@@ -29,8 +29,9 @@ end
function c59185998.exmfilter(c) function c59185998.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(59185998) return c:IsLocation(LOCATION_HAND) and c:IsCode(59185998)
end end
function c59185998.matval(e,c,mg) function c59185998.matval(e,lc,mg,c,tp)
return c:IsSetCard(0x103) and mg:IsExists(c59185998.mfilter,1,nil) and not mg:IsExists(c59185998.exmfilter,1,nil) if not lc:IsSetCard(0x103) then return false,nil end
return true,not mg or mg:IsExists(c59185998.mfilter,1,nil) and not mg:IsExists(c59185998.exmfilter,1,nil)
end end
function c59185998.cfilter(c,tp) function c59185998.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x103) and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK) return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x103) and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK)
......
...@@ -28,8 +28,9 @@ end ...@@ -28,8 +28,9 @@ end
function c75130221.exmfilter(c) function c75130221.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(75130221) return c:IsLocation(LOCATION_HAND) and c:IsCode(75130221)
end end
function c75130221.matval(e,c,mg) function c75130221.matval(e,lc,mg,c,tp)
return c:IsSetCard(0x101) and mg:IsExists(c75130221.mfilter,1,nil) and not mg:IsExists(c75130221.exmfilter,1,nil) if not lc:IsSetCard(0x101) then return false,nil end
return true,not mg or mg:IsExists(c75130221.mfilter,1,nil) and not mg:IsExists(c75130221.exmfilter,1,nil)
end end
function c75130221.discon(e,tp,eg,ep,ev,re,r,rp) function c75130221.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -1876,7 +1876,14 @@ function Auxiliary.LConditionFilter(c,f,lc) ...@@ -1876,7 +1876,14 @@ function Auxiliary.LConditionFilter(c,f,lc)
end end
function Auxiliary.LExtraFilter(c,f,lc,tp) function Auxiliary.LExtraFilter(c,f,lc,tp)
if c:IsLocation(LOCATION_ONFIELD) and not c:IsFaceup() then return false end if c:IsLocation(LOCATION_ONFIELD) and not c:IsFaceup() then return false end
return c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp) and c:IsCanBeLinkMaterial(lc) and (not f or f(c)) if not c:IsCanBeLinkMaterial(lc) or f and not f(c) then return false end
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
for _,te in pairs(le) do
local tf=te:GetValue()
local related,valid=tf(te,lc,nil,c,tp)
if related then return true end
end
return false
end end
function Auxiliary.GetLinkCount(c) function Auxiliary.GetLinkCount(c)
if c:IsType(TYPE_LINK) and c:GetLink()>1 then if c:IsType(TYPE_LINK) and c:GetLink()>1 then
...@@ -1891,11 +1898,15 @@ function Auxiliary.GetLinkMaterials(tp,f,lc) ...@@ -1891,11 +1898,15 @@ function Auxiliary.GetLinkMaterials(tp,f,lc)
end end
function Auxiliary.LCheckOtherMaterial(c,mg,lc,tp) function Auxiliary.LCheckOtherMaterial(c,mg,lc,tp)
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)} local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
local res1=false
local res2=true
for _,te in pairs(le) do for _,te in pairs(le) do
local f=te:GetValue() local f=te:GetValue()
if f and not f(te,lc,mg,c,tp) then return false end local related,valid=f(te,lc,mg,c,tp)
if related then res2=false end
if related and valid then res1=true end
end end
return true return res1 or res2
end end
function Auxiliary.LUncompatibilityFilter(c,sg,lc,tp) function Auxiliary.LUncompatibilityFilter(c,sg,lc,tp)
local mg=sg:Filter(aux.TRUE,c) local mg=sg:Filter(aux.TRUE,c)
...@@ -1913,7 +1924,8 @@ function Auxiliary.LExtraMaterialCount(mg,lc,tp) ...@@ -1913,7 +1924,8 @@ function Auxiliary.LExtraMaterialCount(mg,lc,tp)
for _,te in pairs(le) do for _,te in pairs(le) do
local sg=mg:Filter(aux.TRUE,tc) local sg=mg:Filter(aux.TRUE,tc)
local f=te:GetValue() local f=te:GetValue()
if not f or f(te,lc,sg) then local related,valid=f(te,lc,sg,tc,tp)
if related and valid then
te:UseCountLimit(tp) te:UseCountLimit(tp)
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment