Mercurial > fife-parpg
diff demos/rpg/scripts/scene.py @ 529:d0bce896a526
Changed the quest format in the object xml file.
Quests can now required gold or items to complete.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 28 May 2010 16:25:00 +0000 |
parents | 796d49ab9380 |
children | ea26e7b6f56c |
line wrap: on
line diff
--- a/demos/rpg/scripts/scene.py Fri May 28 14:52:56 2010 +0000 +++ b/demos/rpg/scripts/scene.py Fri May 28 16:25:00 2010 +0000 @@ -102,8 +102,16 @@ questcount = modelsettings.get(npc, "questcount", 0) for x in range(1,questcount+1): quest = "quest" + str(x) - (qname, qtext) = modelsettings.get(npc, quest, []) - actor.addQuest(Quest(actor, qname, qtext)) + questdict = modelsettings.get(npc, quest, {}) + quest = Quest(actor, questdict['name'], questdict['desc']) + + for ritem in questdict['items'].split(" , "): + if ritem == "GoldStack": + quest.addRequiredGold(int(questdict['value'])) + else: + quest.addRequiredItem(ritem) + + actor.addQuest(quest) elif modeldict["type"] == "NPC": actor = Actor(self._gamecontroller, modeldict["model"], npc, True) @@ -176,7 +184,14 @@ location = fife.Location(self._actorlayer) location.setMapCoordinates(target_mapcoord) return location - + + def addObjectToScene(self, obj): + self._objectlist[obj.id] = obj + + def removeObjectFromScene(self, obj): + obj.destroy() + del self._objectlist[obj.id] + def updateScene(self): pass