name: Superheavy
card_text: 1 Tuner + 1+ non-Tuner monsters
  When this card is Synchro Summoned: You can target 1 Machine monster in your GY; add it to your hand, also if you have a Spell/Trap in your GY, you cannot Normal or Special Summon it, or a monster with its name, for the rest of this turn. This card can attack while in face-up Defense Position. If it does, apply its DEF for damage calculation.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--salvage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOHAND)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCondition(s.thcon)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	c:RegisterEffect(e2)
  	--defense attack
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_DEFENSE_ATTACK)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
  end
  function s.thfilter(c)
  	return c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  		if Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_GRAVE, 0, 1, nil, TYPE_SPELL + TYPE_TRAP) then
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_FIELD)
  			e1:SetCode(EFFECT_CANNOT_SUMMON)
  			e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  			e1:SetTargetRange(1, 0)
  			e1:SetTarget(s.sumlimit)
  			e1:SetLabel(tc:GetCode())
  			e1:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e1, tp)
  			local e2 = e1:Clone()
  			e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  			Duel.RegisterEffect(e2, tp)
  		end
  	end
  end
  function s.sumlimit(e, c)
  	return c:IsCode(e:GetLabel())
  end
  
  
source_text: Superheavy
  1 Tuner + 1+ non-Tuner monsters
  When this card is Synchro Summoned: You can target 1 Machine monster in your GY; add it to your hand, also if you have a Spell/Trap in your GY, you cannot Normal or Special Summon it, or a monster with its name, for the rest of this turn. This card can attack while in face-up Defense Position. If it does, apply its DEF for damage calculation.
target_text: -- Superheavy
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--salvage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOHAND)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCondition(s.thcon)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	c:RegisterEffect(e2)
  	--defense attack
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_DEFENSE_ATTACK)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
  end
  function s.thfilter(c)
  	return c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  		if Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_GRAVE, 0, 1, nil, TYPE_SPELL + TYPE_TRAP) then
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_FIELD)
  			e1:SetCode(EFFECT_CANNOT_SUMMON)
  			e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  			e1:SetTargetRange(1, 0)
  			e1:SetTarget(s.sumlimit)
  			e1:SetLabel(tc:GetCode())
  			e1:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e1, tp)
  			local e2 = e1:Clone()
  			e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  			Duel.RegisterEffect(e2, tp)
  		end
  	end
  end
  function s.sumlimit(e, c)
  	return c:IsCode(e:GetLabel())
  end
  
  