name: Solemn
card_text: Activate this card by targeting 1 "Aesir" monster you control; it cannot be targeted by other card effects while this card is on the field. Send this card to the GY during your 2nd Standby Phase after activation.
external_ids: local SETCARD_ID_0 = 0x4b --Aesir
  
lua: local SETCARD_ID_0 = 0x4b --Aesir
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(TIMINGS_CHECK_MONSTER, 0x1c1)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		c:SetCardTarget(tc)
  		e:SetLabelObject(tc)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetCondition(s.rcon)
  		e1:SetValue(1)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  		e2:SetRange(LOCATION_SZONE)
  		e2:SetCountLimit(1)
  		e2:SetLabel(2)
  		e2:SetLabelObject(tc)
  		e2:SetCondition(s.tgcon)
  		e2:SetOperation(s.tgop)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_STANDBY + RESET_SELF_TURN, 2)
  		c:RegisterEffect(e2)
  	end
  end
  function s.rcon(e)
  	return e:GetOwner():IsHasCardTarget(e:GetHandler())
  end
  function s.tgcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = e:GetLabel()
  	ct = ct - 1
  	e:SetLabel(ct)
  	if ct == 0 and e:GetHandler():IsHasCardTarget(e:GetLabelObject()) then
  		Duel.SendtoGrave(e:GetHandler(), REASON_EFFECT)
  	end
  end
  
  
source_text: Solemn
  Activate this card by targeting 1 "Aesir" monster you control; it cannot be targeted by other card effects while this card is on the field. Send this card to the GY during your 2nd Standby Phase after activation.
target_text: -- Solemn
  local SETCARD_ID_0 = 0x4b --Aesir
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(TIMINGS_CHECK_MONSTER, 0x1c1)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		c:SetCardTarget(tc)
  		e:SetLabelObject(tc)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetCondition(s.rcon)
  		e1:SetValue(1)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  		e2:SetRange(LOCATION_SZONE)
  		e2:SetCountLimit(1)
  		e2:SetLabel(2)
  		e2:SetLabelObject(tc)
  		e2:SetCondition(s.tgcon)
  		e2:SetOperation(s.tgop)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_STANDBY + RESET_SELF_TURN, 2)
  		c:RegisterEffect(e2)
  	end
  end
  function s.rcon(e)
  	return e:GetOwner():IsHasCardTarget(e:GetHandler())
  end
  function s.tgcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = e:GetLabel()
  	ct = ct - 1
  	e:SetLabel(ct)
  	if ct == 0 and e:GetHandler():IsHasCardTarget(e:GetLabelObject()) then
  		Duel.SendtoGrave(e:GetHandler(), REASON_EFFECT)
  	end
  end
  
  