name: Swift
card_text: Each turn, after the first time a "Six Samurai" monster you control battles, all "Six Samurai" monsters you control gain 300 ATK until the end of this turn.
external_ids: local SETCARD_ID_0 = 0x103d --Six
  
lua: local SETCARD_ID_0 = 0x103d --Six
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--damage cal
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_BATTLED)
  	e2:SetOperation(s.atop)
  	c:RegisterEffect(e2)
  	--atkup
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCode(EVENT_DAMAGE_STEP_END)
  	e3:SetOperation(s.upop)
  	c:RegisterEffect(e3)
  end
  function s.check(c, tp)
  	return c and c:IsSetCard(SETCARD_ID_0) and c:IsControler(tp)
  end
  function s.atop(e, tp, eg, ep, ev, re, r, rp)
  	if s.check(Duel.GetAttacker(), tp) or s.check(Duel.GetAttackTarget(), tp) then
  		e:GetHandler():RegisterFlagEffect(id, RESET_PHASE + PHASE_DAMAGE, 0, 1)
  	end
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:GetFlagEffect(id) == 0
  end
  function s.upop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetFlagEffect(id) == 0 then
  		return
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, 0, nil)
  	local tc = g:GetFirst()
  	while tc do
  		--Activate
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(300)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1)
  		tc = g:GetNext()
  	end
  end
  
  
source_text: Swift
  Each turn, after the first time a "Six Samurai" monster you control battles, all "Six Samurai" monsters you control gain 300 ATK until the end of this turn.
target_text: -- Swift
  local SETCARD_ID_0 = 0x103d --Six
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--damage cal
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_BATTLED)
  	e2:SetOperation(s.atop)
  	c:RegisterEffect(e2)
  	--atkup
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCode(EVENT_DAMAGE_STEP_END)
  	e3:SetOperation(s.upop)
  	c:RegisterEffect(e3)
  end
  function s.check(c, tp)
  	return c and c:IsSetCard(SETCARD_ID_0) and c:IsControler(tp)
  end
  function s.atop(e, tp, eg, ep, ev, re, r, rp)
  	if s.check(Duel.GetAttacker(), tp) or s.check(Duel.GetAttackTarget(), tp) then
  		e:GetHandler():RegisterFlagEffect(id, RESET_PHASE + PHASE_DAMAGE, 0, 1)
  	end
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:GetFlagEffect(id) == 0
  end
  function s.upop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetFlagEffect(id) == 0 then
  		return
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, 0, nil)
  	local tc = g:GetFirst()
  	while tc do
  		--Activate
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(300)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1)
  		tc = g:GetNext()
  	end
  end
  
  