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 (from parent 1:
efb443c
)
Fix various minor, mostly "unused" flake8 complaints.
author
Christian Heller
<c.heller@plomlompom.de>
Thu, 26 Nov 2020 20:28:45 +0000
(21:28 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Thu, 26 Nov 2020 20:28:45 +0000
(21:28 +0100)
plomrogue/commands.py
patch
|
blob
|
history
plomrogue/game.py
patch
|
blob
|
history
plomrogue/mapping.py
patch
|
blob
|
history
plomrogue/parser.py
patch
|
blob
|
history
plomrogue/tasks.py
patch
|
blob
|
history
plomrogue/things.py
patch
|
blob
|
history
diff --git
a/plomrogue/commands.py
b/plomrogue/commands.py
index a4507b1b74f011654b62de6f319df45fdf963c57..0c3da0ada3b9e49dc784dbd9000c674f0a86b142 100644
(file)
--- a/
plomrogue/commands.py
+++ b/
plomrogue/commands.py
@@
-1,13
+1,11
@@
from plomrogue.misc import quote
from plomrogue.errors import GameError
from plomrogue.misc import quote
from plomrogue.errors import GameError
-from plomrogue.mapping import YX, MapGeometrySquare, MapGeometryHex, DijkstraMap
# TODO: instead of sending tasks, thing types etc. on request, send them on connection
def cmd_TASKS(game, connection_id):
# TODO: instead of sending tasks, thing types etc. on request, send them on connection
def cmd_TASKS(game, connection_id):
- tasks = []
game.io.send('TASKS ' + ','.join(game.tasks.keys()), connection_id)
cmd_TASKS.argtypes = ''
game.io.send('TASKS ' + ','.join(game.tasks.keys()), connection_id)
cmd_TASKS.argtypes = ''
@@
-24,6
+22,7
@@
def cmd_TERRAINS(game, connection_id):
cmd_TERRAINS.argtypes = ''
def cmd_ALL(game, msg, connection_id):
cmd_TERRAINS.argtypes = ''
def cmd_ALL(game, msg, connection_id):
+ from plomrogue.mapping import DijkstraMap
def lower_msg_by_volume(msg, volume, largest_audible_distance):
import random
def lower_msg_by_volume(msg, volume, largest_audible_distance):
import random
@@
-198,7
+197,7
@@
def cmd_PORTAL(game, yx, msg, pw, connection_id):
if msg == ' ':
if big_yx in game.portals:
if little_yx in game.portals[big_yx]:
if msg == ' ':
if big_yx in game.portals:
if little_yx in game.portals[big_yx]:
- del game.portals[big_yx][little_
xy
]
+ del game.portals[big_yx][little_
yx
]
else:
if not big_yx in game.portals:
game.portals[big_yx] = {}
else:
if not big_yx in game.portals:
game.portals[big_yx] = {}
@@
-254,7
+253,7
@@
cmd_MAP_CONTROL_PW.argtypes = 'char string'
def cmd_THING(game, big_yx, little_yx, thing_type, thing_id):
if not thing_type in game.thing_types:
raise GameError('illegal thing type %s' % thing_type)
def cmd_THING(game, big_yx, little_yx, thing_type, thing_id):
if not thing_type in game.thing_types:
raise GameError('illegal thing type %s' % thing_type)
-
map
_ = game.get_map(big_yx)
+ _ = game.get_map(big_yx)
t_old = None
if thing_id > 0:
t_old = game.get_thing(thing_id)
t_old = None
if thing_id > 0:
t_old = game.get_thing(thing_id)
diff --git
a/plomrogue/game.py
b/plomrogue/game.py
index 64ae6898a9f9c11d56506d37f114d3e997585af0..7936842ae6ce892ae9a27e7a4aa28593de5196b8 100755
(executable)
--- a/
plomrogue/game.py
+++ b/
plomrogue/game.py
@@
-1,5
+1,3
@@
-from plomrogue.tasks import (Task_WAIT, Task_MOVE, Task_WRITE,
- Task_FLATTEN_SURROUNDINGS)
from plomrogue.errors import GameError, PlayError
from plomrogue.io import GameIO
from plomrogue.misc import quote
from plomrogue.errors import GameError, PlayError
from plomrogue.io import GameIO
from plomrogue.misc import quote
@@
-219,7
+217,6
@@
class Game(GameBase):
for little_yx in [little_yx for little_yx in self.annotations[big_yx]
if player.fov_test(big_yx, little_yx)]:
target_yx = player.fov_stencil.target_yx(big_yx, little_yx)
for little_yx in [little_yx for little_yx in self.annotations[big_yx]
if player.fov_test(big_yx, little_yx)]:
target_yx = player.fov_stencil.target_yx(big_yx, little_yx)
- annotation = self.annotations[big_yx][little_yx]
self.io.send('ANNOTATION_HINT %s' % (target_yx,), c_id)
self.io.send('GAME_STATE_COMPLETE')
self.io.send('ANNOTATION_HINT %s' % (target_yx,), c_id)
self.io.send('GAME_STATE_COMPLETE')
diff --git
a/plomrogue/mapping.py
b/plomrogue/mapping.py
index 09845fae1aa219b7421b0cb45ed4868182c248af..97f788bf59c52d6b992b25b083f22a5259afc5bd 100644
(file)
--- a/
plomrogue/mapping.py
+++ b/
plomrogue/mapping.py
@@
-360,7
+360,6
@@
class FovMap(SourcedMap):
# and skip evaluation of already shaded tile. (This only works if tiles
# shading implies they completely lie in existing shades; otherwise we
# would lose shade growth through tiles at shade borders.)
# and skip evaluation of already shaded tile. (This only works if tiles
# shading implies they completely lie in existing shades; otherwise we
# would lose shade growth through tiles at shade borders.)
- circle_in_map = True
distance = 1
yx = YX(yx.y, yx.x)
while distance <= self.radius:
distance = 1
yx = YX(yx.y, yx.x)
while distance <= self.radius:
diff --git
a/plomrogue/parser.py
b/plomrogue/parser.py
index d1307a97701d3ef5c5eee6ecc2c16cfcb8d94282..2a87e7d10ea221336cde9dae391b14d5b774b024 100644
(file)
--- a/
plomrogue/parser.py
+++ b/
plomrogue/parser.py
@@
-1,4
+1,3
@@
-import unittest
from plomrogue.errors import ArgError
from plomrogue.mapping import YX
from plomrogue.errors import ArgError
from plomrogue.mapping import YX
diff --git
a/plomrogue/tasks.py
b/plomrogue/tasks.py
index 9335aeddb0df450953a4ffb01bf4710142c9c150..2e12e5a2ec3028f66b1ea7b8b8efbfb7e9196dcf 100644
(file)
--- a/
plomrogue/tasks.py
+++ b/
plomrogue/tasks.py
@@
-1,5
+1,4
@@
from plomrogue.errors import PlayError, GameError
from plomrogue.errors import PlayError, GameError
-from plomrogue.mapping import YX
diff --git
a/plomrogue/things.py
b/plomrogue/things.py
index cedee68266583f9486dea676a0d67bd5bacb2378..a99460974f7dbc8f435f262b3caf8d14be5a9b79 100644
(file)
--- a/
plomrogue/things.py
+++ b/
plomrogue/things.py
@@
-81,8
+81,7
@@
class ThingAnimate(Thing):
self.task.check()
except GameError as e:
self.task = None
self.task.check()
except GameError as e:
self.task = None
- raise GameError
- return
+ raise e
self.task.todo -= 1
if self.task.todo <= 0:
self._last_task_result = self.task.do()
self.task.todo -= 1
if self.task.todo <= 0:
self._last_task_result = self.task.do()