name: Albaz
card_text: This card's name becomes "Fallen of Albaz" while on the field or in the GY. While a Level 8 Fusion Monster is in your GY, this card gains 200 ATK for each monster in your GY, also your opponent cannot target other monsters you control with card effects. If a monster(s) you control leaves the field by an opponent's card effect, while this card and a Fusion Monster are in your GY (except during the Damage Step): You can Special Summon this card. You can only use this effect of "Albaz the Ashen" once per turn.
external_ids: local CARD_ID_0 = 68468459 --Fallen of Albaz
  
lua: local CARD_ID_0 = 68468459 --Fallen of Albaz
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--change name
  	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCondition(s.condition)
  	e1:SetValue(s.atkct)
  	c:RegisterEffect(e1)
  	--cannot be effect target
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetCondition(s.condition)
  	e2:SetTarget(s.tglimit)
  	e2:SetValue(aux.tgoval)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_LEAVE_FIELD)
  	e3:SetRange(LOCATION_GRAVE)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCountLimit(1, id)
  	e3:SetCondition(s.spcon)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.filter(c)
  	return c:IsType(TYPE_FUSION) and c:IsLevel(8)
  end
  function s.condition(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_GRAVE, 0, 1, nil)
  end
  function s.atkct(e)
  	return Duel.GetMatchingGroupCount(Card.IsType, e:GetHandlerPlayer(), LOCATION_GRAVE, 0, nil, TYPE_MONSTER) * 200
  end
  function s.tglimit(e, c)
  	return c ~= e:GetHandler()
  end
  function s.cfilter(c, tp, rp)
  	return c:GetPreviousControler() == tp and c:IsPreviousLocation(LOCATION_MZONE) and rp == 1 - tp and c:IsReason(REASON_EFFECT)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil, tp, rp) and not eg:IsContains(e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_GRAVE, 0, 1, eg, TYPE_FUSION)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if e:GetHandler():IsRelateToEffect(e) then
  		Duel.SpecialSummon(e:GetHandler(), 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: Albaz
  This card's name becomes "Fallen of Albaz" while on the field or in the GY. While a Level 8 Fusion Monster is in your GY, this card gains 200 ATK for each monster in your GY, also your opponent cannot target other monsters you control with card effects. If a monster(s) you control leaves the field by an opponent's card effect, while this card and a Fusion Monster are in your GY (except during the Damage Step): You can Special Summon this card. You can only use this effect of "Albaz the Ashen" once per turn.
target_text: -- Albaz
  local CARD_ID_0 = 68468459 --Fallen of Albaz
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--change name
  	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCondition(s.condition)
  	e1:SetValue(s.atkct)
  	c:RegisterEffect(e1)
  	--cannot be effect target
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetCondition(s.condition)
  	e2:SetTarget(s.tglimit)
  	e2:SetValue(aux.tgoval)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_LEAVE_FIELD)
  	e3:SetRange(LOCATION_GRAVE)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCountLimit(1, id)
  	e3:SetCondition(s.spcon)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.filter(c)
  	return c:IsType(TYPE_FUSION) and c:IsLevel(8)
  end
  function s.condition(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_GRAVE, 0, 1, nil)
  end
  function s.atkct(e)
  	return Duel.GetMatchingGroupCount(Card.IsType, e:GetHandlerPlayer(), LOCATION_GRAVE, 0, nil, TYPE_MONSTER) * 200
  end
  function s.tglimit(e, c)
  	return c ~= e:GetHandler()
  end
  function s.cfilter(c, tp, rp)
  	return c:GetPreviousControler() == tp and c:IsPreviousLocation(LOCATION_MZONE) and rp == 1 - tp and c:IsReason(REASON_EFFECT)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil, tp, rp) and not eg:IsContains(e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_GRAVE, 0, 1, eg, TYPE_FUSION)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if e:GetHandler():IsRelateToEffect(e) then
  		Duel.SpecialSummon(e:GetHandler(), 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  