name: Gouki
card_text: 2+ "Gouki" monsters
  Gains 300 ATK for each monster it points to. Once per turn: You can Tribute 1 monster this card points to on either field; this card can make a second attack during each Battle Phase this turn.
external_ids: local SETCARD_ID_0 = 0xfc --Gouki
  
lua: local SETCARD_ID_0 = 0xfc --Gouki
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkSetCard, SETCARD_ID_0), 2)
  	c:EnableReviveLimit()
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.atkval)
  	c:RegisterEffect(e1)
  	--multiatk
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.atkcon)
  	e2:SetCost(s.atkcost)
  	e2:SetTarget(s.atktg)
  	e2:SetOperation(s.atkop)
  	c:RegisterEffect(e2)
  end
  function s.atkval(e, c)
  	return c:GetLinkedGroupCount() * 300
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsAbleToEnterBP()
  end
  function s.rfilter(c)
  	return c:IsReleasable()
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local lg = e:GetHandler():GetLinkedGroup()
  	if chk == 0 then
  		return lg:IsExists(s.rfilter, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local g = lg:FilterSelect(tp, s.rfilter, 1, 1, nil)
  	Duel.Release(g, REASON_COST)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK) == 0
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK)
  		e1:SetValue(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  	end
  end
  
  
source_text: Gouki
  2+ "Gouki" monsters
  Gains 300 ATK for each monster it points to. Once per turn: You can Tribute 1 monster this card points to on either field; this card can make a second attack during each Battle Phase this turn.
target_text: -- Gouki
  local SETCARD_ID_0 = 0xfc --Gouki
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkSetCard, SETCARD_ID_0), 2)
  	c:EnableReviveLimit()
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.atkval)
  	c:RegisterEffect(e1)
  	--multiatk
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.atkcon)
  	e2:SetCost(s.atkcost)
  	e2:SetTarget(s.atktg)
  	e2:SetOperation(s.atkop)
  	c:RegisterEffect(e2)
  end
  function s.atkval(e, c)
  	return c:GetLinkedGroupCount() * 300
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsAbleToEnterBP()
  end
  function s.rfilter(c)
  	return c:IsReleasable()
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local lg = e:GetHandler():GetLinkedGroup()
  	if chk == 0 then
  		return lg:IsExists(s.rfilter, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local g = lg:FilterSelect(tp, s.rfilter, 1, 1, nil)
  	Duel.Release(g, REASON_COST)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK) == 0
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK)
  		e1:SetValue(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  	end
  end
  
  