home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b72c8ae
)
Make door closing visible.
author
Christian Heller
<c.heller@plomlompom.de>
Tue, 1 Dec 2020 02:31:25 +0000
(
03:31
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Tue, 1 Dec 2020 02:31:25 +0000
(
03:31
+0100)
plomrogue/commands.py
patch
|
blob
|
history
plomrogue/game.py
patch
|
blob
|
history
plomrogue/things.py
patch
|
blob
|
history
rogue_chat.html
patch
|
blob
|
history
rogue_chat_curses.py
patch
|
blob
|
history
diff --git
a/plomrogue/commands.py
b/plomrogue/commands.py
index 94d1c591045dcee8ffbdbcf0f7dd0ab5b5186efa..c25740bd98f93d174b6f4312147abfa448761052 100644
(file)
--- a/
plomrogue/commands.py
+++ b/
plomrogue/commands.py
@@
-79,7
+79,7
@@
def cmd_LOGIN(game, nick, connection_id):
t = game.thing_types['Player'](game)
t.position = game.spawn_point
game.things += [t] # TODO refactor into Thing.__init__?
t = game.thing_types['Player'](game)
t.position = game.spawn_point
game.things += [t] # TODO refactor into Thing.__init__?
- t.
player
_char = game.get_next_player_char()
+ t.
thing
_char = game.get_next_player_char()
game.sessions[connection_id] = {
'thing_id': t.id_,
'status': 'player'
game.sessions[connection_id] = {
'thing_id': t.id_,
'status': 'player'
diff --git
a/plomrogue/game.py
b/plomrogue/game.py
index f504599f59e4146adcc96a2645c9b48583f8e672..8bc7f74b64a2890793352b7717a9c7222831fb38 100755
(executable)
--- a/
plomrogue/game.py
+++ b/
plomrogue/game.py
@@
-214,9
+214,9
@@
class Game(GameBase):
quote(t.protection), t.id_), c_id)
if hasattr(t, 'name'):
self.io.send('THING_NAME %s %s' % (t.id_, quote(t.name)), c_id)
quote(t.protection), t.id_), c_id)
if hasattr(t, 'name'):
self.io.send('THING_NAME %s %s' % (t.id_, quote(t.name)), c_id)
- if hasattr(t, '
player
_char'):
+ if hasattr(t, '
thing
_char'):
self.io.send('THING_CHAR %s %s' % (t.id_,
self.io.send('THING_CHAR %s %s' % (t.id_,
- quote(t.
player
_char)), c_id)
+ quote(t.
thing
_char)), 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)]:
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)]:
diff --git
a/plomrogue/things.py
b/plomrogue/things.py
index 4d319b9d21e0781b98d615d5d29f39e28392d2fd..b757157d99cef4375f344ec0038f83599503cae6 100644
(file)
--- a/
plomrogue/things.py
+++ b/
plomrogue/things.py
@@
-87,10
+87,12
@@
class Thing_Door(Thing):
def open(self):
self.blocking = False
self.portable = True
def open(self):
self.blocking = False
self.portable = True
+ del self.thing_char
def close(self):
self.blocking = True
self.portable = False
def close(self):
self.blocking = True
self.portable = False
+ self.thing_char = '#'
diff --git
a/rogue_chat.html
b/rogue_chat.html
index ce0b6a2c9d69785c9f33b315a7660dc2f514a77f..554c5945232f7aac6d57d786b02b206c7f8052cf 100644
(file)
--- a/
rogue_chat.html
+++ b/
rogue_chat.html
@@
-430,7
+430,7
@@
let server = {
} else if (tokens[0] === 'THING_CHAR') {
let t = game.get_thing(tokens[1], false);
if (t) {
} else if (tokens[0] === 'THING_CHAR') {
let t = game.get_thing(tokens[1], false);
if (t) {
- t.
player
_char = tokens[2];
+ t.
thing
_char = tokens[2];
};
} else if (tokens[0] === 'TASKS') {
game.tasks = tokens[1].split(',');
};
} else if (tokens[0] === 'TASKS') {
game.tasks = tokens[1].split(',');
@@
-897,8
+897,8
@@
let tui = {
let t = game.things[thing_id];
let symbol = game.thing_types[t.type_];
let meta_char = ' ';
let t = game.things[thing_id];
let symbol = game.thing_types[t.type_];
let meta_char = ' ';
- if (t.
player
_char) {
- meta_char = t.
player
_char;
+ if (t.
thing
_char) {
+ meta_char = t.
thing
_char;
}
if (used_positions.includes(t.position.toString())) {
meta_char = '+';
}
if (used_positions.includes(t.position.toString())) {
meta_char = '+';
@@
-1231,8
+1231,8
@@
let explorer = {
protection = 'none';
}
info += "THING: " + t.type_ + " / " + symbol;
protection = 'none';
}
info += "THING: " + t.type_ + " / " + symbol;
- if (t.
player
_char) {
- info += t.
player
_char;
+ if (t.
thing
_char) {
+ info += t.
thing
_char;
};
if (t.name_) {
info += " (" + t.name_ + ")";
};
if (t.name_) {
info += " (" + t.name_ + ")";
diff --git
a/rogue_chat_curses.py
b/rogue_chat_curses.py
index eb708a249a3ddc6c4392e2349fa81d0587de7d43..f715018cc85ef339591c7cfbf119bff5f73d041e 100755
(executable)
--- a/
rogue_chat_curses.py
+++ b/
rogue_chat_curses.py
@@
-1,4
+1,4
@@
-
#
!/usr/bin/env python3
+
e
!/usr/bin/env python3
import curses
import queue
import threading
import curses
import queue
import threading
@@
-179,7
+179,7
@@
cmd_THING_NAME.argtypes = 'int:nonneg string'
def cmd_THING_CHAR(game, thing_id, c):
t = game.get_thing(thing_id)
if t:
def cmd_THING_CHAR(game, thing_id, c):
t = game.get_thing(thing_id)
if t:
- t.
player
_char = c
+ t.
thing
_char = c
cmd_THING_CHAR.argtypes = 'int:nonneg char'
def cmd_MAP(game, geometry, size, content):
cmd_THING_CHAR.argtypes = 'int:nonneg char'
def cmd_MAP(game, geometry, size, content):
@@
-694,8
+694,8
@@
class TUI:
protection = 'none'
info += 'THING: %s / %s' % (t.type_,
self.game.thing_types[t.type_])
protection = 'none'
info += 'THING: %s / %s' % (t.type_,
self.game.thing_types[t.type_])
- if hasattr(t, '
player
_char'):
- info += t.
player
_char
+ if hasattr(t, '
thing
_char'):
+ info += t.
thing
_char
if hasattr(t, 'name'):
info += ' (%s)' % t.name
info += ' / protection: %s\n' % protection
if hasattr(t, 'name'):
info += ' (%s)' % t.name
info += ' / protection: %s\n' % protection
@@
-757,8
+757,8
@@
class TUI:
for t in self.game.things:
symbol = self.game.thing_types[t.type_]
meta_char = ' '
for t in self.game.things:
symbol = self.game.thing_types[t.type_]
meta_char = ' '
- if hasattr(t, '
player
_char'):
- meta_char = t.
player
_char
+ if hasattr(t, '
thing
_char'):
+ meta_char = t.
thing
_char
if t.position in used_positions:
meta_char = '+'
map_lines_split[t.position.y][t.position.x] = symbol + meta_char
if t.position in used_positions:
meta_char = '+'
map_lines_split[t.position.y][t.position.x] = symbol + meta_char