… | |
… | |
189 | if (caster->type == ROD && caster->env && caster->env->type == PLAYER) |
189 | if (caster->type == ROD && caster->env && caster->env->type == PLAYER) |
190 | { |
190 | { |
191 | object *skill = find_skill_by_number (caster->env, SK_USE_MAGIC_ITEM); |
191 | object *skill = find_skill_by_number (caster->env, SK_USE_MAGIC_ITEM); |
192 | int sk_level = skill ? skill->level : 1; |
192 | int sk_level = skill ? skill->level : 1; |
193 | |
193 | |
194 | level = MIN (level, sk_level + level / 10 + 1); |
194 | level = min (level, sk_level + level / 10 + 1); |
195 | } |
195 | } |
196 | else if (caster->type == PLAYER && spell->skill) /* If this is a player, try to find the matching skill */ |
196 | else if (caster->type == PLAYER && spell->skill) /* If this is a player, try to find the matching skill */ |
197 | for (int i = 0; i < NUM_SKILLS; i++) |
197 | for (int i = 0; i < NUM_SKILLS; i++) |
198 | if (caster->contr->last_skill_ob[i] && caster->contr->last_skill_ob[i]->skill == spell->skill) |
198 | if (caster->contr->last_skill_ob[i] && caster->contr->last_skill_ob[i]->skill == spell->skill) |
199 | { |
199 | { |