# # file:: cmd_force.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 force command def cmd_force(args) case args when /(\w+) (.+)/ who = $1 what = $2 ppl = [] ppl = peopleinroom(who) case ppl.size when 0 # More than one check current world ppl.clear objs = world.find_objects(who) objs.each { |o| ppl << o if o.is_a? Character and not o.unused } case ppl.size when 0 sendto _("Player/Mobile not found.") when 1 # Because this cmd is so evil we log it log.info "#{name} used FORCE on #{who} to #{what}" ppl[0].parse(what) else sendto _("There are too many. Perhaps you should go to their room.") end when 1 # Because this cmd is so evil we log it log.info "#{name} used FORCE on #{who} to #{what}" ppl[0].parse(what) else sendto _("Which one?") end else sendto _("Force whom to do what?") end end end