From 32688cd8993aba3a9e163a4507a9103b66106b7a Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <the@jeffreyfreeman.me> Date: Fri, 24 Apr 2020 20:43:50 -0400 Subject: [PATCH] Revamped the help system. --- lib/aethyr/core/commands/admin/acarea.rb | 28 +- lib/aethyr/core/commands/admin/acdoor.rb | 28 +- lib/aethyr/core/commands/admin/acexit.rb | 28 +- lib/aethyr/core/commands/admin/acomm.rb | 28 +- lib/aethyr/core/commands/admin/acomment.rb | 28 +- lib/aethyr/core/commands/admin/aconfig.rb | 28 +- lib/aethyr/core/commands/admin/acportal.rb | 28 +- lib/aethyr/core/commands/admin/acprop.rb | 28 +- lib/aethyr/core/commands/admin/acreate.rb | 28 +- lib/aethyr/core/commands/admin/acroom.rb | 28 +- lib/aethyr/core/commands/admin/adelete.rb | 28 +- lib/aethyr/core/commands/admin/adesc.rb | 28 +- lib/aethyr/core/commands/admin/aforce.rb | 28 +- lib/aethyr/core/commands/admin/ahelp.rb | 28 +- lib/aethyr/core/commands/admin/ahide.rb | 28 +- lib/aethyr/core/commands/admin/ainfo.rb | 28 +- lib/aethyr/core/commands/admin/alearn.rb | 28 +- lib/aethyr/core/commands/admin/alist.rb | 28 +- lib/aethyr/core/commands/admin/alog.rb | 28 +- lib/aethyr/core/commands/admin/alook.rb | 28 +- lib/aethyr/core/commands/admin/aput.rb | 28 +- lib/aethyr/core/commands/admin/areact.rb | 28 +- lib/aethyr/core/commands/admin/areas.rb | 28 +- lib/aethyr/core/commands/admin/areload.rb | 28 +- lib/aethyr/core/commands/admin/asave.rb | 28 +- lib/aethyr/core/commands/admin/aset.rb | 28 +- lib/aethyr/core/commands/admin/ashow.rb | 28 +- lib/aethyr/core/commands/admin/astatus.rb | 28 +- lib/aethyr/core/commands/admin/ateach.rb | 28 +- lib/aethyr/core/commands/admin/awatch.rb | 28 +- lib/aethyr/core/commands/admin/awho.rb | 28 +- .../core/commands/admin/deleteplayer.rb | 28 +- lib/aethyr/core/commands/admin/restart.rb | 28 +- lib/aethyr/core/commands/admin/terrain.rb | 28 +- lib/aethyr/core/commands/block.rb | 37 +- lib/aethyr/core/commands/command_handler.rb | 2 +- lib/aethyr/core/commands/dodge.rb | 28 +- lib/aethyr/core/commands/drop.rb | 34 +- lib/aethyr/core/commands/emotes/agree.rb | 28 +- lib/aethyr/core/commands/emotes/back.rb | 28 +- lib/aethyr/core/commands/emotes/blush.rb | 28 +- lib/aethyr/core/commands/emotes/bow.rb | 28 +- lib/aethyr/core/commands/emotes/brb.rb | 28 +- lib/aethyr/core/commands/emotes/bye.rb | 28 +- lib/aethyr/core/commands/emotes/cheer.rb | 28 +- lib/aethyr/core/commands/emotes/cry.rb | 28 +- lib/aethyr/core/commands/emotes/curtsey.rb | 28 +- lib/aethyr/core/commands/emotes/eh.rb | 28 +- lib/aethyr/core/commands/emotes/emote.rb | 28 +- lib/aethyr/core/commands/emotes/er.rb | 28 +- lib/aethyr/core/commands/emotes/ew.rb | 28 +- lib/aethyr/core/commands/emotes/frown.rb | 28 +- lib/aethyr/core/commands/emotes/grin.rb | 28 +- lib/aethyr/core/commands/emotes/hi.rb | 28 +- lib/aethyr/core/commands/emotes/hm.rb | 28 +- lib/aethyr/core/commands/emotes/hug.rb | 28 +- lib/aethyr/core/commands/emotes/huh.rb | 28 +- lib/aethyr/core/commands/emotes/laugh.rb | 28 +- lib/aethyr/core/commands/emotes/no.rb | 28 +- lib/aethyr/core/commands/emotes/nod.rb | 28 +- lib/aethyr/core/commands/emotes/pet.rb | 28 +- lib/aethyr/core/commands/emotes/poke.rb | 28 +- lib/aethyr/core/commands/emotes/ponder.rb | 28 +- lib/aethyr/core/commands/emotes/shrug.rb | 28 +- lib/aethyr/core/commands/emotes/sigh.rb | 28 +- lib/aethyr/core/commands/emotes/skip.rb | 28 +- lib/aethyr/core/commands/emotes/smile.rb | 28 +- lib/aethyr/core/commands/emotes/snicker.rb | 28 +- lib/aethyr/core/commands/emotes/uh.rb | 28 +- lib/aethyr/core/commands/emotes/wave.rb | 28 +- lib/aethyr/core/commands/emotes/yawn.rb | 28 +- lib/aethyr/core/commands/emotes/yes.rb | 28 +- lib/aethyr/core/commands/gait.rb | 28 +- lib/aethyr/core/commands/generic.rb | 381 +++++++++--------- lib/aethyr/core/commands/get.rb | 37 +- lib/aethyr/core/commands/give.rb | 37 +- lib/aethyr/core/commands/inventory.rb | 37 +- lib/aethyr/core/commands/issue.rb | 62 +-- lib/aethyr/core/commands/kick.rb | 28 +- lib/aethyr/core/commands/locking.rb | 40 +- lib/aethyr/core/commands/look.rb | 44 +- lib/aethyr/core/commands/map.rb | 30 +- lib/aethyr/core/commands/more.rb | 37 +- lib/aethyr/core/commands/move.rb | 44 +- lib/aethyr/core/commands/news.rb | 97 +++-- lib/aethyr/core/commands/open.rb | 47 ++- lib/aethyr/core/commands/portal.rb | 28 +- lib/aethyr/core/commands/pose.rb | 28 +- lib/aethyr/core/commands/punch.rb | 28 +- lib/aethyr/core/commands/put.rb | 34 +- lib/aethyr/core/commands/quit.rb | 35 +- lib/aethyr/core/commands/remove.rb | 35 +- lib/aethyr/core/commands/say.rb | 71 ++-- lib/aethyr/core/commands/set.rb | 56 +-- lib/aethyr/core/commands/sit.rb | 49 +-- lib/aethyr/core/commands/skills.rb | 31 +- lib/aethyr/core/commands/slash.rb | 28 +- lib/aethyr/core/commands/stand.rb | 36 +- lib/aethyr/core/commands/tell.rb | 64 +-- lib/aethyr/core/commands/unwield.rb | 48 +-- lib/aethyr/core/commands/wear.rb | 39 +- lib/aethyr/core/commands/whereis.rb | 28 +- lib/aethyr/core/commands/whisper.rb | 50 +-- lib/aethyr/core/commands/wield.rb | 49 +-- 104 files changed, 2183 insertions(+), 1508 deletions(-) diff --git a/lib/aethyr/core/commands/admin/acarea.rb b/lib/aethyr/core/commands/admin/acarea.rb index 24ccc2d..5fdc36c 100644 --- a/lib/aethyr/core/commands/admin/acarea.rb +++ b/lib/aethyr/core/commands/admin/acarea.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acarea class AcareaHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acarea" + see_also = nil + syntax_formats = ["ACAREA [NAME]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acarea"]) + super(player, ["acarea"], AcareaHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^acarea\s+(.*)$/i name = $1.strip acarea({:name => name}) - when /^help (acarea)$/i - action_help_acarea({}) end end private - def action_help_acarea(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acarea(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/acdoor.rb b/lib/aethyr/core/commands/admin/acdoor.rb index 9953924..3c4089e 100644 --- a/lib/aethyr/core/commands/admin/acdoor.rb +++ b/lib/aethyr/core/commands/admin/acdoor.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acdoor class AcdoorHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acdoor" + see_also = nil + syntax_formats = ["ACDOOR [DIRECTION] [EXIT_ROOM]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acdoor"]) + super(player, ["acdoor"], AcdoorHandler.create_help_entries) end def self.object_added(data) @@ -24,19 +41,10 @@ module Aethyr direction = $1.strip exit_room = $2.strip acdoor({:direction => direction, :exit_room => exit_room}) - when /^help (acdoor)$/i - action_help_acdoor({}) end end private - def action_help_acdoor(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acdoor event, player, room exit_room = nil diff --git a/lib/aethyr/core/commands/admin/acexit.rb b/lib/aethyr/core/commands/admin/acexit.rb index c8075dd..183065a 100644 --- a/lib/aethyr/core/commands/admin/acexit.rb +++ b/lib/aethyr/core/commands/admin/acexit.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acexit class AcexitHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acexit" + see_also = nil + syntax_formats = ["ACEXIT [DIRECTION] [EXIT_ROOM]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acexit"]) + super(player, ["acexit"], AcexitHandler.create_help_entries) end def self.object_added(data) @@ -22,19 +39,10 @@ module Aethyr alt_names = [$1.strip] args = [$2.strip] acreate({:object => object, :alt_names => alt_names, :args => args}) - when /^help (acexit)$/i - action_help_acexit({}) end end private - def action_help_acexit(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acreate(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/acomm.rb b/lib/aethyr/core/commands/admin/acomm.rb index 09eb87d..9821e48 100644 --- a/lib/aethyr/core/commands/admin/acomm.rb +++ b/lib/aethyr/core/commands/admin/acomm.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acomm class AcommHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acomm" + see_also = nil + syntax_formats = ["ACOMMENT [OBJECT] [COMMENT]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acomm"]) + super(player, ["acomm"], AcommHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr target = $2 comment = $3 acomment({:target => target, :comment => comment}) - when /^help (acomm)$/i - action_help_acomm({}) end end private - def action_help_acomm(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acomment(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/acomment.rb b/lib/aethyr/core/commands/admin/acomment.rb index fbed91b..268722a 100644 --- a/lib/aethyr/core/commands/admin/acomment.rb +++ b/lib/aethyr/core/commands/admin/acomment.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acomment class AcommentHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acomment" + see_also = nil + syntax_formats = ["ACOMMENT [OBJECT] [COMMENT]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acomment"]) + super(player, ["acomment"], AcommentHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr target = $2 comment = $3 acomment({:target => target, :comment => comment}) - when /^help (acomment)$/i - action_help_acomment({}) end end private - def action_help_acomment(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acomment(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/aconfig.rb b/lib/aethyr/core/commands/admin/aconfig.rb index 8b40f51..0f41725 100644 --- a/lib/aethyr/core/commands/admin/aconfig.rb +++ b/lib/aethyr/core/commands/admin/aconfig.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Aconfig class AconfigHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "aconfig" + see_also = nil + syntax_formats = ["ACONFIG", "ACONFIG RELOAD", "ACONFIG [SETTING] [VALUE]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["aconfig"]) + super(player, ["aconfig"], AconfigHandler.create_help_entries) end def self.object_added(data) @@ -24,19 +41,10 @@ module Aethyr setting = $1 value = $2 aconfig({:setting => setting, :value => value}) - when /^help (aconfig)$/i - action_help_aconfig({}) end end private - def action_help_aconfig(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def aconfig(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/acportal.rb b/lib/aethyr/core/commands/admin/acportal.rb index b7c3edd..bfb2e70 100644 --- a/lib/aethyr/core/commands/admin/acportal.rb +++ b/lib/aethyr/core/commands/admin/acportal.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acportal class AcportalHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acportal" + see_also = nil + syntax_formats = ["ACPORTAL"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acportal"]) + super(player, ["acportal"], AcportalHandler.create_help_entries) end def self.object_added(data) @@ -23,19 +40,10 @@ module Aethyr portal_action = $2 args = [$4] acportal({:object => object, :alt_names => alt_names, :portal_action => portal_action, :args => args}) - when /^help (acportal)$/i - action_help_acportal({}) end end private - def action_help_acportal(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acportal(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/acprop.rb b/lib/aethyr/core/commands/admin/acprop.rb index da94b07..d580acb 100644 --- a/lib/aethyr/core/commands/admin/acprop.rb +++ b/lib/aethyr/core/commands/admin/acprop.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acprop class AcpropHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acprop" + see_also = nil + syntax_formats = ["ACPROP [GENERIC]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acprop"]) + super(player, ["acprop"], AcpropHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = "prop" generic = $1 acreate({:object => object, :generic => generic}) - when /^help (acprop)$/i - action_help_acprop({}) end end private - def action_help_acprop(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acreate(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/acreate.rb b/lib/aethyr/core/commands/admin/acreate.rb index 55c96b6..137c7a6 100644 --- a/lib/aethyr/core/commands/admin/acreate.rb +++ b/lib/aethyr/core/commands/admin/acreate.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acreate class AcreateHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acreate" + see_also = nil + syntax_formats = ["ACREATE [OBJECT_TYPE] [NAME]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acreate"]) + super(player, ["acreate"], AcreateHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $2 name = $3.strip acreate({:object => object, :name => name}) - when /^help (acreate)$/i - action_help_acreate({}) end end private - def action_help_acreate(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acreate(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/acroom.rb b/lib/aethyr/core/commands/admin/acroom.rb index 9f93812..f28578b 100644 --- a/lib/aethyr/core/commands/admin/acroom.rb +++ b/lib/aethyr/core/commands/admin/acroom.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Acroom class AcroomHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "acroom" + see_also = nil + syntax_formats = ["ACROOM [OUT_DIRECTION] [NAME]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["acroom"]) + super(player, ["acroom"], AcroomHandler.create_help_entries) end def self.object_added(data) @@ -22,19 +39,10 @@ module Aethyr in_dir = opposite_dir($1) name = $2 acroom({:out_dir => out_dir, :in_dir => in_dir, :name => name}) - when /^help (acroom)$/i - action_help_acroom({}) end end private - def action_help_acroom(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def acroom(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/adelete.rb b/lib/aethyr/core/commands/admin/adelete.rb index e94ddd9..9f4db48 100644 --- a/lib/aethyr/core/commands/admin/adelete.rb +++ b/lib/aethyr/core/commands/admin/adelete.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Adelete class AdeleteHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "adelete" + see_also = nil + syntax_formats = ["ADELETE [OBJECT]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["adelete"]) + super(player, ["adelete"], AdeleteHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^adelete\s+(.*)$/i object = $1 adelete({:object => object}) - when /^help (adelete)$/i - action_help_adelete({}) end end private - def action_help_adelete(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def adelete(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/adesc.rb b/lib/aethyr/core/commands/admin/adesc.rb index 18d0899..7f8ef15 100644 --- a/lib/aethyr/core/commands/admin/adesc.rb +++ b/lib/aethyr/core/commands/admin/adesc.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Adesc class AdescHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "adesc" + see_also = nil + syntax_formats = ["ADESC [OBJECT] [DESCRIPTION]", "ADESC INROOM [OBJECT] [DESCRIPTION]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["adesc"]) + super(player, ["adesc"], AdescHandler.create_help_entries) end def self.object_added(data) @@ -26,19 +43,10 @@ module Aethyr object = $1 desc = $2 adesc({:object => object, :desc => desc}) - when /^help (adesc)$/i - action_help_adesc({}) end end private - def action_help_adesc(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def adesc(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/aforce.rb b/lib/aethyr/core/commands/admin/aforce.rb index 13d8e2c..6c63e9f 100644 --- a/lib/aethyr/core/commands/admin/aforce.rb +++ b/lib/aethyr/core/commands/admin/aforce.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Aforce class AforceHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "aforce" + see_also = nil + syntax_formats = ["AFORCE [OBJECT] [ACTION]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["aforce"]) + super(player, ["aforce"], AforceHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr target = $1 command = $2 aforce({:target => target, :command => command}) - when /^help (aforce)$/i - action_help_aforce({}) end end private - def action_help_aforce(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def aforce(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/ahelp.rb b/lib/aethyr/core/commands/admin/ahelp.rb index 1d58b04..4c3ec7d 100644 --- a/lib/aethyr/core/commands/admin/ahelp.rb +++ b/lib/aethyr/core/commands/admin/ahelp.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Ahelp class AhelpHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "ahelp" + see_also = nil + syntax_formats = ["AHELP"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["ahelp"]) + super(player, ["ahelp"], AhelpHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^ahelp(.*)$/i object = $1 ahelp({:object => object}) - when /^help (ahelp)$/i - action_help_ahelp({}) end end private - def action_help_ahelp(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def ahelp(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/ahide.rb b/lib/aethyr/core/commands/admin/ahide.rb index b033837..6ee5a7a 100644 --- a/lib/aethyr/core/commands/admin/ahide.rb +++ b/lib/aethyr/core/commands/admin/ahide.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Ahide class AhideHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "ahide" + see_also = nil + syntax_formats = ["AHIDE"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["ahide"]) + super(player, ["ahide"], AhideHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $1 hide = true ahide({:object => object, :hide => hide}) - when /^help (ahide)$/i - action_help_ahide({}) end end private - def action_help_ahide(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def ahide(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/ainfo.rb b/lib/aethyr/core/commands/admin/ainfo.rb index 88b7c9f..5d68380 100644 --- a/lib/aethyr/core/commands/admin/ainfo.rb +++ b/lib/aethyr/core/commands/admin/ainfo.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Ainfo class AinfoHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "ainfo" + see_also = nil + syntax_formats = ["AINFO SET [OBJECT] @[ATTRIBUTE] [VALUE]", "AINFO DELETE [OBJECT] @[ATTRIBUTE]", "AINFO [SHOW|CLEAR] [OBJECT]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["ainfo"]) + super(player, ["ainfo"], AinfoHandler.create_help_entries) end def self.object_added(data) @@ -32,19 +49,10 @@ module Aethyr object = $2 attrib = $3 ainfo({:command => command, :object => object, :attrib => attrib}) - when /^help (ainfo)$/i - action_help_ainfo({}) end end private - def action_help_ainfo(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def ainfo(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/alearn.rb b/lib/aethyr/core/commands/admin/alearn.rb index dcf633c..62c2467 100644 --- a/lib/aethyr/core/commands/admin/alearn.rb +++ b/lib/aethyr/core/commands/admin/alearn.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Alearn class AlearnHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "alearn" + see_also = nil + syntax_formats = ["ALEARN [SKILL]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["alearn"]) + super(player, ["alearn"], AlearnHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^alearn\s+(\w+)$/i skill = $1 alearn({:skill => skill}) - when /^help (alearn)$/i - action_help_alearn({}) end end private - def action_help_alearn(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def alearn(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/alist.rb b/lib/aethyr/core/commands/admin/alist.rb index 8424c99..629eb21 100644 --- a/lib/aethyr/core/commands/admin/alist.rb +++ b/lib/aethyr/core/commands/admin/alist.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Alist class AlistHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "alist" + see_also = nil + syntax_formats = ["ALIST [ATTRIB] [QUERY]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["alist"]) + super(player, ["alist"], AlistHandler.create_help_entries) end def self.object_added(data) @@ -23,19 +40,10 @@ module Aethyr attrib = $2 match = $1 alist({:attrib => attrib, :match => match}) - when /^help (alist)$/i - action_help_alist({}) end end private - def action_help_alist(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def alist(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/alog.rb b/lib/aethyr/core/commands/admin/alog.rb index 235e7d1..975464e 100644 --- a/lib/aethyr/core/commands/admin/alog.rb +++ b/lib/aethyr/core/commands/admin/alog.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Alog class AlogHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "alog" + see_also = nil + syntax_formats = ["ALOG (DEBUG|NORMAL|HIGH|ULTIMATE|OFF)", "ALOG (PLAYER|SERVER|SYSTEM) [LINES]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["alog"]) + super(player, ["alog"], AlogHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr command = $1 value = $3.downcase if $3 alog({:command => command, :value => value}) - when /^help (alog)$/i - action_help_alog({}) end end private - def action_help_alog(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def alog(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/alook.rb b/lib/aethyr/core/commands/admin/alook.rb index 87fdbd2..ab44f46 100644 --- a/lib/aethyr/core/commands/admin/alook.rb +++ b/lib/aethyr/core/commands/admin/alook.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Alook class AlookHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "alook" + see_also = nil + syntax_formats = ["ALOOK [OBJECT]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["alook"]) + super(player, ["alook"], AlookHandler.create_help_entries) end def self.object_added(data) @@ -22,19 +39,10 @@ module Aethyr when /^alook\s+(.*)$/i at = $1 alook({:at => at}) - when /^help (alook)$/i - action_help_alook({}) end end private - def action_help_alook(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def alook(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/aput.rb b/lib/aethyr/core/commands/admin/aput.rb index 3b02d70..b6b91f2 100644 --- a/lib/aethyr/core/commands/admin/aput.rb +++ b/lib/aethyr/core/commands/admin/aput.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Aput class AputHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "aput" + see_also = nil + syntax_formats = ["APUT [OBJECT] IN [CONTAINER]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["aput"]) + super(player, ["aput"], AputHandler.create_help_entries) end def self.object_added(data) @@ -26,19 +43,10 @@ module Aethyr object = $1 in_var = $2 aput({:object => object, :in => in_var}) - when /^help (aput)$/i - action_help_aput({}) end end private - def action_help_aput(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def aput(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/areact.rb b/lib/aethyr/core/commands/admin/areact.rb index 65f8cec..021ae56 100644 --- a/lib/aethyr/core/commands/admin/areact.rb +++ b/lib/aethyr/core/commands/admin/areact.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Areact class AreactHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "areact" + see_also = nil + syntax_formats = ["AREACT LOAD [OBJECT] [FILE]", "AREACT [RELOAD|CLEAR] [OBJECT]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["areact"]) + super(player, ["areact"], AreactHandler.create_help_entries) end def self.object_added(data) @@ -31,19 +48,10 @@ module Aethyr command = $1 action_name = $3 areaction({:object => object, :command => command, :action_name => action_name}) - when /^help (areact)$/i - action_help_areact({}) end end private - def action_help_areact(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def areaction(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/areas.rb b/lib/aethyr/core/commands/admin/areas.rb index 71b69c0..16c5a44 100644 --- a/lib/aethyr/core/commands/admin/areas.rb +++ b/lib/aethyr/core/commands/admin/areas.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Areas class AreasHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "areas" + see_also = nil + syntax_formats = ["AREAS"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["areas"]) + super(player, ["areas"], AreasHandler.create_help_entries) end def self.object_added(data) @@ -19,19 +36,10 @@ module Aethyr case data[:input] when /^areas$/i areas({}) - when /^help (areas)$/i - action_help_areas({}) end end private - def action_help_areas(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def areas(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/areload.rb b/lib/aethyr/core/commands/admin/areload.rb index 1837bf4..fa47c90 100644 --- a/lib/aethyr/core/commands/admin/areload.rb +++ b/lib/aethyr/core/commands/admin/areload.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Areload class AreloadHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "areload" + see_also = nil + syntax_formats = ["ARELOAD [OBJECT]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["areload"]) + super(player, ["areload"], AreloadHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^areload\s+(.*)$/i object = $1 areload({:object => object}) - when /^help (areload)$/i - action_help_areload({}) end end private - def action_help_areload(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def areload(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/asave.rb b/lib/aethyr/core/commands/admin/asave.rb index 1c8c475..83b8401 100644 --- a/lib/aethyr/core/commands/admin/asave.rb +++ b/lib/aethyr/core/commands/admin/asave.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Asave class AsaveHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "asave" + see_also = nil + syntax_formats = ["ASAVE"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["asave"]) + super(player, ["asave"], AsaveHandler.create_help_entries) end def self.object_added(data) @@ -19,19 +36,10 @@ module Aethyr case data[:input] when /^asave$/i asave({}) - when /^help (asave)$/i - action_help_asave({}) end end private - def action_help_asave(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def asave(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/aset.rb b/lib/aethyr/core/commands/admin/aset.rb index 1ad79e0..c3785c1 100644 --- a/lib/aethyr/core/commands/admin/aset.rb +++ b/lib/aethyr/core/commands/admin/aset.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Aset class AsetHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "aset" + see_also = nil + syntax_formats = ["ASET [OBJECT] @[ATTRIBUTE] [VALUE]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["aset", "aset!"]) + super(player, ["aset", "aset!"], AsetHandler.create_help_entries) end def self.object_added(data) @@ -34,19 +51,10 @@ module Aethyr value = $3 force = true aset({:object => object, :attribute => attribute, :value => value, :force => force}) - when /^help (aset|aset!)$/i - action_help_aset({}) end end private - def action_help_aset(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def aset(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/ashow.rb b/lib/aethyr/core/commands/admin/ashow.rb index 3191f81..f1ff2be 100644 --- a/lib/aethyr/core/commands/admin/ashow.rb +++ b/lib/aethyr/core/commands/admin/ashow.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Ashow class AshowHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "ashow" + see_also = nil + syntax_formats = ["ASHOW"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["ashow"]) + super(player, ["ashow"], AshowHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $1 hide = false ahide({:object => object, :hide => hide}) - when /^help (ashow)$/i - action_help_ashow({}) end end private - def action_help_ashow(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def ahide(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/astatus.rb b/lib/aethyr/core/commands/admin/astatus.rb index 39307d5..1a30bdd 100644 --- a/lib/aethyr/core/commands/admin/astatus.rb +++ b/lib/aethyr/core/commands/admin/astatus.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Astatus class AstatusHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "astatus" + see_also = nil + syntax_formats = ["ASTATUS"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["astatus"]) + super(player, ["astatus"], AstatusHandler.create_help_entries) end def self.object_added(data) @@ -19,19 +36,10 @@ module Aethyr case data[:input] when /^astatus/i astatus({}) - when /^help (astatus)$/i - action_help_astatus({}) end end private - def action_help_astatus(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def astatus(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/ateach.rb b/lib/aethyr/core/commands/admin/ateach.rb index d2e21d1..0f133d0 100644 --- a/lib/aethyr/core/commands/admin/ateach.rb +++ b/lib/aethyr/core/commands/admin/ateach.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Ateach class AteachHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "ateach" + see_also = nil + syntax_formats = ["ATEACH [OBJECT] [SKILL]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["ateach"]) + super(player, ["ateach"], AteachHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr target = $1 skill = $2 ateach({:target => target, :skill => skill}) - when /^help (ateach)$/i - action_help_ateach({}) end end private - def action_help_ateach(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def ateach(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/awatch.rb b/lib/aethyr/core/commands/admin/awatch.rb index b014ca6..7424309 100644 --- a/lib/aethyr/core/commands/admin/awatch.rb +++ b/lib/aethyr/core/commands/admin/awatch.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Awatch class AwatchHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "awatch" + see_also = nil + syntax_formats = ["AWATCH"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["awatch"]) + super(player, ["awatch"], AwatchHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr target = $3.downcase if $3 command = $2.downcase if $2 awatch({:target => target, :command => command}) - when /^help (awatch)$/i - action_help_awatch({}) end end private - def action_help_awatch(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def awatch(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/awho.rb b/lib/aethyr/core/commands/admin/awho.rb index 7a68b50..772acef 100644 --- a/lib/aethyr/core/commands/admin/awho.rb +++ b/lib/aethyr/core/commands/admin/awho.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Awho class AwhoHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "awho" + see_also = nil + syntax_formats = ["AWHO"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["awho"]) + super(player, ["awho"], AwhoHandler.create_help_entries) end def self.object_added(data) @@ -19,19 +36,10 @@ module Aethyr case data[:input] when /^awho/i awho({}) - when /^help (awho)$/i - action_help_awho({}) end end private - def action_help_awho(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def awho(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/deleteplayer.rb b/lib/aethyr/core/commands/admin/deleteplayer.rb index c81cffb..e2c0794 100644 --- a/lib/aethyr/core/commands/admin/deleteplayer.rb +++ b/lib/aethyr/core/commands/admin/deleteplayer.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Deleteplayer class DeleteplayerHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "deleteplayer" + see_also = nil + syntax_formats = ["DELETEPLAYER"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["deleteplayer"]) + super(player, ["deleteplayer"], DeleteplayerHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^deleteplayer\s+(\w+)$/i object = $1.downcase delete_player({:object => object}) - when /^help (deleteplayer)$/i - action_help_deleteplayer({}) end end private - def action_help_deleteplayer(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def delete_player(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/restart.rb b/lib/aethyr/core/commands/admin/restart.rb index b66336d..7720a97 100644 --- a/lib/aethyr/core/commands/admin/restart.rb +++ b/lib/aethyr/core/commands/admin/restart.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Restart class RestartHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "restart" + see_also = nil + syntax_formats = ["RESTART"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["restart"]) + super(player, ["restart"], RestartHandler.create_help_entries) end def self.object_added(data) @@ -19,19 +36,10 @@ module Aethyr case data[:input] when /^restart$/i restart({}) - when /^help (restart)$/i - action_help_restart({}) end end private - def action_help_restart(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def restart(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/admin/terrain.rb b/lib/aethyr/core/commands/admin/terrain.rb index 1c2429c..4ec1d45 100644 --- a/lib/aethyr/core/commands/admin/terrain.rb +++ b/lib/aethyr/core/commands/admin/terrain.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Terrain class TerrainHandler < Aethyr::Extend::AdminHandler + + def self.create_help_entries + help_entries = [] + + command = "terrain" + see_also = nil + syntax_formats = ["TERRAIN AREA [TYPE]", "TERRAIN HERE TYPE [TYPE]", "TERRAIN HERE (INDOORS|WATER|UNDERWATER) (YES|NO)"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["terrain"]) + super(player, ["terrain"], TerrainHandler.create_help_entries) end def self.object_added(data) @@ -26,19 +43,10 @@ module Aethyr setting = $2.downcase value = $3 terrain({:target => target, :setting => setting, :value => value}) - when /^help (terrain)$/i - action_help_terrain({}) end end private - def action_help_terrain(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def terrain(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/block.rb b/lib/aethyr/core/commands/block.rb index 7a7aa7c..6e66009 100644 --- a/lib/aethyr/core/commands/block.rb +++ b/lib/aethyr/core/commands/block.rb @@ -6,8 +6,26 @@ module Aethyr module Commands module Block class BlockHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "block" + see_also = ["THRUST", "STATUS"] + syntax_formats = ["BLOCK <target>", "BLOCK"] + aliases = nil + content = <<'EOF' +This is a simple block which uses your weapon to attempt to block an opponent's attack. If you are not wielding a weapon, you will attempt a block with your bare hands. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["block"]) + super(player, ["block"], BlockHandler.create_help_entries) end def self.object_added(data) @@ -20,27 +38,10 @@ module Aethyr when /^block(\s+(.*))?$/i target = $2 simple_block({:target => target}) - when /^help (block)$/i - action_help_block({}) end end private - def action_help_block(event) - @player.output <<'EOF' -Command: Simple Block -Syntax: BLOCK <target> -Syntax: BLOCK - -This is a simple block which uses your weapon to attempt to block an opponent's attack. If you are not wielding a weapon, you will attempt a block with your bare hands. - - -See also: THRUST, STATUS - -EOF - end - - def simple_block(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/command_handler.rb b/lib/aethyr/core/commands/command_handler.rb index 034a393..f263145 100644 --- a/lib/aethyr/core/commands/command_handler.rb +++ b/lib/aethyr/core/commands/command_handler.rb @@ -7,7 +7,7 @@ module Aethyr attr_reader :player def initialize(player, *args) - super(*args) + super() @player = player end diff --git a/lib/aethyr/core/commands/dodge.rb b/lib/aethyr/core/commands/dodge.rb index fc6d4fd..952b771 100644 --- a/lib/aethyr/core/commands/dodge.rb +++ b/lib/aethyr/core/commands/dodge.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Dodge class DodgeHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "dodge" + see_also = nil + syntax_formats = ["DODGE"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["dodge"]) + super(player, ["dodge"], DodgeHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^dodge(\s+(.*))?$/i target = $2 if $2 simple_dodge({:target => target}) - when /^help (dodge)$/i - action_help_dodge({}) end end private - def action_help_dodge(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def simple_dodge(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/drop.rb b/lib/aethyr/core/commands/drop.rb index dec9787..1b86665 100644 --- a/lib/aethyr/core/commands/drop.rb +++ b/lib/aethyr/core/commands/drop.rb @@ -6,8 +6,26 @@ module Aethyr module Commands module Drop class DropHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "drop" + see_also = ["GET", "TAKE", "GRAB"] + syntax_formats = ["DROP [object]"] + aliases = nil + content = <<'EOF' +Removes an object from your inventory and places it gently on the ground. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["drop"]) + super(player, ["drop"], DropHandler.create_help_entries) end def self.object_added(data) @@ -19,8 +37,6 @@ module Aethyr case data[:input] when /^drop\s+((\w+\s*)*)$/i action({ :object => $1.strip }) - when /^help drop$/i - action_help({}) end end @@ -50,18 +66,6 @@ module Aethyr event[:to_blind_other] = "You hear something hit the ground." room.out_event(event) end - - def action_help(event) - @player.output <<'EOF' -Command: Drop -Syntax: DROP [object] - -Removes an object from your inventory and places it gently on the ground. - -See also: GET, TAKE, GRAB - -EOF - end end Aethyr::Extend::HandlerRegistry.register_handler(DropHandler) diff --git a/lib/aethyr/core/commands/emotes/agree.rb b/lib/aethyr/core/commands/emotes/agree.rb index c672fc1..01757ee 100644 --- a/lib/aethyr/core/commands/emotes/agree.rb +++ b/lib/aethyr/core/commands/emotes/agree.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Agree class AgreeHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "agree" + see_also = nil + syntax_formats = ["AGREE"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["agree"]) + super(player, ["agree"], AgreeHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 agree({:object => object, :post => post}) - when /^help (agree)$/i - action_help_agree({}) end end private - def action_help_agree(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def agree(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/back.rb b/lib/aethyr/core/commands/emotes/back.rb index da00347..1a39578 100644 --- a/lib/aethyr/core/commands/emotes/back.rb +++ b/lib/aethyr/core/commands/emotes/back.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Back class BackHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "back" + see_also = nil + syntax_formats = ["BACK"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["back"]) + super(player, ["back"], BackHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 back({:object => object, :post => post}) - when /^help (back)$/i - action_help_back({}) end end private - def action_help_back(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def back(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/blush.rb b/lib/aethyr/core/commands/emotes/blush.rb index 36760c9..ec30761 100644 --- a/lib/aethyr/core/commands/emotes/blush.rb +++ b/lib/aethyr/core/commands/emotes/blush.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Blush class BlushHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "blush" + see_also = nil + syntax_formats = ["BLUSH"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["blush"]) + super(player, ["blush"], BlushHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 blush({:object => object, :post => post}) - when /^help (blush)$/i - action_help_blush({}) end end private - def action_help_blush(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def blush(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/bow.rb b/lib/aethyr/core/commands/emotes/bow.rb index f2a7a24..eb37bb2 100644 --- a/lib/aethyr/core/commands/emotes/bow.rb +++ b/lib/aethyr/core/commands/emotes/bow.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Bow class BowHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "bow" + see_also = nil + syntax_formats = ["BOW"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["bow"]) + super(player, ["bow"], BowHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 bow({:object => object, :post => post}) - when /^help (bow)$/i - action_help_bow({}) end end private - def action_help_bow(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def bow(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/brb.rb b/lib/aethyr/core/commands/emotes/brb.rb index 48ea3d2..9577d62 100644 --- a/lib/aethyr/core/commands/emotes/brb.rb +++ b/lib/aethyr/core/commands/emotes/brb.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Brb class BrbHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "brb" + see_also = nil + syntax_formats = ["BRB"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["brb"]) + super(player, ["brb"], BrbHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 brb({:object => object, :post => post}) - when /^help (brb)$/i - action_help_brb({}) end end private - def action_help_brb(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def brb(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/bye.rb b/lib/aethyr/core/commands/emotes/bye.rb index 18ffeaa..83d70b3 100644 --- a/lib/aethyr/core/commands/emotes/bye.rb +++ b/lib/aethyr/core/commands/emotes/bye.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Bye class ByeHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "bye" + see_also = nil + syntax_formats = ["BYE"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["bye"]) + super(player, ["bye"], ByeHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 bye({:object => object, :post => post}) - when /^help (bye)$/i - action_help_bye({}) end end private - def action_help_bye(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def bye(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/cheer.rb b/lib/aethyr/core/commands/emotes/cheer.rb index 94370d5..d511895 100644 --- a/lib/aethyr/core/commands/emotes/cheer.rb +++ b/lib/aethyr/core/commands/emotes/cheer.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Cheer class CheerHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "cheer" + see_also = nil + syntax_formats = ["CHEER"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["cheer"]) + super(player, ["cheer"], CheerHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 cheer({:object => object, :post => post}) - when /^help (cheer)$/i - action_help_cheer({}) end end private - def action_help_cheer(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def cheer(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/cry.rb b/lib/aethyr/core/commands/emotes/cry.rb index 5ad2e1e..ee7cd4a 100644 --- a/lib/aethyr/core/commands/emotes/cry.rb +++ b/lib/aethyr/core/commands/emotes/cry.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Cry class CryHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "cry" + see_also = nil + syntax_formats = ["CRY"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["cry"]) + super(player, ["cry"], CryHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 cry({:object => object, :post => post}) - when /^help (cry)$/i - action_help_cry({}) end end private - def action_help_cry(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def cry(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/curtsey.rb b/lib/aethyr/core/commands/emotes/curtsey.rb index e87bb77..c007331 100644 --- a/lib/aethyr/core/commands/emotes/curtsey.rb +++ b/lib/aethyr/core/commands/emotes/curtsey.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Curtsey class CurtseyHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "curtsey" + see_also = nil + syntax_formats = ["CURTSEY"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["curtsey"]) + super(player, ["curtsey"], CurtseyHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 curtsey({:object => object, :post => post}) - when /^help (curtsey)$/i - action_help_curtsey({}) end end private - def action_help_curtsey(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def curtsey(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/eh.rb b/lib/aethyr/core/commands/emotes/eh.rb index 77b0402..85130c3 100644 --- a/lib/aethyr/core/commands/emotes/eh.rb +++ b/lib/aethyr/core/commands/emotes/eh.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Eh class EhHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "eh" + see_also = nil + syntax_formats = ["EH"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["eh", "eh?"]) + super(player, ["eh", "eh?"], EhHandler.create_help_entries) end def self.object_added(data) @@ -25,19 +42,10 @@ module Aethyr object = $3 post = $5 eh({:object => object, :post => post}) - when /^help (eh|eh\?)$/i - action_help_eh({}) end end private - def action_help_eh(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def eh(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/emote.rb b/lib/aethyr/core/commands/emotes/emote.rb index 4ad7c32..dea4b75 100644 --- a/lib/aethyr/core/commands/emotes/emote.rb +++ b/lib/aethyr/core/commands/emotes/emote.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Emote class EmoteHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "emote" + see_also = nil + syntax_formats = ["EMOTE"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["emote"]) + super(player, ["emote"], EmoteHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^emote\s+(.*)/i show = $1 emote({:show => show}) - when /^help (emote)$/i - action_help_emote({}) end end private - def action_help_emote(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def emote(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/er.rb b/lib/aethyr/core/commands/emotes/er.rb index ad1dc73..a44f3a0 100644 --- a/lib/aethyr/core/commands/emotes/er.rb +++ b/lib/aethyr/core/commands/emotes/er.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Er class ErHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "er" + see_also = nil + syntax_formats = ["ER"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["er"]) + super(player, ["er"], ErHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 er({:object => object, :post => post}) - when /^help (er)$/i - action_help_er({}) end end private - def action_help_er(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def er(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/ew.rb b/lib/aethyr/core/commands/emotes/ew.rb index 3b63eac..00de224 100644 --- a/lib/aethyr/core/commands/emotes/ew.rb +++ b/lib/aethyr/core/commands/emotes/ew.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Ew class EwHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "ew" + see_also = nil + syntax_formats = ["EW"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["ew"]) + super(player, ["ew"], EwHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 ew({:object => object, :post => post}) - when /^help (ew)$/i - action_help_ew({}) end end private - def action_help_ew(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def ew(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/frown.rb b/lib/aethyr/core/commands/emotes/frown.rb index e3e8d8a..94a17ed 100644 --- a/lib/aethyr/core/commands/emotes/frown.rb +++ b/lib/aethyr/core/commands/emotes/frown.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Frown class FrownHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "frown" + see_also = nil + syntax_formats = ["FROWN"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["frown"]) + super(player, ["frown"], FrownHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 frown({:object => object, :post => post}) - when /^help (frown)$/i - action_help_frown({}) end end private - def action_help_frown(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def frown(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/grin.rb b/lib/aethyr/core/commands/emotes/grin.rb index 9eaccea..fc78376 100644 --- a/lib/aethyr/core/commands/emotes/grin.rb +++ b/lib/aethyr/core/commands/emotes/grin.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Grin class GrinHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "grin" + see_also = nil + syntax_formats = ["GRIN"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["grin"]) + super(player, ["grin"], GrinHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 grin({:object => object, :post => post}) - when /^help (grin)$/i - action_help_grin({}) end end private - def action_help_grin(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def grin(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/hi.rb b/lib/aethyr/core/commands/emotes/hi.rb index f3479fa..16a41ec 100644 --- a/lib/aethyr/core/commands/emotes/hi.rb +++ b/lib/aethyr/core/commands/emotes/hi.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Hi class HiHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "hi" + see_also = nil + syntax_formats = ["HI"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["hi"]) + super(player, ["hi"], HiHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 hi({:object => object, :post => post}) - when /^help (hi)$/i - action_help_hi({}) end end private - def action_help_hi(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def hi(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/hm.rb b/lib/aethyr/core/commands/emotes/hm.rb index 395038e..1681e11 100644 --- a/lib/aethyr/core/commands/emotes/hm.rb +++ b/lib/aethyr/core/commands/emotes/hm.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Hm class HmHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "hm" + see_also = nil + syntax_formats = ["HM"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["hm"]) + super(player, ["hm"], HmHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 hm({:object => object, :post => post}) - when /^help (hm)$/i - action_help_hm({}) end end private - def action_help_hm(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def hm(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/hug.rb b/lib/aethyr/core/commands/emotes/hug.rb index f0944eb..2516803 100644 --- a/lib/aethyr/core/commands/emotes/hug.rb +++ b/lib/aethyr/core/commands/emotes/hug.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Hug class HugHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "hug" + see_also = nil + syntax_formats = ["HUG"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["hug"]) + super(player, ["hug"], HugHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 hug({:object => object, :post => post}) - when /^help (hug)$/i - action_help_hug({}) end end private - def action_help_hug(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def hug(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/huh.rb b/lib/aethyr/core/commands/emotes/huh.rb index 0736492..cb91a8f 100644 --- a/lib/aethyr/core/commands/emotes/huh.rb +++ b/lib/aethyr/core/commands/emotes/huh.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Huh class HuhHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "huh" + see_also = nil + syntax_formats = ["HUH"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["huh"]) + super(player, ["huh"], HuhHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 huh({:object => object, :post => post}) - when /^help (huh)$/i - action_help_huh({}) end end private - def action_help_huh(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def huh(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/laugh.rb b/lib/aethyr/core/commands/emotes/laugh.rb index e0804c1..dd12ce6 100644 --- a/lib/aethyr/core/commands/emotes/laugh.rb +++ b/lib/aethyr/core/commands/emotes/laugh.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Laugh class LaughHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "laugh" + see_also = nil + syntax_formats = ["LAUGH"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["laugh"]) + super(player, ["laugh"], LaughHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 laugh({:object => object, :post => post}) - when /^help (laugh)$/i - action_help_laugh({}) end end private - def action_help_laugh(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def laugh(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/no.rb b/lib/aethyr/core/commands/emotes/no.rb index 0a4767d..0e7ccad 100644 --- a/lib/aethyr/core/commands/emotes/no.rb +++ b/lib/aethyr/core/commands/emotes/no.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module No class NoHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "no" + see_also = nil + syntax_formats = ["NO"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["no"]) + super(player, ["no"], NoHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 no({:object => object, :post => post}) - when /^help (no)$/i - action_help_no({}) end end private - def action_help_no(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def no(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/nod.rb b/lib/aethyr/core/commands/emotes/nod.rb index 08dbb5c..bbfc7b5 100644 --- a/lib/aethyr/core/commands/emotes/nod.rb +++ b/lib/aethyr/core/commands/emotes/nod.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Nod class NodHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "nod" + see_also = nil + syntax_formats = ["NOD"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["nod"]) + super(player, ["nod"], NodHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 nod({:object => object, :post => post}) - when /^help (nod)$/i - action_help_nod({}) end end private - def action_help_nod(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def nod(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/pet.rb b/lib/aethyr/core/commands/emotes/pet.rb index 7d5407c..ac8ae84 100644 --- a/lib/aethyr/core/commands/emotes/pet.rb +++ b/lib/aethyr/core/commands/emotes/pet.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Pet class PetHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "pet" + see_also = nil + syntax_formats = ["PET"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["pet"]) + super(player, ["pet"], PetHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 pet({:object => object, :post => post}) - when /^help (pet)$/i - action_help_pet({}) end end private - def action_help_pet(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def pet(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/poke.rb b/lib/aethyr/core/commands/emotes/poke.rb index 18558e3..14fa437 100644 --- a/lib/aethyr/core/commands/emotes/poke.rb +++ b/lib/aethyr/core/commands/emotes/poke.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Poke class PokeHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "poke" + see_also = nil + syntax_formats = ["POKE"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["poke"]) + super(player, ["poke"], PokeHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 poke({:object => object, :post => post}) - when /^help (poke)$/i - action_help_poke({}) end end private - def action_help_poke(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def poke(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/ponder.rb b/lib/aethyr/core/commands/emotes/ponder.rb index b5fbcad..0d18d4f 100644 --- a/lib/aethyr/core/commands/emotes/ponder.rb +++ b/lib/aethyr/core/commands/emotes/ponder.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Ponder class PonderHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "ponder" + see_also = nil + syntax_formats = ["PONDER"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["ponder"]) + super(player, ["ponder"], PonderHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 ponder({:object => object, :post => post}) - when /^help (ponder)$/i - action_help_ponder({}) end end private - def action_help_ponder(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def ponder(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/shrug.rb b/lib/aethyr/core/commands/emotes/shrug.rb index f348a64..f0ad86f 100644 --- a/lib/aethyr/core/commands/emotes/shrug.rb +++ b/lib/aethyr/core/commands/emotes/shrug.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Shrug class ShrugHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "shrug" + see_also = nil + syntax_formats = ["SHRUG"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["shrug"]) + super(player, ["shrug"], ShrugHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 shrug({:object => object, :post => post}) - when /^help (shrug)$/i - action_help_shrug({}) end end private - def action_help_shrug(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def shrug(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/sigh.rb b/lib/aethyr/core/commands/emotes/sigh.rb index d8485bf..09dd540 100644 --- a/lib/aethyr/core/commands/emotes/sigh.rb +++ b/lib/aethyr/core/commands/emotes/sigh.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Sigh class SighHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "sigh" + see_also = nil + syntax_formats = ["SIGH"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["sigh"]) + super(player, ["sigh"], SighHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 sigh({:object => object, :post => post}) - when /^help (sigh)$/i - action_help_sigh({}) end end private - def action_help_sigh(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def sigh(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/skip.rb b/lib/aethyr/core/commands/emotes/skip.rb index 105e193..36bf852 100644 --- a/lib/aethyr/core/commands/emotes/skip.rb +++ b/lib/aethyr/core/commands/emotes/skip.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Skip class SkipHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "skip" + see_also = nil + syntax_formats = ["SKIP"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["skip"]) + super(player, ["skip"], SkipHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 skip({:object => object, :post => post}) - when /^help (skip)$/i - action_help_skip({}) end end private - def action_help_skip(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def skip(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/smile.rb b/lib/aethyr/core/commands/emotes/smile.rb index d2c88b9..0ef2b2e 100644 --- a/lib/aethyr/core/commands/emotes/smile.rb +++ b/lib/aethyr/core/commands/emotes/smile.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Smile class SmileHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "smile" + see_also = nil + syntax_formats = ["SMILE"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["smile"]) + super(player, ["smile"], SmileHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 smile({:object => object, :post => post}) - when /^help (smile)$/i - action_help_smile({}) end end private - def action_help_smile(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def smile(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/snicker.rb b/lib/aethyr/core/commands/emotes/snicker.rb index 55932f6..19a93fd 100644 --- a/lib/aethyr/core/commands/emotes/snicker.rb +++ b/lib/aethyr/core/commands/emotes/snicker.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Snicker class SnickerHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "snicker" + see_also = nil + syntax_formats = ["SNICKER"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["snicker"]) + super(player, ["snicker"], SnickerHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 snicker({:object => object, :post => post}) - when /^help (snicker)$/i - action_help_snicker({}) end end private - def action_help_snicker(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def snicker(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/uh.rb b/lib/aethyr/core/commands/emotes/uh.rb index 32f314c..3817845 100644 --- a/lib/aethyr/core/commands/emotes/uh.rb +++ b/lib/aethyr/core/commands/emotes/uh.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Uh class UhHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "uh" + see_also = nil + syntax_formats = ["UH"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["uh"]) + super(player, ["uh"], UhHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 uh({:object => object, :post => post}) - when /^help (uh)$/i - action_help_uh({}) end end private - def action_help_uh(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def uh(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/wave.rb b/lib/aethyr/core/commands/emotes/wave.rb index 8a4c5b6..fc921c9 100644 --- a/lib/aethyr/core/commands/emotes/wave.rb +++ b/lib/aethyr/core/commands/emotes/wave.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Wave class WaveHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "wave" + see_also = nil + syntax_formats = ["WAVE"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["wave"]) + super(player, ["wave"], WaveHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 wave({:object => object, :post => post}) - when /^help (wave)$/i - action_help_wave({}) end end private - def action_help_wave(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def wave(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/yawn.rb b/lib/aethyr/core/commands/emotes/yawn.rb index c3dd414..6fe2fdb 100644 --- a/lib/aethyr/core/commands/emotes/yawn.rb +++ b/lib/aethyr/core/commands/emotes/yawn.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Yawn class YawnHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "yawn" + see_also = nil + syntax_formats = ["YAWN"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["yawn"]) + super(player, ["yawn"], YawnHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 yawn({:object => object, :post => post}) - when /^help (yawn)$/i - action_help_yawn({}) end end private - def action_help_yawn(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def yawn(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/emotes/yes.rb b/lib/aethyr/core/commands/emotes/yes.rb index 689bcdd..98b5ed6 100644 --- a/lib/aethyr/core/commands/emotes/yes.rb +++ b/lib/aethyr/core/commands/emotes/yes.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Yes class YesHandler < Aethyr::Extend::EmoteHandler + + def self.create_help_entries + help_entries = [] + + command = "yes" + see_also = nil + syntax_formats = ["YES"] + aliases = nil + content = <<'EOF' +Please see help for emote instead. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["yes"]) + super(player, ["yes"], YesHandler.create_help_entries) end def self.object_added(data) @@ -21,19 +38,10 @@ module Aethyr object = $3 post = $5 yes({:object => object, :post => post}) - when /^help (yes)$/i - action_help_yes({}) end end private - def action_help_yes(event) - @player.output <<'EOF' -Please see help for emote instead. -EOF - end - - def yes(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/gait.rb b/lib/aethyr/core/commands/gait.rb index 75ef414..ab88b59 100644 --- a/lib/aethyr/core/commands/gait.rb +++ b/lib/aethyr/core/commands/gait.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Gait class GaitHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "gait" + see_also = nil + syntax_formats = ["GAIT"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["gait"]) + super(player, ["gait"], GaitHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^gait(\s+(.*))?$/i phrase = $2 if $2 gait({:phrase => phrase}) - when /^help (gait)$/i - action_help_gait({}) end end private - def action_help_gait(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def gait(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/generic.rb b/lib/aethyr/core/commands/generic.rb index b89b055..ea55ba4 100644 --- a/lib/aethyr/core/commands/generic.rb +++ b/lib/aethyr/core/commands/generic.rb @@ -7,8 +7,192 @@ module Aethyr module Commands module Generic class GenericHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "health" + see_also = ["STATUS", "HUNGER"] + syntax_formats = ["HEALTH"] + aliases = nil + content = <<'EOF' +Shows you how healthy you are. + +You can be: + at full health + a bit bruised + a little beat up + slightly injured + quite injured + slightly wounded + wounded in several places + heavily wounded + bleeding profusely and in serious pain + nearly dead + dead + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "satiety" + see_also = ["STAT", "HEALTH"] + syntax_formats = ["HUNGER", "SATIETY"] + aliases = nil + content = <<'EOF' +Shows you how hungry you are. + +You can be: + completely stuffed + full and happy + full and happy + satisfied + not hungry + slightly hungry + slightly hungry + peckish + hungry + very hungry + famished + starving + literally dying of hunger + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "status" + see_also = ["INVENTORY", "HUNGER", "HEALTH"] + syntax_formats = ["STATUS", "STAT", "ST"] + aliases = nil + content = <<'EOF' +Shows your current health, hunger/satiety, and position. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "fill" + see_also = nil + syntax_formats = ["FILL [container] FROM [source]"] + aliases = nil + content = <<'EOF' +Fill a container from a source + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "date_time" + see_also = nil + syntax_formats = ["DATE"] + aliases = nil + content = <<'EOF' +Date and Time + + TIME + +Shows the current date and time in Aethyr. Not completely done yet, but it is a first step. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "who" + see_also = nil + syntax_formats = ["WHO"] + aliases = nil + content = <<'EOF' +This will list everyone else who is currently in Aethyr and where they happen to be at the moment. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "deleteme" + see_also = nil + syntax_formats = ["DELETE ME PLEASE"] + aliases = nil + content = <<'EOF' +Deleting Your Character + +In case you ever need to do so, you can remove your character from the game. Quite permanently. You will need to enter your password as confirmation and that's it. You will be wiped out of time and memory. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "write" + see_also = nil + syntax_formats = ["WRITE [target]"] + aliases = nil + content = <<'EOF' +Write something on the specified target. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "taste" + see_also = nil + syntax_formats = ["TASTE [target]"] + aliases = nil + content = <<'EOF' +Taste the specified target. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "smell" + see_also = nil + syntax_formats = ["SMELL [target]"] + aliases = nil + content = <<'EOF' +Smell the specified target. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "listen" + see_also = nil + syntax_formats = ["LISTEN [target]"] + aliases = nil + content = <<'EOF' +Listen to the specified target. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "feel" + see_also = nil + syntax_formats = ["FEEL [target]"] + aliases = nil + content = <<'EOF' +Feel the specified target. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ['date', 'delete', 'feel', 'taste', 'smell', 'sniff', 'lick', 'listen', 'health', 'hunger', 'satiety', 'shut', 'status', 'stat', 'st', 'time', 'typo', 'who', 'write']) + super(player, ['date', 'delete', 'feel', 'taste', 'smell', 'sniff', 'lick', 'listen', 'health', 'hunger', 'satiety', 'shut', 'status', 'stat', 'st', 'time', 'typo', 'who', 'write'], GenericHandler.create_help_entries) end def self.object_added(data) @@ -45,30 +229,6 @@ module Aethyr action_time({}) when /^date$/i action_date({}) - when /^help (delete|delete me please)$/i - action_help_deleteme({}) - when /^help health$/i - action_help_health({}) - when /^help (satiety|hunger)$/i - action_help_satiety({}) - when /^help (st|stat|status)$/i - action_help_status({}) - when /^help write/i - action_help_write({ :target => $1.strip}) - when /^help listen$/i - action_help_listen({ :target => $3}) - when /^help (smell|sniff)$/i - action_help_smell({ :target => $3}) - when /^help (taste|lick)$/i - action_help_taste({ :target => $3}) - when /^help feel$/i - action_help_feel({ :target => $3}) - when /^help who$/i - action_help_who({}) - when /^help (date|time)$/i - action_help_date_time({}) - when /^help fill$/i - action_help_fill({}) end end @@ -77,86 +237,16 @@ module Aethyr def action_health(event) @player.output "You are #{@player.health}." end - - def action_help_health(event) - @player.output <<'EOF' -Command: Health -Syntax: HEALTH - -Shows you how healthy you are. - -You can be: - at full health - a bit bruised - a little beat up - slightly injured - quite injured - slightly wounded - wounded in several places - heavily wounded - bleeding profusely and in serious pain - nearly dead - dead - -See also: STATUS, HUNGER - -EOF - end - #Display hunger. def action_satiety(event) @player.output "You are #{@player.satiety}." end - - def action_help_satiety(event) - @player.output <<'EOF' -Command: Hunger (or Satiety) -Syntax: HUNGER -Syntax: SATIETY - -Shows you how hungry you are. - -You can be: - completely stuffed - full and happy - full and happy - satisfied - not hungry - slightly hungry - slightly hungry - peckish - hungry - very hungry - famished - starving - literally dying of hunger - -See also: STAT HEALTH - -EOF - end - #Display status. def action_status(event) @player.output("You are #{@player.health}.") @player.output("You are feeling #{@player.satiety}.") @player.output "You are currently #{@player.pose || 'standing up'}." end - - def action_help_status(event) - @player.output <<'EOF' -Command: Status -Syntax: STATUS -Syntax: STAT -Syntax: ST - -Shows your current health, hunger/satiety, and position. - -See also: INVENTORY, HUNGER, HEALTH - -EOF - end - #Fill something. def action_fill(event) room = $manager.get_object(@player.container) @@ -186,17 +276,6 @@ EOF return end end - - def action_help_fill(event) - @player.output <<'EOF' -Command: Fill -Syntax: FILL [container] FROM [source] - -Fill a container from a source - -EOF - end - #Display time. def action_time(event) @player.output $manager.time @@ -206,19 +285,6 @@ EOF def action_date(event) @player.output $manager.date end - - def action_help_date_time(event) - @player.output <<'EOF' -Date and Time - -Syntax: DATE - TIME - -Shows the current date and time in Aethyr. Not completely done yet, but it is a first step. - -EOF - end - #Show who is in the game. def action_who(event) players = $manager.find_all("class", Player) @@ -230,17 +296,6 @@ EOF @player.output output end - - def action_help_who(event) - @player.output <<'EOF' -Command: Who -Syntax: WHO - -This will list everyone else who is currently in Aethyr and where they happen to be at the moment. - -EOF - end - #Delete your player. def action_deleteme(event) if event[:password] @@ -261,18 +316,6 @@ EOF end end end - - def action_help_deleteme(event) - @player.output <<'EOF' -Deleting Your Character - -Syntax: DELETE ME PLEASE - -In case you ever need to do so, you can remove your character from the game. Quite permanently. You will need to enter your password as confirmation and that's it. You will be wiped out of time and memory. - -EOF - end - #Write something. def action_write(event) object = @player.search_inv(event[:target]) @@ -296,17 +339,6 @@ EOF @player.output "You finish your writing." end end - - def action_help_write(event) - @player.output <<'EOF' -Command: Write -Syntax: WRITE [target] - -Write something on the specified target. - -EOF - end - def action_taste(event) room = $manager.get_object(@player.container) object = @player.search_inv(event[:target]) || room.find(event[:target]) @@ -330,17 +362,6 @@ EOF event[:to_other] = "#{@player.name} hesitantly sticks out #{@player.pronoun(:possessive)} tongue and licks #{object.name}." room.out_event event end - - def action_help_taste(event) - @player.output <<'EOF' -Command: Taste -Syntax: TASTE [target] - -Taste the specified target. - -EOF - end - def action_smell(event) room = $manager.get_object(@player.container) if event[:target].nil? @@ -384,17 +405,6 @@ EOF event[:to_other] = "#{@player.name} thrusts #{@player.pronoun(:possessive)} nose at #{object.name} and sniffs." room.out_event event end - - def action_help_smell(event) - @player.output <<'EOF' -Command: Smell -Syntax: SMELL [target] - -Smell the specified target. - -EOF - end - def action_listen(event) room = $manager.get_object(@player.container) if event[:target].nil? @@ -430,17 +440,6 @@ EOF event[:to_other] = "#{@player.name} bends #{@player.pronoun(:possessive)} head towards #{object.name} and listens." room.out_event event end - - def action_help_listen(event) - @player.output <<'EOF' -Command: Listen -Syntax: LISTEN [target] - -Listen to the specified target. - -EOF - end - def action_feel(event) room = $manager.get_object(@player.container) object = @player.search_inv(event[:target]) || room.find(event[:target]) @@ -464,16 +463,6 @@ EOF event[:to_other] = "#{@player.name} reaches out #{@player.pronoun(:possessive)} hand and touches #{object.name}." room.out_event event end - - def action_help_feel(event) - @player.output <<'EOF' -Command: Feel -Syntax: FEEL [target] - -Feel the specified target. - -EOF - end end Aethyr::Extend::HandlerRegistry.register_handler(GenericHandler) diff --git a/lib/aethyr/core/commands/get.rb b/lib/aethyr/core/commands/get.rb index 85b2dda..e8745ce 100644 --- a/lib/aethyr/core/commands/get.rb +++ b/lib/aethyr/core/commands/get.rb @@ -6,8 +6,26 @@ module Aethyr module Commands module Get class GetHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "get" + see_also = ["GIVE"] + syntax_formats = ["GET [object]", "GRAB [object'", "TAKE [object]"] + aliases = ["grab", "take"] + content = <<'EOF' +Pick up an object and put it in your inventory. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["get", "grab", "take"]) + super(player, ["get", "grab", "take"], GetHandler.create_help_entries) end def self.object_added(data) @@ -21,27 +39,10 @@ module Aethyr action({ :object => $2.strip, :from => $5 }) when /^(get|grab|take)\s+(.*)$/i action({ :object => $2.strip }) - when /^help (get|grab|take)$/i - action_help({}) end end private - def action_help(event) - @player.output <<'EOF' -Command: Get -Command: Grab -Command: Take -Syntax: GET [object] -Syntax: GRAB [object' -Syntax: TAKE [object] - -Pick up an object and put it in your inventory. - -See also: GIVE - -EOF - end #Gets (or takes) an object and puts it in the player's inventory. def action(event) diff --git a/lib/aethyr/core/commands/give.rb b/lib/aethyr/core/commands/give.rb index 2a1adbf..a5321e5 100644 --- a/lib/aethyr/core/commands/give.rb +++ b/lib/aethyr/core/commands/give.rb @@ -6,8 +6,28 @@ module Aethyr module Commands module Give class GiveHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "give" + see_also = ["GET"] + syntax_formats = ["GIVE [object] TO [person]"] + aliases = nil + content = <<'EOF' +Give an object to someone else. Beware, though, they may not want to give it back. + +At the moment, the object must be in your inventory. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["give"]) + super(player, ["give"], GiveHandler.create_help_entries) end def self.object_added(data) @@ -19,25 +39,10 @@ module Aethyr case data[:input] when /^give\s+((\w+\s*)*)\s+to\s+(\w+)/i action({ :item => $2.strip, :to => $3 }) - when /^help give$/i - action_help({}) end end private - def action_help(event) - @player.output <<'EOF' -Command: Give -Syntax: GIVE [object] TO [person] - -Give an object to someone else. Beware, though, they may not want to give it back. - -At the moment, the object must be in your inventory. - -See also: GET - -EOF - end #Gives an item to someone else. def action(event) diff --git a/lib/aethyr/core/commands/inventory.rb b/lib/aethyr/core/commands/inventory.rb index 84d81ab..c1cbb02 100644 --- a/lib/aethyr/core/commands/inventory.rb +++ b/lib/aethyr/core/commands/inventory.rb @@ -6,8 +6,28 @@ module Aethyr module Commands module Inventory class InventoryHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "inventory" + see_also = ["TAKE", "DROP", "WEAR", "REMOVE"] + syntax_formats = ["INVENTORY"] + aliases = ["i", "inv"] + content = <<'EOF' +Displays what you are holding and wearing. + +'i' and 'inv' are shortcuts for inventory. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["i", "inv", "inventory"]) + super(player, ["i", "inv", "inventory"], InventoryHandler.create_help_entries) end def self.object_added(data) @@ -19,25 +39,10 @@ module Aethyr case data[:input] when /^(i|inv|inventory)$/i action({}) - when /^help (i|inv|inventory)$/i - action_help({}) end end private - def action_help(event) - player.output <<'EOF' -Command: Inventory -Syntax: INVENTORY - -Displays what you are holding and wearing. - -'i' and 'inv' are shortcuts for inventory. - - -See also: TAKE, DROP, WEAR, REMOVE -EOF - end #Shows the inventory of the player. def action(event) diff --git a/lib/aethyr/core/commands/issue.rb b/lib/aethyr/core/commands/issue.rb index 30ea3a3..a236431 100644 --- a/lib/aethyr/core/commands/issue.rb +++ b/lib/aethyr/core/commands/issue.rb @@ -6,8 +6,38 @@ module Aethyr module Commands module Issue class IssueHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "issue" + see_also = nil + syntax_formats = ["[BUG|IDEA|TYPO] [issue]", "[BUG|IDEA|TYPO] [id number]", "[BUG|IDEA|TYPO] LIST", "[BUG|IDEA|TYPO] STATUS [id_number] [status]", "[BUG|IDEA|TYPO] [SHOW|ADD|DEL] [id_number]"] + aliases = ["bug", "typo", "idea"] + content = <<'EOF' +These commands allow players and administrators to report and manipulate feedback about the game. The commands are essentially identical, but should be used to report different things. For the rest of this description, BUG is used. + +Note that players can only see and edit their own feedback, while adminsitrators will see them all. + +BUG [issue] is used to make the initial report. +BUG LIST will list all reports. +BUG ADD can be used to append comments to a report. +BUG STATUS can be used to change the status of a report to a different value (administrators only). + +Examples: +bug When I hit a dwarf with my axe, it doesn't do any damage. +bug list +bug 1 +bug add 1 Actually, this only happens with battleaxes, not all axes. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["bug", "typo", "idea"]) + super(player, ["bug", "typo", "idea"], IssueHandler.create_help_entries) end def self.object_added(data) @@ -27,40 +57,10 @@ module Aethyr action({ :itype => $1.downcase.to_sym, :option => $2.downcase, :value => $4 }) when /^(bug|typo|idea)\s+(.*)$/i action({ :itype => $1.downcase.to_sym, :option => "new", :value => $2 }) - when /^help (bug|typo|idea)$/i - action_help({}) end end private - def action_help(event) - player.output <<'EOF' -Command: Bug -Command: Idea -Command: Typo -Syntax: [BUG|IDEA|TYPO] [issue] -Syntax: [BUG|IDEA|TYPO] [id number] -Syntax: [BUG|IDEA|TYPO] LIST -Syntax: [BUG|IDEA|TYPO] STATUS [id_number] [status] -Syntax: [BUG|IDEA|TYPO] [SHOW|ADD|DEL] [id_number] - -These commands allow players and administrators to report and manipulate feedback about the game. The commands are essentially identical, but should be used to report different things. For the rest of this description, BUG is used. - -Note that players can only see and edit their own feedback, while adminsitrators will see them all. - -BUG [issue] is used to make the initial report. -BUG LIST will list all reports. -BUG ADD can be used to append comments to a report. -BUG STATUS can be used to change the status of a report to a different value (administrators only). - -Examples: -bug When I hit a dwarf with my axe, it doesn't do any damage. -bug list -bug 1 -bug add 1 Actually, this only happens with battleaxes, not all axes. -EOF - end - def action(event) case event[:option] when "new" diff --git a/lib/aethyr/core/commands/kick.rb b/lib/aethyr/core/commands/kick.rb index c9a0653..70fa36a 100644 --- a/lib/aethyr/core/commands/kick.rb +++ b/lib/aethyr/core/commands/kick.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Kick class KickHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "kick" + see_also = nil + syntax_formats = ["KICK"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["kick"]) + super(player, ["kick"], KickHandler.create_help_entries) end def self.object_added(data) @@ -22,19 +39,10 @@ module Aethyr when /^kick\s+(.*)$/i target = $1 kick({:target => target}) - when /^help (kick)$/i - action_help_kick({}) end end private - def action_help_kick(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def kick(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/locking.rb b/lib/aethyr/core/commands/locking.rb index b777a55..40d1179 100644 --- a/lib/aethyr/core/commands/locking.rb +++ b/lib/aethyr/core/commands/locking.rb @@ -6,8 +6,28 @@ module Aethyr module Commands module Locking class LockingHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "locking" + see_also = ["OPEN", "CLOSE"] + syntax_formats = ["LOCK [object or direction]", "UNLOCK [object or direction]"] + aliases = ["lock", "unlock"] + content = <<'EOF' +Lock or unlock the given object, if you have a key for it. + +Note that you can lock a door while it is open, then close it. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["lock", "unlock"]) + super(player, ["lock", "unlock"], LockingHandler.create_help_entries) end def self.object_added(data) @@ -21,28 +41,10 @@ module Aethyr action_lock({ :object => $1 }) when /^unlock\s+(.*)$/i action_unlock({ :object => $1 }) - when /^help (lock|unlock)$/i - action_help({}) end end private - def action_help(event) - @player.output <<'EOF' -Command: Lock -Command: Unlock -Syntax: LOCK [object or direction] -Syntax: UNLOCK [object or direction] - -Lock or unlock the given object, if you have a key for it. - -Note that you can lock a door while it is open, then close it. - -See also: OPEN, CLOSE - -EOF - end - def action_lock(event) room = $manager.get_object(@player.container) object = @player.search_inv(event[:object]) || room.find(event[:object]) diff --git a/lib/aethyr/core/commands/look.rb b/lib/aethyr/core/commands/look.rb index 8ac3fc8..ccc760f 100644 --- a/lib/aethyr/core/commands/look.rb +++ b/lib/aethyr/core/commands/look.rb @@ -6,8 +6,31 @@ module Aethyr module Commands module Look class LookHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "look" + see_also = nil + syntax_formats = ["LOOK", "LOOK [object]", "LOOK IN [object]"] + aliases = ["l"] + content = <<'EOF' +Look by itself will show you your surroundings. + +Look followed by an object will look at that object. + +Look IN will look inside of a container (if it is open). + +'l' is a shortcut for look. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["l", "look"]) + super(player, ["l", "look"], LookHandler.create_help_entries) end def self.object_added(data) @@ -23,29 +46,10 @@ module Aethyr action({ :in => $3 }) when /^(l|look)\s+(.*)$/i action({ :at => $2 }) - when /^help (l|look)$/i - action_help({}) end end private - def action_help(event) - @player.output <<'EOF' -Command: Look -Syntax: LOOK -Syntax: LOOK [object] -Syntax: LOOK IN [object] - -Look by itself will show you your surroundings. - -Look followed by an object will look at that object. - -Look IN will look inside of a container (if it is open). - -'l' is a shortcut for look. -EOF - end - def action(event) room = $manager.get_object(@player.container) if @player.blind? diff --git a/lib/aethyr/core/commands/map.rb b/lib/aethyr/core/commands/map.rb index d493375..df6b787 100644 --- a/lib/aethyr/core/commands/map.rb +++ b/lib/aethyr/core/commands/map.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Map class MapHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "map" + see_also = nil + syntax_formats = ["MAP"] + aliases = ["m"] + content = <<'EOF' +Displays a map of the area. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["m", "map"]) + super(player, ["m", "map"], MapHandler.create_help_entries) end def self.object_added(data) @@ -19,21 +36,10 @@ module Aethyr case data[:input] when /^(m|map)$/i action({}) - when /^help (m|map)$/i - action_help({}) end end private - def action_help(event) - player.output <<'EOF' -Command: Map -Syntax: MAP - -Displays a map of the area. -EOF - end - def action(event) room = $manager.get_object(@player.container) player.output(room.area.render_map(player, room.area.position(room))) diff --git a/lib/aethyr/core/commands/more.rb b/lib/aethyr/core/commands/more.rb index 26ff0f9..1366001 100644 --- a/lib/aethyr/core/commands/more.rb +++ b/lib/aethyr/core/commands/more.rb @@ -6,8 +6,28 @@ module Aethyr module Commands module More class MoreHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "more" + see_also = ["PAGELENGTH"] + syntax_formats = ["MORE"] + aliases = nil + content = <<'EOF' +When the output from the last command was too long to display you can issue this +command to see the next page. If there are multiple pages then this command can +be used multiple times. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["more"]) + super(player, ["more"], MoreHandler.create_help_entries) end def self.object_added(data) @@ -19,8 +39,6 @@ module Aethyr case data[:input] when /^more/i action({}) - when /^help more/i - action_help({}) end end @@ -28,19 +46,6 @@ module Aethyr def action(event) player.more end - - def action_help(event) - player.output <<'EOF' -Command: More -Syntax: MORE - -When the output from the last command was too long to display you can issue this -command to see the next page. If there are multiple pages then this command can -be used multiple times. - -See also: PAGELENGTH -EOF - end end Aethyr::Extend::HandlerRegistry.register_handler(MoreHandler) diff --git a/lib/aethyr/core/commands/move.rb b/lib/aethyr/core/commands/move.rb index e26feab..f2c4b6c 100644 --- a/lib/aethyr/core/commands/move.rb +++ b/lib/aethyr/core/commands/move.rb @@ -8,10 +8,34 @@ module Aethyr module Move class MoveHandler < Aethyr::Extend::CommandHandler + def self.create_help_entries + help_entries = [] + + command = "move" + see_also = nil + syntax_formats = ["GO [direction or exit]"] + aliases = ["go", "east", "west", "northeast", "northwest", "north", "southeast", "southwest", "south", "e", "w", "nw", "ne", "sw", "se", "n", "s", "up", "down", "u", "d", "in", "out"] + content = <<'EOF' +Move in a particular direction or through a particular exit. + +Example: + +GO EAST + +Note that you can just use EAST, WEST, IN, OUT, UP, DOWN, etc. instead of GO. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + + include Aethyr::Direction def initialize(player) - super(player, ["go", "move", "east", "west", "northeast", "northwest", "north", "southeast", "southwest", "south", "e", "w", "nw", "ne", "sw", "se", "n", "s", "up", "down", "u", "d", "in", "out"]) + super(player, ["go", "move", "east", "west", "northeast", "northwest", "north", "southeast", "southwest", "south", "e", "w", "nw", "ne", "sw", "se", "n", "s", "up", "down", "u", "d", "in", "out"], MoveHandler.create_help_entries) end def self.object_added(data) @@ -26,28 +50,10 @@ module Aethyr when /^(east|west|northeast|northwest|north|southeast|southwest|south|e|w|nw|ne|sw|se|n|s|up|down|u|d|in|out)(\s+\((.*)\))?$/i action({:direction => expand_direction($1), :pre => $3}) - when /^help (go|move|east|west|northeast|northwest|north|southeast|southwest|south|e|w|nw|ne|sw|se|n|s|up|down|u|d|in|out)$/i - action_help({}) end end private - def action_help(event) - @player.output <<'EOF' -Command: Go -Syntax: GO [direction or exit] - -Move in a particular direction or through a particular exit. - -Example: - -GO EAST - -Note that you can just use EAST, WEST, IN, OUT, UP, DOWN, etc. instead of GO. - -EOF - end - def action(event) room = $manager.get_object(@player.container) exit = room.exit(event[:direction]) diff --git a/lib/aethyr/core/commands/news.rb b/lib/aethyr/core/commands/news.rb index 197716a..bda131e 100644 --- a/lib/aethyr/core/commands/news.rb +++ b/lib/aethyr/core/commands/news.rb @@ -6,45 +6,15 @@ module Aethyr module Commands module News class NewsHandler < Aethyr::Extend::CommandHandler - def initialize(player) - super(player, ["news"]) - end - def self.object_added(data) - super(data, self) - end + def self.create_help_entries + help_entries = [] - def player_input(data) - super(data) - case data[:input] - when "news" - latest_news({}) - when /^news\s+(read\s+)?(\d+)$/i - post_id = $2 - read_post({:post_id => post_id}) - when /^news\s+reply(\s+to\s+)?\s+(\d+)$/i - reply_to = $2 - write_post({:reply_to => reply_to}) - when /^news\s+unread/i - list_unread({}) - when /^news\s+last\s+(\d+)/i - limit = $1.to_i - latest_news({:limit => limit}) - when /^news\s+delete\s+(\d+)/i - post_id = $1 - delete_post({:post_id => post_id}) - when /^news\s+write$/i - write_post({}) - when /^news\s+all/i - all({}) - when /^help (news)$/i - action_help_news({}) - end - end - - private - def action_help_news(event) - @player.output <<'EOF' + command = "news" + see_also = nil + syntax_formats = ["NEWS"] + aliases = nil + content = <<'EOF' NEWS Scattered throughout Aethyr are objects on which one can post notes or read notes left by others. The appearance of these objects may vary from ledgers to large bulletin boards, but they all work the same way. @@ -53,45 +23,68 @@ The news system is currently still being tinkered on, but here is what works cur -Reading posts -Command: NEWS - Lists the latest news. How many posts it lists is dependent on your pagelength. -Command: NEWS LAST <number> - Specify how many of the latest posts to show. -Command: NEWS ALL - Lists all the news postings. Might be really long. -Command: NEWS READ <post id> -Command: NEWS <post id> - Shows the specified post. -Writing posts -Command: NEWS WRITE - First enter a subject for your post, then you will be taken to the editor to write the body of the post. If you decide not to write the post after all, then simply exit the editor without saving. -Command: NEWS REPLY <post id> - Write a reply to an existing post. -Deleting posts -Command: NEWS DELETE <post id> - For testing purposes only, you may delete your own posts. This is so you don't feel guilty about posting a bunch of nonsense to try things out. Note that this command isn't really well-supported, so it may cause some odd things to happen if there are replies to deleted posts. EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + + def initialize(player) + super(player, ["news"], NewsHandler.create_help_entries) end + def self.object_added(data) + super(data, self) + end + def player_input(data) + super(data) + case data[:input] + when "news" + latest_news({}) + when /^news\s+(read\s+)?(\d+)$/i + post_id = $2 + read_post({:post_id => post_id}) + when /^news\s+reply(\s+to\s+)?\s+(\d+)$/i + reply_to = $2 + write_post({:reply_to => reply_to}) + when /^news\s+unread/i + list_unread({}) + when /^news\s+last\s+(\d+)/i + limit = $1.to_i + latest_news({:limit => limit}) + when /^news\s+delete\s+(\d+)/i + post_id = $1 + delete_post({:post_id => post_id}) + when /^news\s+write$/i + write_post({}) + when /^news\s+all/i + all({}) + end + end + + private def latest_news(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/open.rb b/lib/aethyr/core/commands/open.rb index 72bc502..dea95cb 100644 --- a/lib/aethyr/core/commands/open.rb +++ b/lib/aethyr/core/commands/open.rb @@ -7,10 +7,34 @@ module Aethyr module Commands module Open class OpenHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "open" + see_also = ["LOCK", "UNLOCK", "CLOSE"] + syntax_formats = ["OPEN [object or direction]"] + aliases = nil + content = <<'EOF' +Opens the object. For doors and such, it is more accurate to use the direction in which the object lies. + +For example: + +OPEN north + +OPEN door + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + include Aethyr::Direction def initialize(player) - super(player, ["open"]) + super(player, ["open"], OpenHandler.create_help_entries) end def self.object_added(data) @@ -22,31 +46,10 @@ module Aethyr case data[:input] when /^open\s+(\w+)$/i action({ :object => $1 }) - when /^help open$/i - action_help({}) end end private - def action_help(event) - player.output <<'EOF' -Command: Open -Syntax: OPEN [object or direction] - -Opens the object. For doors and such, it is more accurate to use the direction in which the object lies. - -For example: - -OPEN north - -OPEN door - - -See also: LOCK, UNLOCK, CLOSE - -EOF - end - def action(event) room = $manager.get_object(@player.container) object = expand_direction(event[:object]) diff --git a/lib/aethyr/core/commands/portal.rb b/lib/aethyr/core/commands/portal.rb index b384f20..fa061f8 100644 --- a/lib/aethyr/core/commands/portal.rb +++ b/lib/aethyr/core/commands/portal.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Portal class PortalHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "portal" + see_also = nil + syntax_formats = ["PORTAL [OBJECT] (ACTION|EXIT|ENTRANCE|PORTAL) [VALUE]"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["portal"]) + super(player, ["portal"], PortalHandler.create_help_entries) end def self.object_added(data) @@ -22,19 +39,10 @@ module Aethyr setting = $2.downcase value = $3.strip portal({:object => object, :setting => setting, :value => value}) - when /^help (portal)$/i - action_help_portal({}) end end private - def action_help_portal(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def portal(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/pose.rb b/lib/aethyr/core/commands/pose.rb index 71717e9..11b87f6 100644 --- a/lib/aethyr/core/commands/pose.rb +++ b/lib/aethyr/core/commands/pose.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Pose class PoseHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "pose" + see_also = nil + syntax_formats = ["POSE"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["pose"]) + super(player, ["pose"], PoseHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^pose\s+(.*)$/i pose = $1.strip pose({:pose => pose}) - when /^help (pose)$/i - action_help_pose({}) end end private - def action_help_pose(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def pose(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/punch.rb b/lib/aethyr/core/commands/punch.rb index dd90dd4..eaf143e 100644 --- a/lib/aethyr/core/commands/punch.rb +++ b/lib/aethyr/core/commands/punch.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Punch class PunchHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "punch" + see_also = nil + syntax_formats = ["PUNCH"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["punch"]) + super(player, ["punch"], PunchHandler.create_help_entries) end def self.object_added(data) @@ -22,19 +39,10 @@ module Aethyr when /^punch\s+(.*)$/i target = $1 punch({:target => target}) - when /^help (punch)$/i - action_help_punch({}) end end private - def action_help_punch(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def punch(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/put.rb b/lib/aethyr/core/commands/put.rb index d694c98..caa79e9 100644 --- a/lib/aethyr/core/commands/put.rb +++ b/lib/aethyr/core/commands/put.rb @@ -6,8 +6,26 @@ module Aethyr module Commands module Put class PutHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "put" + see_also = ["LOOK", "TAKE", "OPEN"] + syntax_formats = ["PUT [object] IN [container]"] + aliases = nil + content = <<'EOF' +Puts an object in a container. The container must be open to do so. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["put"]) + super(player, ["put"], PutHandler.create_help_entries) end def self.object_added(data) @@ -21,24 +39,10 @@ module Aethyr action({ :item => $4, :count => $3.to_i, :container => $5 }) - when /^help put$/i - action_help({}) end end private - def action_help(event) - @player.output <<'EOF' -Command: Put -Syntax: PUT [object] IN [container] - -Puts an object in a container. The container must be open to do so. - -See also: LOOK TAKE OPEN - -EOF - end - def action(event) room = $manager.get_object(@player.container) item = @player.inventory.find(event[:item]) diff --git a/lib/aethyr/core/commands/quit.rb b/lib/aethyr/core/commands/quit.rb index e24e6d8..e2fb4bc 100644 --- a/lib/aethyr/core/commands/quit.rb +++ b/lib/aethyr/core/commands/quit.rb @@ -6,8 +6,28 @@ module Aethyr module Commands module Quit class QuitHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "quit" + see_also = nil + syntax_formats = ["QUIT"] + aliases = nil + content = <<'EOF' +Saves your character and logs you off from the game. + +You shouldn't need this too often. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["quit"]) + super(player, ["quit"], QuitHandler.create_help_entries) end def self.object_added(data) @@ -18,23 +38,10 @@ module Aethyr case data[:input] when /^quit$/i action({}) - when /^help quit$/i - action_help({}) end end private - def action_help(event) - player.output <<'EOF' -Command: Quit -Syntax: QUIT - -Saves your character and logs you off from the game. - -You shouldn't need this too often. - -EOF - end def action(event) $manager.drop_player player diff --git a/lib/aethyr/core/commands/remove.rb b/lib/aethyr/core/commands/remove.rb index 42070d6..afbaaab 100644 --- a/lib/aethyr/core/commands/remove.rb +++ b/lib/aethyr/core/commands/remove.rb @@ -6,8 +6,26 @@ module Aethyr module Commands module Remove class RemoveHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "remove" + see_also = ["WEAR", "INVENTORY"] + syntax_formats = ["REMOVE <object>"] + aliases = nil + content = <<'EOF' +Remove an article of clothing or armor. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["remove"]) + super(player, ["remove"], RemoveHandler.create_help_entries) end def self.object_added(data) @@ -21,25 +39,10 @@ module Aethyr object = $1 position = $3 remove({:object => object, :position => position}) - when /^help (remove)$/i - action_help_remove({}) end end private - def action_help_remove(event) - @player.output <<'EOF' -Command: Remove -Syntax: REMOVE <object> - -Remove an article of clothing or armor. - -See also: WEAR, INVENTORY - -EOF - end - - def remove(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/say.rb b/lib/aethyr/core/commands/say.rb index f00b2a8..78fb50b 100644 --- a/lib/aethyr/core/commands/say.rb +++ b/lib/aethyr/core/commands/say.rb @@ -6,34 +6,15 @@ module Aethyr module Commands module Say class SayHandler < Aethyr::Extend::CommandHandler - def initialize(player) - super(player, ["say", "sayto"]) - end - - def self.object_added(data) - super(data, self) - end - - def player_input(data) - super(data) - case data[:input] - when /^say\s+(\((.*?)\)\s*)?(.*)$/i - action({ :phrase => $3, :pre => $2 }) - when /^sayto\s+(\w+)\s+(\((.*?)\)\s*)?(.*)$/i - action({:target => $1, :phrase => $4, :pre => $3 }) - when /^help (sayto)$/i - action_help_sayto({}) - when /^help (say)$/i - action_help_say({}) - end - end - private - def action_help_say(event) - @player.output <<'EOF' -Command: Say -Syntax: SAY [message] + def self.create_help_entries + help_entries = [] + command = "say" + see_also = ["WHISPER", "SAYTO"] + syntax_formats = ["SAY [message]"] + aliases = nil + content = <<'EOF' This is the basic command for communication. Everyone in the room hears what you say. Some formatting is automatic, and a few emoticons are supported at the end of the command. @@ -48,15 +29,16 @@ You can also specify a prefix in parentheses after the say command. Example: say (in trepidation) are you going to take my cheese? Output: In trepidation, you ask, "Are you going to take my cheese?" -See also: WHISPER, SAYTO EOF - end + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) - def action_help_sayto(event) - @player.output <<'EOF' -Command: Say to -Syntax: SAYTO [name] [message] + + command = "sayto" + see_also = ["WHISPER", "SAY"] + syntax_formats = ["SAYTO [name] [message]"] + aliases = nil + content = <<'EOF' Say something to someone in particular, who is in the same room: Example: @@ -69,10 +51,33 @@ You say to Bob, "I like cheese." Also supports the same variations as the SAY command. -See also: WHISPER, SAY EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries end + + def initialize(player) + super(player, ["say", "sayto"], SayHandler.create_help_entries) + end + + def self.object_added(data) + super(data, self) + end + + def player_input(data) + super(data) + case data[:input] + when /^say\s+(\((.*?)\)\s*)?(.*)$/i + action({ :phrase => $3, :pre => $2 }) + when /^sayto\s+(\w+)\s+(\((.*?)\)\s*)?(.*)$/i + action({:target => $1, :phrase => $4, :pre => $3 }) + end + end + + private + #Says something to the room or to a specific player. def action(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/set.rb b/lib/aethyr/core/commands/set.rb index cbecf02..b0b58c6 100644 --- a/lib/aethyr/core/commands/set.rb +++ b/lib/aethyr/core/commands/set.rb @@ -6,8 +6,37 @@ module Aethyr module Commands module Set class SetHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "set" + see_also = ["WORDWRAP", "PAGELENGTH", "DESCRIPTION", "COLORS"] + syntax_formats = ["SET <option> [value]"] + aliases = nil + content = <<'EOF' +There are several settings available to you. To see them all, simply use SET. +To see the values available for a certain setting, use SET <option> without a value. + +Example: + +To see your color settings, use + +SET COLOR + +To turn off word wrap, use + +SET WORDWRAP OFF + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["set"]) + super(player, ["set"], SetHandler.create_help_entries) end def self.object_added(data) @@ -32,35 +61,10 @@ module Aethyr setcolor({:option => option, :color => color}) when /^set\s+password$/i setpassword({}) - when /^help (set)$/i - action_help_set({}) end end private - def action_help_set(event) - @player.output <<'EOF' -Syntax: SET <option> [value] - -There are several settings available to you. To see them all, simply use SET. -To see the values available for a certain setting, use SET <option> without a value. - -Example: - -To see your color settings, use - -SET COLOR - -To turn off word wrap, use - -SET WORDWRAP OFF - -See also: WORDWRAP, PAGELENGTH, DESCRIPTION, COLORS - -EOF - end - - def setcolor(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/sit.rb b/lib/aethyr/core/commands/sit.rb index a64a425..1a6f048 100644 --- a/lib/aethyr/core/commands/sit.rb +++ b/lib/aethyr/core/commands/sit.rb @@ -6,8 +6,32 @@ module Aethyr module Commands module Sit class SitHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "sit" + see_also = ["STAND"] + syntax_formats = ["SIT", "SIT ON <object>"] + aliases = nil + content = <<'EOF' +Using this command, you can sit on things like chairs and benches. When used without an object, you will sit down on the ground. + +Note that you must stand up before you can move anywhere. + +Example: + +SIT ON stool + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["sit"]) + super(player, ["sit"], SitHandler.create_help_entries) end def self.object_added(data) @@ -20,33 +44,10 @@ module Aethyr when /^sit\s+on\s+(.*)$/i, /^sit\s+(.*)$/i, /^sit$/i object = $1.strip if $1 sit({:object => object}) - when /^help (sit)$/i - action_help_sit({}) end end private - def action_help_sit(event) - @player.output <<'EOF' -Command: Sit -Syntax: SIT -Syntax: SIT ON <object> - -Using this command, you can sit on things like chairs and benches. When used without an object, you will sit down on the ground. - -Note that you must stand up before you can move anywhere. - -Example: - -SIT ON stool - - -See also: STAND - -EOF - end - - def sit(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/skills.rb b/lib/aethyr/core/commands/skills.rb index 6704dac..acd5836 100644 --- a/lib/aethyr/core/commands/skills.rb +++ b/lib/aethyr/core/commands/skills.rb @@ -8,8 +8,25 @@ module Aethyr module Commands module Skills class SkillsHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "skills" + see_also = nil + syntax_formats = ["SKILLS"] + aliases = nil + content = <<'EOF' +List all your currently known skills, their level, and level up info. +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["skills"]) + super(player, ["skills"], SkillsHandler.create_help_entries) end def self.object_added(data) @@ -21,8 +38,6 @@ module Aethyr case data[:input] when /^skills$/i action({}) - when /^help (skills)$/i - action_help({}) end end @@ -72,16 +87,6 @@ module Aethyr end @player.output(output) end - - def action_help(event) - player.output <<'EOF' -Command: Skills -Syntax: SKILLS - -List all your currently known skills, their level, and level up info. -EOF - end - def self.generate_progress(width, percentage, style = :vertical_smooth) if (style.eql? :horizontal_smooth) or (style.eql? :vertical_smooth) working_space = width - 7 diff --git a/lib/aethyr/core/commands/slash.rb b/lib/aethyr/core/commands/slash.rb index 54550a4..cc60bda 100644 --- a/lib/aethyr/core/commands/slash.rb +++ b/lib/aethyr/core/commands/slash.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Slash class SlashHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "slash" + see_also = nil + syntax_formats = ["SLASH"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["slash"]) + super(player, ["slash"], SlashHandler.create_help_entries) end def self.object_added(data) @@ -22,19 +39,10 @@ module Aethyr when /^slash\s+(.*)$/i target = $1 slash({:target => target}) - when /^help (slash)$/i - action_help_slash({}) end end private - def action_help_slash(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def slash(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/stand.rb b/lib/aethyr/core/commands/stand.rb index 2dc08af..fefba16 100644 --- a/lib/aethyr/core/commands/stand.rb +++ b/lib/aethyr/core/commands/stand.rb @@ -6,8 +6,26 @@ module Aethyr module Commands module Stand class StandHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "stand" + see_also = ["SIT"] + syntax_formats = ["STAND"] + aliases = nil + content = <<'EOF' +Stand up if you are sitting down. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["stand"]) + super(player, ["stand"], StandHandler.create_help_entries) end def self.object_added(data) @@ -19,26 +37,10 @@ module Aethyr case data[:input] when /^stand$/i stand({}) - when /^help (stand)$/i - action_help_stand({}) end end private - def action_help_stand(event) - @player.output <<'EOF' -Command: Stand -Syntax: STAND - -Stand up if you are sitting down. - - -See also: SIT - -EOF - end - - def stand(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/tell.rb b/lib/aethyr/core/commands/tell.rb index 2dfe990..0b13d2d 100644 --- a/lib/aethyr/core/commands/tell.rb +++ b/lib/aethyr/core/commands/tell.rb @@ -6,8 +6,41 @@ module Aethyr module Commands module Tell class TellHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "tell" + see_also = ["SAY", "SAYTO", "WHISPER", "REPLY"] + syntax_formats = ["TELL [player] [message]"] + aliases = nil + content = <<'EOF' +All inhabitants of Aethyr have the ability to communicate privately with each other over long distances. This is done through the TELL command. Those who investigate these kinds of things claim there is some kind of latent telepathy in all of us. However, while no one knows for certain how it works, everyone knows it does. + +Example: +TELL Justin Hey, how's it going? + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + + + command = "reply" + see_also = ["TELL"] + syntax_formats = ["REPLY [message]"] + aliases = nil + content = <<'EOF' +Reply is a shortcut to send a tell to the last person who sent you a tell. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["tell", "reply"]) + super(player, ["tell", "reply"], TellHandler.create_help_entries) end def self.object_added(data) @@ -21,39 +54,10 @@ module Aethyr action_tell({:target => $1, :message => $2 }) when /^reply\s+(.*)$/i action_reply({:message => $1 }) - when /^help (tell)$/i - action_help_tell({}) - when /^help (reply)$/i - action_help_reply({}) end end private - def action_help_tell(event) - @player.output <<'EOF' -Command: Tell -Syntax: TELL [player] [message] - -All inhabitants of Aethyr have the ability to communicate privately with each other over long distances. This is done through the TELL command. Those who investigate these kinds of things claim there is some kind of latent telepathy in all of us. However, while no one knows for certain how it works, everyone knows it does. - -Example: -TELL Justin Hey, how's it going? - - -See also: SAY, SAYTO, WHISPER, REPLY -EOF - end - - def action_help_reply(event) - @player.output <<'EOF' -Command: Reply -Syntax: REPLY [message] - -Reply is a shortcut to send a tell to the last person who sent you a tell. - -See also: TELL -EOF - end #Tells someone something. def action_tell(event) diff --git a/lib/aethyr/core/commands/unwield.rb b/lib/aethyr/core/commands/unwield.rb index 5020325..ac1da57 100644 --- a/lib/aethyr/core/commands/unwield.rb +++ b/lib/aethyr/core/commands/unwield.rb @@ -6,8 +6,31 @@ module Aethyr module Commands module Unwield class UnwieldHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "unwield" + see_also = ["WIELD"] + syntax_formats = ["UNWIELD", "UNWIELD <weapon>", "UNWIELD <left|right>"] + aliases = nil + content = <<'EOF' +This command will cause you to unwield a weapon and place it in your inventory. If you do not specify which weapon or which hand you are using to hold the weapon, it will favor your right hand. + +Example: + +UNWIELD halberd +UNWIELD left + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["unwield"]) + super(player, ["unwield"], UnwieldHandler.create_help_entries) end def self.object_added(data) @@ -20,33 +43,10 @@ module Aethyr when /^unwield(\s+(.*))?$/i weapon = $2 unwield({:weapon => weapon}) - when /^help (unwield)$/i - action_help_unwield({}) end end private - def action_help_unwield(event) - @player.output <<'EOF' -Command: Unwield weapon -Syntax: UNWIELD -Syntax: UNWIELD <weapon> -Syntax: UNWIELD <left|right> - -This command will cause you to unwield a weapon and place it in your inventory. If you do not specify which weapon or which hand you are using to hold the weapon, it will favor your right hand. - -Example: - -UNWIELD halberd -UNWIELD left - - -See also: WIELD - -EOF - end - - def unwield(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/wear.rb b/lib/aethyr/core/commands/wear.rb index 258623d..eee6943 100644 --- a/lib/aethyr/core/commands/wear.rb +++ b/lib/aethyr/core/commands/wear.rb @@ -6,8 +6,28 @@ module Aethyr module Commands module Wear class WearHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "wear" + see_also = ["REMOVE", "INVENTORY"] + syntax_formats = ["WEAR <object>"] + aliases = nil + content = <<'EOF' +Sytnax: WEAR <object> ON <body part> + +Wear an object. Objects usually have specific places they may be worn. + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["wear"]) + super(player, ["wear"], WearHandler.create_help_entries) end def self.object_added(data) @@ -21,27 +41,10 @@ module Aethyr object = $1 position = $3 wear({:object => object, :position => position}) - when /^help (wear)$/i - action_help_wear({}) end end private - def action_help_wear(event) - @player.output <<'EOF' -Command: Wear -Syntax: WEAR <object> -Sytnax: WEAR <object> ON <body part> - -Wear an object. Objects usually have specific places they may be worn. - - -See also: REMOVE, INVENTORY - -EOF - end - - def wear(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/whereis.rb b/lib/aethyr/core/commands/whereis.rb index 2ae0c43..230b5e5 100644 --- a/lib/aethyr/core/commands/whereis.rb +++ b/lib/aethyr/core/commands/whereis.rb @@ -6,8 +6,25 @@ module Aethyr module Commands module Whereis class WhereisHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "whereis" + see_also = nil + syntax_formats = ["WHEREIS"] + aliases = nil + content = <<'EOF' +Sorry no help has been written for this command yet +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["whereis"]) + super(player, ["whereis"], WhereisHandler.create_help_entries) end def self.object_added(data) @@ -20,19 +37,10 @@ module Aethyr when /^whereis\s(.*)$/ object = $1 whereis({:object => object}) - when /^help (whereis)$/i - action_help_whereis({}) end end private - def action_help_whereis(event) - @player.output <<'EOF' -Sorry no help has been written for this command yet -EOF - end - - def whereis(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/whisper.rb b/lib/aethyr/core/commands/whisper.rb index 027fac7..16adcbf 100644 --- a/lib/aethyr/core/commands/whisper.rb +++ b/lib/aethyr/core/commands/whisper.rb @@ -6,8 +6,34 @@ module Aethyr module Commands module Whisper class WhisperHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "whisper" + see_also = ["SAY"] + syntax_formats = ["WHISPER [person] [message]"] + aliases = nil + content = <<'EOF' +To communicate with someone in the same room, but privately, use this command. + +Example: + +whisper justin that dog needs a bath + +Output: + +You whisper to Justin, "That dog needs a bath." + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["whisper"]) + super(player, ["whisper"], WhisperHandler.create_help_entries) end def self.object_added(data) @@ -19,32 +45,10 @@ module Aethyr case data[:input] when /^whisper\s+(\w+)\s+(\((.*?)\)\s*)?(.*)$/i action({ :to => $1, :phrase => $4, :pre => $3 }) - when /^help (whisper)$/i - action_help({}) end end private - def action_help(event) - @player.output <<'EOF' -Command: Whisper -Syntax: WHISPER [person] [message] - -To communicate with someone in the same room, but privately, use this command. - -Example: - -whisper justin that dog needs a bath - -Output: - -You whisper to Justin, "That dog needs a bath." - - -See also: SAY -EOF - end - #Whispers to another thing. def action(event) room = $manager.get_object(@player.container) diff --git a/lib/aethyr/core/commands/wield.rb b/lib/aethyr/core/commands/wield.rb index 0b3b119..37ddd60 100644 --- a/lib/aethyr/core/commands/wield.rb +++ b/lib/aethyr/core/commands/wield.rb @@ -6,8 +6,32 @@ module Aethyr module Commands module Wield class WieldHandler < Aethyr::Extend::CommandHandler + + def self.create_help_entries + help_entries = [] + + command = "wield" + see_also = ["UNWIELD"] + syntax_formats = ["WIELD <item>", "WIELD <item> <left|right>"] + aliases = nil + content = <<'EOF' +This command causes you to wield an item. The item must be wieldable and be present in your inventory. + +You can also specify which hand with which to wield the weapon. If you do not, it will favor your right hand. + +Example: + +WIELD sword left + +EOF + help_entries.push(Aethyr::Core::Help::HelpEntry.new(command, content: content, syntax_formats: syntax_formats, see_also: see_also, aliases: aliases)) + + return help_entries + end + + def initialize(player) - super(player, ["wield"]) + super(player, ["wield"], WieldHandler.create_help_entries) end def self.object_added(data) @@ -21,33 +45,10 @@ module Aethyr weapon = $1 side = $3 wield({:weapon => weapon, :side => side}) - when /^help (wield)$/i - action_help_wield({}) end end private - def action_help_wield(event) - @player.output <<'EOF' -Command: Wield item -Syntax: WIELD <item> -Syntax: WIELD <item> <left|right> - -This command causes you to wield an item. The item must be wieldable and be present in your inventory. - -You can also specify which hand with which to wield the weapon. If you do not, it will favor your right hand. - -Example: - -WIELD sword left - - -See also: UNWIELD - -EOF - end - - def wield(event) room = $manager.get_object(@player.container) -- GitLab