(rest string, user *users.UserRecord, room *rooms.Room, flags events.EventFlag)
| 145 | } |
| 146 | |
| 147 | func (c *CleanupModule) userBuryCommand(rest string, user *users.UserRecord, room *rooms.Room, flags events.EventFlag) (bool, error) { |
| 148 | |
| 149 | args := util.SplitButRespectQuotes(strings.ToLower(rest)) |
| 150 | |
| 151 | if len(args) == 0 { |
| 152 | user.SendText("Bury what?") |
| 153 | return true, nil |
| 154 | } |
| 155 | |
| 156 | if corpse, corpseFound := room.FindCorpse(rest); corpseFound { |
| 157 | |
| 158 | if room.RemoveCorpse(corpse) { |
| 159 | |
| 160 | corpseColor := `mob-corpse` |
| 161 | if corpse.UserId > 0 { |
| 162 | corpseColor = `user-corpse` |
| 163 | } |
| 164 | |
| 165 | user.SendText(fmt.Sprintf(`You bury the <ansi fg="%s">%s corpse</ansi>.`, corpseColor, corpse.Character.Name)) |
| 166 | room.SendText(fmt.Sprintf(`<ansi fg="username">%s</ansi> buries the <ansi fg="%s">%s corpse</ansi>.`, user.Character.Name, corpseColor, corpse.Character.Name), user.UserId) |
| 167 | return true, nil |
| 168 | |
| 169 | } |
| 170 | |
| 171 | return true, nil |
| 172 | } |
| 173 | |
| 174 | user.SendText(fmt.Sprintf("You don't see a %s around for burying.", rest)) |
| 175 | |
| 176 | return true, nil |
| 177 | } |
| 178 | |
| 179 | func (c *CleanupModule) mobBuryCommand(rest string, mob *mobs.Mob, room *rooms.Room) (bool, error) { |
| 180 |
nothing calls this directly
no test coverage detected