name: Mokey
card_text: This card's name becomes "Mokey Mokey" and is treated as a Normal Monster while face-up on the field or in the GY. You can discard this card; add 1 "Mokey Mokey" card from your Deck to your hand, except "Mokey Mokey Adrift".
external_ids: local CARD_ID_0 = 27288416 --Mokey Mokey
  local SETCARD_ID_0 = 0x183 --Mokey
  
lua: local CARD_ID_0 = 27288416 --Mokey Mokey
  local SETCARD_ID_0 = 0x183 --Mokey
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--change name
  	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
  	--normal monster
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_ADD_TYPE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE)
  	e1:SetRange(LOCATION_MZONE + LOCATION_GRAVE)
  	e1:SetValue(TYPE_NORMAL)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_REMOVE_TYPE)
  	e2:SetValue(TYPE_EFFECT)
  	c:RegisterEffect(e2)
  	--to hand
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_HAND)
  	e3:SetCost(s.thcost)
  	e3:SetTarget(s.thtg)
  	e3:SetOperation(s.thop)
  	c:RegisterEffect(e3)
  end
  function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsDiscardable()
  	end
  	Duel.SendtoGrave(c, REASON_COST + REASON_DISCARD)
  end
  function s.thfilter(c)
  	return not c:IsCode(id) and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  end
  
  
source_text: Mokey
  This card's name becomes "Mokey Mokey" and is treated as a Normal Monster while face-up on the field or in the GY. You can discard this card; add 1 "Mokey Mokey" card from your Deck to your hand, except "Mokey Mokey Adrift".
target_text: -- Mokey
  local CARD_ID_0 = 27288416 --Mokey Mokey
  local SETCARD_ID_0 = 0x183 --Mokey
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--change name
  	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
  	--normal monster
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_ADD_TYPE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE)
  	e1:SetRange(LOCATION_MZONE + LOCATION_GRAVE)
  	e1:SetValue(TYPE_NORMAL)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_REMOVE_TYPE)
  	e2:SetValue(TYPE_EFFECT)
  	c:RegisterEffect(e2)
  	--to hand
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_HAND)
  	e3:SetCost(s.thcost)
  	e3:SetTarget(s.thtg)
  	e3:SetOperation(s.thop)
  	c:RegisterEffect(e3)
  end
  function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsDiscardable()
  	end
  	Duel.SendtoGrave(c, REASON_COST + REASON_DISCARD)
  end
  function s.thfilter(c)
  	return not c:IsCode(id) and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  end
  
  