Commit 1fc58554 authored by nanahira's avatar nanahira

workaround for Engraver

parent 4920766f
......@@ -125,8 +125,11 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ac=Duel.AnnounceCard(tp,table.unpack(afilter))
s.AddToAnnounced(tp,ac)
Duel.SetTargetParam(ac)
Auxiliary.DefineGetterTemp(getmetatable(e:GetHandler()),"announce_filter",s.announce_filter_func)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
if #codes>1 then
-- it should be at least two possible choices to make it changeable
Auxiliary.DefineGetterTemp(getmetatable(e:GetHandler()),"announce_filter",s.announce_filter_func)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thlimit(e,c,tp,re)
......@@ -213,10 +216,17 @@ function Auxiliary.DefineGetterTemp(mt, field, f)
end)
end
-- workaround for Engraver
local ARTMEGIA_COUNT=4
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,s.announced[tp],nil,nil)
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={}
end
local af={
TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT,
0x2cd,OPCODE_ISSETCARD,OPCODE_AND,
......
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