t.name = nick
game.io.send('CHAT ' + quote(t.name + ' entered the map.'))
game.io.send('PLAYER_ID %s' % t.id_, connection_id)
+ for s in [s for s in game.things
+ if s.type_ == 'SpawnPoint' and s.name == t.name]:
+ t.position = s.position
+ break
game.changed = True
cmd_LOGIN.argtypes = 'string'
-class Thing_ItemSpawner(Thing):
+class ThingSpawner(Thing):
symbol_hint = 'S'
def proceed(self):
for t in [t for t in self.game.things
if t != self and t.position == self.position]:
return
- t = self.game.thing_types['Item'](self.game, position=self.position)
+ t = self.game.thing_types[self.child_type](self.game,
+ position=self.position)
self.game.things += [t]
self.game.changed = True
+class Thing_ItemSpawner(ThingSpawner):
+ child_type = 'Item'
+
+
+
+class Thing_SpawnPointSpawner(ThingSpawner):
+ child_type = 'SpawnPoint'
+
+
+
+class Thing_SpawnPoint(Thing):
+ symbol_hint = 's'
+ portable = True
+ name = ' '
+
+
+
class ThingAnimate(Thing):
blocking = True
cmd_SET_MAP_CONTROL_PASSWORD, cmd_SPAWN_POINT)
from plomrogue.tasks import (Task_WAIT, Task_MOVE, Task_WRITE, Task_PICK_UP,
Task_DROP, Task_FLATTEN_SURROUNDINGS)
-from plomrogue.things import Thing_Player, Thing_Item, Thing_ItemSpawner
+from plomrogue.things import (Thing_Player, Thing_Item, Thing_ItemSpawner,
+ Thing_SpawnPoint, Thing_SpawnPointSpawner)
from plomrogue.config import config
game = Game(config['savefile'])
game.register_thing_type(Thing_Player)
game.register_thing_type(Thing_Item)
game.register_thing_type(Thing_ItemSpawner)
+game.register_thing_type(Thing_SpawnPoint)
+game.register_thing_type(Thing_SpawnPointSpawner)
game.read_savefile()
game.io.start_loop()
for port in config['servers']: