Cipher
If your opponent controls a face-up monster that was Special Summoned from the Extra Deck and you control no monsters, you can Special Summon this card (from your hand). You can discard 1 card; Special Summon 1 "Cipher" monster from your hand or Deck, also you cannot Special Summon monsters for the rest of this turn, except "Cipher" monsters. You can only use this effect of "Cipher Twin Raptor" once per turn.
local SETCARD_ID_0 = 0xe5 --Cipher

local SETCARD_ID_0 = 0xe5 --Cipher
local s, id, o = GetID()
function s.initial_effect(c)
	--special summon rule
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetRange(LOCATION_HAND)
	e1:SetCondition(s.sprcon)
	c:RegisterEffect(e1)
	--special summon
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 0))
	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCountLimit(1, id)
	e2:SetCost(s.spcost)
	e2:SetTarget(s.sptg)
	e2:SetOperation(s.spop)
	c:RegisterEffect(e2)
end
function s.sprcon(e, c)
	if c == nil then
		return true
	end
	local tp = c:GetControler()
	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) == 0
		and Duel.IsExistingMatchingCard(Card.IsSummonLocation, tp, 0, LOCATION_MZONE, 1, nil, LOCATION_EXTRA)
		and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
end
function s.costfilter(c, e, tp)
	return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_DECK, 0, 1, c, e, tp)
end
function s.spfilter(c, e, tp)
	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
	e:SetLabel(1)
	return true
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
			return false
		end
		if e:GetLabel() ~= 0 then
			e:SetLabel(0)
			return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
		else
			return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_DECK, 0, 1, nil, e, tp)
		end
	end
	if e:GetLabel() ~= 0 then
		e:SetLabel(0)
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
		local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
		Duel.SendtoGrave(g, REASON_COST + REASON_DISCARD)
	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
		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, false, false, POS_FACEUP)
		end
	end
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
	e1:SetTargetRange(1, 0)
	e1:SetTarget(s.splimit)
	e1:SetReset(RESET_PHASE + PHASE_END)
	Duel.RegisterEffect(e1, tp)
end
function s.splimit(e, c)
	return not c:IsSetCard(SETCARD_ID_0)
end


Cipher
If your opponent controls a face-up monster that was Special Summoned from the Extra Deck and you control no monsters, you can Special Summon this card (from your hand). You can discard 1 card; Special Summon 1 "Cipher" monster from your hand or Deck, also you cannot Special Summon monsters for the rest of this turn, except "Cipher" monsters. You can only use this effect of "Cipher Twin Raptor" once per turn.
-- Cipher
local SETCARD_ID_0 = 0xe5 --Cipher
local s, id, o = GetID()
function s.initial_effect(c)
	--special summon rule
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetRange(LOCATION_HAND)
	e1:SetCondition(s.sprcon)
	c:RegisterEffect(e1)
	--special summon
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 0))
	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCountLimit(1, id)
	e2:SetCost(s.spcost)
	e2:SetTarget(s.sptg)
	e2:SetOperation(s.spop)
	c:RegisterEffect(e2)
end
function s.sprcon(e, c)
	if c == nil then
		return true
	end
	local tp = c:GetControler()
	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) == 0
		and Duel.IsExistingMatchingCard(Card.IsSummonLocation, tp, 0, LOCATION_MZONE, 1, nil, LOCATION_EXTRA)
		and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
end
function s.costfilter(c, e, tp)
	return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_DECK, 0, 1, c, e, tp)
end
function s.spfilter(c, e, tp)
	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
	e:SetLabel(1)
	return true
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
			return false
		end
		if e:GetLabel() ~= 0 then
			e:SetLabel(0)
			return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
		else
			return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_DECK, 0, 1, nil, e, tp)
		end
	end
	if e:GetLabel() ~= 0 then
		e:SetLabel(0)
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
		local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
		Duel.SendtoGrave(g, REASON_COST + REASON_DISCARD)
	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
		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, false, false, POS_FACEUP)
		end
	end
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
	e1:SetTargetRange(1, 0)
	e1:SetTarget(s.splimit)
	e1:SetReset(RESET_PHASE + PHASE_END)
	Duel.RegisterEffect(e1, tp)
end
function s.splimit(e, c)
	return not c:IsSetCard(SETCARD_ID_0)
end

