name: Castle
card_text: FLIP: Increases the ATK and DEF of all Zombie-Type monsters by 200 points. As long as this card remains face-up on the field, the ATK and DEF of Zombie-Type monsters continues to increase by 200 points during each of your Standby Phases. This effect continues until your 4th turn after the card is activated.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--flip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(Card.IsRace, tp, LOCATION_MZONE, LOCATION_MZONE, nil, RACE_ZOMBIE)
  	local tc = g:GetFirst()
  	while tc do
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetValue(200)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		tc:RegisterEffect(e2)
  		tc = g:GetNext()
  	end
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		local e3 = Effect.CreateEffect(c)
  		e3:SetDescription(aux.Stringid(id, 1))
  		e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  		e3:SetCode(EVENT_PHASE + PHASE_STANDBY)
  		e3:SetRange(LOCATION_MZONE)
  		e3:SetCountLimit(1)
  		e3:SetCondition(s.atkcon)
  		e3:SetOperation(s.atkop)
  		e3:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_STANDBY + RESET_SELF_TURN, 4)
  		c:RegisterEffect(e3)
  	end
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(Card.IsRace, tp, LOCATION_MZONE, LOCATION_MZONE, nil, RACE_ZOMBIE)
  	local tc = g:GetFirst()
  	while tc do
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetValue(200)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		tc:RegisterEffect(e2)
  		tc = g:GetNext()
  	end
  end
  
  
source_text: Castle
  FLIP: Increases the ATK and DEF of all Zombie-Type monsters by 200 points. As long as this card remains face-up on the field, the ATK and DEF of Zombie-Type monsters continues to increase by 200 points during each of your Standby Phases. This effect continues until your 4th turn after the card is activated.
target_text: -- Castle
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--flip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(Card.IsRace, tp, LOCATION_MZONE, LOCATION_MZONE, nil, RACE_ZOMBIE)
  	local tc = g:GetFirst()
  	while tc do
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetValue(200)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		tc:RegisterEffect(e2)
  		tc = g:GetNext()
  	end
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		local e3 = Effect.CreateEffect(c)
  		e3:SetDescription(aux.Stringid(id, 1))
  		e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  		e3:SetCode(EVENT_PHASE + PHASE_STANDBY)
  		e3:SetRange(LOCATION_MZONE)
  		e3:SetCountLimit(1)
  		e3:SetCondition(s.atkcon)
  		e3:SetOperation(s.atkop)
  		e3:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_STANDBY + RESET_SELF_TURN, 4)
  		c:RegisterEffect(e3)
  	end
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(Card.IsRace, tp, LOCATION_MZONE, LOCATION_MZONE, nil, RACE_ZOMBIE)
  	local tc = g:GetFirst()
  	while tc do
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetValue(200)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		tc:RegisterEffect(e2)
  		tc = g:GetNext()
  	end
  end
  
  