name: Boot
card_text: All "Rokket" monsters on the field gain 300 ATK/DEF.
  You can activate 1 of these effects;
  ● Special Summon up to 2 "Rokket" monsters with different names from your hand in Defense Position.
  ● If your opponent controls more monsters than you do: Special Summon "Rokket" monsters with different names from your GY in Defense Position, up to the difference.
  You can only use this effect of "Boot Sector Launch" once per turn.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x102 --Rokket
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x102 --Rokket
  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)
  	c:RegisterEffect(e1)
  	--def up
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_0))
  	e2:SetValue(300)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	c:RegisterEffect(e3)
  	--special summon (hand)
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e4:SetType(EFFECT_TYPE_IGNITION)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCountLimit(1, id)
  	e4:SetTarget(s.sptg1)
  	e4:SetOperation(s.spop1)
  	c:RegisterEffect(e4)
  	--special summon (GY)
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 1))
  	e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e5:SetType(EFFECT_TYPE_IGNITION)
  	e5:SetRange(LOCATION_FZONE)
  	e5:SetCountLimit(1, id)
  	e5:SetCondition(s.spcon)
  	e5:SetTarget(s.sptg2)
  	e5:SetOperation(s.spop2)
  	c:RegisterEffect(e5)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_DEFENSE)
  end
  function s.sptg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
  end
  function s.spop1(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND, 0, nil, e, tp)
  	if ft < 1 or g:GetCount() == 0 then
  		return
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg = g:SelectSubGroup(tp, aux.dncheck, false, 1, math.min(ft, 2))
  	Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  end
  function s.sptg2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_GRAVE)
  end
  function s.spop2(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) - Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_GRAVE, 0, nil, e, tp)
  	if ft < 1 or ct < 1 or g:GetCount() == 0 then
  		return
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg = g:SelectSubGroup(tp, aux.dncheck, false, 1, math.min(ft, ct))
  	Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  end
  
  
source_text: Boot
  All "Rokket" monsters on the field gain 300 ATK/DEF.
  You can activate 1 of these effects;
  ● Special Summon up to 2 "Rokket" monsters with different names from your hand in Defense Position.
  ● If your opponent controls more monsters than you do: Special Summon "Rokket" monsters with different names from your GY in Defense Position, up to the difference.
  You can only use this effect of "Boot Sector Launch" once per turn.
target_text: -- Boot
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x102 --Rokket
  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)
  	c:RegisterEffect(e1)
  	--def up
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_0))
  	e2:SetValue(300)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	c:RegisterEffect(e3)
  	--special summon (hand)
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e4:SetType(EFFECT_TYPE_IGNITION)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCountLimit(1, id)
  	e4:SetTarget(s.sptg1)
  	e4:SetOperation(s.spop1)
  	c:RegisterEffect(e4)
  	--special summon (GY)
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 1))
  	e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e5:SetType(EFFECT_TYPE_IGNITION)
  	e5:SetRange(LOCATION_FZONE)
  	e5:SetCountLimit(1, id)
  	e5:SetCondition(s.spcon)
  	e5:SetTarget(s.sptg2)
  	e5:SetOperation(s.spop2)
  	c:RegisterEffect(e5)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_DEFENSE)
  end
  function s.sptg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
  end
  function s.spop1(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND, 0, nil, e, tp)
  	if ft < 1 or g:GetCount() == 0 then
  		return
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg = g:SelectSubGroup(tp, aux.dncheck, false, 1, math.min(ft, 2))
  	Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  end
  function s.sptg2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_GRAVE)
  end
  function s.spop2(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) - Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_GRAVE, 0, nil, e, tp)
  	if ft < 1 or ct < 1 or g:GetCount() == 0 then
  		return
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg = g:SelectSubGroup(tp, aux.dncheck, false, 1, math.min(ft, ct))
  	Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  end
  
  