name: Doyon
card_text: If this card is Normal or Special Summoned: You can target 1 "@Ignister" monster in your GY; add it to your hand. If this card is sent to the GY as material for the Link Summon of a Cyberse monster: You can target 1 "A.I." Spell/Trap in your GY; add it to your hand. You can only use each effect of "Doyon @Ignister" once per turn.
external_ids: local SETCARD_ID_0 = 0x136 --A.I.
  local SETCARD_ID_1 = 0x135 --@Ignister
  
lua: local SETCARD_ID_0 = 0x136 --A.I.
  local SETCARD_ID_1 = 0x135 --@Ignister
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--to hand
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOHAND)
  	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:SetTarget(s.thtg1)
  	e1:SetOperation(s.thop1)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	--to hand
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_TOHAND)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
  	e3:SetCode(EVENT_BE_MATERIAL)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetCondition(s.thcon2)
  	e3:SetTarget(s.thtg2)
  	e3:SetOperation(s.thop2)
  	c:RegisterEffect(e3)
  end
  function s.thfilter1(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.thtg1(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter1(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter1, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter1, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop1(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
  function s.thcon2(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return r == REASON_LINK and c:GetReasonCard():IsRace(RACE_CYBERSE) and c:IsLocation(LOCATION_GRAVE)
  end
  function s.thfilter2(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsAbleToHand()
  end
  function s.thtg2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter2(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter2, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter2, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop2(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: Doyon
  If this card is Normal or Special Summoned: You can target 1 "@Ignister" monster in your GY; add it to your hand. If this card is sent to the GY as material for the Link Summon of a Cyberse monster: You can target 1 "A.I." Spell/Trap in your GY; add it to your hand. You can only use each effect of "Doyon @Ignister" once per turn.
target_text: -- Doyon
  local SETCARD_ID_0 = 0x136 --A.I.
  local SETCARD_ID_1 = 0x135 --@Ignister
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--to hand
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOHAND)
  	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:SetTarget(s.thtg1)
  	e1:SetOperation(s.thop1)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	--to hand
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_TOHAND)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
  	e3:SetCode(EVENT_BE_MATERIAL)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetCondition(s.thcon2)
  	e3:SetTarget(s.thtg2)
  	e3:SetOperation(s.thop2)
  	c:RegisterEffect(e3)
  end
  function s.thfilter1(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.thtg1(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter1(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter1, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter1, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop1(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
  function s.thcon2(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return r == REASON_LINK and c:GetReasonCard():IsRace(RACE_CYBERSE) and c:IsLocation(LOCATION_GRAVE)
  end
  function s.thfilter2(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsAbleToHand()
  end
  function s.thtg2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter2(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter2, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter2, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop2(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
  
  