name: Pain
card_text: This card's name becomes "Plaguespreader Zombie" while on the field. Once per turn: You can target up to 2 Zombie monsters you control, except this card; they become Level 2 (until the end of this turn), and if they do, they cannot be used as Synchro Material, except for the Synchro Summon of a Zombie monster.
external_ids: local CARD_ID_0 = 33420078 --Plaguespreader Zombie
  
lua: local CARD_ID_0 = 33420078 --Plaguespreader Zombie
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--alias
  	aux.EnableChangeCode(c, CARD_ID_0)
  	--lvchange
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetTarget(s.lvtg)
  	e2:SetOperation(s.lvop)
  	c:RegisterEffect(e2)
  end
  function s.lvfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and not c:IsLevel(2) and c:IsLevelAbove(1)
  end
  function s.lvtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.lvfilter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.lvfilter, tp, LOCATION_MZONE, 0, 1, 2, e:GetHandler())
  end
  function s.lvop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	local tc = g:GetFirst()
  	while tc do
  		if tc:IsFaceup() then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_CHANGE_LEVEL)
  			e1:SetValue(2)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e1)
  			local e2 = Effect.CreateEffect(c)
  			e2:SetType(EFFECT_TYPE_SINGLE)
  			e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
  			e2:SetValue(s.synlimit)
  			e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e2)
  		end
  		tc = g:GetNext()
  	end
  end
  function s.synlimit(e, c)
  	if not c then
  		return false
  	end
  	return not c:IsRace(RACE_ZOMBIE)
  end
  
  
source_text: Pain
  This card's name becomes "Plaguespreader Zombie" while on the field. Once per turn: You can target up to 2 Zombie monsters you control, except this card; they become Level 2 (until the end of this turn), and if they do, they cannot be used as Synchro Material, except for the Synchro Summon of a Zombie monster.
target_text: -- Pain
  local CARD_ID_0 = 33420078 --Plaguespreader Zombie
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--alias
  	aux.EnableChangeCode(c, CARD_ID_0)
  	--lvchange
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetTarget(s.lvtg)
  	e2:SetOperation(s.lvop)
  	c:RegisterEffect(e2)
  end
  function s.lvfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and not c:IsLevel(2) and c:IsLevelAbove(1)
  end
  function s.lvtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.lvfilter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.lvfilter, tp, LOCATION_MZONE, 0, 1, 2, e:GetHandler())
  end
  function s.lvop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	local tc = g:GetFirst()
  	while tc do
  		if tc:IsFaceup() then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_CHANGE_LEVEL)
  			e1:SetValue(2)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e1)
  			local e2 = Effect.CreateEffect(c)
  			e2:SetType(EFFECT_TYPE_SINGLE)
  			e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
  			e2:SetValue(s.synlimit)
  			e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e2)
  		end
  		tc = g:GetNext()
  	end
  end
  function s.synlimit(e, c)
  	if not c then
  		return false
  	end
  	return not c:IsRace(RACE_ZOMBIE)
  end
  
  