hazelmud/commands/clothing.py

23 lines
801 B
Python

from commands.command import Command
from evennia import CmdSet
class CmdRemove(Command):
key = "remove"
help_category = "clothing"
def func(self):
clothing = self.caller.search(self.args, candidates=self.caller.contents)
if not clothing:
self.caller.msg("You don't have anything like that.")
return
if not clothing.db.worn:
self.caller.msg("You're not wearing that!")
return
if covered := clothing.db.covered_by:
self.caller.msg(f"You have to take off {covered} first.")
return
if not clothing.access(self.caller, 'remove'):
self.caller.msg(clothing.db.remove_err_msg or f"You are unable to remove that.")
return
clothing.remove(self.caller)