name: Brotherhood
card_text: You can Ritual Summon this card with "Fire Formation - Domei". You can discard 1 monster; Set 1 "Fire Formation" Spell/Trap directly from your Deck or GY. When your opponent activates a monster effect (Quick Effect): You can send 1 face-up "Fire Fist" or "Fire Formation" card you control to the GY, except "Brotherhood of the Fire Fist - Eland"; negate that effect. You can only use each effect of "Brotherhood of the Fire Fist - Eland" once per turn.
external_ids: local CARD_ID_0 = 46241344 --Brotherhood of the Fire Fist - Eagle
  local SETCARD_ID_0 = 0x79 --Fire
  local SETCARD_ID_1 = 0x7c --Fire
  
lua: local CARD_ID_0 = 46241344 --Brotherhood of the Fire Fist - Eagle
  local SETCARD_ID_0 = 0x79 --Fire
  local SETCARD_ID_1 = 0x7c --Fire
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--set
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.setcost)
  	e1:SetTarget(s.settg)
  	e1:SetOperation(s.setop)
  	c:RegisterEffect(e1)
  	--disable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_DISABLE)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCondition(s.discon)
  	e2:SetCost(s.discost)
  	e2:SetTarget(s.distg)
  	e2:SetOperation(s.disop)
  	c:RegisterEffect(e2)
  end
  function s.costfilter1(c)
  	return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
  end
  function s.setcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter1, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, s.costfilter1, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.setfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsSSetable()
  end
  function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.setfilter, tp, LOCATION_DECK + LOCATION_GRAVE, 0, 1, nil)
  	end
  end
  function s.setop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
  	local g = Duel.SelectMatchingCard(tp, aux.NecroValleyFilter(s.setfilter), tp, LOCATION_DECK + LOCATION_GRAVE, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SSet(tp, g:GetFirst())
  	end
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp == 1 - tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
  end
  function s.costfilter2(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1, 0x7c) and not c:IsCode(id) and c:IsAbleToGraveAsCost()
  end
  function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter2, tp, LOCATION_ONFIELD, 0, 1, nil) or Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
  	end
  	if Duel.IsExistingMatchingCard(s.costfilter2, tp, LOCATION_ONFIELD, 0, 1, nil) and (not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) or not Duel.SelectYesNo(tp, aux.Stringid(46241344, 0))) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  		local g = Duel.SelectMatchingCard(tp, s.costfilter2, tp, LOCATION_ONFIELD, 0, 1, 1, nil)
  		Duel.SendtoGrave(g, REASON_COST)
  	end
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  
source_text: Brotherhood
  You can Ritual Summon this card with "Fire Formation - Domei". You can discard 1 monster; Set 1 "Fire Formation" Spell/Trap directly from your Deck or GY. When your opponent activates a monster effect (Quick Effect): You can send 1 face-up "Fire Fist" or "Fire Formation" card you control to the GY, except "Brotherhood of the Fire Fist - Eland"; negate that effect. You can only use each effect of "Brotherhood of the Fire Fist - Eland" once per turn.
target_text: -- Brotherhood
  local CARD_ID_0 = 46241344 --Brotherhood of the Fire Fist - Eagle
  local SETCARD_ID_0 = 0x79 --Fire
  local SETCARD_ID_1 = 0x7c --Fire
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--set
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.setcost)
  	e1:SetTarget(s.settg)
  	e1:SetOperation(s.setop)
  	c:RegisterEffect(e1)
  	--disable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_DISABLE)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCondition(s.discon)
  	e2:SetCost(s.discost)
  	e2:SetTarget(s.distg)
  	e2:SetOperation(s.disop)
  	c:RegisterEffect(e2)
  end
  function s.costfilter1(c)
  	return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
  end
  function s.setcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter1, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, s.costfilter1, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.setfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsSSetable()
  end
  function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.setfilter, tp, LOCATION_DECK + LOCATION_GRAVE, 0, 1, nil)
  	end
  end
  function s.setop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
  	local g = Duel.SelectMatchingCard(tp, aux.NecroValleyFilter(s.setfilter), tp, LOCATION_DECK + LOCATION_GRAVE, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SSet(tp, g:GetFirst())
  	end
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp == 1 - tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
  end
  function s.costfilter2(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1, 0x7c) and not c:IsCode(id) and c:IsAbleToGraveAsCost()
  end
  function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter2, tp, LOCATION_ONFIELD, 0, 1, nil) or Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
  	end
  	if Duel.IsExistingMatchingCard(s.costfilter2, tp, LOCATION_ONFIELD, 0, 1, nil) and (not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) or not Duel.SelectYesNo(tp, aux.Stringid(46241344, 0))) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  		local g = Duel.SelectMatchingCard(tp, s.costfilter2, tp, LOCATION_ONFIELD, 0, 1, 1, nil)
  		Duel.SendtoGrave(g, REASON_COST)
  	end
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  