name: Frightfur
card_text: "Edge Imp Sabres" + 1 or more "Fluffal" monsters
  When this card is Fusion Summoned: You can target cards on the field, up to the number of Fusion Materials used for its Fusion Summon; destroy them. All "Frightfur" monsters you control gain 300 ATK for each "Fluffal" monster and "Frightfur" monster you control. You can only control 1 "Frightfur Tiger".
external_ids: local CARD_ID_0 = 30068120 --Edge Imp Sabres
  local SETCARD_ID_0 = 0xad --Frightfur
  local SETCARD_ID_1 = 0xa9 --Fluffal
  
lua: local CARD_ID_0 = 30068120 --Edge Imp Sabres
  local SETCARD_ID_0 = 0xad --Frightfur
  local SETCARD_ID_1 = 0xa9 --Fluffal
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCodeFunRep(c, CARD_ID_0, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_1), 1, 127, true, true)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCondition(s.descon)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  	--atk
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(LOCATION_MZONE, 0)
  	e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_1))
  	e3:SetValue(s.atkval)
  	c:RegisterEffect(e3)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField()
  	end
  	local ct = e:GetHandler():GetMaterialCount()
  	if chk == 0 then
  		return ct > 0 and Duel.IsExistingTarget(aux.TRUE, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, aux.TRUE, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, ct, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  function s.atkfilter(c)
  	return c:IsFaceup() and c:IsSetCard(0xa9, SETCARD_ID_1)
  end
  function s.atkval(e, c)
  	return Duel.GetMatchingGroupCount(s.atkfilter, c:GetControler(), LOCATION_MZONE, 0, nil) * 300
  end
  
  
source_text: Frightfur
  "Edge Imp Sabres" + 1 or more "Fluffal" monsters
  When this card is Fusion Summoned: You can target cards on the field, up to the number of Fusion Materials used for its Fusion Summon; destroy them. All "Frightfur" monsters you control gain 300 ATK for each "Fluffal" monster and "Frightfur" monster you control. You can only control 1 "Frightfur Tiger".
target_text: -- Frightfur
  local CARD_ID_0 = 30068120 --Edge Imp Sabres
  local SETCARD_ID_0 = 0xad --Frightfur
  local SETCARD_ID_1 = 0xa9 --Fluffal
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCodeFunRep(c, CARD_ID_0, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_1), 1, 127, true, true)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCondition(s.descon)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  	--atk
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(LOCATION_MZONE, 0)
  	e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_1))
  	e3:SetValue(s.atkval)
  	c:RegisterEffect(e3)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField()
  	end
  	local ct = e:GetHandler():GetMaterialCount()
  	if chk == 0 then
  		return ct > 0 and Duel.IsExistingTarget(aux.TRUE, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, aux.TRUE, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, ct, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  function s.atkfilter(c)
  	return c:IsFaceup() and c:IsSetCard(0xa9, SETCARD_ID_1)
  end
  function s.atkval(e, c)
  	return Duel.GetMatchingGroupCount(s.atkfilter, c:GetControler(), LOCATION_MZONE, 0, nil) * 300
  end
  
  