name: The
card_text: When this card is activated: You can place 1 "The Weather" Spell/Trap from your Deck face-up in your Spell & Trap Zone. You can only use each of the following effects of "The Weather Forecast" once per turn. If you Link Summon a "The Weather" Link Monster, you can also use face-up "The Weather" cards in your Spell & Trap Zone as "The Weather" monsters for its Link Summon. During your Main Phase, you can: Immediately after this effect resolves, Normal Summon 1 "The Weather" monster from your hand. You can only activate 1 "The Weather Forecast" per turn.
external_ids: local SETCARD_ID_0 = 0x109 --The
  
lua: local SETCARD_ID_0 = 0x109 --The
  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:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--extra material
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_SZONE, 0)
  	e2:SetCountLimit(1, id + o)
  	e2:SetTarget(s.mattg)
  	e2:SetValue(s.matval)
  	c:RegisterEffect(e2)
  	--summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_SUMMON)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetCountLimit(1, id + o * 2)
  	e3:SetTarget(s.sumtg)
  	e3:SetOperation(s.sumop)
  	c:RegisterEffect(e3)
  end
  function s.tffilter(c, tp)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsType(TYPE_FIELD) and c:IsSetCard(SETCARD_ID_0) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.tffilter, tp, LOCATION_DECK, 0, nil, tp)
  	if g:GetCount() > 0 and Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOFIELD)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.MoveToField(sg:GetFirst(), tp, tp, LOCATION_SZONE, POS_FACEUP, true)
  	end
  end
  function s.mattg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:GetSequence() < 5
  end
  function s.matval(e, lc, mg, c, tp)
  	if not (lc:IsSetCard(SETCARD_ID_0) and e:GetHandlerPlayer() == tp) then
  		return false, nil
  	end
  	return true, true
  end
  function s.sumfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsSummonable(true, nil)
  end
  function s.sumtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.sumfilter, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SUMMON, nil, 1, 0, 0)
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.sumfilter, tp, LOCATION_HAND, 0, 1, 1, nil)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.Summon(tp, tc, true, nil)
  	end
  end
  
  
source_text: The
  When this card is activated: You can place 1 "The Weather" Spell/Trap from your Deck face-up in your Spell & Trap Zone. You can only use each of the following effects of "The Weather Forecast" once per turn. If you Link Summon a "The Weather" Link Monster, you can also use face-up "The Weather" cards in your Spell & Trap Zone as "The Weather" monsters for its Link Summon. During your Main Phase, you can: Immediately after this effect resolves, Normal Summon 1 "The Weather" monster from your hand. You can only activate 1 "The Weather Forecast" per turn.
target_text: -- The
  local SETCARD_ID_0 = 0x109 --The
  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:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--extra material
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_SZONE, 0)
  	e2:SetCountLimit(1, id + o)
  	e2:SetTarget(s.mattg)
  	e2:SetValue(s.matval)
  	c:RegisterEffect(e2)
  	--summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_SUMMON)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetCountLimit(1, id + o * 2)
  	e3:SetTarget(s.sumtg)
  	e3:SetOperation(s.sumop)
  	c:RegisterEffect(e3)
  end
  function s.tffilter(c, tp)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsType(TYPE_FIELD) and c:IsSetCard(SETCARD_ID_0) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.tffilter, tp, LOCATION_DECK, 0, nil, tp)
  	if g:GetCount() > 0 and Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOFIELD)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.MoveToField(sg:GetFirst(), tp, tp, LOCATION_SZONE, POS_FACEUP, true)
  	end
  end
  function s.mattg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:GetSequence() < 5
  end
  function s.matval(e, lc, mg, c, tp)
  	if not (lc:IsSetCard(SETCARD_ID_0) and e:GetHandlerPlayer() == tp) then
  		return false, nil
  	end
  	return true, true
  end
  function s.sumfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsSummonable(true, nil)
  end
  function s.sumtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.sumfilter, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SUMMON, nil, 1, 0, 0)
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.sumfilter, tp, LOCATION_HAND, 0, 1, 1, nil)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.Summon(tp, tc, true, nil)
  	end
  end
  
  