raise PlayError('carrying nothing to wear')
if self.thing.name in self.thing.game.hats:
raise PlayError('already wearing a hat')
- if self.thing.carrying.type_ != 'Hat':
- raise PlayError('can only wear a hat')
+ if self.thing.carrying.type_ not in {'Hat', 'Bottle'}:
+ raise PlayError('can not wear the kind of thing you hold')
def do(self):
if self.thing.name in self.thing.game.hats:
remixer.accept(t)
break
else:
- self.thing.game.hats[self.thing.name] = self.thing.carrying.design
+ if self.thing.carrying.type_ == 'Bottle':
+ self.thing.send_msg('CHAT "Your attempt to wear a bottle on '
+ 'your head fails."')
+ self.thing.carrying.sound('BOTTLE', 'SMASH')
+ elif self.thing.carrying.type_ == 'Hat':
+ self.thing.game.hats[self.thing.name] =\
+ self.thing.carrying.design
+ self.thing.send_msg('CHAT "You put on a hat."')
self.thing.game.remove_thing(self.thing.carrying)
self.thing.carrying = None
- self.thing.send_msg('CHAT "You put on a hat."')