… | |
… | |
237 | /* This changes the objects skill to new_skill. |
237 | /* This changes the objects skill to new_skill. |
238 | * note that this function doesn't always need to get used - |
238 | * note that this function doesn't always need to get used - |
239 | * you can now add skill exp to the player without the chosen_skill being |
239 | * you can now add skill exp to the player without the chosen_skill being |
240 | * set. This function is of most interest to players to update |
240 | * set. This function is of most interest to players to update |
241 | * the various range information. |
241 | * the various range information. |
242 | * if new_skill is null, this just unapplies the skill. |
|
|
243 | * flag has the current meaning: |
|
|
244 | * 0x1: If set, don't update the range pointer. This is useful when we |
|
|
245 | * need to ready a new skill, but don't want to clobber range. |
|
|
246 | * return 1 on success, 0 on error |
242 | * return 1 on success, 0 on error |
247 | */ |
243 | */ |
248 | int |
244 | int |
249 | change_skill (object *who, object *new_skill, int flag) |
245 | change_skill (object *who, object *new_skill, int flag) |
250 | { |
246 | { |
… | |
… | |
278 | { |
274 | { |
279 | who->chosen_skill = 0; |
275 | who->chosen_skill = 0; |
280 | CLEAR_FLAG (who, FLAG_READY_SKILL); |
276 | CLEAR_FLAG (who, FLAG_READY_SKILL); |
281 | |
277 | |
282 | if (who->type == PLAYER) |
278 | if (who->type == PLAYER) |
283 | { |
|
|
284 | if (who->contr->ranged_ob && who->contr->ranged_ob->type == SKILL) |
279 | if (who->contr->ranged_ob && who->contr->ranged_ob->type == SKILL) |
285 | who->contr->ranged_ob = 0; |
280 | who->contr->ranged_ob = 0; |
286 | } |
|
|
287 | } |
281 | } |
288 | |
282 | |
289 | /* do_skill() - Main skills use function-similar in scope to cast_spell(). |
283 | /* do_skill() - Main skills use function-similar in scope to cast_spell(). |
290 | * We handle all requests for skill use outside of some combat here. |
284 | * We handle all requests for skill use outside of some combat here. |
291 | * We require a separate routine outside of fire() so as to allow monsters |
285 | * We require a separate routine outside of fire() so as to allow monsters |