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

Method mobBuryCommand

modules/cleanup/cleanup.go:179–205  ·  view source on GitHub ↗
(rest string, mob *mobs.Mob, room *rooms.Room)

Source from the content-addressed store, hash-verified

177}
178
179func (c *CleanupModule) mobBuryCommand(rest string, mob *mobs.Mob, room *rooms.Room) (bool, error) {
180
181 args := util.SplitButRespectQuotes(strings.ToLower(rest))
182
183 if len(args) == 0 {
184 return true, nil
185 }
186
187 if corpse, corpseFound := room.FindCorpse(rest); corpseFound {
188
189 if room.RemoveCorpse(corpse) {
190
191 corpseColor := `mob-corpse`
192 if corpse.UserId > 0 {
193 corpseColor = `user-corpse`
194 }
195
196 room.SendText(fmt.Sprintf(`<ansi fg="mobname">%s</ansi> buries the <ansi fg="%s">%s corpse</ansi>.`, mob.Character.Name, corpseColor, corpse.Character.Name))
197 return true, nil
198
199 }
200
201 return true, nil
202 }
203
204 return true, nil
205}

Callers

nothing calls this directly

Calls 4

SplitButRespectQuotesFunction · 0.92
FindCorpseMethod · 0.80
RemoveCorpseMethod · 0.80
SendTextMethod · 0.45

Tested by

no test coverage detected