name: D-HERO
card_text: このカードは通常召喚できない。
  「D-HERO」モンスターを含む自分フィールドのモンスター3体をリリースした場合のみ特殊召喚できる。
  1:この方法でこのカードが特殊召喚に成功した場合、次の相手スタンバイフェイズに発動する。
  相手のLPを半分にする。
external_ids: local SETCARD_ID_0 = 0xc008 --D-HERO
  
lua: local SETCARD_ID_0 = 0xc008 --D-HERO
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.FALSE)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SPSUMMON_PROC)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetRange(LOCATION_HAND)
  	e2:SetValue(SUMMON_VALUE_SELF)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--special summon success
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e3:SetCondition(s.lp)
  	e3:SetOperation(s.lpop)
  	c:RegisterEffect(e3)
  	c:EnableReviveLimit()
  end
  function s.rfilter(c, tp)
  	return c:IsSetCard(SETCARD_ID_0) and (c:IsControler(tp) or c:IsFaceup())
  end
  function s.fselect(g, tp)
  	return g:IsExists(s.rfilter, 1, nil, tp) and aux.mzctcheckrel(g, tp, REASON_SPSUMMON)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local rg = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON)
  	return rg:CheckSubGroup(s.fselect, 3, 3, tp)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local rg = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local sg = rg:SelectSubGroup(tp, s.fselect, true, 3, 3, tp)
  	if sg then
  		sg:KeepAlive()
  		e:SetLabelObject(sg)
  		return true
  	else
  		return false
  	end
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Release(g, REASON_SPSUMMON)
  	g:DeleteGroup()
  end
  function s.lp(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():GetSummonType() == SUMMON_TYPE_SPECIAL + SUMMON_VALUE_SELF
  end
  function s.lpop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 1))
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetReset(RESET_EVENT + 0x2fe0000 + RESET_PHASE + PHASE_STANDBY)
  	e1:SetCondition(s.lpc)
  	e1:SetOperation(s.lpcop)
  	c:RegisterEffect(e1)
  end
  function s.lpc(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer()
  end
  function s.lpcop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SetLP(1 - tp, math.ceil(Duel.GetLP(1 - tp) / 2))
  end
  
  
source_text: D-HERO
  このカードは通常召喚できない。
  「D-HERO」モンスターを含む自分フィールドのモンスター3体をリリースした場合のみ特殊召喚できる。
  1:この方法でこのカードが特殊召喚に成功した場合、次の相手スタンバイフェイズに発動する。
  相手のLPを半分にする。
target_text: -- D-HERO
  local SETCARD_ID_0 = 0xc008 --D-HERO
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.FALSE)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SPSUMMON_PROC)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetRange(LOCATION_HAND)
  	e2:SetValue(SUMMON_VALUE_SELF)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--special summon success
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e3:SetCondition(s.lp)
  	e3:SetOperation(s.lpop)
  	c:RegisterEffect(e3)
  	c:EnableReviveLimit()
  end
  function s.rfilter(c, tp)
  	return c:IsSetCard(SETCARD_ID_0) and (c:IsControler(tp) or c:IsFaceup())
  end
  function s.fselect(g, tp)
  	return g:IsExists(s.rfilter, 1, nil, tp) and aux.mzctcheckrel(g, tp, REASON_SPSUMMON)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local rg = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON)
  	return rg:CheckSubGroup(s.fselect, 3, 3, tp)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local rg = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local sg = rg:SelectSubGroup(tp, s.fselect, true, 3, 3, tp)
  	if sg then
  		sg:KeepAlive()
  		e:SetLabelObject(sg)
  		return true
  	else
  		return false
  	end
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Release(g, REASON_SPSUMMON)
  	g:DeleteGroup()
  end
  function s.lp(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():GetSummonType() == SUMMON_TYPE_SPECIAL + SUMMON_VALUE_SELF
  end
  function s.lpop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 1))
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetReset(RESET_EVENT + 0x2fe0000 + RESET_PHASE + PHASE_STANDBY)
  	e1:SetCondition(s.lpc)
  	e1:SetOperation(s.lpcop)
  	c:RegisterEffect(e1)
  end
  function s.lpc(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer()
  end
  function s.lpcop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SetLP(1 - tp, math.ceil(Duel.GetLP(1 - tp) / 2))
  end
  
  