name: Cyberse
card_text: If all monsters you control are Cyberse monsters (min. 1), you can Special Summon this card (from your hand). You can only Special Summon "Cyberse Converter" once per turn this way. When this card is Normal Summoned: You can target 1 face-up monster you control; it becomes a Cyberse monster until the end of this turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.sprcon)
  	c:RegisterEffect(e1)
  	--race
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetTarget(s.rctg)
  	e2:SetOperation(s.rcop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFacedown() or not c:IsRace(RACE_CYBERSE)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) > 0 and not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.rcfilter(c)
  	return c:IsFaceup() and not c:IsRace(RACE_CYBERSE)
  end
  function s.rctg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.rcfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.rcfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.rcfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  end
  function s.rcop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CHANGE_RACE)
  		e1:SetValue(RACE_CYBERSE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  	end
  end
  
  
source_text: Cyberse
  If all monsters you control are Cyberse monsters (min. 1), you can Special Summon this card (from your hand). You can only Special Summon "Cyberse Converter" once per turn this way. When this card is Normal Summoned: You can target 1 face-up monster you control; it becomes a Cyberse monster until the end of this turn.
target_text: -- Cyberse
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.sprcon)
  	c:RegisterEffect(e1)
  	--race
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetTarget(s.rctg)
  	e2:SetOperation(s.rcop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFacedown() or not c:IsRace(RACE_CYBERSE)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) > 0 and not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.rcfilter(c)
  	return c:IsFaceup() and not c:IsRace(RACE_CYBERSE)
  end
  function s.rctg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.rcfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.rcfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.rcfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  end
  function s.rcop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CHANGE_RACE)
  		e1:SetValue(RACE_CYBERSE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  	end
  end
  
  