name: Lucius
card_text: You can banish 1 Level 5 or higher monster from your GY; Special Summon this card from your hand, also you cannot Special Summon from the Extra Deck for the rest of this turn. If this card is Tributed for a Tribute Summon: You can look at all Set cards your opponent controls. Your opponent cannot activate cards or effects in response to this effect's activation. You can only use each effect of "Lucius the Shadow Vassal" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.spcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--confirm
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_RELEASE)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCondition(s.condition)
  	e2:SetTarget(s.target)
  	e2:SetOperation(s.operation)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsLevelAbove(5) and c:IsAbleToRemoveAsCost()
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  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)
  	local c = e:GetHandler()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	Duel.RegisterEffect(e1, tp)
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp, se)
  	return c:IsLocation(LOCATION_EXTRA)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsReason(REASON_SUMMON)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsFacedown, tp, 0, LOCATION_ONFIELD, 1, nil)
  	end
  	Duel.SetChainLimit(s.chlimit)
  end
  function s.chlimit(e, ep, tp)
  	return tp == ep
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(Card.IsFacedown, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.ConfirmCards(tp, g)
  end
  
  
source_text: Lucius
  You can banish 1 Level 5 or higher monster from your GY; Special Summon this card from your hand, also you cannot Special Summon from the Extra Deck for the rest of this turn. If this card is Tributed for a Tribute Summon: You can look at all Set cards your opponent controls. Your opponent cannot activate cards or effects in response to this effect's activation. You can only use each effect of "Lucius the Shadow Vassal" once per turn.
target_text: -- Lucius
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.spcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--confirm
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_RELEASE)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCondition(s.condition)
  	e2:SetTarget(s.target)
  	e2:SetOperation(s.operation)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsLevelAbove(5) and c:IsAbleToRemoveAsCost()
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  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)
  	local c = e:GetHandler()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	Duel.RegisterEffect(e1, tp)
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp, se)
  	return c:IsLocation(LOCATION_EXTRA)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsReason(REASON_SUMMON)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsFacedown, tp, 0, LOCATION_ONFIELD, 1, nil)
  	end
  	Duel.SetChainLimit(s.chlimit)
  end
  function s.chlimit(e, ep, tp)
  	return tp == ep
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(Card.IsFacedown, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.ConfirmCards(tp, g)
  end
  
  