X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/form?a=blobdiff_plain;ds=sidebyside;f=plomrogue%2Ftasks.py;h=8fa3a178067bf4864f929638b79d5a8e4d8bb6d2;hb=ba9a4a402779b49f3b960f937ca73565a4854e8d;hp=eca94003d6c8a5a52e3b6f15d13464f188c17d86;hpb=018bb0242ebd2b7e9fde170fae830376dea55e16;p=plomrogue2 diff --git a/plomrogue/tasks.py b/plomrogue/tasks.py index eca9400..8fa3a17 100644 --- a/plomrogue/tasks.py +++ b/plomrogue/tasks.py @@ -103,8 +103,20 @@ class Task_DROP(Task): def check(self): if not self.thing.carrying: raise PlayError('nothing to drop') + if self.thing.carrying.type_ == 'Bottle' and self.thing.carrying.full: + for t in [t for t in self.thing.game.things + if t.type_ == 'BottleDeposit' + and t.position == self.thing.position]: + raise PlayError('cannot drop full bottle into bottle deposit') def do(self): + if self.thing.carrying.type_ == 'Bottle' and not self.thing.carrying.full: + for t in [t for t in self.thing.game.things + if t.type_ == 'BottleDeposit' + and t.position == self.thing.position]: + t.accept() + self.thing.game.things.remove(self.thing.carrying) + break self.thing.carrying = None @@ -136,6 +148,7 @@ class Task_INTOXICATE(Task): def do(self): self.thing.carrying.full = False + self.thing.carrying.empty() for c_id in self.thing.game.sessions: if self.thing.game.sessions[c_id]['thing_id'] == self.thing.id_: self.thing.game.io.send('RANDOM_COLORS', c_id)