name: Infernoble
card_text: 1 Tuner + 1+ non-Tuner monsters
  When this card declares an attack while equipped: You can target 1 face-up card on the field; destroy it. During your Main Phase, except the turn this card was sent to the GY: You can target 1 Warrior monster you control; Special Summon this card from your GY as a Tuner, and if you do, equip that monster you control to this card as an Equip Spell that gives it 500 ATK. You can only use this effect of "Infernoble Knight Captain Oliver" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCondition(s.descon)
  	e1:SetTarget(s.destg)
  	e1:SetOperation(s.desop)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_EQUIP)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(aux.exccon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  s.treat_itself_tuner = true
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():GetEquipCount() > 0
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField() and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, Card.IsFaceup, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  function s.eqfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local c = e:GetHandler()
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  			and Duel.GetLocationCount(tp, LOCATION_SZONE) > 0
  			and Duel.IsExistingTarget(s.eqfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.eqfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) then
  		local res = Duel.SpecialSummonStep(c, 0, tp, tp, false, false, POS_FACEUP)
  		if res then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_ADD_TYPE)
  			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e1:SetValue(TYPE_TUNER)
  			c:RegisterEffect(e1)
  		end
  		Duel.SpecialSummonComplete()
  		if res and tc:IsRelateToEffect(e) and tc:IsControler(tp) then
  			if not Duel.Equip(tp, tc, c, false) then
  				return
  			end
  			--equip limit
  			local e2 = Effect.CreateEffect(c)
  			e2:SetType(EFFECT_TYPE_SINGLE)
  			e2:SetProperty(EFFECT_FLAG_OWNER_RELATE)
  			e2:SetCode(EFFECT_EQUIP_LIMIT)
  			e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e2:SetLabelObject(c)
  			e2:SetValue(s.eqlimit)
  			tc:RegisterEffect(e2)
  			--atk up
  			local e3 = Effect.CreateEffect(tc)
  			e3:SetType(EFFECT_TYPE_EQUIP)
  			e3:SetCode(EFFECT_UPDATE_ATTACK)
  			e3:SetValue(500)
  			e3:SetReset(RESET_EVENT + RESETS_STANDARD)
  			tc:RegisterEffect(e3)
  		end
  	end
  end
  function s.eqlimit(e, c)
  	return c == e:GetLabelObject()
  end
  
  
source_text: Infernoble
  1 Tuner + 1+ non-Tuner monsters
  When this card declares an attack while equipped: You can target 1 face-up card on the field; destroy it. During your Main Phase, except the turn this card was sent to the GY: You can target 1 Warrior monster you control; Special Summon this card from your GY as a Tuner, and if you do, equip that monster you control to this card as an Equip Spell that gives it 500 ATK. You can only use this effect of "Infernoble Knight Captain Oliver" once per turn.
target_text: -- Infernoble
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCondition(s.descon)
  	e1:SetTarget(s.destg)
  	e1:SetOperation(s.desop)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_EQUIP)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(aux.exccon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  s.treat_itself_tuner = true
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():GetEquipCount() > 0
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField() and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, Card.IsFaceup, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  function s.eqfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local c = e:GetHandler()
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  			and Duel.GetLocationCount(tp, LOCATION_SZONE) > 0
  			and Duel.IsExistingTarget(s.eqfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.eqfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) then
  		local res = Duel.SpecialSummonStep(c, 0, tp, tp, false, false, POS_FACEUP)
  		if res then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_ADD_TYPE)
  			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e1:SetValue(TYPE_TUNER)
  			c:RegisterEffect(e1)
  		end
  		Duel.SpecialSummonComplete()
  		if res and tc:IsRelateToEffect(e) and tc:IsControler(tp) then
  			if not Duel.Equip(tp, tc, c, false) then
  				return
  			end
  			--equip limit
  			local e2 = Effect.CreateEffect(c)
  			e2:SetType(EFFECT_TYPE_SINGLE)
  			e2:SetProperty(EFFECT_FLAG_OWNER_RELATE)
  			e2:SetCode(EFFECT_EQUIP_LIMIT)
  			e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e2:SetLabelObject(c)
  			e2:SetValue(s.eqlimit)
  			tc:RegisterEffect(e2)
  			--atk up
  			local e3 = Effect.CreateEffect(tc)
  			e3:SetType(EFFECT_TYPE_EQUIP)
  			e3:SetCode(EFFECT_UPDATE_ATTACK)
  			e3:SetValue(500)
  			e3:SetReset(RESET_EVENT + RESETS_STANDARD)
  			tc:RegisterEffect(e3)
  		end
  	end
  end
  function s.eqlimit(e, c)
  	return c == e:GetLabelObject()
  end
  
  