name: Blizzard
card_text: You can discard 1 card; Special Summon 2 WATER Winged Beast-Type monsters, 1 from your hand and 1 from your Graveyard, except "Blizzard Thunderbird", then return this card from the field to the hand. You can only use this effect of "Blizzard Thunderbird" once per turn.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c, e, tp)
  	return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_HAND, 0, 1, c, e, tp)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.DiscardHand(tp, s.cfilter, 1, 1, REASON_COST + REASON_DISCARD, nil, e, tp)
  end
  function s.filter(c, e, tp)
  	return c:IsRace(RACE_WINDBEAST) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 1 and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 2, tp, LOCATION_HAND + LOCATION_GRAVE)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		return
  	end
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) < 2 then
  		return
  	end
  	local g1 = Duel.GetMatchingGroup(s.filter, tp, LOCATION_HAND, 0, nil, e, tp)
  	local g2 = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter), tp, LOCATION_GRAVE, 0, nil, e, tp)
  	if g1:GetCount() == 0 or g2:GetCount() == 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg1 = g1:Select(tp, 1, 1, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg2 = g2:Select(tp, 1, 1, nil)
  	sg1:Merge(sg2)
  	Duel.SpecialSummon(sg1, 0, tp, tp, false, false, POS_FACEUP)
  	if e:GetHandler():IsRelateToEffect(e) then
  		Duel.BreakEffect()
  		Duel.SendtoHand(e:GetHandler(), nil, REASON_EFFECT)
  	end
  end
  
  
source_text: Blizzard
  You can discard 1 card; Special Summon 2 WATER Winged Beast-Type monsters, 1 from your hand and 1 from your Graveyard, except "Blizzard Thunderbird", then return this card from the field to the hand. You can only use this effect of "Blizzard Thunderbird" once per turn.
target_text: -- Blizzard
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c, e, tp)
  	return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_HAND, 0, 1, c, e, tp)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.DiscardHand(tp, s.cfilter, 1, 1, REASON_COST + REASON_DISCARD, nil, e, tp)
  end
  function s.filter(c, e, tp)
  	return c:IsRace(RACE_WINDBEAST) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 1 and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 2, tp, LOCATION_HAND + LOCATION_GRAVE)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		return
  	end
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) < 2 then
  		return
  	end
  	local g1 = Duel.GetMatchingGroup(s.filter, tp, LOCATION_HAND, 0, nil, e, tp)
  	local g2 = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter), tp, LOCATION_GRAVE, 0, nil, e, tp)
  	if g1:GetCount() == 0 or g2:GetCount() == 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg1 = g1:Select(tp, 1, 1, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg2 = g2:Select(tp, 1, 1, nil)
  	sg1:Merge(sg2)
  	Duel.SpecialSummon(sg1, 0, tp, tp, false, false, POS_FACEUP)
  	if e:GetHandler():IsRelateToEffect(e) then
  		Duel.BreakEffect()
  		Duel.SendtoHand(e:GetHandler(), nil, REASON_EFFECT)
  	end
  end
  
  