name: Blue-Eyes
card_text: "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon"
  Your opponent cannot target or destroy this card with card effects. Once per turn: You can target 1 card your opponent controls; destroy it. If this card was Fusion Summoned using a monster whose original name is "Blue-Eyes Alternative White Dragon" as material, you can target up to 3 cards your opponent controls instead. This card cannot attack the turn this effect is activated.
external_ids: local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
  
lua: local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCodeRep(c, CARD_ID_0, 3, true, true)
  	--cannot be target/effect indestructable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(aux.tgoval)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetValue(aux.indoval)
  	c:RegisterEffect(e2)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_DESTROY)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCost(s.descost)
  	e3:SetTarget(s.destg)
  	e3:SetOperation(s.desop)
  	c:RegisterEffect(e3)
  	local e0 = Effect.CreateEffect(c)
  	e0:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e0:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e0:SetCondition(s.matcon)
  	e0:SetOperation(s.matop)
  	c:RegisterEffect(e0)
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_MATERIAL_CHECK)
  	e4:SetValue(s.valcheck)
  	e4:SetLabelObject(e0)
  	c:RegisterEffect(e4)
  end
  function s.descost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:GetAttackAnnouncedCount() == 0
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CANNOT_ATTACK)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_OATH)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  	c:RegisterEffect(e1)
  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
  	if chk == 0 then
  		return Duel.IsExistingTarget(nil, tp, 0, LOCATION_ONFIELD, 1, nil)
  	end
  	local ct = 1
  	if e:GetHandler():GetFlagEffect(id) > 0 then
  		ct = 3
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, nil, tp, 0, LOCATION_ONFIELD, 1, ct, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, #g, 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  function s.matcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) and e:GetLabel() == 1
  end
  function s.matop(e, tp, eg, ep, ev, re, r, rp)
  	e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  end
  function s.spfilter(c)
  	return c:IsOriginalCodeRule(38517737)
  end
  function s.valcheck(e, c)
  	local g = c:GetMaterial()
  	if g:IsExists(s.spfilter, 1, nil) then
  		e:GetLabelObject():SetLabel(1)
  	else
  		e:GetLabelObject():SetLabel(0)
  	end
  end
  
  
source_text: Blue-Eyes
  "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon"
  Your opponent cannot target or destroy this card with card effects. Once per turn: You can target 1 card your opponent controls; destroy it. If this card was Fusion Summoned using a monster whose original name is "Blue-Eyes Alternative White Dragon" as material, you can target up to 3 cards your opponent controls instead. This card cannot attack the turn this effect is activated.
target_text: -- Blue-Eyes
  local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCodeRep(c, CARD_ID_0, 3, true, true)
  	--cannot be target/effect indestructable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(aux.tgoval)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetValue(aux.indoval)
  	c:RegisterEffect(e2)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_DESTROY)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCost(s.descost)
  	e3:SetTarget(s.destg)
  	e3:SetOperation(s.desop)
  	c:RegisterEffect(e3)
  	local e0 = Effect.CreateEffect(c)
  	e0:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e0:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e0:SetCondition(s.matcon)
  	e0:SetOperation(s.matop)
  	c:RegisterEffect(e0)
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_MATERIAL_CHECK)
  	e4:SetValue(s.valcheck)
  	e4:SetLabelObject(e0)
  	c:RegisterEffect(e4)
  end
  function s.descost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:GetAttackAnnouncedCount() == 0
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CANNOT_ATTACK)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_OATH)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  	c:RegisterEffect(e1)
  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
  	if chk == 0 then
  		return Duel.IsExistingTarget(nil, tp, 0, LOCATION_ONFIELD, 1, nil)
  	end
  	local ct = 1
  	if e:GetHandler():GetFlagEffect(id) > 0 then
  		ct = 3
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, nil, tp, 0, LOCATION_ONFIELD, 1, ct, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, #g, 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  function s.matcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) and e:GetLabel() == 1
  end
  function s.matop(e, tp, eg, ep, ev, re, r, rp)
  	e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  end
  function s.spfilter(c)
  	return c:IsOriginalCodeRule(38517737)
  end
  function s.valcheck(e, c)
  	local g = c:GetMaterial()
  	if g:IsExists(s.spfilter, 1, nil) then
  		e:GetLabelObject():SetLabel(1)
  	else
  		e:GetLabelObject():SetLabel(0)
  	end
  end
  
  