diff gamestate.py @ 187:ab6a0fd1668a

Added help, moveObject, deleteObject, putItemIntoContainer, equipItem, createItemByID and createItemByType functions to the GameEnvironment.
author Beliar <KarstenBock@gmx.net>
date Sat, 24 Mar 2012 09:59:46 +0100
parents 9e7f494cc850
children
line wrap: on
line diff
--- a/gamestate.py	Tue Mar 20 14:31:02 2012 +0100
+++ b/gamestate.py	Sat Mar 24 09:59:46 2012 +0100
@@ -12,11 +12,14 @@
 
 #   You should have received a copy of the GNU General Public License
 #   along with PARPG.  If not, see <http://www.gnu.org/licenses/>.
-
 import math
 
 from parpg.quest_engine import QuestEngine
 
+def script_help(object):
+    """Python's help() function with the no-parameters path disabled"""
+    help(object)
+    
 class GameState(object):
     """This class holds the current state of the game."""
     def __init__(self, quests_dir = None):
@@ -29,13 +32,14 @@
         self.maps = {}
         self.npcs_met = set()
         self.funcs = {
-            "__builtins__":None,
-            "meet":self.meet,
-            "met":self.met,
-            "sqrt":math.sqrt,
-            "log":math.log, 
-            "str":str, 
-            }
+                "__builtins__":None,
+                "help":script_help, 
+                "sqrt":math.sqrt,
+                "log":math.log, 
+                "str":str, 
+                "meet":self.meet,
+                "met":self.met,
+                }                
         self.locals = {}