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, then target 1 monster you control (Quick Effect); Tribute that target, and if you do, Special Summon 1 "The Weather" monster from your hand or GY, but not with the same name the Tributed monster had on the field.
  You can only control 1 "The Weather Sunny 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_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	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.spcfilter(c, e, tp, ft)
  	return c:IsReleasableByEffect() and (ft > 0 or c:GetSequence() < 5) and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, nil, e, tp, c:GetCode())
  end
  function s.spfilter(c, e, tp, code)
  	return c:IsSetCard(SETCARD_ID_0) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.spcfilter(chkc, e, tp, ft)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.spcfilter, tp, LOCATION_MZONE, 0, 1, e:GetHandler(), e, tp, ft)
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	Duel.SelectTarget(tp, s.spcfilter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler(), e, tp, ft)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND + LOCATION_GRAVE)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsControler(tp) and tc:IsRelateToEffect(e) and Duel.Release(tc, REASON_EFFECT) > 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(tp, aux.NecroValleyFilter(s.spfilter), tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, 1, nil, e, tp, tc:GetCode())
  		if g:GetCount() > 0 then
  			Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  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, then target 1 monster you control (Quick Effect); Tribute that target, and if you do, Special Summon 1 "The Weather" monster from your hand or GY, but not with the same name the Tributed monster had on the field.
  You can only control 1 "The Weather Sunny 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_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	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.spcfilter(c, e, tp, ft)
  	return c:IsReleasableByEffect() and (ft > 0 or c:GetSequence() < 5) and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, nil, e, tp, c:GetCode())
  end
  function s.spfilter(c, e, tp, code)
  	return c:IsSetCard(SETCARD_ID_0) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.spcfilter(chkc, e, tp, ft)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.spcfilter, tp, LOCATION_MZONE, 0, 1, e:GetHandler(), e, tp, ft)
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	Duel.SelectTarget(tp, s.spcfilter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler(), e, tp, ft)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND + LOCATION_GRAVE)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsControler(tp) and tc:IsRelateToEffect(e) and Duel.Release(tc, REASON_EFFECT) > 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(tp, aux.NecroValleyFilter(s.spfilter), tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, 1, nil, e, tp, tc:GetCode())
  		if g:GetCount() > 0 then
  			Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  