… | |
… | |
2559 | default: |
2559 | default: |
2560 | return 0; |
2560 | return 0; |
2561 | } |
2561 | } |
2562 | } |
2562 | } |
2563 | |
2563 | |
2564 | |
|
|
2565 | /* quiet suppresses the "don't know how to apply" and "you must get it first" |
2564 | /* quiet suppresses the "don't know how to apply" and "you must get it first" |
2566 | * messages as needed by player_apply_below(). But there can still be |
2565 | * messages as needed by player_apply_below(). But there can still be |
2567 | * "but you are floating high above the ground" messages. |
2566 | * "but you are floating high above the ground" messages. |
2568 | * |
2567 | * |
2569 | * Same return value as apply() function. |
2568 | * Same return value as apply() function. |
2570 | */ |
2569 | */ |
2571 | int |
2570 | int |
2572 | player_apply (object *pl, object *op, int aflag, int quiet) |
2571 | player_apply (object *pl, object *op, int aflag, int quiet) |
2573 | { |
2572 | { |
2574 | int tmp; |
|
|
2575 | |
|
|
2576 | if (op->env && (pl->move_type & MOVE_FLYING)) |
2573 | if (!op->env && (pl->move_type & MOVE_FLYING)) |
2577 | { |
2574 | { |
2578 | /* player is flying and applying object not in inventory */ |
2575 | /* player is flying and applying object not in inventory */ |
2579 | if (!QUERY_FLAG (pl, FLAG_WIZ) && !(op->move_type & MOVE_FLYING)) |
2576 | if (!QUERY_FLAG (pl, FLAG_WIZ) && !(op->move_type & MOVE_FLYING)) |
2580 | { |
2577 | { |
2581 | pl->failmsg ("But you are floating high above the ground! H<You have to stop levitating first, if you can.>"); |
2578 | pl->failmsg ("But you are floating high above the ground! " |
|
|
2579 | "H<You have to stop levitating first, if you can, either by using your levitation skill, " |
|
|
2580 | "or waiting till the levitation effect wears off.>"); |
2582 | return 0; |
2581 | return 0; |
2583 | } |
2582 | } |
2584 | } |
2583 | } |
2585 | |
2584 | |
2586 | pl->contr->last_used = op; |
2585 | pl->contr->last_used = op; |
2587 | |
2586 | |
2588 | tmp = manual_apply (pl, op, aflag); |
2587 | int tmp = manual_apply (pl, op, aflag); |
|
|
2588 | |
2589 | if (!quiet) |
2589 | if (!quiet) |
2590 | { |
2590 | { |
2591 | if (tmp == 0) |
2591 | if (tmp == 0) |
2592 | pl->statusmsg (format ("I don't know how to apply the %s.", query_name (op))); |
2592 | pl->statusmsg (format ("I don't know how to apply the %s.", query_name (op))); |
2593 | else if (tmp == 2) |
2593 | else if (tmp == 2) |
… | |
… | |
3180 | switch (op->type) |
3180 | switch (op->type) |
3181 | { |
3181 | { |
3182 | case WEAPON: |
3182 | case WEAPON: |
3183 | if (!check_weapon_power (who, op->last_eat)) |
3183 | if (!check_weapon_power (who, op->last_eat)) |
3184 | { |
3184 | { |
3185 | op->failmsg ("This weapon is too powerful for you to use. It would consume your soul!." LACK_ITEM_POWER); |
3185 | op->failmsg ("This weapon is too powerful for you to use. It would consume your soul!" LACK_ITEM_POWER); |
3186 | |
3186 | |
3187 | if (tmp) |
3187 | if (tmp) |
3188 | insert_ob_in_ob (tmp, who); |
3188 | insert_ob_in_ob (tmp, who); |
3189 | |
3189 | |
3190 | return 1; |
3190 | return 1; |
… | |
… | |
3908 | if (!strcmp (walk->name, "NOCLASSFACECHANGE")) |
3908 | if (!strcmp (walk->name, "NOCLASSFACECHANGE")) |
3909 | flag_change_face = 0; |
3909 | flag_change_face = 0; |
3910 | |
3910 | |
3911 | if (flag_change_face) |
3911 | if (flag_change_face) |
3912 | { |
3912 | { |
3913 | pl->animation_id = GET_ANIM_ID (change); |
|
|
3914 | pl->face = change->face; |
3913 | pl->face = change->face; |
3915 | |
3914 | pl->animation_id = change->animation_id; |
3916 | if (QUERY_FLAG (change, FLAG_ANIMATE)) |
3915 | pl->flag [FLAG_ANIMATE] = change->flag [FLAG_ANIMATE]; |
3917 | SET_FLAG (pl, FLAG_ANIMATE); |
|
|
3918 | else |
|
|
3919 | CLEAR_FLAG (pl, FLAG_ANIMATE); |
|
|
3920 | } |
3916 | } |
3921 | |
3917 | |
3922 | /* check the special case of can't use weapons */ |
3918 | /* check the special case of can't use weapons */ |
3923 | /*if(QUERY_FLAG(change,FLAG_USE_WEAPON)) CLEAR_FLAG(pl,FLAG_USE_WEAPON); */ |
3919 | /*if(QUERY_FLAG(change,FLAG_USE_WEAPON)) CLEAR_FLAG(pl,FLAG_USE_WEAPON); */ |
3924 | if (!strcmp (change->name, "monk")) |
3920 | if (!strcmp (change->name, "monk")) |