MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / sendLookDescription

Method sendLookDescription

modules/gambling/gambling.go:134–147  ·  view source on GitHub ↗

sendLookDescription sends a noun look response matching the framing used by the core look command: blank line, "You look at the :", blank line, description lines, blank line. Also broadcasts the examine message to the room.

(user *users.UserRecord, room *rooms.Room, noun, desc string)

Source from the content-addressed store, hash-verified

132// the core look command: blank line, "You look at the <noun>:", blank line,
133// description lines, blank line. Also broadcasts the examine message to the room.
134func (g *GamblingModule) sendLookDescription(user *users.UserRecord, room *rooms.Room, noun, desc string) {
135 user.SendText(``)
136 user.SendText(fmt.Sprintf(`You look at the <ansi fg="noun">%s</ansi>:`, noun))
137 user.SendText(``)
138 for _, line := range strings.Split(desc, "\n") {
139 user.SendText(line)
140 }
141 user.SendText(``)
142
143 room.SendText(
144 fmt.Sprintf(`<ansi fg="username">%s</ansi> is examining the <ansi fg="noun">%s</ansi>.`, user.Character.Name, noun),
145 user.UserId,
146 )
147}
148
149// GamblingModule holds module-level state for the gambling plugin.
150type GamblingModule struct {

Callers 1

onLookInputMethod · 0.95

Calls 1

SendTextMethod · 0.45

Tested by

no test coverage detected