From: Laszlo T. <ave...@us...> - 2004-09-19 20:05:01
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24107/GUIScripts/bg2 Modified Files: GUICommonWindows.py GUIREC.py Log Message: changed class.2da to classes.2da in PST (it is now compatible with classes.2da of other gametypes) Index: GUICommonWindows.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2/GUICommonWindows.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GUICommonWindows.py 18 Sep 2004 17:54:49 -0000 1.6 --- GUICommonWindows.py 19 Sep 2004 20:04:51 -0000 1.7 *************** *** 134,152 **** def GetActorClassTitle (actor): ! ClassTitle = GemRB.GetPlayerStat (actor, IE_TITLE1) ! KitIndex = GemRB.GetPlayerStat (actor, IE_KIT) & 0xfff ! Class = GemRB.GetPlayerStat (actor, IE_CLASS) ! ClassTable = GemRB.LoadTable ("classes") Class = GemRB.FindTableValue( ClassTable, 5, Class ) ! KitTable = GemRB.LoadTable ("kitlist") ! if ClassTitle==0: ! if KitIndex == 0: ! ClassTitle=GemRB.GetTableValue(ClassTable, Class, 2) ! else: ! ClassTitle=GemRB.GetTableValue(KitTable, KitIndex, 2) ! GemRB.UnloadTable (ClassTable) ! GemRB.UnloadTable (KitTable) return ClassTitle --- 134,152 ---- def GetActorClassTitle (actor): ! ClassTitle = GemRB.GetPlayerStat (actor, IE_TITLE1) ! KitIndex = GemRB.GetPlayerStat (actor, IE_KIT) & 0xfff ! Class = GemRB.GetPlayerStat (actor, IE_CLASS) ! ClassTable = GemRB.LoadTable ("classes") Class = GemRB.FindTableValue( ClassTable, 5, Class ) ! KitTable = GemRB.LoadTable ("kitlist") ! if ClassTitle==0: ! if KitIndex == 0: ! ClassTitle=GemRB.GetTableValue(ClassTable, Class, 2) ! else: ! ClassTitle=GemRB.GetTableValue(KitTable, KitIndex, 2) ! GemRB.UnloadTable (ClassTable) ! GemRB.UnloadTable (KitTable) return ClassTitle *************** *** 253,254 **** --- 253,295 ---- GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, i + 1 == sel) + def GetSavingThrow (SaveName, row, level): + SaveTable = GemRB.LoadTable (SaveName) + tmp = GemRB.GetTableValue (SaveTable, level) + GemRB.UnloadTable (SaveName) + return tmp + + def SetupSavingThrows (pc): + level1 = GemRB.GetPlayerStat (pc, IE_LEVEL) - 1 + if level1 > 20: + level1 = 20 + level2 = GemRB.GetPlayerStat (pc, IE_LEVEL2) - 1 + if level2 > 20: + level2 = 20 + Class = GemRB.GetPlayerStat (pc, IE_CLASS) + ClassTable = GemRB.LoadTable ("classes") + Class = GemRB.FindTableValue (ClassTable, 5, Class) + Multi = GemRB.GetTableValue (ClassTable, 4, Class) + if Multi: + if Class == 7: + #fighter/mage + Class = GemRB.FindTableValue (ClassTable, 5, 1) + else: + #fighter/thief + Class = GemRB.FindTableValue (ClassTable, 5, 4) + SaveName2 = GemRB.GetTableValue (ClassTable, Class, 3) + Class = 0 #fighter + print "SaveName2", SaveName2 + + SaveName1 = GemRB.GetTableValue (ClassTable, Class, 3) + print "SaveName1", SaveName1 + + for row in range(5): + tmp1 = GetSavingThrow (SaveName1, row, level1) + if Multi: + tmp2 = GetSavingThrow (SaveName2, row, level2) + if tmp2<tmp1: + tmp1=tmp2 + GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + print "Savingthrow:", tmp1 + return + Index: GUIREC.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2/GUIREC.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GUIREC.py 18 Sep 2004 17:54:49 -0000 1.8 --- GUIREC.py 19 Sep 2004 20:04:51 -0000 1.9 *************** *** 213,216 **** --- 213,223 ---- GemRB.SetText (Window, Label, 7199) + #collecting tokens for stat overview + ClassTitle = GemRB.GetString (GetActorClassTitle (pc) ) + + GemRB.SetToken("CLASS", ClassTitle) + GemRB.SetToken("LEVEL", str (GemRB.GetPlayerStat (pc, IE_LEVEL) ) ) + GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) + # help, info textarea stats_overview = GetStatOverview (pc) *************** *** 231,241 **** # Next Level: <NEXTLEVEL> - ClassTitle = GemRB.GetString (GetActorClassTitle (pc) ) - Main = GemRB.GetString (16480) - Main = Main.replace ("<CLASS>", ClassTitle) - Main = Main.replace ("<LEVEL>", str (GemRB.GetPlayerStat (pc, IE_LEVEL)) ) - Main = Main.replace ("<EXPERIENCE>", str (GemRB.GetPlayerStat (pc, IE_XP)) ) - Main = Main.replace ("<NEXTLEVEL>", "??") # 59856 Current State --- 238,242 ---- |