name: Vernusylph
card_text: "Vernusylph" monsters you control cannot be destroyed by card effects. You can discard this card, and 1 monster or "Vernusylph" card; add 1 "Vernusylph" card from your Deck to your hand, except "Vernusylph of the Flourishing Hills", then you can Special Summon 1 EARTH monster from your GY, also you cannot activate non-EARTH monster effects for the rest of this turn. You can only use this effect of "Vernusylph of the Flourishing Hills" once per turn.
external_ids: local CARD_ID_0 = 14108995 --Vernusylph Corolla
  local SETCARD_ID_0 = 0x182 --Vernusylph
  
lua: local CARD_ID_0 = 14108995 --Vernusylph Corolla
  local SETCARD_ID_0 = 0x182 --Vernusylph
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--to hand
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_SPECIAL_SUMMON + CATEGORY_GRAVE_SPSUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.thcost)
  	e1:SetTarget(s.thtg)
  	e1:SetOperation(s.thop)
  	c:RegisterEffect(e1)
  	--indes
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(s.indtg)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  end
  function s.costfilter(c)
  	return (c:IsType(TYPE_MONSTER) or c:IsSetCard(SETCARD_ID_0)) and c:IsDiscardable()
  end
  function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local fe = Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
  	local b2 = Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, c)
  	if chk == 0 then
  		return c:IsDiscardable() and (fe or b2)
  	end
  	if fe and (not b2 or Duel.SelectYesNo(tp, aux.Stringid(14108995, 0))) then
  		Duel.Hint(HINT_CARD, 0, CARD_ID_0)
  		fe:UseCountLimit(tp)
  		Duel.SendtoGrave(c, REASON_COST + REASON_DISCARD)
  	else
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
  		local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_HAND, 0, 1, 1, c)
  		g:AddCard(c)
  		Duel.SendtoGrave(g, REASON_COST + REASON_DISCARD)
  	end
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.spfilter(c, e, tp)
  	return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 and Duel.SendtoHand(g, nil, REASON_EFFECT) > 0 and g:GetFirst():IsLocation(LOCATION_HAND) then
  		Duel.ConfirmCards(1 - tp, g)
  		local sg = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter), tp, LOCATION_GRAVE, 0, nil, e, tp)
  		if sg:GetCount() > 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  			local sc = sg:Select(tp, 1, 1, nil)
  			Duel.SpecialSummon(sc, 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_ACTIVATE)
  	e1:SetTargetRange(1, 0)
  	e1:SetValue(s.aclimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.aclimit(e, re, tp)
  	return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsNonAttribute(ATTRIBUTE_EARTH)
  end
  function s.indtg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup()
  end
  
  
source_text: Vernusylph
  "Vernusylph" monsters you control cannot be destroyed by card effects. You can discard this card, and 1 monster or "Vernusylph" card; add 1 "Vernusylph" card from your Deck to your hand, except "Vernusylph of the Flourishing Hills", then you can Special Summon 1 EARTH monster from your GY, also you cannot activate non-EARTH monster effects for the rest of this turn. You can only use this effect of "Vernusylph of the Flourishing Hills" once per turn.
target_text: -- Vernusylph
  local CARD_ID_0 = 14108995 --Vernusylph Corolla
  local SETCARD_ID_0 = 0x182 --Vernusylph
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--to hand
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_SPECIAL_SUMMON + CATEGORY_GRAVE_SPSUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.thcost)
  	e1:SetTarget(s.thtg)
  	e1:SetOperation(s.thop)
  	c:RegisterEffect(e1)
  	--indes
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(s.indtg)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  end
  function s.costfilter(c)
  	return (c:IsType(TYPE_MONSTER) or c:IsSetCard(SETCARD_ID_0)) and c:IsDiscardable()
  end
  function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local fe = Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
  	local b2 = Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, c)
  	if chk == 0 then
  		return c:IsDiscardable() and (fe or b2)
  	end
  	if fe and (not b2 or Duel.SelectYesNo(tp, aux.Stringid(14108995, 0))) then
  		Duel.Hint(HINT_CARD, 0, CARD_ID_0)
  		fe:UseCountLimit(tp)
  		Duel.SendtoGrave(c, REASON_COST + REASON_DISCARD)
  	else
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
  		local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_HAND, 0, 1, 1, c)
  		g:AddCard(c)
  		Duel.SendtoGrave(g, REASON_COST + REASON_DISCARD)
  	end
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.spfilter(c, e, tp)
  	return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 and Duel.SendtoHand(g, nil, REASON_EFFECT) > 0 and g:GetFirst():IsLocation(LOCATION_HAND) then
  		Duel.ConfirmCards(1 - tp, g)
  		local sg = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter), tp, LOCATION_GRAVE, 0, nil, e, tp)
  		if sg:GetCount() > 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  			local sc = sg:Select(tp, 1, 1, nil)
  			Duel.SpecialSummon(sc, 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_ACTIVATE)
  	e1:SetTargetRange(1, 0)
  	e1:SetValue(s.aclimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.aclimit(e, re, tp)
  	return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsNonAttribute(ATTRIBUTE_EARTH)
  end
  function s.indtg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup()
  end
  
  