name: Pumprincess
card_text: If this face-up card is destroyed in a Monster Zone, you can place it face-up in your Spell & Trap Zone as a Continuous Spell, instead of sending it to the GY. While this card is treated as a Continuous Spell by this effect, during each Standby Phase: Place 1 Pumpkin Counter on this card. All monsters your opponent controls lose 100 ATK/DEF for each Pumpkin Counter on this card.
external_ids: local COUNTER_ID_0 = 0x2f --Pumpkin
  
lua: local COUNTER_ID_0 = 0x2f --Pumpkin
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x2f, LOCATION_SZONE)
  	--send replace
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCondition(s.repcon)
  	e1:SetOperation(s.repop)
  	c:RegisterEffect(e1)
  end
  function s.repcon(e)
  	local c = e:GetHandler()
  	return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY)
  end
  function s.repop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCode(EFFECT_CHANGE_TYPE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TURN_SET)
  	e1:SetValue(TYPE_SPELL + TYPE_CONTINUOUS)
  	c:RegisterEffect(e1)
  	--counter
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_COUNTER)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e2:SetCountLimit(1)
  	e2:SetTarget(s.addct)
  	e2:SetOperation(s.addc)
  	e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  	c:RegisterEffect(e2)
  	--addown
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetTargetRange(0, LOCATION_MZONE)
  	e3:SetValue(s.adval)
  	e3:SetReset(RESET_EVENT + RESETS_STANDARD)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e4)
  end
  function s.addct(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_COUNTER, nil, 1, 0, 0x2f)
  end
  function s.addc(e, tp, eg, ep, ev, re, r, rp)
  	if e:GetHandler():IsRelateToEffect(e) then
  		e:GetHandler():AddCounter(COUNTER_ID_0, 1)
  	end
  end
  function s.adval(e, c)
  	return e:GetHandler():GetCounter(COUNTER_ID_0) * -100
  end
  
  
source_text: Pumprincess
  If this face-up card is destroyed in a Monster Zone, you can place it face-up in your Spell & Trap Zone as a Continuous Spell, instead of sending it to the GY. While this card is treated as a Continuous Spell by this effect, during each Standby Phase: Place 1 Pumpkin Counter on this card. All monsters your opponent controls lose 100 ATK/DEF for each Pumpkin Counter on this card.
target_text: -- Pumprincess
  local COUNTER_ID_0 = 0x2f --Pumpkin
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x2f, LOCATION_SZONE)
  	--send replace
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCondition(s.repcon)
  	e1:SetOperation(s.repop)
  	c:RegisterEffect(e1)
  end
  function s.repcon(e)
  	local c = e:GetHandler()
  	return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY)
  end
  function s.repop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCode(EFFECT_CHANGE_TYPE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TURN_SET)
  	e1:SetValue(TYPE_SPELL + TYPE_CONTINUOUS)
  	c:RegisterEffect(e1)
  	--counter
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_COUNTER)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e2:SetCountLimit(1)
  	e2:SetTarget(s.addct)
  	e2:SetOperation(s.addc)
  	e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  	c:RegisterEffect(e2)
  	--addown
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetTargetRange(0, LOCATION_MZONE)
  	e3:SetValue(s.adval)
  	e3:SetReset(RESET_EVENT + RESETS_STANDARD)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e4)
  end
  function s.addct(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_COUNTER, nil, 1, 0, 0x2f)
  end
  function s.addc(e, tp, eg, ep, ev, re, r, rp)
  	if e:GetHandler():IsRelateToEffect(e) then
  		e:GetHandler():AddCounter(COUNTER_ID_0, 1)
  	end
  end
  function s.adval(e, c)
  	return e:GetHandler():GetCounter(COUNTER_ID_0) * -100
  end
  
  