name: Clear
card_text: You are unaffected by the effects of "Clear World". If this card is Normal or Special Summoned: You can activate this effect; this turn, your monsters that mention "Clear World" can attack directly. You can only use this effect of "Clear Rage Golem" once per turn. When this card inflicts battle damage to your opponent: You can inflict 300 damage to your opponent for each card in their hand.
external_ids: local CARD_ID_0 = 33900648 --Clear World
  
lua: local CARD_ID_0 = 33900648 --Clear World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--direct attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.atkcon)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	--unaffected
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(1, 0)
  	e3:SetCode(97811903)
  	c:RegisterEffect(e3)
  	--inflict damage
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e4:SetCode(EVENT_BATTLE_DAMAGE)
  	e4:SetCondition(s.damcon)
  	e4:SetTarget(s.damtg)
  	e4:SetOperation(s.damop)
  	c:RegisterEffect(e4)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsAbleToEnterBP()
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_DIRECT_ATTACK)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetTarget(s.atktg)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.atktg(e, c)
  	return aux.IsCodeListed(c, CARD_ID_0)
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep ~= tp
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(1 - tp, LOCATION_HAND, 0) > 0
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, Duel.GetFieldGroupCount(1 - tp, LOCATION_HAND, 0) * 300)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	Duel.Damage(p, Duel.GetFieldGroupCount(p, LOCATION_HAND, 0) * 300, REASON_EFFECT)
  end
  
  
source_text: Clear
  You are unaffected by the effects of "Clear World". If this card is Normal or Special Summoned: You can activate this effect; this turn, your monsters that mention "Clear World" can attack directly. You can only use this effect of "Clear Rage Golem" once per turn. When this card inflicts battle damage to your opponent: You can inflict 300 damage to your opponent for each card in their hand.
target_text: -- Clear
  local CARD_ID_0 = 33900648 --Clear World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--direct attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.atkcon)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	--unaffected
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(1, 0)
  	e3:SetCode(97811903)
  	c:RegisterEffect(e3)
  	--inflict damage
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e4:SetCode(EVENT_BATTLE_DAMAGE)
  	e4:SetCondition(s.damcon)
  	e4:SetTarget(s.damtg)
  	e4:SetOperation(s.damop)
  	c:RegisterEffect(e4)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsAbleToEnterBP()
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_DIRECT_ATTACK)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetTarget(s.atktg)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.atktg(e, c)
  	return aux.IsCodeListed(c, CARD_ID_0)
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep ~= tp
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(1 - tp, LOCATION_HAND, 0) > 0
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, Duel.GetFieldGroupCount(1 - tp, LOCATION_HAND, 0) * 300)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	Duel.Damage(p, Duel.GetFieldGroupCount(p, LOCATION_HAND, 0) * 300, REASON_EFFECT)
  end
  
  