X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/balance2?a=blobdiff_plain;f=plomrogue%2Ftasks.py;h=423758d8f5959ec7ebec088abfa18d7800d28bc1;hb=6354f0d85ce38a5450142b2bc775e49f0abfc7b8;hp=eca94003d6c8a5a52e3b6f15d13464f188c17d86;hpb=018bb0242ebd2b7e9fde170fae830376dea55e16;p=plomrogue2 diff --git a/plomrogue/tasks.py b/plomrogue/tasks.py index eca9400..423758d 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