name: Dark
card_text: "Dark Magician" + "Flame Swordsman"
  You take no Battle Damage from battles involving this card. When this card is destroyed by battle and sent to the Graveyard: Special Summon 1 "Mirage Knight" from your hand or Deck.
external_ids: local CARD_ID_0 = 46986414 --Dark Magician
  local CARD_ID_1 = 45231177 --Flame Swordsman
  local CARD_ID_2 = 49217579 --Mirage Knight
  
lua: local CARD_ID_0 = 46986414 --Dark Magician
  local CARD_ID_1 = 45231177 --Flame Swordsman
  local CARD_ID_2 = 49217579 --Mirage Knight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode2(c, CARD_ID_0, CARD_ID_1, true, true)
  	--Special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetCode(EVENT_BATTLE_DESTROYED)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  end
  function s.spfilter(c, e, tp)
  	return c:IsCode(CARD_ID_2) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND + LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND + LOCATION_DECK, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, true, false, POS_FACEUP)
  		g:GetFirst():CompleteProcedure()
  	end
  end
  
  
source_text: Dark
  "Dark Magician" + "Flame Swordsman"
  You take no Battle Damage from battles involving this card. When this card is destroyed by battle and sent to the Graveyard: Special Summon 1 "Mirage Knight" from your hand or Deck.
target_text: -- Dark
  local CARD_ID_0 = 46986414 --Dark Magician
  local CARD_ID_1 = 45231177 --Flame Swordsman
  local CARD_ID_2 = 49217579 --Mirage Knight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode2(c, CARD_ID_0, CARD_ID_1, true, true)
  	--Special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetCode(EVENT_BATTLE_DESTROYED)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  end
  function s.spfilter(c, e, tp)
  	return c:IsCode(CARD_ID_2) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND + LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND + LOCATION_DECK, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, true, false, POS_FACEUP)
  		g:GetFirst():CompleteProcedure()
  	end
  end
  
  