name: Heart
card_text: If the equipped monster's ATK is 1300 or higher, this card is destroyed. The monster equipped with this card is not destroyed as a result of battle or by the effect of a card that targets the monster. (Damage calculation is applied normally.)
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--Indes
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_EQUIP)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_EQUIP)
  	e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e3:SetValue(s.indval)
  	c:RegisterEffect(e3)
  	--Equip limit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_EQUIP_LIMIT)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--selfdes
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e5:SetRange(LOCATION_SZONE)
  	e5:SetCode(EFFECT_SELF_DESTROY)
  	e5:SetCondition(s.descon)
  	c:RegisterEffect(e5)
  	--selfdes in damage step
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e6:SetRange(LOCATION_SZONE)
  	e6:SetCode(EVENT_ADJUST)
  	e6:SetOperation(s.descheck)
  	c:RegisterEffect(e6)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	Duel.SelectTarget(tp, Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Equip(tp, e:GetHandler(), tc)
  	end
  end
  function s.indval(e, re, rp)
  	local tc = e:GetHandler():GetEquipTarget()
  	local rc = re:GetHandler()
  	return (re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):IsContains(tc)) or (re:IsHasType(EFFECT_TYPE_CONTINUOUS) and rc:IsHasCardTarget(tc))
  end
  function s.descon(e)
  	local tc = e:GetHandler():GetEquipTarget()
  	return tc and tc:GetAttack() >= 1300
  end
  function s.descheck(e, tp, eg, ep, ev, re, r, rp)
  	local ph = Duel.GetCurrentPhase()
  	if ph >= PHASE_DAMAGE and ph <= PHASE_DAMAGE_CAL then
  		local c = e:GetHandler()
  		local tc = c:GetEquipTarget()
  		if tc and tc:GetAttack() >= 1300 then
  			Duel.Destroy(c, REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Heart
  If the equipped monster's ATK is 1300 or higher, this card is destroyed. The monster equipped with this card is not destroyed as a result of battle or by the effect of a card that targets the monster. (Damage calculation is applied normally.)
target_text: -- Heart
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--Indes
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_EQUIP)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_EQUIP)
  	e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e3:SetValue(s.indval)
  	c:RegisterEffect(e3)
  	--Equip limit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_EQUIP_LIMIT)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--selfdes
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e5:SetRange(LOCATION_SZONE)
  	e5:SetCode(EFFECT_SELF_DESTROY)
  	e5:SetCondition(s.descon)
  	c:RegisterEffect(e5)
  	--selfdes in damage step
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e6:SetRange(LOCATION_SZONE)
  	e6:SetCode(EVENT_ADJUST)
  	e6:SetOperation(s.descheck)
  	c:RegisterEffect(e6)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	Duel.SelectTarget(tp, Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Equip(tp, e:GetHandler(), tc)
  	end
  end
  function s.indval(e, re, rp)
  	local tc = e:GetHandler():GetEquipTarget()
  	local rc = re:GetHandler()
  	return (re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):IsContains(tc)) or (re:IsHasType(EFFECT_TYPE_CONTINUOUS) and rc:IsHasCardTarget(tc))
  end
  function s.descon(e)
  	local tc = e:GetHandler():GetEquipTarget()
  	return tc and tc:GetAttack() >= 1300
  end
  function s.descheck(e, tp, eg, ep, ev, re, r, rp)
  	local ph = Duel.GetCurrentPhase()
  	if ph >= PHASE_DAMAGE and ph <= PHASE_DAMAGE_CAL then
  		local c = e:GetHandler()
  		local tc = c:GetEquipTarget()
  		if tc and tc:GetAttack() >= 1300 then
  			Duel.Destroy(c, REASON_EFFECT)
  		end
  	end
  end
  
  