name: Blue-Eyes
card_text: "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon"
  Must be either Fusion Summoned, or Special Summoned by sending the above monsters you control to the GY. Cannot be destroyed by battle. Can make up to 2 attacks on monsters during each Battle Phase. At the end of the Damage Step, when this card attacks an opponent's monster, but the opponent's monster was not destroyed by the battle: You can banish that opponent's monster.
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, 2, true, true)
  	aux.AddContactFusionProcedure(c, Card.IsAbleToGraveAsCost, LOCATION_MZONE, 0, Duel.SendtoGrave, REASON_COST)
  	--spsummon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(s.splimit)
  	c:RegisterEffect(e1)
  	--indes
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  	--attack twice
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--remove
  	local e7 = Effect.CreateEffect(c)
  	e7:SetDescription(aux.Stringid(id, 0))
  	e7:SetCategory(CATEGORY_REMOVE)
  	e7:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e7:SetCode(EVENT_DAMAGE_STEP_END)
  	e7:SetCondition(s.rmcon)
  	e7:SetTarget(s.rmtg)
  	e7:SetOperation(s.rmop)
  	c:RegisterEffect(e7)
  end
  function s.splimit(e, se, sp, st)
  	return bit.band(st, SUMMON_TYPE_FUSION) == SUMMON_TYPE_FUSION
  end
  function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local bc = c:GetBattleTarget()
  	e:SetLabelObject(bc)
  	return c == Duel.GetAttacker() and aux.dsercon(e, tp, eg, ep, ev, re, r, rp) and bc and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle()
  end
  function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetLabelObject():IsAbleToRemove()
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, e:GetLabelObject(), 1, 0, 0)
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	local bc = e:GetLabelObject()
  	if bc:IsRelateToBattle() then
  		Duel.Remove(bc, POS_FACEUP, REASON_EFFECT)
  	end
  end
  
  
source_text: Blue-Eyes
  "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon"
  Must be either Fusion Summoned, or Special Summoned by sending the above monsters you control to the GY. Cannot be destroyed by battle. Can make up to 2 attacks on monsters during each Battle Phase. At the end of the Damage Step, when this card attacks an opponent's monster, but the opponent's monster was not destroyed by the battle: You can banish that opponent's monster.
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, 2, true, true)
  	aux.AddContactFusionProcedure(c, Card.IsAbleToGraveAsCost, LOCATION_MZONE, 0, Duel.SendtoGrave, REASON_COST)
  	--spsummon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(s.splimit)
  	c:RegisterEffect(e1)
  	--indes
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  	--attack twice
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--remove
  	local e7 = Effect.CreateEffect(c)
  	e7:SetDescription(aux.Stringid(id, 0))
  	e7:SetCategory(CATEGORY_REMOVE)
  	e7:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e7:SetCode(EVENT_DAMAGE_STEP_END)
  	e7:SetCondition(s.rmcon)
  	e7:SetTarget(s.rmtg)
  	e7:SetOperation(s.rmop)
  	c:RegisterEffect(e7)
  end
  function s.splimit(e, se, sp, st)
  	return bit.band(st, SUMMON_TYPE_FUSION) == SUMMON_TYPE_FUSION
  end
  function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local bc = c:GetBattleTarget()
  	e:SetLabelObject(bc)
  	return c == Duel.GetAttacker() and aux.dsercon(e, tp, eg, ep, ev, re, r, rp) and bc and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle()
  end
  function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetLabelObject():IsAbleToRemove()
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, e:GetLabelObject(), 1, 0, 0)
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	local bc = e:GetLabelObject()
  	if bc:IsRelateToBattle() then
  		Duel.Remove(bc, POS_FACEUP, REASON_EFFECT)
  	end
  end
  
  