name: The
card_text: This card's name becomes "Fallen of Albaz" while on the field or in the GY. If this card is Normal or Special Summoned: You can discard 1 card, then target 1 Dragon monster your opponent controls or in their GY, and activate the appropriate effect;
  ● Send this card to the GY, and if you do, take control of that monster on the field until the End Phase.
  ● Send this card to the GY, and if you do, Special Summon that monster from the GY to your field.
  You can only use this effect of "The Bystial Aluber" once per turn.
external_ids: local CARD_ID_0 = 68468459 --Fallen of Albaz
  
lua: local CARD_ID_0 = 68468459 --Fallen of Albaz
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--change name
  	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
  	--control or special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.tg)
  	e1:SetOperation(s.op)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.filter1(c)
  	return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsControlerCanBeChanged()
  end
  function s.filter2(c, e, tp)
  	return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		if e:GetLabel() == 0 then
  			return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter1(chkc)
  		else
  			return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter2(chkc, e, tp)
  		end
  	end
  	local c = e:GetHandler()
  	local b1 = Duel.IsExistingTarget(s.filter1, tp, 0, LOCATION_MZONE, 1, nil)
  	local b2 = Duel.IsExistingTarget(s.filter2, tp, 0, LOCATION_GRAVE, 1, nil, e, tp) and Duel.GetMZoneCount(tp, c) > 0
  	if chk == 0 then
  		return c:IsAbleToGrave() and (b1 or b2)
  	end
  	local op = 0
  	if b1 and b2 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 0), aux.Stringid(id, 1))
  	elseif b1 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 0))
  	else
  		op = Duel.SelectOption(tp, aux.Stringid(id, 1)) + 1
  	end
  	e:SetLabel(op)
  	if op == 0 then
  		e:SetCategory(CATEGORY_CONTROL)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  		local g = Duel.SelectTarget(tp, s.filter1, tp, 0, LOCATION_MZONE, 1, 1, nil)
  		Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  	else
  		e:SetCategory(CATEGORY_SPECIAL_SUMMON)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectTarget(tp, s.filter2, tp, 0, LOCATION_GRAVE, 1, 1, nil, e, tp)
  		Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, c, 1, 0, 0)
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if not c:IsRelateToEffect(e) or Duel.SendtoGrave(c, REASON_EFFECT) == 0 then
  		return
  	end
  	if c:GetLocation() ~= LOCATION_GRAVE or not tc:IsRelateToEffect(e) then
  		return
  	end
  	if e:GetLabel() == 0 then
  		Duel.GetControl(tc, tp, PHASE_END, 1)
  	else
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: The
  This card's name becomes "Fallen of Albaz" while on the field or in the GY. If this card is Normal or Special Summoned: You can discard 1 card, then target 1 Dragon monster your opponent controls or in their GY, and activate the appropriate effect;
  ● Send this card to the GY, and if you do, take control of that monster on the field until the End Phase.
  ● Send this card to the GY, and if you do, Special Summon that monster from the GY to your field.
  You can only use this effect of "The Bystial Aluber" once per turn.
target_text: -- The
  local CARD_ID_0 = 68468459 --Fallen of Albaz
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--change name
  	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
  	--control or special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.tg)
  	e1:SetOperation(s.op)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.filter1(c)
  	return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsControlerCanBeChanged()
  end
  function s.filter2(c, e, tp)
  	return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		if e:GetLabel() == 0 then
  			return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter1(chkc)
  		else
  			return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter2(chkc, e, tp)
  		end
  	end
  	local c = e:GetHandler()
  	local b1 = Duel.IsExistingTarget(s.filter1, tp, 0, LOCATION_MZONE, 1, nil)
  	local b2 = Duel.IsExistingTarget(s.filter2, tp, 0, LOCATION_GRAVE, 1, nil, e, tp) and Duel.GetMZoneCount(tp, c) > 0
  	if chk == 0 then
  		return c:IsAbleToGrave() and (b1 or b2)
  	end
  	local op = 0
  	if b1 and b2 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 0), aux.Stringid(id, 1))
  	elseif b1 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 0))
  	else
  		op = Duel.SelectOption(tp, aux.Stringid(id, 1)) + 1
  	end
  	e:SetLabel(op)
  	if op == 0 then
  		e:SetCategory(CATEGORY_CONTROL)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  		local g = Duel.SelectTarget(tp, s.filter1, tp, 0, LOCATION_MZONE, 1, 1, nil)
  		Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  	else
  		e:SetCategory(CATEGORY_SPECIAL_SUMMON)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectTarget(tp, s.filter2, tp, 0, LOCATION_GRAVE, 1, 1, nil, e, tp)
  		Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, c, 1, 0, 0)
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if not c:IsRelateToEffect(e) or Duel.SendtoGrave(c, REASON_EFFECT) == 0 then
  		return
  	end
  	if c:GetLocation() ~= LOCATION_GRAVE or not tc:IsRelateToEffect(e) then
  		return
  	end
  	if e:GetLabel() == 0 then
  		Duel.GetControl(tc, tp, PHASE_END, 1)
  	else
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  