name: World
card_text: Unaffected by activated effects from any monster Special Summoned from the Extra Deck. Your opponent cannot target your "World Legacy" cards in this card's column with card effects, also they cannot be destroyed by your opponent's card effects. During the Standby Phase, if this card is in your GY: You can pay 1000 LP; Special Summon this card, then your opponent can Special Summon 1 monster from their hand or GY. You can only use this effect of "World Legacy - "World Shield"" once per turn.
external_ids: local SETCARD_ID_0 = 0xfe --World
  
lua: local SETCARD_ID_0 = 0xfe --World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--immune
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_IMMUNE_EFFECT)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.immval)
  	c:RegisterEffect(e1)
  	--cannot be target/indestructable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_ONFIELD, 0)
  	e2:SetTarget(s.tgtg)
  	e2:SetValue(aux.indoval)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e3:SetValue(aux.tgoval)
  	c:RegisterEffect(e3)
  	--spsummon
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e4:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e4:SetRange(LOCATION_GRAVE)
  	e4:SetCountLimit(1, id)
  	e4:SetCost(s.spcost)
  	e4:SetTarget(s.sptg)
  	e4:SetOperation(s.spop)
  	c:RegisterEffect(e4)
  end
  function s.immval(e, te)
  	local tc = te:GetOwner()
  	return tc ~= e:GetHandler() and te:IsActiveType(TYPE_MONSTER) and te:IsActivated() and te:GetActivateLocation() == LOCATION_MZONE and tc:IsSummonLocation(LOCATION_EXTRA)
  end
  function s.tgtg(e, c)
  	return e:GetHandler() == c or (c:IsSetCard(SETCARD_ID_0) and e:GetHandler():GetColumnGroup():IsContains(c))
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckLPCost(tp, 1000)
  	end
  	Duel.PayLPCost(tp, 1000)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  end
  function s.spfilter(c, e, tp)
  	return c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local g = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter), 1 - tp, LOCATION_HAND + LOCATION_GRAVE, 0, nil, e, 1 - tp)
  		if Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0 and g:GetCount() > 0 and Duel.SelectYesNo(1 - tp, aux.Stringid(id, 1)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_SPSUMMON)
  			local sg = g:Select(1 - tp, 1, 1, nil)
  			Duel.SpecialSummon(sg, 0, 1 - tp, 1 - tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  
source_text: World
  Unaffected by activated effects from any monster Special Summoned from the Extra Deck. Your opponent cannot target your "World Legacy" cards in this card's column with card effects, also they cannot be destroyed by your opponent's card effects. During the Standby Phase, if this card is in your GY: You can pay 1000 LP; Special Summon this card, then your opponent can Special Summon 1 monster from their hand or GY. You can only use this effect of "World Legacy - "World Shield"" once per turn.
target_text: -- World
  local SETCARD_ID_0 = 0xfe --World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--immune
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_IMMUNE_EFFECT)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.immval)
  	c:RegisterEffect(e1)
  	--cannot be target/indestructable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_ONFIELD, 0)
  	e2:SetTarget(s.tgtg)
  	e2:SetValue(aux.indoval)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e3:SetValue(aux.tgoval)
  	c:RegisterEffect(e3)
  	--spsummon
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e4:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e4:SetRange(LOCATION_GRAVE)
  	e4:SetCountLimit(1, id)
  	e4:SetCost(s.spcost)
  	e4:SetTarget(s.sptg)
  	e4:SetOperation(s.spop)
  	c:RegisterEffect(e4)
  end
  function s.immval(e, te)
  	local tc = te:GetOwner()
  	return tc ~= e:GetHandler() and te:IsActiveType(TYPE_MONSTER) and te:IsActivated() and te:GetActivateLocation() == LOCATION_MZONE and tc:IsSummonLocation(LOCATION_EXTRA)
  end
  function s.tgtg(e, c)
  	return e:GetHandler() == c or (c:IsSetCard(SETCARD_ID_0) and e:GetHandler():GetColumnGroup():IsContains(c))
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckLPCost(tp, 1000)
  	end
  	Duel.PayLPCost(tp, 1000)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  end
  function s.spfilter(c, e, tp)
  	return c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local g = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter), 1 - tp, LOCATION_HAND + LOCATION_GRAVE, 0, nil, e, 1 - tp)
  		if Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0 and g:GetCount() > 0 and Duel.SelectYesNo(1 - tp, aux.Stringid(id, 1)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_SPSUMMON)
  			local sg = g:Select(1 - tp, 1, 1, nil)
  			Duel.SpecialSummon(sg, 0, 1 - tp, 1 - tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  