name: Revendread
card_text: This card can be used to Ritual Summon any "Vendread" Ritual Monster from your hand or GY. You must also Tribute monsters from your hand or field, and/or banish Zombie monsters from your GY, whose total Levels equal or exceed the Level of the Ritual Monster you Ritual Summon. If "Revendread Slayer(s)" you control would be destroyed by battle or card effect, you can banish this card from your GY instead.
external_ids: local CARD_ID_0 = 4388680 --Revendread Slayer
  local SETCARD_ID_0 = 0x106 --Vendread
  
lua: local CARD_ID_0 = 4388680 --Revendread Slayer
  local SETCARD_ID_0 = 0x106 --Vendread
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	aux.AddRitualProcGreater2(c, s.filter, LOCATION_HAND + LOCATION_GRAVE, s.mfilter)
  	--destroy replace
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EFFECT_DESTROY_REPLACE)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetTarget(s.reptg)
  	e2:SetValue(s.repval)
  	e2:SetOperation(s.repop)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  function s.mfilter(c)
  	return c:IsRace(RACE_ZOMBIE)
  end
  function s.repfilter(c, tp)
  	return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsCode(CARD_ID_0) and c:IsReason(REASON_EFFECT + REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
  end
  function s.reptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToRemove() and eg:IsExists(s.repfilter, 1, nil, tp)
  	end
  	return Duel.SelectEffectYesNo(tp, e:GetHandler(), 96)
  end
  function s.repval(e, c)
  	return s.repfilter(c, e:GetHandlerPlayer())
  end
  function s.repop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Remove(e:GetHandler(), POS_FACEUP, REASON_EFFECT)
  end
  
  
source_text: Revendread
  This card can be used to Ritual Summon any "Vendread" Ritual Monster from your hand or GY. You must also Tribute monsters from your hand or field, and/or banish Zombie monsters from your GY, whose total Levels equal or exceed the Level of the Ritual Monster you Ritual Summon. If "Revendread Slayer(s)" you control would be destroyed by battle or card effect, you can banish this card from your GY instead.
target_text: -- Revendread
  local CARD_ID_0 = 4388680 --Revendread Slayer
  local SETCARD_ID_0 = 0x106 --Vendread
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	aux.AddRitualProcGreater2(c, s.filter, LOCATION_HAND + LOCATION_GRAVE, s.mfilter)
  	--destroy replace
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EFFECT_DESTROY_REPLACE)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetTarget(s.reptg)
  	e2:SetValue(s.repval)
  	e2:SetOperation(s.repop)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  function s.mfilter(c)
  	return c:IsRace(RACE_ZOMBIE)
  end
  function s.repfilter(c, tp)
  	return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsCode(CARD_ID_0) and c:IsReason(REASON_EFFECT + REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
  end
  function s.reptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToRemove() and eg:IsExists(s.repfilter, 1, nil, tp)
  	end
  	return Duel.SelectEffectYesNo(tp, e:GetHandler(), 96)
  end
  function s.repval(e, c)
  	return s.repfilter(c, e:GetHandlerPlayer())
  end
  function s.repop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Remove(e:GetHandler(), POS_FACEUP, REASON_EFFECT)
  end
  
  