home · contact · privacy
Add writable signs.
[plomrogue2] / plomrogue / things.py
index da995d311dd84b7a777f9c0cc28aae2f091be0d5..46ea770ab302994272afe7d83612ba5204dd0d18 100644 (file)
@@ -148,6 +148,17 @@ class Thing_SpawnPoint(Thing):
     symbol_hint = 's'
     portable = True
     name = 'username'
+    temporary = False
+
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.created_at = datetime.datetime.now()
+
+    def proceed(self):
+        super().proceed()
+        if self.temporary and datetime.datetime.now() >\
+           self.created_at + datetime.timedelta(minutes=10):
+            self.game.remove_thing(self)
 
 
 
@@ -163,6 +174,21 @@ class ThingInstallable(Thing):
 
 
 
+class Thing_SignSpawner(ThingSpawner):
+    child_type = 'Sign'
+
+
+
+class Thing_Sign(ThingInstallable):
+    symbol_hint = '?'
+    design_size = YX(16, 36)
+
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.design = 'x' * self.design_size.y * self.design_size.x
+
+
+
 class Thing_DoorSpawner(ThingSpawner):
     child_type = 'Door'
 
@@ -265,6 +291,7 @@ class Thing_Hat(Thing):
     design = ' +--+ ' + ' |  | ' + '======'
     spinnable = True
     cookable = True
+    design_size = YX(3, 6)
 
     def spin(self):
         new_design = ''