name: Shien's
card_text: When this card is Normal Summoned: Place 1 Bushido Counter on it (max. 1). This card gains 300 ATK while it has a Bushido Counter on it. Once per turn: You can target 1 face-up card on the field that you can place a Bushido Counter on; remove 1 Bushido Counter from this card, then place it on that target.
external_ids: local COUNTER_ID_0 = 0x3 --Bushido
  
lua: local COUNTER_ID_0 = 0x3 --Bushido
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x3)
  	c:SetCounterLimit(0x3, 1)
  	--summon success
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_COUNTER)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.addct)
  	e1:SetOperation(s.addc)
  	c:RegisterEffect(e1)
  	--attackup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetValue(s.attackup)
  	c:RegisterEffect(e2)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_COUNTER)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetTarget(s.addct2)
  	e3:SetOperation(s.addc2)
  	c:RegisterEffect(e3)
  end
  s.counter_add_list = { 0x3 }
  function s.addct(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_COUNTER, nil, 1, 0, 0x3)
  end
  function s.addc(e, tp, eg, ep, ev, re, r, rp)
  	if e:GetHandler():IsRelateToEffect(e) then
  		e:GetHandler():AddCounter(COUNTER_ID_0, 1)
  	end
  end
  function s.attackup(e, c)
  	return c:GetCounter(COUNTER_ID_0) * 300
  end
  function s.addct2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField() and chkc:IsCanAddCounter(COUNTER_ID_0, 1)
  	end
  	if chk == 0 then
  		return e:GetHandler():IsCanRemoveCounter(tp, COUNTER_ID_0, 1, REASON_EFFECT) and Duel.IsExistingTarget(Card.IsCanAddCounter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, e:GetHandler(), 0x3, 1)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_COUNTER)
  	Duel.SelectTarget(tp, Card.IsCanAddCounter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, e:GetHandler(), 0x3, 1)
  end
  function s.addc2(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetCounter(COUNTER_ID_0) == 0 then
  		return
  	end
  	c:RemoveCounter(tp, COUNTER_ID_0, 1, REASON_EFFECT)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		tc:AddCounter(COUNTER_ID_0, 1)
  	end
  end
  
  
source_text: Shien's
  When this card is Normal Summoned: Place 1 Bushido Counter on it (max. 1). This card gains 300 ATK while it has a Bushido Counter on it. Once per turn: You can target 1 face-up card on the field that you can place a Bushido Counter on; remove 1 Bushido Counter from this card, then place it on that target.
target_text: -- Shien's
  local COUNTER_ID_0 = 0x3 --Bushido
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x3)
  	c:SetCounterLimit(0x3, 1)
  	--summon success
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_COUNTER)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.addct)
  	e1:SetOperation(s.addc)
  	c:RegisterEffect(e1)
  	--attackup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetValue(s.attackup)
  	c:RegisterEffect(e2)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_COUNTER)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetTarget(s.addct2)
  	e3:SetOperation(s.addc2)
  	c:RegisterEffect(e3)
  end
  s.counter_add_list = { 0x3 }
  function s.addct(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_COUNTER, nil, 1, 0, 0x3)
  end
  function s.addc(e, tp, eg, ep, ev, re, r, rp)
  	if e:GetHandler():IsRelateToEffect(e) then
  		e:GetHandler():AddCounter(COUNTER_ID_0, 1)
  	end
  end
  function s.attackup(e, c)
  	return c:GetCounter(COUNTER_ID_0) * 300
  end
  function s.addct2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField() and chkc:IsCanAddCounter(COUNTER_ID_0, 1)
  	end
  	if chk == 0 then
  		return e:GetHandler():IsCanRemoveCounter(tp, COUNTER_ID_0, 1, REASON_EFFECT) and Duel.IsExistingTarget(Card.IsCanAddCounter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, e:GetHandler(), 0x3, 1)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_COUNTER)
  	Duel.SelectTarget(tp, Card.IsCanAddCounter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, e:GetHandler(), 0x3, 1)
  end
  function s.addc2(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetCounter(COUNTER_ID_0) == 0 then
  		return
  	end
  	c:RemoveCounter(tp, COUNTER_ID_0, 1, REASON_EFFECT)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		tc:AddCounter(COUNTER_ID_0, 1)
  	end
  end
  
  