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/static/gitweb.css?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=daa43576cd7181ed4e285e3a389abf7dce0b5bbd;hb=d13e2f639316c1dba7a62d84f3c850bc937c2b1e;hp=07bfae0e1b905f8141fe281d1c475b44fcd400e0;hpb=a81ea397900267331c15c1cda5d349b22a49ea16;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 07bfae0..daa4357 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -285,7 +285,7 @@ def cmd_THING_MUSICPLAYER_SETTINGS(game, thing_id, playing, index, repeat): t.playing = playing t.playlist_index = index t.repeat = repeat -cmd_THING_MUSICPLAYER_SETTINGS.argtypes = 'int:pos bool int:nonneg bool' +cmd_THING_MUSICPLAYER_SETTINGS.argtypes = 'int:pos bool int bool' def cmd_THING_MUSICPLAYER_PLAYLIST_ITEM(game, thing_id, title, length): t = game.get_thing(thing_id) @@ -304,3 +304,12 @@ def cmd_THING_BOTTLE_EMPTY(game, thing_id): raise GameError('thing of ID %s not bottle' % thing_id) t.empty() cmd_THING_BOTTLE_EMPTY.argtypes = 'int:pos' + +def cmd_THING_INSTALLED(game, thing_id): + t = game.get_thing(thing_id) + if not t: + raise GameError('thing of ID %s not found' % thing_id) + if not hasattr(t, 'installable'): + raise GameError('thing of ID %s not installable' % thing_id) + t.install() +cmd_THING_INSTALLED.argtypes = 'int:pos'