Commit 6b88f93a authored by wind2009's avatar wind2009

Fix 共界神淵体

* 在自己主要怪兽区域满时仍能从额外卡组特殊召唤。
* 不能选择通常怪兽或者已无效的怪兽为对象。
* 无效效果处理成功才能将两张卡除外。
parent cf36467f
......@@ -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 sumtype=tc:GetSummonType()
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)
local sg=mg:Select(tp,1,1,nil)
Duel.BreakEffect()
......
......@@ -13,7 +13,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
end
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())
end
function s.spfilter(c,e,tp,race,att,atk)
......@@ -27,12 +27,11 @@ function s.spfilter(c,e,tp,race,att,atk)
end
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 chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
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.SetChainLimit(s.limit(g:GetFirst()))
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then Duel.SetChainLimit(s.limit(g:GetFirst())) end
end
function s.limit(c)
return function (e,lp,tp)
......@@ -42,7 +41,7 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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 att=tc:GetAttribute()
local atk=tc:GetAttack()
......@@ -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 sc=g:GetFirst()
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:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DISABLE_EFFECT)
e4:SetValue(RESET_TURN_SET)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
if tc:IsType(TYPE_TRAPMONSTER) then
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e5:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e5)
end
local rg=Group.FromCards(tc,sc)
if (sc:IsCode(tc:GetCode()) or tc:IsCode(sc:GetCode())) and rg:IsExists(Card.IsAbleToRemove,2,nil,POS_FACEDOWN)
and rg:IsExists(Card.IsLocation,2,nil,LOCATION_MZONE)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
if tc:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DISABLE_EFFECT)
e4:SetValue(RESET_TURN_SET)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
if tc:IsType(TYPE_TRAPMONSTER) then
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e5:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e5)
end
local rg=Group.FromCards(tc,sc)
if (sc:IsCode(tc:GetCode()) or tc:IsCode(sc:GetCode())) and rg:IsExists(Card.IsAbleToRemove,2,nil,POS_FACEDOWN)
and rg:IsExists(Card.IsLocation,2,nil,LOCATION_MZONE)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
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