name: Birth
card_text: Target 2 FIRE monsters (1 Tuner and 1 non-Tuner) with 200 DEF in your GY; banish both monsters, and if you do, Special Summon 1 FIRE Synchro Monster from your Extra Deck whose Level equals the total Levels of those monsters. You can only activate 1 "Birth of the Prominence Flame" per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_REMOVE + CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter1(c, e, tp)
  	return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDefense(200) and c:IsType(TYPE_TUNER) and c:IsAbleToRemove() and Duel.IsExistingTarget(s.filter2, tp, LOCATION_GRAVE, 0, 1, c, e, tp, c:GetLevel())
  end
  function s.filter2(c, e, tp, lv)
  	return c:IsAttribute(ATTRIBUTE_FIRE)
  		and c:IsDefense(200)
  		and not c:IsType(TYPE_TUNER)
  		and c:IsLevelAbove(0)
  		and c:IsAbleToRemove()
  		and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp, c:GetLevel() + lv)
  end
  function s.spfilter(c, e, tp, lv)
  	return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsType(TYPE_SYNCHRO) and c:IsLevel(lv) and Duel.GetLocationCountFromEx(tp, tp, nil, c) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter1, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g1 = Duel.SelectTarget(tp, s.filter1, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g2 = Duel.SelectTarget(tp, s.filter2, tp, LOCATION_GRAVE, 0, 1, 1, g1:GetFirst(), e, tp, g1:GetFirst():GetLevel())
  	g1:Merge(g2)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g1, 2, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tg = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
  	if not tg or tg:FilterCount(Card.IsRelateToEffect, nil, e) ~= 2 then
  		return
  	end
  	if Duel.Remove(tg, POS_FACEUP, REASON_EFFECT) == 2 then
  		local og = Duel.GetOperatedGroup()
  		local lv = og:GetSum(Card.GetLevel)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp, lv)
  		if #sg > 0 then
  			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  
source_text: Birth
  Target 2 FIRE monsters (1 Tuner and 1 non-Tuner) with 200 DEF in your GY; banish both monsters, and if you do, Special Summon 1 FIRE Synchro Monster from your Extra Deck whose Level equals the total Levels of those monsters. You can only activate 1 "Birth of the Prominence Flame" per turn.
target_text: -- Birth
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_REMOVE + CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter1(c, e, tp)
  	return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDefense(200) and c:IsType(TYPE_TUNER) and c:IsAbleToRemove() and Duel.IsExistingTarget(s.filter2, tp, LOCATION_GRAVE, 0, 1, c, e, tp, c:GetLevel())
  end
  function s.filter2(c, e, tp, lv)
  	return c:IsAttribute(ATTRIBUTE_FIRE)
  		and c:IsDefense(200)
  		and not c:IsType(TYPE_TUNER)
  		and c:IsLevelAbove(0)
  		and c:IsAbleToRemove()
  		and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp, c:GetLevel() + lv)
  end
  function s.spfilter(c, e, tp, lv)
  	return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsType(TYPE_SYNCHRO) and c:IsLevel(lv) and Duel.GetLocationCountFromEx(tp, tp, nil, c) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter1, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g1 = Duel.SelectTarget(tp, s.filter1, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g2 = Duel.SelectTarget(tp, s.filter2, tp, LOCATION_GRAVE, 0, 1, 1, g1:GetFirst(), e, tp, g1:GetFirst():GetLevel())
  	g1:Merge(g2)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g1, 2, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tg = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
  	if not tg or tg:FilterCount(Card.IsRelateToEffect, nil, e) ~= 2 then
  		return
  	end
  	if Duel.Remove(tg, POS_FACEUP, REASON_EFFECT) == 2 then
  		local og = Duel.GetOperatedGroup()
  		local lv = og:GetSum(Card.GetLevel)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp, lv)
  		if #sg > 0 then
  			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  