name: Fuhma
card_text: Target 1 face-up monster on the field; destroy 1 monster on the field with the same Attribute, but a different name, as that monster.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.desfilter1(c, tp)
  	return c:IsFaceup() and Duel.IsExistingMatchingCard(s.desfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, c, c)
  end
  function s.desfilter2(c, mc)
  	return c:IsFaceup() and c:IsAttribute(mc:GetAttribute()) and not c:IsCode(mc:GetCode())
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.desfilter1(chkc, tp)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.desfilter1, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	local g1 = Duel.SelectTarget(tp, s.desfilter1, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, tp)
  	local g2 = Duel.GetMatchingGroup(s.desfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, g1, g1:GetFirst())
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g2, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local g = Duel.SelectMatchingCard(tp, s.desfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, tc, tc)
  		if g:GetCount() > 0 then
  			Duel.HintSelection(g)
  			Duel.Destroy(g, REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Fuhma
  Target 1 face-up monster on the field; destroy 1 monster on the field with the same Attribute, but a different name, as that monster.
target_text: -- Fuhma
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.desfilter1(c, tp)
  	return c:IsFaceup() and Duel.IsExistingMatchingCard(s.desfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, c, c)
  end
  function s.desfilter2(c, mc)
  	return c:IsFaceup() and c:IsAttribute(mc:GetAttribute()) and not c:IsCode(mc:GetCode())
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.desfilter1(chkc, tp)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.desfilter1, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	local g1 = Duel.SelectTarget(tp, s.desfilter1, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, tp)
  	local g2 = Duel.GetMatchingGroup(s.desfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, g1, g1:GetFirst())
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g2, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local g = Duel.SelectMatchingCard(tp, s.desfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, tc, tc)
  		if g:GetCount() > 0 then
  			Duel.HintSelection(g)
  			Duel.Destroy(g, REASON_EFFECT)
  		end
  	end
  end
  
  