name: Fallen
card_text: If this card is Normal or Special Summoned (except during the Damage Step): You can discard 1 card; Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters on either field as Fusion Material, including this card, but you cannot use other monsters you control as Fusion Material. You can only use this effect of "Fallen of Albaz" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion summon
  	local e1 = FusionSpell.CreateSummonEffect(c, {
  		matfilter = s.matfilter,
  		pre_select_mat_location = LOCATION_MZONE,
  		pre_select_mat_opponent_location = LOCATION_MZONE,
  		gc = s.gc,
  	})
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  end
  
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() & (PHASE_DAMAGE + PHASE_DAMAGE_CAL) == 0
  end
  
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, e:GetHandler())
  	end
  	Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
  end
  
  function s.matfilter(c, e, tp)
  	if c:IsOnField() and c:IsControler(tp) and c ~= e:GetHandler() then
  		return false
  	end
  	return true
  end
  
  function s.gc(e)
  	return e:GetHandler()
  end
  
  
source_text: Fallen
  If this card is Normal or Special Summoned (except during the Damage Step): You can discard 1 card; Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters on either field as Fusion Material, including this card, but you cannot use other monsters you control as Fusion Material. You can only use this effect of "Fallen of Albaz" once per turn.
target_text: -- Fallen
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion summon
  	local e1 = FusionSpell.CreateSummonEffect(c, {
  		matfilter = s.matfilter,
  		pre_select_mat_location = LOCATION_MZONE,
  		pre_select_mat_opponent_location = LOCATION_MZONE,
  		gc = s.gc,
  	})
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  end
  
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() & (PHASE_DAMAGE + PHASE_DAMAGE_CAL) == 0
  end
  
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, e:GetHandler())
  	end
  	Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
  end
  
  function s.matfilter(c, e, tp)
  	if c:IsOnField() and c:IsControler(tp) and c ~= e:GetHandler() then
  		return false
  	end
  	return true
  end
  
  function s.gc(e)
  	return e:GetHandler()
  end
  
  