name: Gazelle
card_text: If this card is Normal or Special Summoned: You can add 1 Level 5 Fiend monster or 1 "Chimera Fusion" from your Deck to your hand. If this card is sent to the GY as material for a Fusion Summon: You can add 1 Illusion monster from your Deck to your hand. You can only use each effect of "Gazelle the King of Mythical Claws" once per turn.
external_ids: local CARD_ID_0 = 63136489 --Chimera Fusion
  
lua: local CARD_ID_0 = 63136489 --Chimera Fusion
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--add fusion/fiend
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SEARCH + CATEGORY_TOHAND)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetTarget(s.thtg(s.filter))
  	e1:SetOperation(s.thop(s.filter))
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	--add illusionist
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_SEARCH + CATEGORY_TOHAND)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_BE_MATERIAL)
  	e3:SetCountLimit(1, id + o)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCondition(s.condition)
  	e3:SetTarget(s.thtg(s.ifilter))
  	e3:SetOperation(s.thop(s.ifilter))
  	c:RegisterEffect(e3)
  end
  function s.filter(c)
  	return (c:IsCode(CARD_ID_0) or c:IsLevel(5) and c:IsRace(RACE_FIEND)) and c:IsAbleToHand()
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsLocation(LOCATION_GRAVE) and r == REASON_FUSION
  end
  function s.ifilter(c)
  	return c:IsRace(RACE_ILLUSION) and c:IsAbleToHand()
  end
  function s.thtg(f)
  	return function(e, tp, eg, ep, ev, re, r, rp, chk)
  		if chk == 0 then
  			return Duel.IsExistingMatchingCard(f, tp, LOCATION_DECK, 0, 1, nil)
  		end
  		Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  	end
  end
  function s.thop(f)
  	return function(e, tp, eg, ep, ev, re, r, rp)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local g = Duel.SelectMatchingCard(tp, f, tp, LOCATION_DECK, 0, 1, 1, nil)
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  end
  
  
source_text: Gazelle
  If this card is Normal or Special Summoned: You can add 1 Level 5 Fiend monster or 1 "Chimera Fusion" from your Deck to your hand. If this card is sent to the GY as material for a Fusion Summon: You can add 1 Illusion monster from your Deck to your hand. You can only use each effect of "Gazelle the King of Mythical Claws" once per turn.
target_text: -- Gazelle
  local CARD_ID_0 = 63136489 --Chimera Fusion
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--add fusion/fiend
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SEARCH + CATEGORY_TOHAND)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetTarget(s.thtg(s.filter))
  	e1:SetOperation(s.thop(s.filter))
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	--add illusionist
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_SEARCH + CATEGORY_TOHAND)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_BE_MATERIAL)
  	e3:SetCountLimit(1, id + o)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCondition(s.condition)
  	e3:SetTarget(s.thtg(s.ifilter))
  	e3:SetOperation(s.thop(s.ifilter))
  	c:RegisterEffect(e3)
  end
  function s.filter(c)
  	return (c:IsCode(CARD_ID_0) or c:IsLevel(5) and c:IsRace(RACE_FIEND)) and c:IsAbleToHand()
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsLocation(LOCATION_GRAVE) and r == REASON_FUSION
  end
  function s.ifilter(c)
  	return c:IsRace(RACE_ILLUSION) and c:IsAbleToHand()
  end
  function s.thtg(f)
  	return function(e, tp, eg, ep, ev, re, r, rp, chk)
  		if chk == 0 then
  			return Duel.IsExistingMatchingCard(f, tp, LOCATION_DECK, 0, 1, nil)
  		end
  		Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  	end
  end
  function s.thop(f)
  	return function(e, tp, eg, ep, ev, re, r, rp)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local g = Duel.SelectMatchingCard(tp, f, tp, LOCATION_DECK, 0, 1, 1, nil)
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  end
  
  