name: Springans
card_text: 2 Level 4 monsters
  If this card is Special Summoned from your Extra Deck: You can send 1 "Springans" monster from your Deck to the GY. During your opponent's Main or Battle Phase (Quick Effect): You can banish this card until the End Phase, then if you banished this card with 2 or more Xyz Materials, you can also send 1 Fusion Monster from your Extra Deck to the GY that lists "Fallen of Albaz" as material. You can only use each effect of "Springans Merrymaker" once per turn.
external_ids: local CARD_ID_0 = 68468459 --Fallen of Albaz
  local SETCARD_ID_0 = 0x155 --Springans
  
lua: local CARD_ID_0 = 68468459 --Fallen of Albaz
  local SETCARD_ID_0 = 0x155 --Springans
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 2)
  	c:EnableReviveLimit()
  	--tograve
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.tgcon)
  	e1:SetTarget(s.tgtg)
  	e1:SetOperation(s.tgop)
  	c:RegisterEffect(e1)
  	--banish temporary
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_REMOVE)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetHintTiming(0, TIMING_MAIN_END + TIMING_BATTLE_START + TIMING_BATTLE_END)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.rmcon)
  	e2:SetTarget(s.rmtg)
  	e2:SetOperation(s.rmop)
  	c:RegisterEffect(e2)
  end
  function s.tgcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonLocation(LOCATION_EXTRA)
  end
  function s.tgfilter(c)
  	return c:IsType(TYPE_MONSTER) and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToGrave()
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoGrave(g, REASON_EFFECT)
  	end
  end
  function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
  	local ph = Duel.GetCurrentPhase()
  	return Duel.GetTurnPlayer() ~= tp and (ph == PHASE_MAIN1 or (ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE) or ph == PHASE_MAIN2)
  end
  function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToRemove()
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, e:GetHandler(), 1, 0, 0)
  end
  function s.exfilter(c)
  	return c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c, CARD_ID_0)
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFaceup() and c:IsRelateToEffect(e) then
  		local ct = c:GetOverlayCount()
  		if Duel.Remove(c, 0, REASON_EFFECT + REASON_TEMPORARY) ~= 0 and c:GetOriginalCode() == id then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  			e1:SetCode(EVENT_PHASE + PHASE_END)
  			e1:SetReset(RESET_PHASE + PHASE_END)
  			e1:SetLabelObject(c)
  			e1:SetCountLimit(1)
  			e1:SetOperation(s.retop)
  			Duel.RegisterEffect(e1, tp)
  		end
  		if ct >= 2 and Duel.IsExistingMatchingCard(s.exfilter, tp, LOCATION_EXTRA, 0, 1, nil) and Duel.SelectYesNo(tp, aux.Stringid(id, 2)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  			local g = Duel.SelectMatchingCard(tp, s.exfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil)
  			if g:GetCount() > 0 then
  				Duel.SendtoGrave(g, REASON_EFFECT)
  			end
  		end
  	end
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ReturnToField(e:GetLabelObject())
  end
  
  
source_text: Springans
  2 Level 4 monsters
  If this card is Special Summoned from your Extra Deck: You can send 1 "Springans" monster from your Deck to the GY. During your opponent's Main or Battle Phase (Quick Effect): You can banish this card until the End Phase, then if you banished this card with 2 or more Xyz Materials, you can also send 1 Fusion Monster from your Extra Deck to the GY that lists "Fallen of Albaz" as material. You can only use each effect of "Springans Merrymaker" once per turn.
target_text: -- Springans
  local CARD_ID_0 = 68468459 --Fallen of Albaz
  local SETCARD_ID_0 = 0x155 --Springans
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 2)
  	c:EnableReviveLimit()
  	--tograve
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.tgcon)
  	e1:SetTarget(s.tgtg)
  	e1:SetOperation(s.tgop)
  	c:RegisterEffect(e1)
  	--banish temporary
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_REMOVE)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetHintTiming(0, TIMING_MAIN_END + TIMING_BATTLE_START + TIMING_BATTLE_END)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.rmcon)
  	e2:SetTarget(s.rmtg)
  	e2:SetOperation(s.rmop)
  	c:RegisterEffect(e2)
  end
  function s.tgcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonLocation(LOCATION_EXTRA)
  end
  function s.tgfilter(c)
  	return c:IsType(TYPE_MONSTER) and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToGrave()
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoGrave(g, REASON_EFFECT)
  	end
  end
  function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
  	local ph = Duel.GetCurrentPhase()
  	return Duel.GetTurnPlayer() ~= tp and (ph == PHASE_MAIN1 or (ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE) or ph == PHASE_MAIN2)
  end
  function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToRemove()
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, e:GetHandler(), 1, 0, 0)
  end
  function s.exfilter(c)
  	return c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c, CARD_ID_0)
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFaceup() and c:IsRelateToEffect(e) then
  		local ct = c:GetOverlayCount()
  		if Duel.Remove(c, 0, REASON_EFFECT + REASON_TEMPORARY) ~= 0 and c:GetOriginalCode() == id then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  			e1:SetCode(EVENT_PHASE + PHASE_END)
  			e1:SetReset(RESET_PHASE + PHASE_END)
  			e1:SetLabelObject(c)
  			e1:SetCountLimit(1)
  			e1:SetOperation(s.retop)
  			Duel.RegisterEffect(e1, tp)
  		end
  		if ct >= 2 and Duel.IsExistingMatchingCard(s.exfilter, tp, LOCATION_EXTRA, 0, 1, nil) and Duel.SelectYesNo(tp, aux.Stringid(id, 2)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  			local g = Duel.SelectMatchingCard(tp, s.exfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil)
  			if g:GetCount() > 0 then
  				Duel.SendtoGrave(g, REASON_EFFECT)
  			end
  		end
  	end
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ReturnToField(e:GetLabelObject())
  end
  
  