name: Neo
card_text: "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon"
  At the end of the Damage Step, if this Fusion Summoned card attacked, and this is the only face-up card you control: You can send 1 "Blue-Eyes" Fusion Monster from your Extra Deck to the GY; this card can attack again in a row. You can use this effect of "Neo Blue-Eyes Ultimate Dragon" twice per turn. When a card or effect is activated that targets a "Blue-Eyes" monster(s) you control (Quick Effect): You can banish this card from your GY; negate the activation, and if you do, destroy that card.
external_ids: local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
  local SETCARD_ID_0 = 0xdd --Blue-Eyes
  
lua: local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
  local SETCARD_ID_0 = 0xdd --Blue-Eyes
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCodeRep(c, CARD_ID_0, 3, true, true)
  	--chain attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_DAMAGE_STEP_END)
  	e1:SetCountLimit(2, id)
  	e1:SetCondition(s.atcon)
  	e1:SetCost(s.atcost)
  	e1:SetOperation(s.atop)
  	c:RegisterEffect(e1)
  	--Negate
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_NEGATE + CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL)
  	e2:SetCondition(s.condition)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.target)
  	e2:SetOperation(s.operation)
  	c:RegisterEffect(e2)
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_FUSION) and c:IsAbleToGraveAsCost()
  end
  function s.atcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsSummonType(SUMMON_TYPE_FUSION) and Duel.GetAttacker() == c and c:IsChainAttackable(0) and not Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_ONFIELD, 0, 1, c)
  end
  function s.atcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_EXTRA, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.atop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ChainAttack()
  end
  function s.filter(c, tp)
  	return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
  		return false
  	end
  	local g = Duel.GetChainInfo(ev, CHAININFO_TARGET_CARDS)
  	return g and g:IsExists(s.filter, 1, nil, tp) and Duel.IsChainNegatable(ev)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  	if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  
  
source_text: Neo
  "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon"
  At the end of the Damage Step, if this Fusion Summoned card attacked, and this is the only face-up card you control: You can send 1 "Blue-Eyes" Fusion Monster from your Extra Deck to the GY; this card can attack again in a row. You can use this effect of "Neo Blue-Eyes Ultimate Dragon" twice per turn. When a card or effect is activated that targets a "Blue-Eyes" monster(s) you control (Quick Effect): You can banish this card from your GY; negate the activation, and if you do, destroy that card.
target_text: -- Neo
  local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
  local SETCARD_ID_0 = 0xdd --Blue-Eyes
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCodeRep(c, CARD_ID_0, 3, true, true)
  	--chain attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_DAMAGE_STEP_END)
  	e1:SetCountLimit(2, id)
  	e1:SetCondition(s.atcon)
  	e1:SetCost(s.atcost)
  	e1:SetOperation(s.atop)
  	c:RegisterEffect(e1)
  	--Negate
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_NEGATE + CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL)
  	e2:SetCondition(s.condition)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.target)
  	e2:SetOperation(s.operation)
  	c:RegisterEffect(e2)
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_FUSION) and c:IsAbleToGraveAsCost()
  end
  function s.atcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsSummonType(SUMMON_TYPE_FUSION) and Duel.GetAttacker() == c and c:IsChainAttackable(0) and not Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_ONFIELD, 0, 1, c)
  end
  function s.atcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_EXTRA, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.atop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ChainAttack()
  end
  function s.filter(c, tp)
  	return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
  		return false
  	end
  	local g = Duel.GetChainInfo(ev, CHAININFO_TARGET_CARDS)
  	return g and g:IsExists(s.filter, 1, nil, tp) and Duel.IsChainNegatable(ev)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  	if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  
  