name: Thunder
card_text: Inflict 400 damage to your opponent for each monster they control.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--damage
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DAMAGE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) ~= 0
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	local dam = Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) * 400
  	Duel.SetTargetParam(dam)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, dam)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local dam = Duel.GetFieldGroupCount(p, LOCATION_MZONE, 0) * 400
  	Duel.Damage(p, dam, REASON_EFFECT)
  end
  
  
source_text: Thunder
  Inflict 400 damage to your opponent for each monster they control.
target_text: -- Thunder
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--damage
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DAMAGE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) ~= 0
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	local dam = Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) * 400
  	Duel.SetTargetParam(dam)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, dam)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local dam = Duel.GetFieldGroupCount(p, LOCATION_MZONE, 0) * 400
  	Duel.Damage(p, dam, REASON_EFFECT)
  end
  
  