quote(t.thing_char)), c_id)
if hasattr(t, 'carrying') and t.carrying:
self.io.send('THING_CARRYING %s' % (t.id_), c_id)
+ if hasattr(t, 'installable') and not t.portable:
+ self.io.send('THING_INSTALLED %s' % (t.id_), c_id)
for big_yx in self.portals:
for little_yx in [little_yx for little_yx in self.portals[big_yx]
if player.fov_test(big_yx, little_yx)]:
if (t) {
t.carrying = true;
};
+ } else if (tokens[0] === 'THING_INSTALLED') {
+ let t = game.get_thing(tokens[1], false);
+ if (t) {
+ t.installed = true;
+ };
} else if (tokens[0] === 'TERRAIN') {
game.terrains[tokens[1]] = tokens[2]
} else if (tokens[0] === 'MAP') {
get_thing_info: function(t) {
const symbol = game.thing_types[t.type_];
let info = t.type_ + " / " + symbol;
- if (t.thing_char) {
- info += t.thing_char;
- };
- if (t.name_) {
- info += " (" + t.name_ + ")";
- }
+ if (t.thing_char) {
+ info += t.thing_char;
+ };
+ if (t.name_) {
+ info += " (" + t.name_ + ")";
+ }
+ if (t.installed) {
+ info += " / installed";
+ }
return info;
},
annotate: function(msg) {
game.thing_types[thing_type] = symbol_hint
cmd_THING_TYPE.argtypes = 'string char'
+def cmd_THING_INSTALLED(game, thing_id):
+ game.get_thing(thing_id).installed = True
+cmd_THING_INSTALLED.argtypes = 'int:pos'
+
def cmd_THING_CARRYING(game, thing_id):
game.get_thing(thing_id).carrying = True
-cmd_THING_CARRYING.argtypes = 'int:nonneg'
+cmd_THING_CARRYING.argtypes = 'int:pos'
def cmd_TERRAIN(game, terrain_char, terrain_desc):
game.terrains[terrain_char] = terrain_desc
self.register_command(cmd_THING_NAME)
self.register_command(cmd_THING_CHAR)
self.register_command(cmd_THING_CARRYING)
+ self.register_command(cmd_THING_INSTALLED)
self.register_command(cmd_TERRAIN)
self.register_command(cmd_MAP)
self.register_command(cmd_MAP_CONTROL)
info += t.thing_char
if hasattr(t, 'name'):
info += ' (%s)' % t.name
+ if hasattr(t, 'installed'):
+ info += ' / installed'
return info
def loop(self, stdscr):