name: Burning
card_text: (This card is always treated as a "Salamangreat" card.)
  If your opponent controls more cards than you do: Target 1 Link Monster your opponent controls; draw cards equal to its Link Rating. You can only activate 1 "Burning Draw" per turn. You cannot Normal or Special Summon monsters the turn you activate this card, except FIRE monsters.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	Duel.AddCustomActivityCounter(id, ACTIVITY_SUMMON, s.counterfilter)
  	Duel.AddCustomActivityCounter(id, ACTIVITY_SPSUMMON, s.counterfilter)
  end
  function s.counterfilter(c)
  	return c:IsAttribute(ATTRIBUTE_FIRE)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_ONFIELD) > Duel.GetFieldGroupCount(tp, LOCATION_ONFIELD, 0)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetCustomActivityCount(id, tp, ACTIVITY_SUMMON) == 0 and Duel.GetCustomActivityCount(id, tp, ACTIVITY_SPSUMMON) == 0
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH)
  	e1:SetCode(EFFECT_CANNOT_SUMMON)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.splimit(e, c)
  	return not c:IsAttribute(ATTRIBUTE_FIRE)
  end
  function s.filter(c, tp)
  	return c:IsFaceup() and c:IsType(TYPE_LINK) and Duel.IsPlayerCanDraw(tp, c:GetLink())
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc, tp)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil, tp)
  	local lk = g:GetFirst():GetLink()
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(lk)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, lk)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if not tc:IsRelateToEffect(e) then
  		return
  	end
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local d = tc:GetLink()
  	Duel.Draw(p, d, REASON_EFFECT)
  end
  
  
source_text: Burning
  (This card is always treated as a "Salamangreat" card.)
  If your opponent controls more cards than you do: Target 1 Link Monster your opponent controls; draw cards equal to its Link Rating. You can only activate 1 "Burning Draw" per turn. You cannot Normal or Special Summon monsters the turn you activate this card, except FIRE monsters.
target_text: -- Burning
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	Duel.AddCustomActivityCounter(id, ACTIVITY_SUMMON, s.counterfilter)
  	Duel.AddCustomActivityCounter(id, ACTIVITY_SPSUMMON, s.counterfilter)
  end
  function s.counterfilter(c)
  	return c:IsAttribute(ATTRIBUTE_FIRE)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_ONFIELD) > Duel.GetFieldGroupCount(tp, LOCATION_ONFIELD, 0)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetCustomActivityCount(id, tp, ACTIVITY_SUMMON) == 0 and Duel.GetCustomActivityCount(id, tp, ACTIVITY_SPSUMMON) == 0
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH)
  	e1:SetCode(EFFECT_CANNOT_SUMMON)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.splimit(e, c)
  	return not c:IsAttribute(ATTRIBUTE_FIRE)
  end
  function s.filter(c, tp)
  	return c:IsFaceup() and c:IsType(TYPE_LINK) and Duel.IsPlayerCanDraw(tp, c:GetLink())
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc, tp)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil, tp)
  	local lk = g:GetFirst():GetLink()
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(lk)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, lk)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if not tc:IsRelateToEffect(e) then
  		return
  	end
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local d = tc:GetLink()
  	Duel.Draw(p, d, REASON_EFFECT)
  end
  
  