name: Superheavy
card_text: You can target 1 "Superheavy Samurai" monster you control; equip this monster from your hand or your side of the field to that target. It gains 1200 DEF. When the monster equipped with this card by this effect is targeted for an attack: You can send this Equip Card to the Graveyard; negate that attack, but the equipped monster's DEF becomes 0.
external_ids: local SETCARD_ID_0 = 0x9a --Superheavy
  
lua: local SETCARD_ID_0 = 0x9a --Superheavy
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetRange(LOCATION_HAND + LOCATION_MZONE)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler())
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then
  		return
  	end
  	local tc = Duel.GetFirstTarget()
  	if Duel.GetLocationCount(tp, LOCATION_SZONE) <= 0 or tc:IsControler(1 - tp) or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
  		Duel.SendtoGrave(c, REASON_EFFECT)
  		return
  	end
  	Duel.Equip(tp, c, tc)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_EQUIP_LIMIT)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	e1:SetValue(s.eqlimit)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_EQUIP)
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	e2:SetValue(1200)
  	e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_BE_BATTLE_TARGET)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCondition(s.btcon)
  	e3:SetCost(s.btcost)
  	e3:SetOperation(s.btop)
  	e3:SetReset(RESET_EVENT + RESETS_STANDARD)
  	c:RegisterEffect(e3)
  end
  function s.eqlimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  function s.btcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:GetFirst() == e:GetHandler():GetEquipTarget()
  end
  function s.btcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	e:SetLabelObject(e:GetHandler():GetEquipTarget())
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.btop(e, tp, eg, ep, ev, re, r, rp)
  	local ec = e:GetLabelObject()
  	if Duel.NegateAttack() and ec:IsFaceup() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
  		e1:SetValue(0)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		ec:RegisterEffect(e1)
  	end
  end
  
  
source_text: Superheavy
  You can target 1 "Superheavy Samurai" monster you control; equip this monster from your hand or your side of the field to that target. It gains 1200 DEF. When the monster equipped with this card by this effect is targeted for an attack: You can send this Equip Card to the Graveyard; negate that attack, but the equipped monster's DEF becomes 0.
target_text: -- Superheavy
  local SETCARD_ID_0 = 0x9a --Superheavy
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetRange(LOCATION_HAND + LOCATION_MZONE)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler())
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then
  		return
  	end
  	local tc = Duel.GetFirstTarget()
  	if Duel.GetLocationCount(tp, LOCATION_SZONE) <= 0 or tc:IsControler(1 - tp) or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
  		Duel.SendtoGrave(c, REASON_EFFECT)
  		return
  	end
  	Duel.Equip(tp, c, tc)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_EQUIP_LIMIT)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	e1:SetValue(s.eqlimit)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_EQUIP)
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	e2:SetValue(1200)
  	e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_BE_BATTLE_TARGET)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCondition(s.btcon)
  	e3:SetCost(s.btcost)
  	e3:SetOperation(s.btop)
  	e3:SetReset(RESET_EVENT + RESETS_STANDARD)
  	c:RegisterEffect(e3)
  end
  function s.eqlimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  function s.btcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:GetFirst() == e:GetHandler():GetEquipTarget()
  end
  function s.btcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	e:SetLabelObject(e:GetHandler():GetEquipTarget())
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.btop(e, tp, eg, ep, ev, re, r, rp)
  	local ec = e:GetLabelObject()
  	if Duel.NegateAttack() and ec:IsFaceup() then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
  		e1:SetValue(0)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		ec:RegisterEffect(e1)
  	end
  end
  
  