name: Todoroki
card_text: You can Special Summon this card (from your hand) by sending 1 other monster from your hand to the GY, but this card loses 500 ATK. You can only Special Summon "Todoroki the Earthbolt Star" once per turn this way. During the Battle Phase (Quick Effect): You can pay 500 LP; Fusion Summon 1 Warrior Fusion Monster from your Extra Deck, using monsters from your hand or field as material. You can only use this effect of "Todoroki the Earthbolt Star" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon (hand)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.hspcon)
  	e1:SetTarget(s.hsptg)
  	e1:SetOperation(s.hspop)
  	c:RegisterEffect(e1)
  	--fusion summon
  	local e2 = FusionSpell.CreateSummonEffect(c, {
  		fusfilter = s.fusfilter,
  	})
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id + o)
  	e2:SetHintTiming(0, TIMING_BATTLE_START + TIMING_BATTLE_END)
  	e2:SetCondition(s.spcon)
  	e2:SetCost(s.spcost)
  	c:RegisterEffect(e2)
  end
  
  function s.hspcfilter(c)
  	return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
  end
  
  function s.hspcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.hspcfilter, tp, LOCATION_HAND, 0, 1, c)
  end
  
  function s.hsptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetMatchingGroup(s.hspcfilter, tp, LOCATION_HAND, 0, c)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
  	if tc then
  		e:SetLabelObject(tc)
  		return true
  	else
  		return false
  	end
  end
  
  function s.hspop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.SendtoGrave(g, REASON_SPSUMMON)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetValue(-500)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD + RESET_DISABLE)
  	c:RegisterEffect(e1)
  end
  
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() >= PHASE_BATTLE_START and Duel.GetCurrentPhase() <= PHASE_BATTLE
  end
  
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckLPCost(tp, 500)
  	end
  	Duel.PayLPCost(tp, 500)
  end
  
  function s.fusfilter(c)
  	return c:IsRace(RACE_WARRIOR)
  end
  
  
source_text: Todoroki
  You can Special Summon this card (from your hand) by sending 1 other monster from your hand to the GY, but this card loses 500 ATK. You can only Special Summon "Todoroki the Earthbolt Star" once per turn this way. During the Battle Phase (Quick Effect): You can pay 500 LP; Fusion Summon 1 Warrior Fusion Monster from your Extra Deck, using monsters from your hand or field as material. You can only use this effect of "Todoroki the Earthbolt Star" once per turn.
target_text: -- Todoroki
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon (hand)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.hspcon)
  	e1:SetTarget(s.hsptg)
  	e1:SetOperation(s.hspop)
  	c:RegisterEffect(e1)
  	--fusion summon
  	local e2 = FusionSpell.CreateSummonEffect(c, {
  		fusfilter = s.fusfilter,
  	})
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id + o)
  	e2:SetHintTiming(0, TIMING_BATTLE_START + TIMING_BATTLE_END)
  	e2:SetCondition(s.spcon)
  	e2:SetCost(s.spcost)
  	c:RegisterEffect(e2)
  end
  
  function s.hspcfilter(c)
  	return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
  end
  
  function s.hspcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.hspcfilter, tp, LOCATION_HAND, 0, 1, c)
  end
  
  function s.hsptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetMatchingGroup(s.hspcfilter, tp, LOCATION_HAND, 0, c)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
  	if tc then
  		e:SetLabelObject(tc)
  		return true
  	else
  		return false
  	end
  end
  
  function s.hspop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.SendtoGrave(g, REASON_SPSUMMON)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetValue(-500)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD + RESET_DISABLE)
  	c:RegisterEffect(e1)
  end
  
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() >= PHASE_BATTLE_START and Duel.GetCurrentPhase() <= PHASE_BATTLE
  end
  
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckLPCost(tp, 500)
  	end
  	Duel.PayLPCost(tp, 500)
  end
  
  function s.fusfilter(c)
  	return c:IsRace(RACE_WARRIOR)
  end
  
  