… | |
… | |
3330 | static bool |
3330 | static bool |
3331 | manual_apply (object *who, object *op, int aflag) |
3331 | manual_apply (object *who, object *op, int aflag) |
3332 | { |
3332 | { |
3333 | if (INVOKE_OBJECT (APPLY, op, ARG_OBJECT (who))) |
3333 | if (INVOKE_OBJECT (APPLY, op, ARG_OBJECT (who))) |
3334 | return RESULT_INT (0); |
3334 | return RESULT_INT (0); |
|
|
3335 | |
3335 | else if (apply_types_inv_only [op->type]) |
3336 | if (apply_types_inv_only [op->type]) |
3336 | { |
3337 | { |
3337 | // special item, using slot system, needs to be in inv |
3338 | // special item, using slot system, needs to be in inv |
3338 | if (op->env == who) |
3339 | if (op->env == who) |
3339 | return apply_special (who, op, aflag); |
3340 | return apply_special (who, op, aflag); |
3340 | |
3341 | |
3341 | who->failmsgf ("You must get it first! H<You can only apply the %s if it is in your inventory.>\n", query_name (op)); |
3342 | who->failmsgf ("You must get it first! H<You can only apply the %s if it is in your inventory.>\n", query_name (op)); |
3342 | |
3343 | |
3343 | return 0; |
3344 | return 0; |
3344 | } |
3345 | } |
|
|
3346 | |
3345 | else if (!who->contr && apply_types_player_only [op->type]) |
3347 | if (!who->contr && apply_types_player_only [op->type]) |
3346 | return 0; // monsters shouldn't try to apply player-only stuff |
3348 | return 0; // monsters shouldn't try to apply player-only stuff |
|
|
3349 | |
3347 | else if (!apply_types [op->type]) |
3350 | if (!apply_types [op->type]) |
3348 | { |
3351 | { |
3349 | who->statusmsg (format ("I don't know how to apply the %s. H<This object cannot be applied.>", query_name (op))); |
3352 | who->statusmsg (format ("I don't know how to apply the %s. H<This object cannot be applied.>", query_name (op))); |
3350 | return 0; |
3353 | return 0; |
3351 | } |
3354 | } |
3352 | |
3355 | |