name: Zombie
card_text: Destroy this card if you do not have a Zombie-Type monster in your Graveyard. When this face-up card is destroyed, inflict damage to its controller equal to its original ATK.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--self destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_SELF_DESTROY)
  	e1:SetCondition(s.sdcon)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DAMAGE)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_LEAVE_FIELD)
  	e2:SetCondition(s.dmcon)
  	e2:SetTarget(s.dmtg)
  	e2:SetOperation(s.dmop)
  	c:RegisterEffect(e2)
  end
  function s.sdcon(e)
  	return not Duel.IsExistingMatchingCard(Card.IsRace, e:GetHandlerPlayer(), LOCATION_GRAVE, 0, 1, nil, RACE_ZOMBIE)
  end
  function s.dmcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
  end
  function s.dmtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local c = e:GetHandler()
  	Duel.SetTargetPlayer(c:GetPreviousControler())
  	Duel.SetTargetParam(1900)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, c:GetPreviousControler(), 1900)
  end
  function s.dmop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Damage(p, d, REASON_EFFECT)
  end
  
  
source_text: Zombie
  Destroy this card if you do not have a Zombie-Type monster in your Graveyard. When this face-up card is destroyed, inflict damage to its controller equal to its original ATK.
target_text: -- Zombie
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--self destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_SELF_DESTROY)
  	e1:SetCondition(s.sdcon)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DAMAGE)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_LEAVE_FIELD)
  	e2:SetCondition(s.dmcon)
  	e2:SetTarget(s.dmtg)
  	e2:SetOperation(s.dmop)
  	c:RegisterEffect(e2)
  end
  function s.sdcon(e)
  	return not Duel.IsExistingMatchingCard(Card.IsRace, e:GetHandlerPlayer(), LOCATION_GRAVE, 0, 1, nil, RACE_ZOMBIE)
  end
  function s.dmcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
  end
  function s.dmtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local c = e:GetHandler()
  	Duel.SetTargetPlayer(c:GetPreviousControler())
  	Duel.SetTargetParam(1900)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, c:GetPreviousControler(), 1900)
  end
  function s.dmop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Damage(p, d, REASON_EFFECT)
  end
  
  