name: Vertical
card_text: Tribute any number of WIND monsters, except Tokens; Special Summon an equal number of "Mecha Phantom Beast Tokens" (Machine-Type/WIND/Level 3/ATK 0/DEF 0). You can only activate 1 "Vertical Landing" per turn.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 904186 --Mecha Phantom Beast Token
  local CARD_ID_2 = 31533705 --Mecha Phantom Beast Token
  local SETCARD_ID_0 = 0x101b --Mecha
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 904186 --Mecha Phantom Beast Token
  local CARD_ID_2 = 31533705 --Mecha Phantom Beast Token
  local SETCARD_ID_0 = 0x101b --Mecha
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.rfilter(c, ft, tp)
  	return c:IsAttribute(ATTRIBUTE_WIND) and not c:IsType(TYPE_TOKEN) and (ft > 0 or (c:IsControler(tp) and c:GetSequence() < 5)) and (c:IsControler(tp) or c:IsFaceup())
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if chk == 0 then
  		return ft > -1 and Duel.CheckReleaseGroup(tp, s.rfilter, 1, nil, ft, tp)
  	end
  	local maxc = 10
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		maxc = 1
  	end
  	local g = Duel.SelectReleaseGroup(tp, s.rfilter, 1, maxc, nil, ft, tp)
  	e:SetLabel(g:GetCount())
  	Duel.Release(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanSpecialSummonMonster(tp, CARD_ID_2, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, 3, RACE_MACHINE, ATTRIBUTE_WIND)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, e:GetLabel(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, e:GetLabel(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if ft <= 0 then
  		return
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	if ft < e:GetLabel() then
  		return
  	end
  	if Duel.IsPlayerCanSpecialSummonMonster(tp, CARD_ID_2, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, 3, RACE_MACHINE, ATTRIBUTE_WIND) then
  		for i = 1, e:GetLabel() do
  			local token = Duel.CreateToken(tp, id + 1)
  			Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
  		end
  		Duel.SpecialSummonComplete()
  	end
  end
  
  
source_text: Vertical
  Tribute any number of WIND monsters, except Tokens; Special Summon an equal number of "Mecha Phantom Beast Tokens" (Machine-Type/WIND/Level 3/ATK 0/DEF 0). You can only activate 1 "Vertical Landing" per turn.
target_text: -- Vertical
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 904186 --Mecha Phantom Beast Token
  local CARD_ID_2 = 31533705 --Mecha Phantom Beast Token
  local SETCARD_ID_0 = 0x101b --Mecha
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.rfilter(c, ft, tp)
  	return c:IsAttribute(ATTRIBUTE_WIND) and not c:IsType(TYPE_TOKEN) and (ft > 0 or (c:IsControler(tp) and c:GetSequence() < 5)) and (c:IsControler(tp) or c:IsFaceup())
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if chk == 0 then
  		return ft > -1 and Duel.CheckReleaseGroup(tp, s.rfilter, 1, nil, ft, tp)
  	end
  	local maxc = 10
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		maxc = 1
  	end
  	local g = Duel.SelectReleaseGroup(tp, s.rfilter, 1, maxc, nil, ft, tp)
  	e:SetLabel(g:GetCount())
  	Duel.Release(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanSpecialSummonMonster(tp, CARD_ID_2, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, 3, RACE_MACHINE, ATTRIBUTE_WIND)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, e:GetLabel(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, e:GetLabel(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if ft <= 0 then
  		return
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	if ft < e:GetLabel() then
  		return
  	end
  	if Duel.IsPlayerCanSpecialSummonMonster(tp, CARD_ID_2, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, 3, RACE_MACHINE, ATTRIBUTE_WIND) then
  		for i = 1, e:GetLabel() do
  			local token = Duel.CreateToken(tp, id + 1)
  			Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
  		end
  		Duel.SpecialSummonComplete()
  	end
  end
  
  