return the # of slots required to advance the skill */
| 1129 | |
| 1130 | /* return the # of slots required to advance the skill */ |
| 1131 | staticfn int |
| 1132 | slots_required(int skill) |
| 1133 | { |
| 1134 | int tmp = P_SKILL(skill); |
| 1135 | |
| 1136 | /* The more difficult the training, the more slots it takes. |
| 1137 | * unskilled -> basic 1 |
| 1138 | * basic -> skilled 2 |
| 1139 | * skilled -> expert 3 |
| 1140 | */ |
| 1141 | if (skill <= P_LAST_WEAPON || skill == P_TWO_WEAPON_COMBAT) |
| 1142 | return tmp; |
| 1143 | |
| 1144 | /* Fewer slots used up for unarmed or martial. |
| 1145 | * unskilled -> basic 1 |
| 1146 | * basic -> skilled 1 |
| 1147 | * skilled -> expert 2 |
| 1148 | * expert -> master 2 |
| 1149 | * master -> grand master 3 |
| 1150 | */ |
| 1151 | return (tmp + 1) / 2; |
| 1152 | } |
| 1153 | |
| 1154 | /* return true if this skill can be advanced */ |
| 1155 | boolean |
no outgoing calls
no test coverage detected