X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_structured?a=blobdiff_plain;f=plomrogue%2Ftasks.py;h=6a886496658f4c228e33563fb6958a09c8efe4cc;hb=eadcddf7699d5df683d544531b441332d79b6661;hp=1e6737b64671188b967e42210a6fda8f73b7e3c9;hpb=1750783da9cd6fd4f80d6484a3b714c352eef126;p=plomrogue2 diff --git a/plomrogue/tasks.py b/plomrogue/tasks.py index 1e6737b..6a88649 100644 --- a/plomrogue/tasks.py +++ b/plomrogue/tasks.py @@ -234,8 +234,8 @@ class Task_WEAR(Task): 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: @@ -249,10 +249,16 @@ class Task_WEAR(Task): 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."')