name: Vice
card_text: If this card is sent to the Graveyard as a Synchro Material Monster, inflict 2000 damage to the player that Synchro Summoned, and the Synchro Monster that used this card as a Synchro Material Monster gains 2000 ATK until the End Phase.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--damage & atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DAMAGE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_BE_MATERIAL)
  	e1:SetCondition(s.damcon)
  	e1:SetTarget(s.damtg)
  	e1:SetOperation(s.damop)
  	c:RegisterEffect(e1)
  	aux.CreateMaterialReasonCardRelation(c, e1)
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsLocation(LOCATION_GRAVE) and r == REASON_SYNCHRO
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local rc = e:GetHandler():GetReasonCard()
  	if rc:IsRelateToEffect(e) and rc:IsFaceup() then
  		Duel.SetTargetCard(rc)
  	end
  	Duel.SetTargetPlayer(rp)
  	Duel.SetTargetParam(2000)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, rp, 2000)
  end
  function s.damop(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)
  	local rc = Duel.GetFirstTarget()
  	if rc and rc:IsFaceup() and rc:IsRelateToChain() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e1:SetValue(2000)
  		rc:RegisterEffect(e1)
  	end
  end
  
  
source_text: Vice
  If this card is sent to the Graveyard as a Synchro Material Monster, inflict 2000 damage to the player that Synchro Summoned, and the Synchro Monster that used this card as a Synchro Material Monster gains 2000 ATK until the End Phase.
target_text: -- Vice
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--damage & atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DAMAGE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_BE_MATERIAL)
  	e1:SetCondition(s.damcon)
  	e1:SetTarget(s.damtg)
  	e1:SetOperation(s.damop)
  	c:RegisterEffect(e1)
  	aux.CreateMaterialReasonCardRelation(c, e1)
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsLocation(LOCATION_GRAVE) and r == REASON_SYNCHRO
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local rc = e:GetHandler():GetReasonCard()
  	if rc:IsRelateToEffect(e) and rc:IsFaceup() then
  		Duel.SetTargetCard(rc)
  	end
  	Duel.SetTargetPlayer(rp)
  	Duel.SetTargetParam(2000)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, rp, 2000)
  end
  function s.damop(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)
  	local rc = Duel.GetFirstTarget()
  	if rc and rc:IsFaceup() and rc:IsRelateToChain() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e1:SetValue(2000)
  		rc:RegisterEffect(e1)
  	end
  end
  
  