home · contact · privacy
Re-calibrate bladder pressure following weariness mechanic.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 16 Dec 2020 21:22:42 +0000 (22:22 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 16 Dec 2020 21:22:42 +0000 (22:22 +0100)
plomrogue/tasks.py
plomrogue/things.py

index 5449c0c2eda8dd27e980a2c4b6f28da68e8e1952..94f79a3350e1335eede208608b15a8a3e7577190 100644 (file)
@@ -240,7 +240,7 @@ class Task_INTOXICATE(Task):
             self.thing.carrying.full = False
             self.thing.carrying.empty()
             self.thing.send_msg('CHAT "You are drunk now."')
-            self.thing.need_for_toilet += 10000
+            self.thing.need_for_toilet += 1
             self.thing.drunk = 10000
             self.thing.invalidate('fov')
             self.thing.game.record_change(self.thing.position, 'other')
index c8ef346b13a05e831d092f9430d9a93c49a8473e..f8f13733ec2aef82ceab45c5dd27768c7b64eb46 100644 (file)
@@ -603,18 +603,22 @@ class Thing_Player(ThingAnimate):
         if self.tripping >= 0:
             self.tripping -= 1
         if self.need_for_toilet > 0:
-            self.need_for_toilet += 1
             terrain = self.game.maps[self.position[0]][self.position[1]]
             if terrain in self.game.terrains:
                 terrain_type = self.game.terrains[terrain]
                 if 'toilet' in terrain_type.tags:
                     self.send_msg('CHAT "You use the toilet. What a relief!"')
                     self.need_for_toilet = 0
-            if 10000 * random.random() < self.need_for_toilet / 100000:
+        if self.need_for_toilet > 0:
+            if random.random() > 0.9999:
+                self.need_for_toilet += 1
+                self.game.changed = True
+            if 100000 * random.random() < self.need_for_toilet:
                 self.send_msg('CHAT "You need to go to a toilet."')
-            if self.need_for_toilet > 1000000:
+            if self.need_for_toilet > 100:
                 self.send_msg('CHAT "You pee into your pants. Eww!"')
                 self.need_for_toilet = 0
+                self.game.changed = True
         if self.drunk == 0:
             self.send_msg('CHAT "You sober up."')
             self.invalidate('fov')
@@ -631,6 +635,7 @@ class Thing_Player(ThingAnimate):
                 self.weariness += 1
             elif self.weariness > 0:
                 self.weariness -= 1
+            self.game.changed = True
 
     def send_msg(self, msg):
         for c_id in self.game.sessions: