name: Noble
card_text: While equipped with a "Noble Arms" Equip Spell Card, this card becomes DARK and its Level is increased by 1. When this card is sent to the Graveyard while equipped with a "Noble Arms" Equip Spell Card: Target 1 "Noble Arms" card in your Graveyard; add that target to your hand.
external_ids: local SETCARD_ID_0 = 0x207a --Noble
  
lua: local SETCARD_ID_0 = 0x207a --Noble
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Attribute Dark
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCondition(s.eqcon2)
  	e2:SetValue(ATTRIBUTE_DARK)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_LEVEL)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  	--tohand
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_TOHAND)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e4:SetCode(EVENT_LEAVE_FIELD)
  	e4:SetCondition(s.thcon)
  	e4:SetTarget(s.thtg)
  	e4:SetOperation(s.thop)
  	c:RegisterEffect(e4)
  end
  function s.eqcon2(e)
  	return e:GetHandler():GetEquipGroup():IsExists(Card.IsSetCard, 1, nil, 0x207a)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return s.eqcon2(e) and e:GetHandler():IsLocation(LOCATION_GRAVE)
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  	end
  end
  
  
source_text: Noble
  While equipped with a "Noble Arms" Equip Spell Card, this card becomes DARK and its Level is increased by 1. When this card is sent to the Graveyard while equipped with a "Noble Arms" Equip Spell Card: Target 1 "Noble Arms" card in your Graveyard; add that target to your hand.
target_text: -- Noble
  local SETCARD_ID_0 = 0x207a --Noble
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Attribute Dark
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCondition(s.eqcon2)
  	e2:SetValue(ATTRIBUTE_DARK)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_LEVEL)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  	--tohand
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_TOHAND)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e4:SetCode(EVENT_LEAVE_FIELD)
  	e4:SetCondition(s.thcon)
  	e4:SetTarget(s.thtg)
  	e4:SetOperation(s.thop)
  	c:RegisterEffect(e4)
  end
  function s.eqcon2(e)
  	return e:GetHandler():GetEquipGroup():IsExists(Card.IsSetCard, 1, nil, 0x207a)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return s.eqcon2(e) and e:GetHandler():IsLocation(LOCATION_GRAVE)
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  	end
  end
  
  