name: Ghost
card_text: Tribute 1 "Mayakashi" or "Shiranui" Synchro or Link Monster; neither player can Special Summon monsters from the hand, Deck, or Extra Deck for the rest of this turn. You can banish this card from your GY, then target 1 of your banished Zombie monsters; return it to the GY. You can only use 1 "Ghost Meets Girl - A Masterful Mayakashi Shiranui Saga" effect per turn, and only once that turn.
external_ids: local SETCARD_ID_0 = 0x121 --Mayakashi
  
lua: local SETCARD_ID_0 = 0x121 --Mayakashi
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.limcost)
  	e1:SetOperation(s.limop)
  	c:RegisterEffect(e1)
  	--to grave
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_TOGRAVE)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetHintTiming(0, TIMING_END_PHASE)
  	e2:SetCountLimit(1, id)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.tgtg)
  	e2:SetOperation(s.tgop)
  	c:RegisterEffect(e2)
  end
  function s.rfilter(c, tp)
  	return c:IsSetCard(SETCARD_ID_0, 0xd9) and c:IsType(TYPE_SYNCHRO + TYPE_LINK) and (c:IsControler(tp) or c:IsFaceup())
  end
  function s.limcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, s.rfilter, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local g = Duel.SelectReleaseGroup(tp, s.rfilter, 1, 1, nil, tp)
  	Duel.Release(g, REASON_COST)
  end
  function s.limop(e, tp, eg, ep, ev, re, r, rp)
  	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, 1)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	--cant spsummon from main deck check
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(63060238)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetTargetRange(1, 1)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.splimit(e, c)
  	return c:IsLocation(LOCATION_HAND + LOCATION_DECK + LOCATION_EXTRA)
  end
  function s.tgfilter(c)
  	return c:IsRace(RACE_ZOMBIE) and c:IsFaceup() and c:IsAbleToGrave()
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.tgfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.tgfilter, tp, LOCATION_REMOVED, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectTarget(tp, s.tgfilter, tp, LOCATION_REMOVED, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, 1, 0, 0)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoGrave(tc, REASON_EFFECT + REASON_RETURN)
  	end
  end
  
  
source_text: Ghost
  Tribute 1 "Mayakashi" or "Shiranui" Synchro or Link Monster; neither player can Special Summon monsters from the hand, Deck, or Extra Deck for the rest of this turn. You can banish this card from your GY, then target 1 of your banished Zombie monsters; return it to the GY. You can only use 1 "Ghost Meets Girl - A Masterful Mayakashi Shiranui Saga" effect per turn, and only once that turn.
target_text: -- Ghost
  local SETCARD_ID_0 = 0x121 --Mayakashi
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.limcost)
  	e1:SetOperation(s.limop)
  	c:RegisterEffect(e1)
  	--to grave
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_TOGRAVE)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetHintTiming(0, TIMING_END_PHASE)
  	e2:SetCountLimit(1, id)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.tgtg)
  	e2:SetOperation(s.tgop)
  	c:RegisterEffect(e2)
  end
  function s.rfilter(c, tp)
  	return c:IsSetCard(SETCARD_ID_0, 0xd9) and c:IsType(TYPE_SYNCHRO + TYPE_LINK) and (c:IsControler(tp) or c:IsFaceup())
  end
  function s.limcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, s.rfilter, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local g = Duel.SelectReleaseGroup(tp, s.rfilter, 1, 1, nil, tp)
  	Duel.Release(g, REASON_COST)
  end
  function s.limop(e, tp, eg, ep, ev, re, r, rp)
  	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, 1)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	--cant spsummon from main deck check
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(63060238)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetTargetRange(1, 1)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.splimit(e, c)
  	return c:IsLocation(LOCATION_HAND + LOCATION_DECK + LOCATION_EXTRA)
  end
  function s.tgfilter(c)
  	return c:IsRace(RACE_ZOMBIE) and c:IsFaceup() and c:IsAbleToGrave()
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.tgfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.tgfilter, tp, LOCATION_REMOVED, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectTarget(tp, s.tgfilter, tp, LOCATION_REMOVED, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, 1, 0, 0)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoGrave(tc, REASON_EFFECT + REASON_RETURN)
  	end
  end
  
  