local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(130000001,0))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e5:SetHintTiming(0,0x1c0)
e5:SetRange(LOCATION_EXTRA)
e5:SetCondition(c130000001.sprdon)
e5:SetOperation(c130000001.sprdop)
c:RegisterEffect(e5)
function c130000001.sprdon(e,tp,eg,ep,ev,re,r,rp)
if c==nil then return true end
local tp=c:GetControler()
local selfExist = not Duel.IsExistingMatchingCard(c130000001.sprdfilter,tp,LOCATION_ONFIELD,0,1,nil)
--醒めない悪夢からの移植記述1
local selfNotChain = e:GetHandler():GetFlagEffect(130000001)==0
return selfExist and selfNotChain
--醒めない悪夢からの移植記述2(この行でエラー発生)
e:GetHandler():RegisterFlagEffect(130000001,RESET_CHAIN,0,1)
end
function c130000001.sprdfilter(c)
return c:IsCode(130000001) and c:IsFaceup()
end
function c130000001.sprdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if Duel.SpecialSummon(e:GetHandler(),SUMMON_TYPE_FUSION,tp,tp,true,false,POS_FACEUP_ATTACK)~=0 then
e:GetHandler():CompleteProcedure()
end
end
end