package
0.0.0-20250103183519-5d391d309e22
Repository: https://github.com/volte6/gomud.git
Documentation: pkg.go.dev
# README
usercommands
The usercommands
package defines a function type and contains all of the commands a user can enter.
type UserCommand func(rest string, user *users.UserRecord, room *rooms.Room) (bool, error)
All commands follow that definition, where
rest
contains everything except the initial command the user entered (if user enteredglarble some text
,rest
would containsome text
)user
is the user object executing the commandroom
is the room object for the room the user is in while executing the command
func Glarble(rest string, user *users.UserRecord, room *rooms.Room) (bool, error) {
room.SendText(`This glarble text goes out to all players in room`)
room.SendText(`This glarble text goes out to all players in room except the user who typed the command`, user.UserId)
user.SendText(`This glarble text goes out to the user`)
// we handled this command in this function, so return true
return true, nil
}
Then the command must be entered into the userCommands
map in usercommands.go
Each entry into userCommands
defines:
UserCommand
- the function for the commandAllowedWhenDowned
- can users execute this command when downed?AdminOnly
- is this a command only admins can use?
Must return two values:
- bool - whether this was handled or should be allowed to continue down processing chain (and indicate a failed command if never gets handled)
- error - An error with error message (for logging purposes)
TODO: More info.
# Functions
Protection Skill
Level 1 - Aid (revive) a player
Level 3 - Aid (revive) a player, even during combat
*/.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SkullDuggery Skill
Level 2 - Backstab
*/.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Global chat room.
No description provided by the author
No description provided by the author
SkullDuggery Skill
Level 3 - Backstab
*/.
No description provided by the author
Cast Skill
Level 1 - You can cast spells
Level 2 - Become proficient in a spell at 125% rate
Level 3 - Become proficient in a spell at 175% rate
Level 4 - Become proficient in a spell at 250% rate
*/.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Default is a special command that tries to contextually pick a default action for a room.
Brawling Skill
Level 4 - Attempt to disarm an opponent.
No description provided by the author
No description provided by the author
Dual WIeld
Level 1 - You can dual wield weapons that you normally couldn't.
No description provided by the author
No description provided by the author
Enchant Skill
Level 1 - Enchant a weapon with a damage bonus.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Returns a list of close match commands.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Peep Skill
Level 1 - Reveals the type and value of items.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Skill Map
Level 1 - Map a 5x5 area
Level 2 - Map a 9x7 area
Level 3 - Map a 13x9 area
Level 4 - Map a 17x9 area, and enables the "wide" version.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
This is a no-op, does nothing.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Peep Skill
Level 1 - Always visibly see the health % of an NPC
Level 2 - Reveals detailed stats of a player or mob.
No description provided by the author
No description provided by the author
SkullDuggery Skill
Level 4 - Pickpocket
*/.
Portal Skill
Level 1 - Teleport back to town square
Level 2 - Teleport back to the root of the area you are in
Level 3 - Set a new destination for your portal teleportation
Level 4 - Create a physical portal that you can share with players, or return through.
Protection Skill
Level 4 - Pray to gods for a blessing
*/.
No description provided by the author
Prints message to screen.
PrintLine (command `printline`) is just a simple measuring tool/ruler for layout purposes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Protection Skill
Level 2 - Front/Backrank
*/.
No description provided by the author
Brawling Skill
Level 1 - Enter a state of rest where health is recovered more quickly
*/.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Scribe Skill
Level 1 - Scribe to a scrap of paper
Level 2 - Scribe to a sign
Level 3 - Scribe a hidden rune
Level 4 - TODO
*/.
Searcg Skill
Level 1 - Find secret exits or hidden players/mobs
Level 2 - Find objects stashed in the area
Level 3 - ???
Level 4 - You are always aware of hidden players/mobs in the area
(Lvl 1) <ansi fg="skill">search</ansi> Search for secret exits or hidden players/mobs.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SkullDuggery Skill
Level 1 - Sneak
*/.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Brawling Skill
Level 3 - Attempt to tackle an opponent, making them miss a round.
Skill Tame
Level 1 - Tame up to 2 creatures
Level 2 - Tame up to 3 creatures
Level 3 - Tame up to 4 creatures
Level 4 - Tame up to 5 creatures
*/.
Brawling Skill
Level 2 - You can throw objects at NPCs or other rooms.
No description provided by the author
Skill Track
Level 1 - Display the last player or mob to walk through here (not the currently player or current mobs)
Level 2 - Display all players and mobs to recently walk through here
Level 3 - Shows exit information for all tracked players or mobs
Level 4 - Specify a mob or username and every room you enter will tell you what exit they took.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
Signature of user command.