diff demos/rpg/scripts/scene.py @ 525:19db5a8619a4

Added the GoldStack item class. The scene now loads the goldstack and assigns it's value based on the maps objects file.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 27 May 2010 21:34:36 +0000
parents 6037f79b0dcf
children 796d49ab9380
line wrap: on
line diff
--- a/demos/rpg/scripts/scene.py	Thu May 27 21:11:37 2010 +0000
+++ b/demos/rpg/scripts/scene.py	Thu May 27 21:34:36 2010 +0000
@@ -34,7 +34,7 @@
 from scripts.actors.baseactor import QuestGiver, Quest
 from scripts.actors.player import Player
 from scripts.objects.baseobject import GameObjectTypes
-from scripts.objects.items import BaseItem
+from scripts.objects.items import BaseItem, GoldStack
 
 class Scene(object):
 	def __init__(self, gamecontroller):
@@ -75,7 +75,14 @@
 			itemdict = objectsettings.get("items", item, {})
 			modeldict = itemsettings.get("models", itemdict["typename"])
 			
-			newitem = BaseItem(self._gamecontroller, item, modeldict["model"])
+			if itemdict["typename"] == "GoldStack":
+				newitem = GoldStack(self._gamecontroller, modeldict["model"], item)
+				#newitem.value = itemdict["value"]
+				print itemdict["value"]
+			else:
+				newitem = BaseItem(self._gamecontroller, modeldict["model"], item)
+				
+			self._objectlist[newitem.instance.getId()] = newitem
 		
 		for npc in objectsettings.get("npcs", "npclist", []):
 			objdict = objectsettings.get("npcs", npc, {})