name: Cliant
card_text: While this Normal Summoned/Set card is face-up on the field, all Cyberse monsters you control gain 500 ATK/DEF during your turn only. If this card on the field would be destroyed by battle or card effect, you can destroy 1 Cyberse monster in your hand or face-up field instead.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--atk/def
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetCondition(s.atkcon)
  	e1:SetTarget(aux.TargetBoolFunction(Card.IsRace, RACE_CYBERSE))
  	e1:SetValue(500)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e2)
  	--destroy replace
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCode(EFFECT_DESTROY_REPLACE)
  	e3:SetTarget(s.reptg)
  	e3:SetOperation(s.repop)
  	c:RegisterEffect(e3)
  end
  function s.atkcon(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.GetTurnPlayer() == tp and e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
  end
  function s.repfilter(c, e)
  	return (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsRace(RACE_CYBERSE) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
  end
  function s.reptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsReason(REASON_BATTLE + REASON_EFFECT) and not c:IsReason(REASON_REPLACE) and Duel.IsExistingMatchingCard(s.repfilter, tp, LOCATION_MZONE + LOCATION_HAND, 0, 1, c, e)
  	end
  	if Duel.SelectEffectYesNo(tp, c, 96) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESREPLACE)
  		local g = Duel.SelectMatchingCard(tp, s.repfilter, tp, LOCATION_MZONE + LOCATION_HAND, 0, 1, 1, c, e)
  		e:SetLabelObject(g:GetFirst())
  		g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED, true)
  		return true
  	else
  		return false
  	end
  end
  function s.repop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	tc:SetStatus(STATUS_DESTROY_CONFIRMED, false)
  	Duel.Destroy(tc, REASON_EFFECT + REASON_REPLACE)
  end
  
  
source_text: Cliant
  While this Normal Summoned/Set card is face-up on the field, all Cyberse monsters you control gain 500 ATK/DEF during your turn only. If this card on the field would be destroyed by battle or card effect, you can destroy 1 Cyberse monster in your hand or face-up field instead.
target_text: -- Cliant
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--atk/def
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetCondition(s.atkcon)
  	e1:SetTarget(aux.TargetBoolFunction(Card.IsRace, RACE_CYBERSE))
  	e1:SetValue(500)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e2)
  	--destroy replace
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCode(EFFECT_DESTROY_REPLACE)
  	e3:SetTarget(s.reptg)
  	e3:SetOperation(s.repop)
  	c:RegisterEffect(e3)
  end
  function s.atkcon(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.GetTurnPlayer() == tp and e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
  end
  function s.repfilter(c, e)
  	return (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsRace(RACE_CYBERSE) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
  end
  function s.reptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsReason(REASON_BATTLE + REASON_EFFECT) and not c:IsReason(REASON_REPLACE) and Duel.IsExistingMatchingCard(s.repfilter, tp, LOCATION_MZONE + LOCATION_HAND, 0, 1, c, e)
  	end
  	if Duel.SelectEffectYesNo(tp, c, 96) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESREPLACE)
  		local g = Duel.SelectMatchingCard(tp, s.repfilter, tp, LOCATION_MZONE + LOCATION_HAND, 0, 1, 1, c, e)
  		e:SetLabelObject(g:GetFirst())
  		g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED, true)
  		return true
  	else
  		return false
  	end
  end
  function s.repop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	tc:SetStatus(STATUS_DESTROY_CONFIRMED, false)
  	Duel.Destroy(tc, REASON_EFFECT + REASON_REPLACE)
  end
  
  