diff charactercreationcontroller.py @ 153:741d7d193bad

Changed CharacterStatistic classes to work with components.
author KarstenBock@gmx.net
date Sat, 05 Nov 2011 14:42:12 +0100
parents 8bb84164e6a2
children 4dc7951c3bfc
line wrap: on
line diff
--- a/charactercreationcontroller.py	Wed Oct 26 13:01:49 2011 +0200
+++ b/charactercreationcontroller.py	Sat Nov 05 14:42:12 2011 +0100
@@ -89,12 +89,12 @@
     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_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 = []
@@ -110,15 +110,18 @@
             self.PICTURES[self.GENDERS[0]][0]
         )
         for primary_stat in primary_stats:
-            short_name = primary_stat.short_name
-            self.char_data.characterstats.primary_stats[short_name] = (
+            long_name = primary_stat.long_name
+            self.char_data.characterstats.primary_stats[long_name] = (
                 char_stats.PrimaryStatisticValue(
-                    primary_stat, self, DEFAULT_STAT_VALUE)
+                    primary_stat, self.char_data.characterstats, 
+                    DEFAULT_STAT_VALUE)
             )
         for secondary_stat in secondary_stats:
             name = secondary_stat.name            
             self.char_data.characterstats.secondary_stats[name] = (
-                char_stats.SecondaryStatisticValue(secondary_stat, self)
+                char_stats.SecondaryStatisticValue(secondary_stat, 
+                                                   self.char_data.
+                                                   characterstats)
             )
         self.char_data.container.max_bulk = self.MAX_BULK
         self.char_data.container.children = inventory