From 518cdefd7b90e2e9dfc89cb67c3903ee26aeac10 Mon Sep 17 00:00:00 2001 From: Eldritch Cheese Date: Sat, 6 Apr 2013 17:23:54 -0400 Subject: [PATCH] Added the full list of professions to Professions.txt Started implementation of initial stat distributions. Changed level-up of stats to specify a Delta, rather than an absolute value, for parallels with skill levelling-up. Can modify stat, ask for the points in the potential or the current stat value. Currently, changing of the potential stat is bugged, to be fixed in next version. --- Character.py | 42 +++-- MainWindow.py | 31 +++- Professions.py | 6 +- TODO.txt | 20 ++- glade/MainWindow.ui | 193 ++++++++++++++------- tables/Professions.txt | 373 ++++++++++++++++++++++++++++++++++++++--- tests.py | 18 +- 7 files changed, 565 insertions(+), 118 deletions(-) diff --git a/Character.py b/Character.py index 43952f1..8a606d3 100755 --- a/Character.py +++ b/Character.py @@ -127,11 +127,14 @@ def LoadProfession(self,profname,profdict): self[skill].Costs = costs[:] except KeyError: pass - def StatPoints(self,levelled=False): - return sum(st.Points(levelled) for st in self.Stats) - def StatPointsAllowed(self,levelled=False): - level = self.GetMisc('Level') + (1 if levelled else 0) - return 55+12*level + def StatPoints(self,levelled=False,potl=False): + return sum(st.Points(levelled,potl) for st in self.Stats) + def StatPointsAllowed(self,level=None,potl=False): + if potl: + return 355 + else: + level = self.GetMisc('Level') if level is None else level + return 55 if level==0 else 12 def DPspent(self): return sum(sk.DPspent() for sk in self.Skills) def DPallowed(self): @@ -222,8 +225,11 @@ def Value(self): return 0 if self._value is None else self._value @Value.setter def Value(self,val): - self._value = val - self.Changed() + if self.IsValid(val): + self._value = val + self.Changed() + def IsValid(self,val): + return True @property def Delta(self): return self._delta @@ -371,16 +377,28 @@ def Max(self): except: pass else: - return 100 + return 50 @Max.setter def Max(self,val): self.Options = [opt for opt in self.Options if opt[3:]!='Max'] self.Options.append('Max' + '{0:+d}'.format(val)) self.Changed(False) - def SelfBonus(self,asker=None,levelled=False): - return 0 if self.NoBonus else _statBonuses(self.Value + (self.Delta if levelled else 0)) - def Points(self,levelled=False): - return 0 if self.NoBonus else _statBonuses(self.Value + (self.Delta if levelled else 0),item=1) + def IsValid(self,val): + return 1 <= val <= 100 + def SelfBonus(self,asker=None,levelled=False,potl=False): + if self.NoBonus: + return 0 + elif potl: + return _statBonuses(self.Max) + else: + return _statBonuses(self.Value + (self.Delta if levelled else 0)) + def Points(self,levelled=False,potl=False): + if self.NoBonus: + return 0 + elif potl: + return _statBonuses(self.Max,item=1) + else: + return _statBonuses(self.Value + (self.Delta if levelled else 0),item=1) class Resistance(Value): Type = 'Resistance' diff --git a/MainWindow.py b/MainWindow.py index f6b08cd..d949888 100755 --- a/MainWindow.py +++ b/MainWindow.py @@ -55,9 +55,10 @@ def __init__(self): self.b.get_object('statView').connect('cursor-changed',self.FromStatSelected) self.b.get_object('statNameBox').connect('changed',self.FromActiveStatNameChange) self.b.get_object('statCurrentBox').connect('changed',self.FromActiveStatCurrentChange) + self.b.get_object('statPotentialBox').connect('changed',self.FromActiveStatPotentialChange) self.b.get_object('statDescriptionBox').get_buffer().connect('changed',self.FromActiveStatDescriptionChange) - self.b.get_object('postLevelStatValue').connect('changed',self.FromActiveStatLevellingChange) - self.b.get_object('postLevelStatValue').connect('value-changed',self.FromActiveStatLevellingChange) + self.b.get_object('levellingStatGain').connect('changed',self.FromActiveStatLevellingChange) + self.b.get_object('levellingStatGain').connect('value-changed',self.FromActiveStatLevellingChange) #Skill modifications self.activeSkill = None @@ -332,10 +333,10 @@ def UpdateActiveStat(self,stat): self.b.get_object('statBonusLabel').set_text(str(stat.Bonus())) self.b.get_object('statPotentialBox').set_text(str(stat.Max)) better_set_text(self.b.get_object('statDescriptionBox').get_buffer(),stat.Description) - adj = self.b.get_object('postLevelStatValue') - adj.set_value(stat.Value + stat.Delta) - adj.set_lower(stat.Min) - adj.set_upper(stat.Max) + adj = self.b.get_object('levellingStatGain') + adj.set_value(stat.Delta) + adj.set_lower(0) + adj.set_upper(stat.Max-stat.Value) self.b.get_object('postLevelStatBonus').set_text(str(stat.SelfBonus(levelled=True))) def UpdateActiveSkill(self,skill): self.b.get_object('skillNameBox').set_text(skill.Name) @@ -445,8 +446,11 @@ def OnStatChange(self,stat): self.UpdateStatOverview(stat) if stat is self.activeStat and stat is not None: self.UpdateActiveStat(stat) - self.b.get_object('SPspentLabel').set_text('Stat Points Spent: {0}/{1}'.format( - self.char.StatPoints(levelled=True), self.char.StatPointsAllowed(levelled=True))) + for widname in ['SPspentLabel','initSPspent']: + self.b.get_object(widname).set_text('Stat Points Spent: {0}/{1}'.format( + self.char.StatPoints(levelled=True)-self.char.StatPoints(), self.char.StatPointsAllowed())) + self.b.get_object('potlSPspent').set_text("Pot'l Stat Points Spent: {0}/{1}".format( + self.char.StatPoints(potl=True), self.char.StatPointsAllowed(potl=True))) def FromSkillSelected(self,*args): selection = self.skillView.get_selection() model,skIter = selection.get_selected() @@ -523,16 +527,25 @@ def FromActiveStatNameChange(self,widget): def FromActiveStatCurrentChange(self,widget): if self.activeStat is not None: try: + print "Changing stat to ",widget.get_text() self.activeStat.Value = int(widget.get_text()) except ValueError: pass + print "Done Changing" + def FromActiveStatPotentialChange(self,widget): + if self.activeStat is not None: + print "box text ", widget.get_text() + try: + self.activeStat.Max = int(widget.get_text()) + except ValueError: + pass def FromActiveStatDescriptionChange(self,widget): if self.activeStat is not None: text = widget.get_text(widget.get_start_iter(),widget.get_end_iter()) self.activeStat.Description = text def FromActiveStatLevellingChange(self,widget): if self.activeStat is not None: - self.activeStat.Delta = int(widget.get_value())-self.activeStat.Value + self.activeStat.Delta = int(widget.get_value()) def FromActiveSkillNameChange(self,widget): if self.activeSkill is not None: self.activeSkill.Name = self.b.get_object('skillNameBox').get_text() diff --git a/Professions.py b/Professions.py index 11c737b..1848ea1 100755 --- a/Professions.py +++ b/Professions.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import re +from collections import OrderedDict def LoadProfessions(filename): """ @@ -10,7 +11,7 @@ def LoadProfessions(filename): """ with open(filename) as f: text = f.read() - profs = {} + profs = OrderedDict() #Strip out comments. text = re.sub(r'(^|[^\\])#.*',r'',text) for profMatch in re.finditer(r'(\S[^{}]*?)\s*' @@ -28,4 +29,5 @@ def LoadProfessions(filename): if __name__=='__main__': import pprint - pprint.pprint(LoadProfessions('tables/Professions.txt')) + LoadProfessions('tables/Professions.txt') + diff --git a/TODO.txt b/TODO.txt index 710e731..0ab5150 100644 --- a/TODO.txt +++ b/TODO.txt @@ -29,10 +29,6 @@ Implement StatBonus, ParentBonus, ItemBonus in Value Have Ctrl-N,O,S start New, Open, and Save commands. -Add potential stat to the save format and to the Character.Stat object. - Added as "Max+Num" option. - Still need to add GUI options to change this. - Removing a bonus from an item does not update skills that were children, but are no longer. Ex. "Dagger+5, Linguistics-2" becomes "Dagger+5" would not remove the -2 from Linguistics. Fix this. @@ -49,3 +45,19 @@ Experiment with having text columns update only on losing focus Add a "Disabled" parameter to items, allowing for item-bonuses to be temporarily disabled. This could be used, for example, if an item is broken, but can be repaired. + +Improve GUI-backend communication. + Currently, the reading of values from the backend can cause additional backend changes, + such as when reloading the active stat. + This can cause infinite loops that become hard to diagnose. + To fix this, should make two big changes. + 1. Have EventHandler collect the signals to be run, + but not call them until an "Execute" function is called. + This will allow for delayed updating of the GUI. + 2. Have a MainWindow.Update() function, to be called when the GUI is to be updated from the backend. + Should first disable all the signals from the GUI. + object.handler_block(handler_id) + Then, should call self.char.Events.Executes() (Probably through a self.char.Update()) + Finally, re-enable the signals from the GUI. + object.handler_unblock(handler_id) + This way, the GUI will only be updated at specified times. diff --git a/glade/MainWindow.ui b/glade/MainWindow.ui index f70c60d..e41fba8 100755 --- a/glade/MainWindow.ui +++ b/glade/MainWindow.ui @@ -777,88 +777,101 @@ True vertical - + True - 0 - + True - 12 + 0 - + True + 12 + + + True + + + + + + + True + <b>Profession</b> + True + + 0 + - - - True - <b>Profession</b> - True - - - - - 0 - - - - - True - 0 - + True - 12 + 0 - + + True + 12 + + + True + Not implemented + + + + + + True - Not implemented + <b>Race</b> + True + + 1 + - - - True - <b>Race</b> - True - - - - - 1 - - - - - True - 0 - + True - 12 + 0 - + True - Not implemented + 12 + + + True + Not implemented + + + + + + + True + <b>Culture</b> + True - - - - True - <b>Culture</b> - True - + + 2 + - 2 + False + False + 0 + + + 1 @@ -911,6 +924,68 @@ True vertical + + + True + 0 + + + True + 12 + + + True + 2 + 2 + + + True + + + 1 + 2 + + + + + True + + + 1 + 2 + 1 + 2 + + + + + True + 0 + 10 + Select each stat, then choose a value for the current and potential stat value. The higher the stat value, the stronger the character. The allowed number of stat points for the starting and the potential stat are shown here. + True + + + 2 + GTK_EXPAND + + + + + + + + + True + <b>Initial Stats</b> + True + + + + + 0 + + True @@ -1004,7 +1079,7 @@ True True - + True True @@ -1123,7 +1198,7 @@ - 0 + 1 @@ -1144,7 +1219,7 @@ True 1 10 - New Value: + Stat Increase: @@ -1167,7 +1242,7 @@ True True True - postLevelStatValue + levellingStatGain True True @@ -1216,7 +1291,7 @@ - 1 + 2 @@ -1927,7 +2002,7 @@ - + 100 1 10 diff --git a/tables/Professions.txt b/tables/Professions.txt index 9dfc012..1be397a 100644 --- a/tables/Professions.txt +++ b/tables/Professions.txt @@ -4,32 +4,353 @@ No Profession {Linguistics, 2, 4} {Lore, 2, 4} {Science, 3, 5} {Body Development, 4, 6} {Gymnastic, 3, 5} {Movement, 2, 4} - {Combat Expertise, 3, 5} {Shield, 3, 4} - {Combat Training 1, 3, 5} {Combat Training 2, 5, 7} {Combat Training 3, 9, 12} - {Combat Training 4, 12, 15} {Combat Training 5, 16, 20} - {Body Discipline, 3, 4} {Mental Discipline, 3, 4} - {Delving, 3, 5} {Magical Expertise, 3, 5} {Power Manipulation, 3, 5} - {Animal Handling, 3, 4} {Riding, 3, 4} {Driving/Pilot, 3, 4} {Survival, 3, 4} - {Navigation, 2, 4} {Perception, 2, 4} {Tracking, 2, 4} - {Influence, 3, 4} {Leadership, 3, 4} {Social Awareness, 3, 4} - {Magic Ritual, 4, 6} {Power Development, 4, 6} {Base/Open, 4, 6} - {Closed Spells, 4, 6} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} - {Ambush, 4, 6} {Stalk/Hide, 3, 5} {Trickery, 2, 4} - {Composition, 3, 4} {Crafting, 3, 4} {Mechanical, 3, 5} - {Medical, 3, 4} {Performance Art, 3, 4} {Vocation, 2, 4} + {Combat Expertise, 3, 5} {Shield, 3, 4} + {Combat Training 1, 3, 5} {Combat Training 2, 5, 7} {Combat Training 3, 9, 12} + {Combat Training 4, 12, 15} {Combat Training 5, 16, 20} + {Body Discipline, 3, 4} {Mental Discipline, 3, 4} + {Delving, 3, 5} {Magical Expertise, 3, 5} {Power Manipulation, 3, 5} + {Animal Handling, 3, 4} {Riding, 3, 4} {Driving/Pilot, 3, 4} {Survival, 3, 4} + {Navigation, 2, 4} {Perception, 2, 4} {Tracking, 2, 4} + {Influence, 3, 4} {Leadership, 3, 4} {Social Awareness, 3, 4} + {Magic Ritual, 4, 6} {Power Development, 4, 6} {Base/Open, 4, 6} + {Closed Spells, 4, 6} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 4, 6} {Stalk/Hide, 3, 5} {Trickery, 2, 4} + {Composition, 3, 4} {Crafting, 3, 4} {Mechanical, 3, 5} + {Medical, 3, 4} {Performance Art, 3, 4} {Vocation, 2, 4} Fighter {Linguistics, 3, 5} {Lore, 3, 5} {Science, 5, 7} - {Body Development, 1, 3} {Gymnastic, 2, 4} {Movement, 1, 3} - {Combat Expertise, 1, 2} {Shield, 1, 2} - {Combat Training 1, 1, 2} {Combat Training 2, 2, 3} {Combat Training 3, 3, 4} - {Combat Training 4, 3, 5} {Combat Training 5, 4, 6} - {Body Discipline, 2, 3} {Mental Discipline, 4, 6} - {Delving, 9, 12} {Magical Expertise, 9, 12} {Power Manipulation, 9, 12} - {Animal Handling, 2, 4} {Riding, 2, 3} {Driving/Pilot, 2, 4} {Survival, 2, 4} - {Navigation, 3, 4} {Perception, 3, 4} {Tracking, 2, 4} - {Influence, 3, 4} {Leadership, 2, 4} {Social Awareness, 3, 4} - {Magic Ritual, 12, 15} {Power Development, 12, 15} {Base/Open, 12, 15} - {Closed Spells, 20, 24} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} - {Ambush, 3, 4} {Stalk/Hide, 2, 4} {Trickery, 2, 3} - {Composition, 3, 5} {Crafting, 2, 4} {Mechanical, 4, 6} + {Body Development, 1, 3} {Gymnastic, 2, 4} {Movement, 1, 3} + {Combat Expertise, 1, 2} {Shield, 1, 2} + {Combat Training 1, 1, 2} {Combat Training 2, 2, 3} {Combat Training 3, 3, 4} + {Combat Training 4, 3, 5} {Combat Training 5, 4, 6} + {Body Discipline, 2, 3} {Mental Discipline, 4, 6} + {Delving, 9, 12} {Magical Expertise, 9, 12} {Power Manipulation, 9, 12} + {Animal Handling, 2, 4} {Riding, 2, 3} {Driving/Pilot, 2, 4} {Survival, 2, 4} + {Navigation, 3, 4} {Perception, 3, 4} {Tracking, 2, 4} + {Influence, 3, 4} {Leadership, 2, 4} {Social Awareness, 3, 4} + {Magic Ritual, 12, 15} {Power Development, 12, 15} {Base/Open, 12, 15} + {Closed Spells, 20, 24} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 3, 4} {Stalk/Hide, 2, 4} {Trickery, 2, 3} + {Composition, 3, 5} {Crafting, 2, 4} {Mechanical, 4, 6} {Medical, 3, 4} {Performance Art, 3, 5} {Vocation, 2, 4} + +Warrior Monk {Linguistics, 3, 4} {Lore, 3, 4} {Science, 4, 6} + {Body Development, 2, 4} {Gymnastic, 2, 3} {Movement, 1, 2} + {Combat Expertise, 1, 2} {Shield, 1, 2} + {Combat Training 1, 1, 2} {Combat Training 2, 2, 3} {Combat Training 3, 3, 4} + {Combat Training 4, 3, 5} {Combat Training 5, 4, 6} + {Body Discipline, 1, 3} {Mental Discipline, 1, 3} + {Delving, 9, 12} {Magical Expertise, 9, 12} {Power Manipulation, 9, 12} + {Animal Handling, 3, 4} {Riding, 3, 4} {Driving/Pilot, 3, 4} {Survival, 3, 4} + {Navigation, 3, 4} {Perception, 3, 4} {Tracking, 3, 4} + {Influence, 3, 5} {Leadership, 3, 5} {Social Awareness, 3, 5} + {Magic Ritual, 12, 15} {Power Development, 12, 15} {Base/Open, 12, 15} + {Closed Spells, 20, 24} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 3, 5} {Stalk/Hide, 2, 4} {Trickery, 2, 3} + {Composition, 3, 4} {Crafting, 3, 4} {Mechanical, 3, 5} + {Medical, 3, 4} {Performance Art, 3, 4} {Vocation, 2, 4} + +Thief {Linguistics, 3, 4} {Lore, 3, 4} {Science, 4, 6} + {Body Development, 3, 5} {Gymnastic, 2, 3} {Movement, 1, 3} + {Combat Expertise, 3, 4} {Shield, 3, 4} + {Combat Training 1, 3, 4} {Combat Training 2, 4, 6} {Combat Training 3, 6, 8} + {Combat Training 4, 9, 12} {Combat Training 5, 12, 15} + {Body Discipline, 4, 6} {Mental Discipline, 5, 7} + {Delving, 5, 7} {Magical Expertise, 9, 12} {Power Manipulation, 9, 12} + {Animal Handling, 3, 4} {Riding, 3, 4} {Driving/Pilot, 3, 4} {Survival, 3, 4} + {Navigation, 2, 3} {Perception, 1, 2} {Tracking, 2, 3} + {Influence, 2, 3} {Leadership, 3, 4} {Social Awareness, 3, 4} + {Magic Ritual, 12, 15} {Power Development, 12, 15} {Base/Open, 12, 15} + {Closed Spells, 20, 24} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 2, 3} {Stalk/Hide, 1, 3} {Trickery, 1, 2} + {Composition, 3, 4} {Crafting, 3, 4} {Mechanical, 1, 3} + {Medical, 3, 4} {Performance Art, 3, 4} {Vocation, 2, 4} + +Rogue {Linguistics, 3, 4} {Lore, 3, 4} {Science, 5, 7} + {Body Development, 2, 4} {Gymnastic, 2, 4} {Movement, 1, 3} + {Combat Expertise, 2, 3} {Shield, 1, 3} + {Combat Training 1, 2, 3} {Combat Training 2, 3, 4} {Combat Training 3, 4, 6} + {Combat Training 4, 5, 7} {Combat Training 5, 6, 8} + {Body Discipline, 3, 4} {Mental Discipline, 4, 6} + {Delving, 6, 8} {Magical Expertise, 9, 12} {Power Manipulation, 9, 12} + {Animal Handling, 2, 4} {Riding, 2, 4} {Driving/Pilot, 2, 4} {Survival, 2, 4} + {Navigation, 2, 4} {Perception, 2, 3} {Tracking, 2, 4} + {Influence, 2, 4} {Leadership, 3, 4} {Social Awareness, 3, 4} + {Magic Ritual, 12, 15} {Power Development, 12, 15} {Base/Open, 12, 15} + {Closed Spells, 20, 24} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 4, 6} {Stalk/Hide, 3, 5} {Trickery, 2, 4} + {Composition, 2, 4} {Crafting, 1, 2} {Mechanical, 2, 3} + {Medical, 2, 4} {Performance Art, 2, 4} {Vocation, 1, 2} + +Laborer {Linguistics, 3, 5} {Lore, 3, 4} {Science, 5, 7} + {Body Development, 2, 3} {Gymnastic, 2, 3} {Movement, 1, 2} + {Combat Expertise, 3, 5} {Shield, 3, 4} + {Combat Training 1, 3, 4} {Combat Training 2, 4, 6} {Combat Training 3, 6, 8} + {Combat Training 4, 9, 12} {Combat Training 5, 12, 15} + {Body Discipline, 4, 6} {Mental Discipline, 4, 6} + {Delving, 9, 12} {Magical Expertise, 9, 12} {Power Manipulation, 9, 12} + {Animal Handling, 1, 3} {Riding, 1, 3} {Driving/Pilot, 1, 3} {Survival, 1, 3} + {Navigation, 3, 4} {Perception, 3, 4} {Tracking, 3, 4} + {Influence, 3, 4} {Leadership, 3, 4} {Social Awareness, 3, 4} + {Magic Ritual, 12, 15} {Power Development, 12, 15} {Base/Open, 12, 15} + {Closed Spells, 20, 24} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 4, 6} {Stalk/Hide, 3, 5} {Trickery, 2, 4} + {Composition, 2, 4} {Crafting, 1, 2} {Mechanical, 2, 3} + {Medical, 2, 4} {Performance Art, 2, 4} {Vocation, 1, 2} + +Scholar {Linguistics, 1, 2} {Lore, 1, 2} {Science, 2, 3} + {Body Development, 6, 8} {Gymnastic, 5, 7} {Movement, 3, 5} + {Combat Expertise, 5, 7} {Shield, 4, 6} + {Combat Training 1, 5, 7} {Combat Training 2, 9, 12} {Combat Training 3, 16, 20} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 3, 5} {Mental Discipline, 3, 4} + {Delving, 3, 5} {Magical Expertise, 4, 6} {Power Manipulation, 4, 6} + {Animal Handling, 3, 4} {Riding, 3, 4} {Driving/Pilot, 3, 4} {Survival, 3, 4} + {Navigation, 2, 3} {Perception, 2, 3} {Tracking, 2, 3} + {Influence, 2, 4} {Leadership, 2, 3} {Social Awareness, 2, 4} + {Magic Ritual, 6, 8} {Power Development, 6, 8} {Base/Open, 6, 8} + {Closed Spells, 12, 15} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 6, 8} {Stalk/Hide, 5, 7} {Trickery, 3, 5} + {Composition, 2, 3} {Crafting, 2, 4} {Mechanical, 3, 4} + {Medical, 1, 3} {Performance Art, 2, 3} {Vocation, 1, 3} + +Ranger {Linguistics, 3, 5} {Lore, 3, 5} {Science, 5, 7} + {Body Development, 4, 6} {Gymnastic, 3, 5} {Movement, 1, 3} + {Combat Expertise, 3, 4} {Shield, 2, 4} + {Combat Training 1, 3, 4} {Combat Training 2, 4, 6} {Combat Training 3, 6, 8} + {Combat Training 4, 9, 12} {Combat Training 5, 12, 15} + {Body Discipline, 4, 6} {Mental Discipline, 5, 7} + {Delving, 4, 6} {Magical Expertise, 4, 6} {Power Manipulation, 4, 6} + {Animal Handling, 1, 3} {Riding, 1, 3} {Driving/Pilot, 1, 3} {Survival, 1, 3} + {Navigation, 1, 2} {Perception, 1, 3} {Tracking, 1, 2} + {Influence, 3, 5} {Leadership, 3, 5} {Social Awareness, 3, 5} + {Magic Ritual, 3, 5} {Power Development, 3, 5} {Base/Open, 3, 5} + {Closed Spells, 5, 7} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 4, 6} {Stalk/Hide, 2, 4} {Trickery, 4, 6} + {Composition, 4, 6} {Crafting, 3, 4} {Mechanical, 5, 7} + {Medical, 4, 6} {Performance Art, 4, 6} {Vocation, 3, 5} + +Paladin {Linguistics, 3, 4} {Lore, 3, 4} {Science, 5, 7} + {Body Development, 2, 4} {Gymnastic, 3, 4} {Movement, 2, 3} + {Combat Expertise, 2, 3} {Shield, 1, 3} + {Combat Training 1, 2, 4} {Combat Training 2, 3, 5} {Combat Training 3, 5, 7} + {Combat Training 4, 6, 8} {Combat Training 5, 9, 12} + {Body Discipline, 3, 4} {Mental Discipline, 4, 6} + {Delving, 4, 6} {Magical Expertise, 4, 6} {Power Manipulation, 3, 5} + {Animal Handling, 2, 4} {Riding, 2, 3} {Driving/Pilot, 2, 4} {Survival, 2, 4} + {Navigation, 3, 4} {Perception, 3, 4} {Tracking, 3, 4} + {Influence, 2, 4} {Leadership, 1, 2} {Social Awareness, 2, 4} + {Magic Ritual, 4, 6} {Power Development, 4, 6} {Base/Open, 4, 6} + {Closed Spells, 6, 8} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 6, 8} {Stalk/Hide, 4, 6} {Trickery, 4, 6} + {Composition, 4, 6} {Crafting, 2, 4} {Mechanical, 5, 7} + {Medical, 4, 6} {Performance Art, 4, 6} {Vocation, 3, 4} + +Monk {Linguistics, 3, 4} {Lore, 2, 4} {Science, 4, 6} + {Body Development, 4, 6} {Gymnastic, 2, 4} {Movement, 1, 3} + {Combat Expertise, 2, 4} {Shield, 2, 3} + {Combat Training 1, 2, 4} {Combat Training 2, 3, 5} {Combat Training 3, 5, 7} + {Combat Training 4, 6, 8} {Combat Training 5, 9, 12} + {Body Discipline, 2, 3} {Mental Discipline, 3, 4} + {Delving, 4, 6} {Magical Expertise, 4, 6} {Power Manipulation, 4, 6} + {Animal Handling, 3, 4} {Riding, 3, 4} {Driving/Pilot, 3, 4} {Survival, 2, 4} + {Navigation, 3, 4} {Perception, 3, 4} {Tracking, 3, 4} + {Influence, 3, 4} {Leadership, 3, 4} {Social Awareness, 3, 4} + {Magic Ritual, 4, 6} {Power Development, 4, 6} {Base/Open, 4, 6} + {Closed Spells, 6, 8} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 4, 6} {Stalk/Hide, 3, 5} {Trickery, 3, 5} + {Composition, 3, 4} {Crafting, 3, 5} {Mechanical, 4, 6} + {Medical, 3, 4} {Performance Art, 3, 5} {Vocation, 2, 4} + +Magent {Linguistics, 3, 4} {Lore, 3, 4} {Science, 4, 6} + {Body Development, 4, 6} {Gymnastic, 3, 4} {Movement, 2, 3} + {Combat Expertise, 3, 4} {Shield, 2, 4} + {Combat Training 1, 3, 4} {Combat Training 2, 4, 6} {Combat Training 3, 6, 8} + {Combat Training 4, 9, 12} {Combat Training 5, 12, 15} + {Body Discipline, 3, 5} {Mental Discipline, 3, 5} + {Delving, 4, 6} {Magical Expertise, 4, 6} {Power Manipulation, 4, 6} + {Animal Handling, 3, 5} {Riding, 3, 5} {Driving/Pilot, 3, 5} {Survival, 3, 5} + {Navigation, 3, 4} {Perception, 2, 3} {Tracking, 2, 4} + {Influence, 2, 3} {Leadership, 3, 4} {Social Awareness, 3, 4} + {Magic Ritual, 3, 5} {Power Development, 3, 5} {Base/Open, 3, 5} + {Closed Spells, 5, 7} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 2, 4} {Stalk/Hide, 2, 3} {Trickery, 2, 3} + {Composition, 3, 5} {Crafting, 3, 5} {Mechanical, 4, 6} + {Medical, 3, 4} {Performance Art, 3, 5} {Vocation, 3, 4} + +Bard {Linguistics, 1, 3} {Lore, 1, 3} {Science, 2, 4} + {Body Development, 5, 7} {Gymnastic, 4, 6} {Movement, 3, 4} + {Combat Expertise, 3, 5} {Shield, 3, 4} + {Combat Training 1, 3, 5} {Combat Training 2, 5, 7} {Combat Training 3, 9, 12} + {Combat Training 4, 12, 15} {Combat Training 5, 16, 20} + {Body Discipline, 5, 7} {Mental Discipline, 5, 7} + {Delving, 3, 5} {Magical Expertise, 3, 5} {Power Manipulation, 3, 5} + {Animal Handling, 3, 5} {Riding, 3, 5} {Driving/Pilot, 3, 5} {Survival, 3, 5} + {Navigation, 3, 4} {Perception, 3, 4} {Tracking, 3, 4} + {Influence, 2, 3} {Leadership, 2, 3} {Social Awareness, 2, 3} + {Magic Ritual, 3, 4} {Power Development, 3, 4} {Base/Open, 3, 4} + {Closed Spells, 4, 6} {Arcane Spells, 16, 20} {Restricted Spells, 20, 24} + {Ambush, 9, 12} {Stalk/Hide, 4, 6} {Trickery, 3, 4} + {Composition, 3, 4} {Crafting, 3, 4} {Mechanical, 3, 5} + {Medical, 3, 4} {Performance Art, 1, 3} {Vocation, 2, 4} + +Dabbler {Linguistics, 3, 4} {Lore, 3, 4} {Science, 4, 6} + {Body Development, 6, 8} {Gymnastic, 4, 6} {Movement, 3, 4} + {Combat Expertise, 3, 5} {Shield, 3, 4} + {Combat Training 1, 3, 5} {Combat Training 2, 5, 7} {Combat Training 3, 9, 12} + {Combat Training 4, 12, 15} {Combat Training 5, 16, 20} + {Body Discipline, 6, 8} {Mental Discipline, 6, 8} + {Delving, 2, 4} {Magical Expertise, 3, 5} {Power Manipulation, 3, 5} + {Animal Handling, 3, 5} {Riding, 3, 5} {Driving/Pilot, 3, 5} {Survival, 3, 5} + {Navigation, 2, 4} {Perception, 1, 3} {Tracking, 2, 4} + {Influence, 2, 3} {Leadership, 2, 4} {Social Awareness, 2, 3} + {Magic Ritual, 3, 5} {Power Development, 3, 5} {Base/Open, 3, 5} + {Closed Spells, 5, 7} {Arcane Spells, 20, 24} {Restricted Spells, 20, 24} + {Ambush, 3, 5} {Stalk/Hide, 2, 4} {Trickery, 1, 3} + {Composition, 3, 4} {Crafting, 3, 4} {Mechanical, 2, 4} + {Medical, 3, 4} {Performance Art, 3, 4} {Vocation, 2, 4} + +Cleric {Linguistics, 2, 3} {Lore, 1, 3} {Science, 3, 4} + {Body Development, 6, 8} {Gymnastic, 5, 7} {Movement, 3, 5} + {Combat Expertise, 6, 8} {Shield, 4, 6} + {Combat Training 1, 5, 7} {Combat Training 2, 9, 12} {Combat Training 3, 16, 20} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 4, 6} {Mental Discipline, 3, 4} + {Delving, 2, 4} {Magical Expertise, 2, 3} {Power Manipulation, 2, 3} + {Animal Handling, 3, 5} {Riding, 3, 5} {Driving/Pilot, 3, 5} {Survival, 3, 5} + {Navigation, 3, 4} {Perception, 4, 6} {Tracking, 4, 6} + {Influence, 4, 6} {Leadership, 1, 3} {Social Awareness, 1, 3} + {Magic Ritual, 1, 3} {Power Development, 1, 2} {Base/Open, 1, 3} + {Closed Spells, 2, 4} {Arcane Spells, 6, 8} {Restricted Spells, 12, 15} + {Ambush, 9, 12} {Stalk/Hide, 6, 8} {Trickery, 4, 6} + {Composition, 2, 4} {Crafting, 4, 6} {Mechanical, 5, 7} + {Medical, 2, 4} {Performance Art, 2, 3} {Vocation, 3, 5} + +Druid {Linguistics, 2, 4} {Lore, 2, 3} {Science, 3, 5} + {Body Development, 6, 8} {Gymnastic, 5, 7} {Movement, 3, 5} + {Combat Expertise, 9, 12} {Shield, 6, 8} + {Combat Training 1, 6, 8} {Combat Training 2, 12, 15} {Combat Training 3, 20, 24} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 4, 6} {Mental Discipline, 3, 4} + {Delving, 2, 4} {Magical Expertise, 2, 4} {Power Manipulation, 2, 4} + {Animal Handling, 1, 3} {Riding, 1, 3} {Driving/Pilot, 1, 3} {Survival, 1, 3} + {Navigation, 2, 4} {Perception, 3, 5} {Tracking, 2, 4} + {Influence, 3, 5} {Leadership, 3, 5} {Social Awareness, 3, 5} + {Magic Ritual, 1, 2} {Power Development, 1, 3} {Base/Open, 1, 3} + {Closed Spells, 2, 4} {Arcane Spells, 6, 8} {Restricted Spells, 12, 15} + {Ambush, 9, 12} {Stalk/Hide, 4, 6} {Trickery, 4, 6} + {Composition, 3, 5} {Crafting, 3, 5} {Mechanical, 4, 6} + {Medical, 2, 4} {Performance Art, 3, 5} {Vocation, 3, 4} + +Magician {Linguistics, 1, 2} {Lore, 1, 2} {Science, 1, 3} + {Body Development, 6, 8} {Gymnastic, 5, 7} {Movement, 3, 5} + {Combat Expertise, 6, 8} {Shield, 5, 7} + {Combat Training 1, 4, 6} {Combat Training 2, 6, 8} {Combat Training 3, 12, 15} + {Combat Training 4, 16, 20} {Combat Training 5, 20, 24} + {Body Discipline, 5, 7} {Mental Discipline, 2, 4} + {Delving, 1, 2} {Magical Expertise, 1, 2} {Power Manipulation, 1, 2} + {Animal Handling, 4, 6} {Riding, 4, 6} {Driving/Pilot, 4, 6} {Survival, 4, 6} + {Navigation, 3, 4} {Perception, 4, 6} {Tracking, 4, 6} + {Influence, 2, 4} {Leadership, 2, 4} {Social Awareness, 2, 4} + {Magic Ritual, 1, 3} {Power Development, 1, 3} {Base/Open, 1, 3} + {Closed Spells, 2, 4} {Arcane Spells, 6, 8} {Restricted Spells, 12, 15} + {Ambush, 9, 12} {Stalk/Hide, 6, 8} {Trickery, 4, 6} + {Composition, 3, 4} {Crafting, 3, 5} {Mechanical, 4, 6} + {Medical, 3, 5} {Performance Art, 3, 4} {Vocation, 3, 4} + +Illusionist {Linguistics, 2, 3} {Lore, 2, 3} {Science, 3, 4} + {Body Development, 9, 12} {Gymnastic, 6, 8} {Movement, 4, 6} + {Combat Expertise, 9, 12} {Shield, 6, 8} + {Combat Training 1, 6, 8} {Combat Training 2, 12, 15} {Combat Training 3, 20, 24} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 6, 8} {Mental Discipline, 3, 5} + {Delving, 1, 2} {Magical Expertise, 1, 2} {Power Manipulation, 1, 2} + {Animal Handling, 4, 6} {Riding, 4, 6} {Driving/Pilot, 4, 6} {Survival, 4, 6} + {Navigation, 2, 4} {Perception, 1, 3} {Tracking, 2, 4} + {Influence, 2, 4} {Leadership, 2, 4} {Social Awareness, 2, 4} + {Magic Ritual, 1, 3} {Power Development, 1, 2} {Base/Open, 1, 3} + {Closed Spells, 2, 4} {Arcane Spells, 6, 8} {Restricted Spells, 12, 15} + {Ambush, 9, 12} {Stalk/Hide, 4, 6} {Trickery, 1, 3} + {Composition, 2, 4} {Crafting, 3, 5} {Mechanical, 5, 7} + {Medical, 4, 6} {Performance Art, 2, 3} {Vocation, 3, 5} + +Mentalist {Linguistics, 2, 3} {Lore, 2, 3} {Science, 3, 4} + {Body Development, 6, 8} {Gymnastic, 5, 7} {Movement, 3, 5} + {Combat Expertise, 6, 8} {Shield, 5, 7} + {Combat Training 1, 5, 7} {Combat Training 2, 9, 12} {Combat Training 3, 16, 20} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 1, 3} {Mental Discipline, 1, 3} + {Delving, 1, 3} {Magical Expertise, 1, 3} {Power Manipulation, 1, 3} + {Animal Handling, 4, 6} {Riding, 4, 6} {Driving/Pilot, 4, 6} {Survival, 4, 6} + {Navigation, 3, 5} {Perception, 3, 5} {Tracking, 3, 5} + {Influence, 1, 3} {Leadership, 1, 3} {Social Awareness, 1, 3} + {Magic Ritual, 2, 4} {Power Development, 1, 3} {Base/Open, 1, 3} + {Closed Spells, 2, 4} {Arcane Spells, 6, 8} {Restricted Spells, 12, 15} + {Ambush, 9, 12} {Stalk/Hide, 6, 8} {Trickery, 4, 6} + {Composition, 3, 5} {Crafting, 3, 5} {Mechanical, 4, 6} + {Medical, 3, 5} {Performance Art, 3, 5} {Vocation, 3, 4} + +Lay Healer {Linguistics, 2, 3} {Lore, 2, 3} {Science, 2, 4} + {Body Development, 6, 8} {Gymnastic, 5, 7} {Movement, 3, 5} + {Combat Expertise, 9, 12} {Shield, 6, 8} + {Combat Training 1, 6, 8} {Combat Training 2, 12, 15} {Combat Training 3, 20, 24} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 2, 4} {Mental Discipline, 2, 4} + {Delving, 2, 3} {Magical Expertise, 2, 3} {Power Manipulation, 2, 3} + {Animal Handling, 3, 5} {Riding, 4, 6} {Driving/Pilot, 4, 6} {Survival, 4, 6} + {Navigation, 3, 4} {Perception, 2, 4} {Tracking, 4, 6} + {Influence, 2, 3} {Leadership, 2, 3} {Social Awareness, 2, 3} + {Magic Ritual, 2, 4} {Power Development, 1, 3} {Base/Open, 1, 3} + {Closed Spells, 2, 4} {Arcane Spells, 6, 8} {Restricted Spells, 12, 15} + {Ambush, 9, 12} {Stalk/Hide, 6, 8} {Trickery, 4, 6} + {Composition, 2, 4} {Crafting, 2, 4} {Mechanical, 4, 6} + {Medical, 1, 3} {Performance Art, 3, 5} {Vocation, 2, 4} + +Healer {Linguistics, 2, 4} {Lore, 2, 4} {Science, 3, 4} + {Body Development, 1, 2} {Gymnastic, 4, 6} {Movement, 3, 4} + {Combat Expertise, 9, 12} {Shield, 6, 8} + {Combat Training 1, 6, 8} {Combat Training 2, 12, 15} {Combat Training 3, 20, 24} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 2, 4} {Mental Discipline, 2, 4} + {Delving, 2, 3} {Magical Expertise, 2, 3} {Power Manipulation, 2, 3} + {Animal Handling, 4, 6} {Riding, 4, 6} {Driving/Pilot, 4, 6} {Survival, 4, 6} + {Navigation, 3} {Perception} {Tracking, 3, 4} + {Influence, 4, 6} {Leadership, 2, 4} {Social Awareness, 2, 4} + {Magic Ritual, 2, 4} {Power Development, 1, 3} {Base/Open, 1, 3} + {Closed Spells, 2, 4} {Arcane Spells, 6, 8} {Restricted Spells, 12, 15} + {Ambush, 9, 12} {Stalk/Hide, 6, 8} {Trickery, 4, 6} + {Composition, 3, 4} {Crafting, 3, 4} {Mechanical, 4, 6} + {Medical, 1, 3} {Performance Art, 3, 5} {Vocation, 2, 4} + +Mystic {Linguistics, 2, 4} {Lore, 2, 4} {Science, 3, 5} + {Body Development, 6, 8} {Gymnastic, 4, 6} {Movement, 3, 4} + {Combat Expertise, 6, 8} {Shield, 5, 7} + {Combat Training 1, 6, 8} {Combat Training 2, 12, 15} {Combat Training 3, 20, 24} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 5, 7} {Mental Discipline, 3, 5} + {Delving, 2, 4} {Magical Expertise, 2, 4} {Power Manipulation, 2, 4} + {Animal Handling, 4, 6} {Riding, 4, 6} {Driving/Pilot, 4, 6} {Survival, 4, 6} + {Navigation, 3, 4} {Perception, 2, 4} {Tracking, 3, 4} + {Influence, 2, 3} {Leadership, 2, 3} {Social Awareness, 2, 3} + {Magic Ritual, 2, 4} {Power Development, 1, 3} {Base/Open, 1, 3} + {Closed Spells, 2, 4} {Arcane Spells, 6, 8} {Restricted Spells, 12, 15} + {Ambush, 4, 6} {Stalk/Hide, 3, 5} {Trickery, 2, 4} + {Composition, 2, 4} {Crafting, 3, 5} {Mechanical, 3, 5} + {Medical, 2, 4} {Performance Art, 2, 4} {Vocation, 2, 4} + +Sorcerer {Linguistics, 1, 2} {Lore, 1, 2} {Science, 2, 3} + {Body Development, 9, 12} {Gymnastic, 6, 8} {Movement, 4, 6} + {Combat Expertise, 9, 12} {Shield, 6, 8} + {Combat Training 1, 9, 12} {Combat Training 2, 16, 20} {Combat Training 3, 20, 24} + {Combat Training 4, 20, 24} {Combat Training 5, 20, 24} + {Body Discipline, 6, 8} {Mental Discipline, 2, 4} + {Delving, 1, 2} {Magical Expertise, 1, 2} {Power Manipulation, 1, 2} + {Animal Handling, 3, 5} {Riding, 4, 6} {Driving/Pilot, 4, 6} {Survival, 4, 6} + {Navigation, 3, 4} {Perception, 4, 6} {Tracking, 4, 6} + {Influence, 2, 3} {Leadership, 2, 4} {Social Awareness, 2, 4} + {Magic Ritual, 1, 2} {Power Development, 1, 3} {Base/Open, 1, 2} + {Closed Spells, 2, 3} {Arcane Spells, 5, 7} {Restricted Spells, 9, 12} + {Ambush, 9, 12} {Stalk/Hide, 6, 8} {Trickery, 4, 6} + {Composition, 2, 4} {Crafting, 3, 4} {Mechanical, 3, 5} + {Medical, 3, 4} {Performance Art, 2, 4} {Vocation, 2, 4} + diff --git a/tests.py b/tests.py index 7c2d2c1..85f92f3 100755 --- a/tests.py +++ b/tests.py @@ -57,6 +57,12 @@ def test_skill_delta(self): testSkill.Delta = 5 self.assertEqual(testSkill.SelfBonus(),-25) self.assertEqual(testSkill.SelfBonus(levelled=True),25) + def test_stat_minmax(self): + testStat = Character.Stat(50) + testStat.Min = 5 + self.assertEqual(testStat.Min,5) + testStat.Max = 75 + self.assertEqual(testStat.Max,75) class TestChar(unittest.TestCase): def test_char_building(self): @@ -68,12 +74,12 @@ def test_char_building(self): self.assertEqual(char['Lore'].Bonus(),17) self.assertEqual(len(list(char.Stats)),10) self.assertEqual(len(list(char.Skills)),5) - self.assertEqual(char.Name,'Grognar') - self.assertEqual(char.PlayerName,'Grog') - self.assertEqual(char.Profession,'Fighter') - self.assertEqual(char.Race,'Troll') - self.assertEqual(char.Level,3) - self.assertEqual(char.Experience,12345) + self.assertEqual(char.GetMisc('Name'),'Grognar') + self.assertEqual(char.GetMisc('PlayerName'),'Grog') + self.assertEqual(char.GetMisc('Profession'),'Fighter') + self.assertEqual(char.GetMisc('Race'),'Troll') + self.assertEqual(char.GetMisc('Level'),3) + self.assertEqual(char.GetMisc('Experience'),12345) def test_linking(self): c = Character.Character() par1 = Character.Stat(100,Names=['name1'])