1 #include "info-reader/skill-reader.h"
2 #include "main/angband-headers.h"
3 #include "player/player-skill.h"
6 * @brief 職業技能情報(s_info)のパース関数 /
7 * Initialize the "s_info" array, by parsing an ascii "template" file
12 errr parse_s_info(char *buf, angband_header *head)
14 static skill_table *s_ptr = NULL;
16 int i = atoi(buf + 2);
19 if (i >= head->info_num)
26 } else if (buf[0] == 'W') {
27 int tval, sval, start, max;
28 const s16b exp_conv_table[] = { WEAPON_EXP_UNSKILLED, WEAPON_EXP_BEGINNER, WEAPON_EXP_SKILLED, WEAPON_EXP_EXPERT, WEAPON_EXP_MASTER };
30 if (4 != sscanf(buf + 2, "%d:%d:%d:%d", &tval, &sval, &start, &max))
33 if (start < EXP_LEVEL_UNSKILLED || start > EXP_LEVEL_MASTER || max < EXP_LEVEL_UNSKILLED || max > EXP_LEVEL_MASTER)
36 s_ptr->w_start[tval][sval] = exp_conv_table[start];
37 s_ptr->w_max[tval][sval] = exp_conv_table[max];
38 } else if (buf[0] == 'S') {
40 if (3 != sscanf(buf + 2, "%d:%d:%d", &num, &start, &max))
43 if (start < WEAPON_EXP_UNSKILLED || start > WEAPON_EXP_MASTER || max < WEAPON_EXP_UNSKILLED || max > WEAPON_EXP_MASTER)
46 s_ptr->s_start[num] = (SUB_EXP)start;
47 s_ptr->s_max[num] = (SUB_EXP)max;