Commit 6b88f93a authored by wind2009's avatar wind2009

Fix 共界神淵体

* 在自己主要怪兽区域满时仍能从额外卡组特殊召唤。
* 不能选择通常怪兽或者已无效的怪兽为对象。
* 无效效果处理成功才能将两张卡除外。
parent cf36467f
Pipeline #25260 passed with stages
in 1 minute
...@@ -32,7 +32,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,7 +32,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=tc:GetMaterial():Filter(aux.NecroValleyFilter(s.mgfilter),nil,e,tp,tc) local mg=tc:GetMaterial():Filter(aux.NecroValleyFilter(s.mgfilter),nil,e,tp,tc)
local sumtype=tc:GetSummonType() local sumtype=tc:GetSummonType()
if Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and sumtype==SUMMON_TYPE_LINK if Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and sumtype==SUMMON_TYPE_LINK
and tc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and mg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then and tc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and mg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=mg:Select(tp,1,1,nil) local sg=mg:Select(tp,1,1,nil)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -13,7 +13,7 @@ function s.initial_effect(c) ...@@ -13,7 +13,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.tgfilter(c,e,tp) function s.tgfilter(c,e,tp)
return c:IsFaceup() and not c:IsType(TYPE_TOKEN) return c:IsFaceup() and not c:IsType(TYPE_TOKEN) and aux.NegateEffectMonsterFilter(c)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND,0,1,nil,e,tp,c:GetRace(),c:GetAttribute(),c:GetAttack()) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND,0,1,nil,e,tp,c:GetRace(),c:GetAttribute(),c:GetAttack())
end end
function s.spfilter(c,e,tp,race,att,atk) function s.spfilter(c,e,tp,race,att,atk)
...@@ -27,12 +27,11 @@ function s.spfilter(c,e,tp,race,att,atk) ...@@ -27,12 +27,11 @@ function s.spfilter(c,e,tp,race,att,atk)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
and Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,s.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND)
Duel.SetChainLimit(s.limit(g:GetFirst())) if e:IsHasType(EFFECT_TYPE_ACTIVATE) then Duel.SetChainLimit(s.limit(g:GetFirst())) end
end end
function s.limit(c) function s.limit(c)
return function (e,lp,tp) return function (e,lp,tp)
...@@ -42,7 +41,7 @@ end ...@@ -42,7 +41,7 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local race=tc:GetRace() local race=tc:GetRace()
local att=tc:GetAttribute() local att=tc:GetAttribute()
local atk=tc:GetAttack() local atk=tc:GetAttack()
...@@ -50,44 +49,44 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,44 +49,44 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND,0,1,1,nil,e,tp,race,att,atk) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND,0,1,1,nil,e,tp,race,att,atk)
local sc=g:GetFirst() local sc=g:GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1) sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2) sc:RegisterEffect(e2)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
Duel.NegateRelatedChain(tc,RESET_TURN_SET) if tc:IsCanBeDisabledByEffect(e) then
local e3=Effect.CreateEffect(c) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
e3:SetType(EFFECT_TYPE_SINGLE) local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_DISABLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetCode(EFFECT_DISABLE)
tc:RegisterEffect(e3) e3:SetReset(RESET_EVENT+RESETS_STANDARD)
local e4=Effect.CreateEffect(c) tc:RegisterEffect(e3)
e4:SetType(EFFECT_TYPE_SINGLE) local e4=Effect.CreateEffect(c)
e4:SetCode(EFFECT_DISABLE_EFFECT) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetValue(RESET_TURN_SET) e4:SetCode(EFFECT_DISABLE_EFFECT)
e4:SetReset(RESET_EVENT+RESETS_STANDARD) e4:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e4) e4:SetReset(RESET_EVENT+RESETS_STANDARD)
if tc:IsType(TYPE_TRAPMONSTER) then tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c) if tc:IsType(TYPE_TRAPMONSTER) then
e5:SetType(EFFECT_TYPE_SINGLE) local e5=Effect.CreateEffect(c)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_DISABLE_TRAPMONSTER) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetReset(RESET_EVENT+RESETS_STANDARD) e5:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e5) e5:SetReset(RESET_EVENT+RESETS_STANDARD)
end tc:RegisterEffect(e5)
local rg=Group.FromCards(tc,sc) end
if (sc:IsCode(tc:GetCode()) or tc:IsCode(sc:GetCode())) and rg:IsExists(Card.IsAbleToRemove,2,nil,POS_FACEDOWN) local rg=Group.FromCards(tc,sc)
and rg:IsExists(Card.IsLocation,2,nil,LOCATION_MZONE) if (sc:IsCode(tc:GetCode()) or tc:IsCode(sc:GetCode())) and rg:IsExists(Card.IsAbleToRemove,2,nil,POS_FACEDOWN)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then and rg:IsExists(Card.IsLocation,2,nil,LOCATION_MZONE)
Duel.BreakEffect() and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT) Duel.BreakEffect()
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
end end
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