# # file:: cmd_heal.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") # Heal a player def cmd_heal(args) case args when nil, "" sendto _("Heal whom?") when "self", "me" @body.assignhp(stats[:maxhp]) @body.bodyparts.each { |bpid| get_object(bpid).crippled = false } set_stat(:hunger, 0) set_stat(:thirst, 0) set_stat(:tired, 0) set_stat(:infection, 0) if not has_attribute? :zombie or has_attribute? :infected del_attribute :zombie if has_attribute? :zombie del_attribute :infected if has_attribute? :infected end sendto _("You feel MUCH better.") else ppl = peopleinroom(args) case ppl.size when 0 sendto _("You do not see them here.") when 1 to = ppl[0] to.body.assignhp(to.stats[:maxhp]) to.body.bodyparts.each { |bpid| get_object(bpid).crippled = false } to.stats[:hunger] = 0 to.stats[:thirst] = 0 to.stats[:tired] = 0 to.stats[:infection] = 0 if not to.has_attribute? :zombie and not to.is_a? Zombie to.del_attribute :zombie if to.has_attribute? :zombie to.del_attribute :infected if to.has_attribute? :infected end sendto _("You heal %{player}." % {:player => to.name}) add_event(id, to.id, :show, _("%{name} waves his hand over you and baths you in light.\nYou feel MUCH better!" % {:name => name})) else sendto _("Which one?") end end end end