name: Bujingi
card_text: During damage calculation (in either player's turn), if a Beast-Warrior-Type "Bujin" monster you control battles an opponent's monster: You can send this card from your hand to the Graveyard; the ATK of your monster becomes double its original ATK, during that damage calculation only.
external_ids: local SETCARD_ID_0 = 0x88 --Bujin
  
lua: local SETCARD_ID_0 = 0x88 --Bujin
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.atkcon)
  	e1:SetCost(s.atkcost)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = Duel.GetAttackTarget()
  	if not c then
  		return false
  	end
  	if c:IsControler(1 - tp) then
  		c = Duel.GetAttacker()
  	end
  	e:SetLabelObject(c)
  	return c and c:IsSetCard(SETCARD_ID_0) and c:IsRace(RACE_BEASTWARRIOR) and c:IsRelateToBattle()
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetLabelObject()
  	if c:IsFaceup() and c:IsRelateToBattle() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_SET_ATTACK_FINAL)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_DAMAGE_CAL)
  		e1:SetValue(c:GetBaseAttack() * 2)
  		c:RegisterEffect(e1)
  	end
  end
  
  
source_text: Bujingi
  During damage calculation (in either player's turn), if a Beast-Warrior-Type "Bujin" monster you control battles an opponent's monster: You can send this card from your hand to the Graveyard; the ATK of your monster becomes double its original ATK, during that damage calculation only.
target_text: -- Bujingi
  local SETCARD_ID_0 = 0x88 --Bujin
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.atkcon)
  	e1:SetCost(s.atkcost)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = Duel.GetAttackTarget()
  	if not c then
  		return false
  	end
  	if c:IsControler(1 - tp) then
  		c = Duel.GetAttacker()
  	end
  	e:SetLabelObject(c)
  	return c and c:IsSetCard(SETCARD_ID_0) and c:IsRace(RACE_BEASTWARRIOR) and c:IsRelateToBattle()
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetLabelObject()
  	if c:IsFaceup() and c:IsRelateToBattle() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_SET_ATTACK_FINAL)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_DAMAGE_CAL)
  		e1:SetValue(c:GetBaseAttack() * 2)
  		c:RegisterEffect(e1)
  	end
  end
  
  