name: Predaplant
card_text: During your Standby Phase: You can banish this card from your Graveyard, then target 2 Level 4 or lower "Predaplant" monsters in your Graveyard; Special Summon them, also, for the rest of this turn, you cannot Special Summon monsters, except Fusion Monsters, nor Normal Summon/Set any monsters.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x10f3 --Predaplant
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x10f3 --Predaplant
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetRange(LOCATION_GRAVE)
  	e1:SetCondition(s.spcon)
  	e1:SetCost(aux.bfgcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.filter(c, e, tp)
  	return c:IsLevelBelow(4) and c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc, e, tp)
  	end
  	if chk == 0 then
  		return not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 1 and Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 2, e:GetHandler(), e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 2, 2, e:GetHandler(), e, tp)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 2, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	if ft > 0 and (g:GetCount() > 0 or (g:GetCount() > 1 and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0))) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		if g:GetCount() > ft then
  			g = g:Select(tp, ft, ft, nil)
  		end
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CANNOT_SUMMON)
  	Duel.RegisterEffect(e2, tp)
  	local e3 = e1:Clone()
  	e3:SetCode(EFFECT_CANNOT_MSET)
  	Duel.RegisterEffect(e3, tp)
  	--cant spsummon from main deck check
  	local e4 = Effect.CreateEffect(e:GetHandler())
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(63060238)
  	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e4:SetTargetRange(1, 0)
  	e4:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e4, tp)
  end
  function s.splimit(e, c)
  	return not c:IsType(TYPE_FUSION)
  end
  
  
source_text: Predaplant
  During your Standby Phase: You can banish this card from your Graveyard, then target 2 Level 4 or lower "Predaplant" monsters in your Graveyard; Special Summon them, also, for the rest of this turn, you cannot Special Summon monsters, except Fusion Monsters, nor Normal Summon/Set any monsters.
target_text: -- Predaplant
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x10f3 --Predaplant
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetRange(LOCATION_GRAVE)
  	e1:SetCondition(s.spcon)
  	e1:SetCost(aux.bfgcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.filter(c, e, tp)
  	return c:IsLevelBelow(4) and c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc, e, tp)
  	end
  	if chk == 0 then
  		return not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 1 and Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 2, e:GetHandler(), e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 2, 2, e:GetHandler(), e, tp)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 2, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	if ft > 0 and (g:GetCount() > 0 or (g:GetCount() > 1 and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0))) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		if g:GetCount() > ft then
  			g = g:Select(tp, ft, ft, nil)
  		end
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CANNOT_SUMMON)
  	Duel.RegisterEffect(e2, tp)
  	local e3 = e1:Clone()
  	e3:SetCode(EFFECT_CANNOT_MSET)
  	Duel.RegisterEffect(e3, tp)
  	--cant spsummon from main deck check
  	local e4 = Effect.CreateEffect(e:GetHandler())
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(63060238)
  	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e4:SetTargetRange(1, 0)
  	e4:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e4, tp)
  end
  function s.splimit(e, c)
  	return not c:IsType(TYPE_FUSION)
  end
  
  