X-Git-Url: https://plomlompom.com/repos//%22https:/validator.w3.org/check?a=blobdiff_plain;f=plomrogue%2Fthings.py;h=4f802db6e25a9f340a9da02074b219d80502b0ab;hb=ba09978e0179406218f052ed29690f1f7c508920;hp=e1a9bd3a2d18b0d8b1b64943b6f055dfd11508e6;hpb=856b68988876a63409737dac77b4d4921b9a466b;p=plomrogue2 diff --git a/plomrogue/things.py b/plomrogue/things.py index e1a9bd3..4f802db 100644 --- a/plomrogue/things.py +++ b/plomrogue/things.py @@ -22,6 +22,7 @@ class Thing(ThingBase): portable = False protection = '.' commandable = False + carried = False def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -351,7 +352,7 @@ class ThingAnimate(Thing): # TODO: refactor with self.send_msg self.game.io.send('DEFAULT_COLORS', c_id) self.game.io.send('CHAT "You sober up."', c_id) - self.game.changed_fovs = True + self.invalidate_map_view() break self.game.changed = True if self.task is None: @@ -436,3 +437,9 @@ class Thing_Player(ThingAnimate): if self.game.sessions[c_id]['thing_id'] == self.id_: self.game.io.send(msg, c_id) break + + def uncarry(self): + t = self.carrying + t.carried = False + self.carrying = None + return t