name: The
card_text: "The Weather" Effect Monsters in your Main Monster Zones of this card's column and its adjacent columns gain this effect.
  ● You can banish this card (Quick Effect); add 1 "The Weather" card from your Deck to your hand, also you cannot add cards from your Deck to your hand for the rest of this turn, except by drawing them.
  You can only control 1 "The Weather Snowy Canvas".
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)
  	c:SetUniqueOnField(1, 0, id)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--effect gain
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetHintTiming(0, TIMING_END_PHASE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_GRANT)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetTargetRange(LOCATION_MZONE, 0)
  	e3:SetTarget(s.eftg)
  	e3:SetLabelObject(e2)
  	c:RegisterEffect(e3)
  end
  function s.eftg(e, c)
  	local seq = c:GetSequence()
  	return c:IsType(TYPE_EFFECT) and c:IsSetCard(SETCARD_ID_0) and seq < 5 and math.abs(e:GetHandler():GetSequence() - seq) <= 1
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) 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.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0)
  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 then
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_TO_HAND)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation, LOCATION_DECK))
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  
  
source_text: The
  "The Weather" Effect Monsters in your Main Monster Zones of this card's column and its adjacent columns gain this effect.
  ● You can banish this card (Quick Effect); add 1 "The Weather" card from your Deck to your hand, also you cannot add cards from your Deck to your hand for the rest of this turn, except by drawing them.
  You can only control 1 "The Weather Snowy Canvas".
target_text: -- The
  local SETCARD_ID_0 = 0x109 --The
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--effect gain
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetHintTiming(0, TIMING_END_PHASE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_GRANT)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetTargetRange(LOCATION_MZONE, 0)
  	e3:SetTarget(s.eftg)
  	e3:SetLabelObject(e2)
  	c:RegisterEffect(e3)
  end
  function s.eftg(e, c)
  	local seq = c:GetSequence()
  	return c:IsType(TYPE_EFFECT) and c:IsSetCard(SETCARD_ID_0) and seq < 5 and math.abs(e:GetHandler():GetSequence() - seq) <= 1
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) 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.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0)
  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 then
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_TO_HAND)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation, LOCATION_DECK))
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  
  