X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=plomrogue%2Ftasks.py;h=841a0e663d0f343542dd7e0dd96476f37a5151e3;hb=017484da7f2648254dda67a30a64ddd699dc0efc;hp=1e6737b64671188b967e42210a6fda8f73b7e3c9;hpb=52b01fc00d6ea2c053f9022981498b97ebd05839;p=plomrogue2 diff --git a/plomrogue/tasks.py b/plomrogue/tasks.py index 1e6737b..841a0e6 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."') @@ -266,3 +272,4 @@ class Task_SPIN(Task): def do(self): self.thing.carrying.spin() + self.thing.send_msg('CHAT "You spin this object."')