name: Goddess
card_text: When this card is activated: If all monsters you control are "Valkyrie" monsters (min. 1), you can add 1 "Goddess Urd's Verdict" from your Deck to your hand. Once per turn: You can declare 1 type of card (Monster, Spell, or Trap); reveal the top card of your opponent's Deck and if it was the declared type, they Set it to their field. Otherwise, they add it to their hand. You can only activate 1 "Goddess Verdande's Guidance" per turn.
external_ids: local CARD_ID_0 = 91969909 --Goddess Urd's Verdict
  local SETCARD_ID_0 = 0x122 --Valkyrie
  
lua: local CARD_ID_0 = 91969909 --Goddess Urd's Verdict
  local SETCARD_ID_0 = 0x122 --Valkyrie
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--see top
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_SPECIAL_SUMMON + CATEGORY_DECKDES)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.thcfilter(c)
  	return c:IsFacedown() or not c:IsSetCard(SETCARD_ID_0)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) > 0 and not Duel.IsExistingMatchingCard(s.thcfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.thfilter(c)
  	return c:IsCode(CARD_ID_0) and c:IsAbleToHand()
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.thfilter, tp, LOCATION_DECK, 0, nil)
  	if #g > 0 and s.thcon(e, tp, eg, ep, ev, re, r, rp) and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.SendtoHand(sg, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, sg)
  	end
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_DECK) > 0
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CARDTYPE)
  	Duel.SetTargetParam(Duel.AnnounceType(tp))
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFieldGroupCount(tp, 0, LOCATION_DECK) <= 0 then
  		return
  	end
  	Duel.ConfirmDecktop(1 - tp, 1)
  	local g = Duel.GetDecktopGroup(1 - tp, 1)
  	local tc = g:GetFirst()
  	Duel.DisableShuffleCheck()
  	local opt = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	if opt == 0 and tc:IsType(TYPE_MONSTER) and tc:IsCanBeSpecialSummoned(e, 0, 1 - tp, false, false, POS_FACEDOWN_DEFENSE, 1 - tp) then
  		Duel.SpecialSummon(tc, 0, 1 - tp, 1 - tp, false, false, POS_FACEDOWN_DEFENSE)
  	elseif opt == 1 and tc:IsType(TYPE_SPELL) and tc:IsSSetable() then
  		Duel.SSet(1 - tp, tc)
  	elseif opt == 2 and tc:IsType(TYPE_TRAP) and tc:IsSSetable() then
  		Duel.SSet(1 - tp, tc)
  	else
  		Duel.SendtoHand(g, 1 - tp, REASON_EFFECT)
  		Duel.ShuffleHand(1 - tp)
  	end
  end
  
  
source_text: Goddess
  When this card is activated: If all monsters you control are "Valkyrie" monsters (min. 1), you can add 1 "Goddess Urd's Verdict" from your Deck to your hand. Once per turn: You can declare 1 type of card (Monster, Spell, or Trap); reveal the top card of your opponent's Deck and if it was the declared type, they Set it to their field. Otherwise, they add it to their hand. You can only activate 1 "Goddess Verdande's Guidance" per turn.
target_text: -- Goddess
  local CARD_ID_0 = 91969909 --Goddess Urd's Verdict
  local SETCARD_ID_0 = 0x122 --Valkyrie
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--see top
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_SPECIAL_SUMMON + CATEGORY_DECKDES)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.thcfilter(c)
  	return c:IsFacedown() or not c:IsSetCard(SETCARD_ID_0)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) > 0 and not Duel.IsExistingMatchingCard(s.thcfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.thfilter(c)
  	return c:IsCode(CARD_ID_0) and c:IsAbleToHand()
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.thfilter, tp, LOCATION_DECK, 0, nil)
  	if #g > 0 and s.thcon(e, tp, eg, ep, ev, re, r, rp) and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.SendtoHand(sg, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, sg)
  	end
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_DECK) > 0
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CARDTYPE)
  	Duel.SetTargetParam(Duel.AnnounceType(tp))
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFieldGroupCount(tp, 0, LOCATION_DECK) <= 0 then
  		return
  	end
  	Duel.ConfirmDecktop(1 - tp, 1)
  	local g = Duel.GetDecktopGroup(1 - tp, 1)
  	local tc = g:GetFirst()
  	Duel.DisableShuffleCheck()
  	local opt = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	if opt == 0 and tc:IsType(TYPE_MONSTER) and tc:IsCanBeSpecialSummoned(e, 0, 1 - tp, false, false, POS_FACEDOWN_DEFENSE, 1 - tp) then
  		Duel.SpecialSummon(tc, 0, 1 - tp, 1 - tp, false, false, POS_FACEDOWN_DEFENSE)
  	elseif opt == 1 and tc:IsType(TYPE_SPELL) and tc:IsSSetable() then
  		Duel.SSet(1 - tp, tc)
  	elseif opt == 2 and tc:IsType(TYPE_TRAP) and tc:IsSSetable() then
  		Duel.SSet(1 - tp, tc)
  	else
  		Duel.SendtoHand(g, 1 - tp, REASON_EFFECT)
  		Duel.ShuffleHand(1 - tp)
  	end
  end
  
  