Commit 925cca2d authored by 聖園ミカ's avatar 聖園ミカ 🐟

Replace c21185608.lua

parent f5ceb34c
Pipeline #30720 passed with stages
in 31 minutes and 18 seconds
......@@ -6,9 +6,9 @@ function c21185608.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c21185608.LinkCondition(c21185608.effectmonster,3,c:GetLink(),nil))
e1:SetTarget(c21185608.LinkTarget(c21185608.effectmonster,3,c:GetLink(),nil))
e1:SetOperation(c21185608.LinkOperation(c21185608.effectmonster,3,c:GetLink(),nil))
e1:SetCondition(c21185608.linkcon())
e1:SetTarget(c21185608.linktg())
e1:SetOperation(c21185608.linkop())
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
local e0=Effect.CreateEffect(c)
......@@ -58,18 +58,29 @@ function c21185608.initial_effect(c)
e5:SetOperation(c21185608.op5)
c:RegisterEffect(e5)
end
c21185608.SetCard_FF_SEER=true
function c21185608.GetLinkMaterials(tp,f,lc,e)
local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f,lc,e)
local mg2=Duel.GetMatchingGroup(Auxiliary.LExtraFilter,tp,LOCATION_HAND+LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc,tp)
local mg3=Duel.GetMatchingGroup(c21185608.effectmonster2,tp,LOCATION_EXTRA,0,lc)
if mg2:GetCount()>0 then mg:Merge(mg2) end
if mg3:GetCount()>0 then mg:Merge(mg3) end
return mg
end
function c21185608.effectmonster(c)
return c:IsFaceup() and c:IsLinkType(TYPE_EFFECT) and c:IsType(TYPE_MONSTER) and c:IsCanBeLinkMaterial(nil)
if not c:IsFaceup() or not c:IsType(TYPE_MONSTER) then return false end
return c:IsType(TYPE_EFFECT) and c:IsCanBeLinkMaterial(nil)
end
function c21185608.effectmonster2(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsType(TYPE_MONSTER) and c:IsCanBeLinkMaterial(nil) and c:IsAbleToRemoveAsCost() and not (c:IsFaceup() and c:IsType(TYPE_PENDULUM))
if c:IsFaceup() and c:IsType(TYPE_PENDULUM) then return false end
return c:IsType(TYPE_MONSTER) and c:IsType(TYPE_EFFECT) and c:IsCanBeLinkMaterial(nil)
end
function c21185608.LinkCondition(f,minct,maxct,gf)
function c21185608.linkcon()
return function(e,c,og,lmat,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minct
local maxc=maxct
local minc=3
local maxc=5
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
......@@ -78,37 +89,38 @@ function c21185608.LinkCondition(f,minct,maxct,gf)
local tp=c:GetControler()
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
mg=og:Filter(Auxiliary.LConditionFilter,nil,c21185608.effectmonster,c,e)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
local mg2=Duel.GetMatchingGroup(c21185608.effectmonster2,tp,LOCATION_EXTRA,0,c)
if mg2:GetCount()>0 then
mg:Merge(mg2)
end
mg=c21185608.GetLinkMaterials(tp,c21185608.effectmonster,c,e)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
if not Auxiliary.LConditionFilter(lmat,c21185608.effectmonster,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
if fg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(fg)
return mg:CheckSubGroup(c21185608.LCheckGoal,minc,maxc,tp,c,gf,lmat)
return mg:CheckSubGroup(c21185608.LCheckGoal,3,5,tp,c,lmat)
end
end
function c21185608.location(c)
return not c:IsLocation(LOCATION_EXTRA)
end
function c21185608.LCheckGoal(sg,tp,lc,gf,lmat)
function c21185608.LCheckGoal(sg,tp,lc,lmat)
if not sg:IsExists(function(c)
return not c:IsLocation(LOCATION_EXTRA)
end,2,nil) then
return
end
return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),#sg,#sg)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg,lc,tp))
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
and not sg:IsExists(Auxiliary.LUncompatibilityFilter,1,nil,sg,lc,tp)
and (not lmat or sg:IsContains(lmat)) and not sg:IsExists(Card.IsLocation,2,nil,LOCATION_EXTRA)
and (not lmat or sg:IsContains(lmat)) and sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=1
end
function c21185608.LinkTarget(f,minct,maxct,gf)
function c21185608.linktg()
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
local minc=minct
local maxc=maxct
local minc=3
local maxc=5
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
......@@ -116,23 +128,19 @@ function c21185608.LinkTarget(f,minct,maxct,gf)
end
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
mg=og:Filter(Auxiliary.LConditionFilter,nil,c21185608.effectmonster,c,e)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
local mg2=Duel.GetMatchingGroup(c21185608.effectmonster2,tp,LOCATION_EXTRA,0,c)
if mg2:GetCount()>0 then
mg:Merge(mg2)
end
mg=c21185608.GetLinkMaterials(tp,c21185608.effectmonster,c,e)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
if not Auxiliary.LConditionFilter(lmat,c21185608.effectmonster,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
Duel.SetSelectedCard(fg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local cancel=Duel.IsSummonCancelable()
local sg=mg:SelectSubGroup(tp,c21185608.LCheckGoal,cancel,minc,maxc,tp,c,gf,lmat)
local sg=mg:SelectSubGroup(tp,c21185608.LCheckGoal,cancel,minc,maxc,tp,c,lmat)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
......@@ -140,7 +148,7 @@ function c21185608.LinkTarget(f,minct,maxct,gf)
else return false end
end
end
function c21185608.LinkOperation(f,minct,maxct,gf)
function c21185608.linkop()
return function(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
......@@ -148,6 +156,7 @@ function c21185608.LinkOperation(f,minct,maxct,gf)
local g1=g:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
local g2=g:Filter(c21185608.location,nil)
Duel.Remove(g1,POS_FACEDOWN,REASON_MATERIAL+REASON_LINK)
Duel.ConfirmCards(1-tp,g1)
Duel.SendtoGrave(g2,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup()
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