home · contact · privacy
Add weariness mechanic.
[plomrogue2] / plomrogue / things.py
index 3686ab0c2a2b78f41e024a5f9c8ef14958fc285d..c8ef346b13a05e831d092f9430d9a93c49a8473e 100644 (file)
@@ -452,6 +452,7 @@ class Thing_CookieSpawner(Thing):
 
 
 class ThingAnimate(Thing):
+    weariness = 0
 
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
@@ -480,6 +481,7 @@ class ThingAnimate(Thing):
             task = self.next_task[0]
             self.next_task = [None]
             task.check()
+            task.todo += self.weariness * 10
             return task
 
     def proceed(self):
@@ -624,6 +626,11 @@ class Thing_Player(ThingAnimate):
         elif self.tripping > 0 and self.tripping % 250 == 0:
             self.send_msg('RANDOM_COLORS')
             self.game.changed = True
+        if random.random() > 0.9999:
+            if self.standing:
+                self.weariness += 1
+            elif self.weariness > 0:
+                self.weariness -= 1
 
     def send_msg(self, msg):
         for c_id in self.game.sessions: