if hasattr(t, 'thing_char'):
self.io.send('THING_CHAR %s %s' % (t.id_,
quote(t.thing_char)), c_id)
+ if hasattr(t, 'carrying') and t.carrying:
+ self.io.send('THING_CARRYING %s' % (t.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)]:
tui.mode_take_thing.legal = game.tasks.includes('PICK_UP');
} else if (tokens[0] === 'THING_TYPE') {
game.thing_types[tokens[1]] = tokens[2]
+ } else if (tokens[0] === 'THING_CARRYING') {
+ let t = game.get_thing(tokens[1], false);
+ if (t) {
+ t.carrying = true;
+ };
} else if (tokens[0] === 'TERRAIN') {
game.terrains[tokens[1]] = tokens[2]
} else if (tokens[0] === 'MAP') {
if (used_positions.includes(t.position.toString())) {
meta_char = '+';
};
+ if (t.carrying) {
+ meta_char = '$';
+ }
map_lines_split[t.position[0]][t.position[1]] = symbol + meta_char;
used_positions.push(t.position.toString());
}
game.thing_types[thing_type] = symbol_hint
cmd_THING_TYPE.argtypes = 'string char'
+def cmd_THING_CARRYING(game, thing_id):
+ game.get_thing(thing_id).carrying = True
+cmd_THING_CARRYING.argtypes = 'int:nonneg'
+
def cmd_TERRAIN(game, terrain_char, terrain_desc):
game.terrains[terrain_char] = terrain_desc
cmd_TERRAIN.argtypes = 'char string'
self.register_command(cmd_THING_TYPE)
self.register_command(cmd_THING_NAME)
self.register_command(cmd_THING_CHAR)
+ self.register_command(cmd_THING_CARRYING)
self.register_command(cmd_TERRAIN)
self.register_command(cmd_MAP)
self.register_command(cmd_MAP_CONTROL)
meta_char = t.thing_char
if t.position in used_positions:
meta_char = '+'
+ if hasattr(t, 'carrying') and t.carrying:
+ meta_char = '$'
map_lines_split[t.position.y][t.position.x] = symbol + meta_char
used_positions += [t.position]