znmud-0.0.1/benchmark/
znmud-0.0.1/cmd/
znmud-0.0.1/cmd/emotes/
znmud-0.0.1/cmd/objects/
znmud-0.0.1/cmd/tiny/
znmud-0.0.1/doc/
znmud-0.0.1/farts/
znmud-0.0.1/lib/
znmud-0.0.1/lib/combat/
znmud-0.0.1/lib/core/bodytypes/
znmud-0.0.1/lib/engine/
znmud-0.0.1/lib/farts/
znmud-0.0.1/logs/
#
# file::    cmd_kill.rb

# This source code copyright (C) 2009 Craig Smith
# All rights reserved.
#
# Released under the terms of the TeensyMUD Public License
# See LICENSE file for additional information.
#

module Cmd

  bindtextdomain("cmd")

  # The kill command
  def cmd_kill(args)
	case args
	when "", nil
		sendto _("Kill whom?")
	else
		room = get_object(location)
		if room.has_attribute? :peaceful and not world.is_admin? id
			if not room.owner == id or not world.can_build? id
				sendto(_("No.  You do not want to do that here."))
				return
			end
		end
		ppl = peopleinroom(args)
		case ppl.size
		when 0
			sendto _("Nobody here by that name")
		when 1
			person = ppl[0]
			if world.is_admin? id
				if world.is_admin? person.id
					sendto _("You can not kill a fellow admin.  Shame on you!")
				else
					sendto _("You smote %{person}!!" % {:person => person.name})
					sendroom _("%{name} smotes %{person} with a lightning bolt from the heavens!!!" % {:name => name, :person => person.name})
					person.make_corpse
				end
			elsif world.can_build? person.id
				sendto _("You are stupid but not THAT stupid!")
			elsif person.account and @account
				if options['player_killing'] == true
					add_event(person.id, id, :show, _("You attack %{person}!!!" % {:person => person.name}))
					add_event(id, person.id, :show, _("%{name} attacks you!!!" % {:name => name}))
					add_event(person.id, id, :showrest, _("%{name} attacks %{person}!!!" % {:name => name, :person => person.name}))
					@targetattack = person.id
					add_combatant(person.id)
				else
					sendto _("You should not attack a fellow player!")
				end
			else # Mobile
				add_event(person.id, id, :show, _("You attack %{person}!!!" % {:person => person.name}))
				add_event(id, person.id, :show, _("%{name} attacks you!!!" % {:name => name}))
				@targetattack = person.id
				add_combatant(person.id)
			end
		else
			sendto _("Which one?")
		end
	end
  end

end