Changeset 312

Show
Ignore:
Timestamp:
05/30/08 22:34:42 (4 years ago)
Author:
simon
Message:

Add rank calculation.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • hodgestar/PythonCode/DmTools/l5rchars.py

    r263 r312  
    179179 
    180180    def calculate_rank(self): 
    181         pass 
     181        insight = self.insight 
     182        rank = min((max(0, insight - 125) // 25) + 1, 8) 
     183        return rank 
    182184 
    183185    rank = property(fget=calculate_rank) 
     
    200202    print "    -", ", ".join(["%s: %d" % (section, xp) for section, xp in oC.xp_breakdown]) 
    201203    print " Insight:", oC.insight 
     204    print " Rank:", oC.rank 
    202205 
    203206def main(aArgs):