Calculate and add skill level to Historical Figures
Add 2 fields to Historical Figures-> Skills:
- Level: numeric value of level
- Level Name: Name of the level (aka, "Novice","Adequate",.."Legendary")
This makes it easier to display the values.
https://dwarffortresswiki.org/index.php/DF2014:Skill
Sample Javascript code:
function get_level(xp){
if( xp < 0 ){
return 0;
}
for( let i = 1; i <= 15; i++){
if( xp < xp_for_level(i) ){
return i-1;
}
}
}
function xp_for_level(level){
if( level == 0){
return 0;
}
return (400 + 100 * level + xp_for_level(level-1));
}
let level_names = ["Dabbling","Novice","Adequate","Competent","Skilled","Proficient",
"Talented", "Adept", "Expert", "Professional", "Accomplished", "Great", "Master",
"High Master", "Grand Master", "Legendary"];
Calculations have to be checked.