# HG changeset patch # User KarstenBock@gmx.net # Date 1320501192 -3600 # Node ID 4dc7951c3bfc864852776cef7b370564f876cad1 # Parent 741d7d193bad2f655b660660635d4f8a089103cb Moved code from CharacterCreationController to GameModel diff -r 741d7d193bad -r 4dc7951c3bfc charactercreationcontroller.py --- a/charactercreationcontroller.py Sat Nov 05 14:42:12 2011 +0100 +++ b/charactercreationcontroller.py Sat Nov 05 14:53:12 2011 +0100 @@ -17,7 +17,6 @@ from parpg import vfs import characterstatistics as char_stats -from serializers import XmlSerializer from controllerbase import ControllerBase from gamescenecontroller import GameSceneController from gamesceneview import GameSceneView @@ -87,16 +86,6 @@ self.view.cancel_new_game_callback = self.cancelNewGame def reset_character(self): - # FIXME M. George Hansen 2011-06-06: character stats scripts aren't - # finished, unfortunately. - #primary_stats_file = \ - # vfs.VFS.open('character_scripts/primary_stats.xml') - #primary_stats = XmlSerializer.deserialize(primary_stats_file) - #secondary_stats_file = \ - # vfs.VFS.open('character_scripts/secondary_stats.xml') - #secondary_stats = XmlSerializer.deserialize(secondary_stats_file) - primary_stats = [] - secondary_stats = [] inventory = [] for x in xrange(self.INV_SLOTS): inventory.append(None) @@ -109,14 +98,14 @@ self.char_data.characterstats.picture = ( self.PICTURES[self.GENDERS[0]][0] ) - for primary_stat in primary_stats: + for primary_stat in self.model.primary_stats: long_name = primary_stat.long_name self.char_data.characterstats.primary_stats[long_name] = ( char_stats.PrimaryStatisticValue( primary_stat, self.char_data.characterstats, DEFAULT_STAT_VALUE) ) - for secondary_stat in secondary_stats: + for secondary_stat in self.model.secondary_stats: name = secondary_stat.name self.char_data.characterstats.secondary_stats[name] = ( char_stats.SecondaryStatisticValue(secondary_stat, diff -r 741d7d193bad -r 4dc7951c3bfc gamemodel.py --- a/gamemodel.py Sat Nov 05 14:42:12 2011 +0100 +++ b/gamemodel.py Sat Nov 05 14:53:12 2011 +0100 @@ -22,6 +22,7 @@ from fife import fife from fife.extensions.serializers.xmlobject import XMLObjectLoader from parpg.bGrease.geometry import Vec2d +from serializers import XmlSerializer from parpg import vfs from gamestate import GameState @@ -95,7 +96,17 @@ self.dialogues = {} self.agent_import_files = {} self.obj_loader = XMLObjectLoader(self.engine) - + # FIXME M. George Hansen 2011-06-06: character stats scripts aren't + # finished, unfortunately. + #primary_stats_file = \ + # vfs.VFS.open('character_scripts/primary_stats.xml') + #self.primary_stats = XmlSerializer.deserialize(primary_stats_file) + #secondary_stats_file = \ + # vfs.VFS.open('character_scripts/secondary_stats.xml') + #self.secondary_stats = XmlSerializer.deserialize(secondary_stats_file) + self.primary_stats = [] + self.secondary_stats = [] + def checkAttributes(self, attributes, template): """Checks for attributes that where not given in the map file and fills them with values from the object database