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)
| 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. |
| 134 | func (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. |
| 150 | type GamblingModule struct { |