changeset 375:c80a1bd291d1

Only give vandalism warning once
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 28 Aug 2010 18:02:49 +0200
parents 277a7a0c2cea
children 41ee3fc71404
files TODO gamelib/scenes/cryo.py
diffstat 2 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/TODO	Sat Aug 28 17:50:21 2010 +0200
+++ b/TODO	Sat Aug 28 18:02:49 2010 +0200
@@ -11,7 +11,3 @@
   * Clean-up finding and loading of speech strings.
   * Move interacts out into their own module?
   * Fix thing.enter being called multiple times without leaving
-
-Artwork:
-  * Can Pipe
-  * 0/1 Fixed can + 0/1/2 fixed pipes + ductape overlay images
--- a/gamelib/scenes/cryo.py	Sat Aug 28 17:50:21 2010 +0200
+++ b/gamelib/scenes/cryo.py	Sat Aug 28 18:02:49 2010 +0200
@@ -22,7 +22,8 @@
 
     INITIAL_DATA = {
         'accessible': True,
-        'greet' : True
+        'greet' : True,
+        'vandalism_warn': True,
         }
 
     # sounds that will be played randomly as background noise
@@ -156,7 +157,7 @@
 
     INITIAL_DATA = {
         'fixed': True,
-        }
+    }
 
     def interact_with_machete(self, item):
         if self.get_data('fixed'):
@@ -165,11 +166,15 @@
             self.state.add_item(pipe)
             self.state.add_inventory_item(pipe.name)
             self.set_interact("chopped")
-            return (Result("It takes more effort than one would expect, but "
-                          "eventually the pipe is separated from the wall."),
-                          make_jim_dialog("Prisoner %s. Vandalism is an offence "
-                              "punishable by a minimum of an additional 6 months "
-                              "to your sentence" % PLAYER_ID, self.state))
+            responses = [Result("It takes more effort than one would expect, but "
+                                "eventually the pipe is separated from the wall.")]
+            if self.state.current_scene.get_data('vandalism_warn'):
+                self.state.current_scene.set_data('vandalism_warn', False)
+                responses.append(make_jim_dialog(
+                    ("Prisoner %s. Vandalism is an offence punishable by a "
+                     "minimum of an additional 6 months to your sentence"
+                    ) % PLAYER_ID, self.state))
+            return responses
 
     def is_interactive(self):
         return self.get_data('fixed')