… | |
… | |
188 | * is being cast at. |
188 | * is being cast at. |
189 | * Note that I changed the repelled/attuned bonus to 2 from 5. |
189 | * Note that I changed the repelled/attuned bonus to 2 from 5. |
190 | * This is because the new code compares casting_level against |
190 | * This is because the new code compares casting_level against |
191 | * min_caster_level, so the difference is effectively 4 |
191 | * min_caster_level, so the difference is effectively 4 |
192 | */ |
192 | */ |
193 | |
|
|
194 | int |
193 | int |
195 | caster_level (object *caster, object *spell) |
194 | caster_level (object *caster, object *spell) |
196 | { |
195 | { |
197 | int level = caster->level; |
196 | int level = caster->level; |
198 | |
197 | |
… | |
… | |
213 | |
212 | |
214 | level = MIN (level, sk_level + level / 10 + 1); |
213 | level = MIN (level, sk_level + level / 10 + 1); |
215 | } |
214 | } |
216 | |
215 | |
217 | /* Got valid caster level. Now adjust for attunement */ |
216 | /* Got valid caster level. Now adjust for attunement */ |
218 | level += ((caster->path_repelled & spell->path_attuned) ? -2 : 0) + ((caster->path_attuned & spell->path_attuned) ? 2 : 0); |
217 | level += caster->path_repelled & spell->path_attuned ? -2 : 0; |
|
|
218 | level += caster->path_attuned & spell->path_attuned ? +2 : 0; |
219 | |
219 | |
220 | /* Always make this at least 1. If this is zero, we get divide by zero |
220 | /* Always make this at least 1. If this is zero, we get divide by zero |
221 | * errors in various places. |
221 | * errors in various places. |
222 | */ |
222 | */ |
223 | if (level < 1) |
|
|
224 | level = 1; |
|
|
225 | |
|
|
226 | return level; |
223 | return max (level, 1); |
227 | } |
224 | } |
228 | |
225 | |
229 | /* The following function scales the spellpoint cost of |
226 | /* The following function scales the spellpoint cost of |
230 | * a spell by it's increased effectiveness. Some of the |
227 | * a spell by it's increased effectiveness. Some of the |
231 | * lower level spells become incredibly vicious at high |
228 | * lower level spells become incredibly vicious at high |