name: Bravedrive
card_text: Once per turn, when your Cyberse monster declares an attack: You can discard 1 monster; that attacking monster gains 600 ATK, until the end of this turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--pierce
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.atkcon)
  	e1:SetCost(s.atkcost)
  	e1:SetTarget(s.atktg)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	return a:IsControler(tp) and a:IsRace(RACE_CYBERSE)
  end
  function s.cfilter(c)
  	return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, s.cfilter, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.GetAttacker():CreateEffectRelation(e)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	if a:IsRelateToEffect(e) and a:IsFaceup() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(600)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		a:RegisterEffect(e1)
  	end
  end
  
  
source_text: Bravedrive
  Once per turn, when your Cyberse monster declares an attack: You can discard 1 monster; that attacking monster gains 600 ATK, until the end of this turn.
target_text: -- Bravedrive
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pierce
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.atkcon)
  	e1:SetCost(s.atkcost)
  	e1:SetTarget(s.atktg)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	return a:IsControler(tp) and a:IsRace(RACE_CYBERSE)
  end
  function s.cfilter(c)
  	return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, s.cfilter, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.GetAttacker():CreateEffectRelation(e)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	if a:IsRelateToEffect(e) and a:IsFaceup() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(600)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		a:RegisterEffect(e1)
  	end
  end
  
  