Commit 3ce8d2f7 authored by wind2009's avatar wind2009

Fix Divine Serpent Apophis

parent 664c30be
Pipeline #33434 passed with stages
in 1 minute and 5 seconds
No preview for this file type
......@@ -10,7 +10,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(s.splimit)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -49,23 +49,23 @@ end
function s.ffilter(c)
return aux.IsCodeListed(c,29762407)
end
function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function s.hspfilter(c)
return c:IsFusionSetCard(0x2c9) and c:IsControler(tp)
function s.hspfilter(c,tp,sc)
return c:IsFusionSetCard(0x2c9) and c:IsControler(tp) and c:IsReleasable(REASON_SPSUMMON)
and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end
function s.hspchk(g,tp,sc)
return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
end
function s.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(s.hspfilter,tp,LOCATION_MZONE,0,nil)
return rg:CheckSubGroup(aux.mzctcheck,2,2,tp)
local rg=Duel.GetMatchingGroup(s.hspfilter,tp,LOCATION_MZONE,0,nil,tp,e:GetHandler())
return rg:CheckSubGroup(s.hspchk,2,2,tp,e:GetHandler())
end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetMatchingGroup(s.hspfilter,tp,LOCATION_MZONE,0,nil)
local rg=Duel.GetMatchingGroup(s.hspfilter,tp,LOCATION_MZONE,0,nil,tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheck,true,2,2,tp)
local sg=rg:SelectSubGroup(tp,s.hspchk,true,2,2,tp,e:GetHandler())
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
......@@ -78,7 +78,7 @@ function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
g:DeleteGroup()
end
function s.setfilter(c)
return c:IsSetCard(0x2c9) and c:IsType(TYPE_TRAP) and c:IsSSetable()
return c:IsSetCard(0x2c9) and c:IsType(TYPE_TRAP) and c:IsSSetable() and c:IsCanBeEffectTarget()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_GRAVE,0,nil)
......@@ -91,18 +91,17 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(aux.NecroValleyFilter(Card.IsRelateToEffect),nil,e)
local tg=g:Filter(aux.NecroValleyFilter(Card.IsRelateToChain),nil,e)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if #tg==0 or ft<=0 then return end
if #tg>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
tg=tg:Select(tp,1,ft,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
tg=tg:Select(tp,ft,ft,nil)
end
Duel.SSet(tp,tg)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
return rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) 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