Commit 0f0541f5 authored by POLYMER's avatar POLYMER

fix

parent 6b46e865
......@@ -220,13 +220,44 @@ function cm.matfilter(c)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_ONFIELD,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,nil,mg) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.slfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.slfilter(c,mg)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(cm.matfilter))
e1:SetValue(cm.matval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
local res=c:IsLinkSummonable(mg)
e1:Reset()
return res
end
function cm.matval(e,lc,mg,c,tp)
if lc~=e:GetHandler() then return false,nil end
return true,true
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local g=Duel.SelectMatchingCard(tp,cm.slfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local tc=g:GetFirst()
if tc then Duel.LinkSummon(tp,tc,mg) end
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(cm.matfilter))
e1:SetValue(cm.matval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
Duel.LinkSummon(tp,tc,mg)
end
end
\ No newline at end of file
......@@ -83,14 +83,45 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end --Duel.IsExistingMatchingCard(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.slfilter(c,mg,e,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(cm.matfilter,e,tp))
e1:SetValue(cm.matval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
local res=c:IsLinkSummonable(mg)
e1:Reset()
return res
end
function cm.matval(e,lc,mg,c,tp)
if lc~=e:GetHandler() then return false,nil end
return true,true
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local g=Duel.SelectMatchingCard(tp,cm.slfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg,e,tp)
local tc=g:GetFirst()
if tc then Duel.LinkSummon(tp,tc,mg) end
if tc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(cm.matfilter,e,tp))
e1:SetValue(cm.matval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
Duel.LinkSummon(tp,tc,mg)
end
end
function cm.costfilter(c,tp)
return c:IsSetCard(0x129) and c:IsAbleToGraveAsCost() and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,c:GetCode())
......
......@@ -56,7 +56,25 @@ function cm.filter1(c)
return c:IsSetCard(0x10) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.filter2(c,mg)
return (c:IsSynchroSummonable(nil,mg) or c:IsLinkSummonable(mg)) --and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
local e1=Effect.CreateEffect(c)
if c:IsType(TYPE_LINK) then
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetTarget(aux.TRUE)
e1:SetValue(cm.matval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
end
local res=c:IsSynchroSummonable(nil,mg) or c:IsLinkSummonable(mg)
e1:Reset()
return res
end
function cm.matval(e,lc,mg,c,tp)
if lc~=e:GetHandler() then return false,nil end
return true,true
end
function cm.filter3(c)
return c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
......@@ -101,6 +119,16 @@ function cm.slop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsSynchroSummonable(nil,mg) then
Duel.SynchroSummon(tp,tc,nil,mg)
else
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetTarget(aux.TRUE)
e1:SetValue(cm.matval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
Duel.LinkSummon(tp,tc,mg)
end
end
......
......@@ -55,7 +55,19 @@ function cm.tgfilter(c,tp)
return c:IsFaceup() and c:IsDestructable() and Duel.IsExistingMatchingCard(cm.lfilter,tp,LOCATION_EXTRA,0,1,nil,mg,c)
end
function cm.lfilter(c,mg,tc)
return c:IsRace(RACE_BEASTWARRIOR) and c:IsLinkSummonable(mg,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c) return c==tc end)
e1:SetValue(function(e,lc) if lc~=e:GetHandler() then return false,nil end return true,true end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
local res=c:IsRace(RACE_BEASTWARRIOR) and c:IsLinkSummonable(mg,tc)
e1:Reset()
return res
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -75,6 +87,16 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,cm.lfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg,tc)
local lc=g:GetFirst()
if lc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c) return c==tc end)
e1:SetValue(function(e,lc) if lc~=e:GetHandler() then return false,nil end return true,true end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
lc:RegisterEffect(e1,true)
local _SendToGrave=Duel.SendtoGrave
Duel.SendtoGrave=function(tg,r)
if r&(REASON_MATERIAL+REASON_LINK)==REASON_MATERIAL+REASON_LINK then
......
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