name: Cyber
card_text: If this card is Summoned: Activate 1 of these effects.
  ● Target 1 Equip Card on the field; destroy that target.
  ● Target 1 Equip Card on the field; equip that target to this card.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--effect
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  end
  function s.desfilter(c)
  	return c:GetEquipTarget() or c:IsFaceup() and c:IsType(TYPE_EQUIP)
  end
  function s.eqfilter(c, ec)
  	return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(ec)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		if e:GetLabel() == 1 then
  			return chkc:IsLocation(LOCATION_SZONE) and s.desfilter(chkc)
  		else
  			return chkc:IsLocation(LOCATION_SZONE) and s.eqfilter(chkc, e:GetHandler())
  		end
  	end
  	if chk == 0 then
  		return true
  	end
  	local sel = 0
  	if Duel.IsExistingMatchingCard(s.desfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, nil) then
  		sel = sel + 1
  	end
  	if Duel.IsExistingMatchingCard(s.eqfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, nil, e:GetHandler()) then
  		sel = sel + 2
  	end
  	if sel == 3 then
  		Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  		sel = Duel.SelectOption(tp, aux.Stringid(id, 1), aux.Stringid(id, 2)) + 1
  	end
  	e:SetLabel(sel)
  	if sel == 1 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local g = Duel.SelectTarget(tp, s.desfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, 1, nil)
  		if g:GetCount() > 0 then
  			Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  		end
  	elseif sel == 2 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  		local g = Duel.SelectTarget(tp, s.eqfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, 1, nil, e:GetHandler())
  		if g:GetCount() > 0 then
  			Duel.SetOperationInfo(0, CATEGORY_EQUIP, nil, 1, 0, 0)
  		end
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local sel = e:GetLabel()
  	if sel == 0 then
  		return
  	end
  	local tc = Duel.GetFirstTarget()
  	if sel == 1 then
  		if tc and tc:IsRelateToEffect(e) then
  			Duel.Destroy(tc, REASON_EFFECT)
  		end
  	else
  		local c = e:GetHandler()
  		if tc and tc:IsRelateToEffect(e) then
  			Duel.Equip(tp, tc, c)
  		end
  	end
  end
  
  
source_text: Cyber
  If this card is Summoned: Activate 1 of these effects.
  ● Target 1 Equip Card on the field; destroy that target.
  ● Target 1 Equip Card on the field; equip that target to this card.
target_text: -- Cyber
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--effect
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  end
  function s.desfilter(c)
  	return c:GetEquipTarget() or c:IsFaceup() and c:IsType(TYPE_EQUIP)
  end
  function s.eqfilter(c, ec)
  	return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(ec)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		if e:GetLabel() == 1 then
  			return chkc:IsLocation(LOCATION_SZONE) and s.desfilter(chkc)
  		else
  			return chkc:IsLocation(LOCATION_SZONE) and s.eqfilter(chkc, e:GetHandler())
  		end
  	end
  	if chk == 0 then
  		return true
  	end
  	local sel = 0
  	if Duel.IsExistingMatchingCard(s.desfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, nil) then
  		sel = sel + 1
  	end
  	if Duel.IsExistingMatchingCard(s.eqfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, nil, e:GetHandler()) then
  		sel = sel + 2
  	end
  	if sel == 3 then
  		Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  		sel = Duel.SelectOption(tp, aux.Stringid(id, 1), aux.Stringid(id, 2)) + 1
  	end
  	e:SetLabel(sel)
  	if sel == 1 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local g = Duel.SelectTarget(tp, s.desfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, 1, nil)
  		if g:GetCount() > 0 then
  			Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  		end
  	elseif sel == 2 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  		local g = Duel.SelectTarget(tp, s.eqfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, 1, nil, e:GetHandler())
  		if g:GetCount() > 0 then
  			Duel.SetOperationInfo(0, CATEGORY_EQUIP, nil, 1, 0, 0)
  		end
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local sel = e:GetLabel()
  	if sel == 0 then
  		return
  	end
  	local tc = Duel.GetFirstTarget()
  	if sel == 1 then
  		if tc and tc:IsRelateToEffect(e) then
  			Duel.Destroy(tc, REASON_EFFECT)
  		end
  	else
  		local c = e:GetHandler()
  		if tc and tc:IsRelateToEffect(e) then
  			Duel.Equip(tp, tc, c)
  		end
  	end
  end
  
  