name: Temple
card_text: Each time a "Six Samurai" monster(s) is Normal or Special Summoned, place 1 Bushido Counter on this card. Monsters your opponent controls lose 100 ATK for each Bushido Counter on this card.
external_ids: local SETCARD_ID_0 = 0x103d --Six
  local COUNTER_ID_0 = 0x3 --Bushido
  
lua: local SETCARD_ID_0 = 0x103d --Six
  local COUNTER_ID_0 = 0x3 --Bushido
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x3)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--add counter
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  	--atk down
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_UPDATE_ATTACK)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetTargetRange(0, LOCATION_MZONE)
  	e4:SetValue(s.val)
  	c:RegisterEffect(e4)
  end
  s.counter_add_list = { 0x3 }
  function s.ctfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	if eg:IsExists(s.ctfilter, 1, nil) then
  		e:GetHandler():AddCounter(COUNTER_ID_0, 1)
  	end
  end
  function s.val(e)
  	return e:GetHandler():GetCounter(COUNTER_ID_0) * -100
  end
  
  
source_text: Temple
  Each time a "Six Samurai" monster(s) is Normal or Special Summoned, place 1 Bushido Counter on this card. Monsters your opponent controls lose 100 ATK for each Bushido Counter on this card.
target_text: -- Temple
  local SETCARD_ID_0 = 0x103d --Six
  local COUNTER_ID_0 = 0x3 --Bushido
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x3)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--add counter
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  	--atk down
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_UPDATE_ATTACK)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetTargetRange(0, LOCATION_MZONE)
  	e4:SetValue(s.val)
  	c:RegisterEffect(e4)
  end
  s.counter_add_list = { 0x3 }
  function s.ctfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	if eg:IsExists(s.ctfilter, 1, nil) then
  		e:GetHandler():AddCounter(COUNTER_ID_0, 1)
  	end
  end
  function s.val(e)
  	return e:GetHandler():GetCounter(COUNTER_ID_0) * -100
  end
  
  