name: Oneiros,
card_text: 2 "Dream Mirror" monsters with different Attributes
  While face-up on the field, this card is also LIGHT-Attribute. You can only use each of the following effects of "Oneiros, the Dream Mirror Tormentor" once per turn.
  ● When a monster effect is activated while "Dream Mirror of Terror" is in a Field Zone (Quick Effect): You can negate that effect.
  ● If "Dream Mirror of Joy" is in a Field Zone (Quick Effect): You can Tribute this card; Special Summon 1 "Oneiros, the Dream Mirror Erlking" from your Extra Deck in Defense Position.
external_ids: local CARD_ID_1 = 74665651 --Dream Mirror of Joy
  local CARD_ID_2 = 1050355 --Dream Mirror of Terror
  local CARD_ID_3 = 35187185 --Oneiros, the Dream Mirror Erlking
  local SETCARD_ID_0 = 0x131 --Dream
  
lua: local CARD_ID_1 = 74665651 --Dream Mirror of Joy
  local CARD_ID_2 = 1050355 --Dream Mirror of Terror
  local CARD_ID_3 = 35187185 --Oneiros, the Dream Mirror Erlking
  local SETCARD_ID_0 = 0x131 --Dream
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_1, CARD_ID_2, CARD_ID_3)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFunRep(c, s.ffilter, 2, true)
  	--attribute
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_ADD_ATTRIBUTE)
  	e1:SetValue(ATTRIBUTE_LIGHT)
  	c:RegisterEffect(e1)
  	--disable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DISABLE)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.discon)
  	e2:SetTarget(s.distg)
  	e2:SetOperation(s.disop)
  	c:RegisterEffect(e2)
  	--special summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_FREE_CHAIN)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetCondition(s.spcon)
  	e3:SetCost(s.spcost)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.ffilter(c, fc, sub, mg, sg)
  	return c:IsFusionSetCard(SETCARD_ID_0) and (not sg or not sg:IsExists(Card.IsFusionAttribute, 1, c, c:GetFusionAttribute()))
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and Duel.IsEnvironment(CARD_ID_2, PLAYER_ALL, LOCATION_FZONE)
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsEnvironment(CARD_ID_1, PLAYER_ALL, LOCATION_FZONE)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsReleasable()
  	end
  	Duel.Release(e:GetHandler(), REASON_COST)
  end
  function s.spfilter(c, e, tp, mc)
  	return c:IsCode(CARD_ID_3) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and Duel.GetLocationCountFromEx(tp, tp, mc, c) > 0
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp, e:GetHandler())
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp, nil)
  	if #g > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  
  
source_text: Oneiros,
  2 "Dream Mirror" monsters with different Attributes
  While face-up on the field, this card is also LIGHT-Attribute. You can only use each of the following effects of "Oneiros, the Dream Mirror Tormentor" once per turn.
  ● When a monster effect is activated while "Dream Mirror of Terror" is in a Field Zone (Quick Effect): You can negate that effect.
  ● If "Dream Mirror of Joy" is in a Field Zone (Quick Effect): You can Tribute this card; Special Summon 1 "Oneiros, the Dream Mirror Erlking" from your Extra Deck in Defense Position.
target_text: -- Oneiros,
  local CARD_ID_1 = 74665651 --Dream Mirror of Joy
  local CARD_ID_2 = 1050355 --Dream Mirror of Terror
  local CARD_ID_3 = 35187185 --Oneiros, the Dream Mirror Erlking
  local SETCARD_ID_0 = 0x131 --Dream
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_1, CARD_ID_2, CARD_ID_3)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFunRep(c, s.ffilter, 2, true)
  	--attribute
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_ADD_ATTRIBUTE)
  	e1:SetValue(ATTRIBUTE_LIGHT)
  	c:RegisterEffect(e1)
  	--disable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DISABLE)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.discon)
  	e2:SetTarget(s.distg)
  	e2:SetOperation(s.disop)
  	c:RegisterEffect(e2)
  	--special summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_FREE_CHAIN)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetCondition(s.spcon)
  	e3:SetCost(s.spcost)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.ffilter(c, fc, sub, mg, sg)
  	return c:IsFusionSetCard(SETCARD_ID_0) and (not sg or not sg:IsExists(Card.IsFusionAttribute, 1, c, c:GetFusionAttribute()))
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and Duel.IsEnvironment(CARD_ID_2, PLAYER_ALL, LOCATION_FZONE)
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsEnvironment(CARD_ID_1, PLAYER_ALL, LOCATION_FZONE)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsReleasable()
  	end
  	Duel.Release(e:GetHandler(), REASON_COST)
  end
  function s.spfilter(c, e, tp, mc)
  	return c:IsCode(CARD_ID_3) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and Duel.GetLocationCountFromEx(tp, tp, mc, c) > 0
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp, e:GetHandler())
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp, nil)
  	if #g > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  
  