Commit d1d8004c authored by nanahira's avatar nanahira

Engraver workaround again

parent 0dc87f98
......@@ -21,7 +21,6 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_ANNOUNCE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(s.thcost)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
......@@ -222,10 +221,23 @@ end
function s.announce_filter_func(c)
local tp=c:GetControler()
local exg=Duel.GetMatchingGroup(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,nil,0x2cd)
local ncodes=s.CreateCodeList(exg,nil,nil,nil)
if #ncodes>=ARTMEGIA_COUNT then
-- this case Engraver would freeze, so we make it at least don't freeze
ncodes={}
local exc={}
local cchain=Duel.GetCurrentChain()
local called_by_engraver=false
if cchain>1 then
local ac=Duel.GetChainInfo(cchain-1,CHAININFO_TARGET_PARAM)
if ac and ac>0 then
table.insert(exc,ac)
end
local ce=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
if ce:GetHandler()~=c then
called_by_engraver=true
end
end
local ncodes=s.CreateCodeList(exg,exc,nil,nil)
if #ncodes>=ARTMEGIA_COUNT and called_by_engraver then
-- make Engraver's effect quit
error("Nothing can be declared", 3)
end
local af={
TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT,
......
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