… | |
… | |
654 | * just dumped this as we found it, this would be a bit |
654 | * just dumped this as we found it, this would be a bit |
655 | * simpler. |
655 | * simpler. |
656 | */ |
656 | */ |
657 | //TODO: egad, do it in perl, do not suffer from the big buffer on stack, make it one single drawinfo. |
657 | //TODO: egad, do it in perl, do not suffer from the big buffer on stack, make it one single drawinfo. |
658 | void |
658 | void |
659 | show_skills (object *op, const char *search) |
659 | show_skills (object *pl, const char *search) |
660 | { |
660 | { |
661 | const char *cp; |
661 | const char *cp; |
662 | int i, num_skills_found = 0; |
662 | int i, num_skills_found = 0; |
663 | const char *const periods = ".............................."; // 30 |
663 | const char *const periods = ".............................."; // 30 |
664 | |
664 | |
665 | /* Need to have a pointer and use strdup for qsort to work properly */ |
665 | /* Need to have a pointer and use strdup for qsort to work properly */ |
666 | char skills[NUM_SKILLS][128]; // d'oh |
666 | char skills[NUM_SKILLS][128]; // d'oh |
|
|
667 | |
|
|
668 | object *op = pl->contr->ob; |
667 | |
669 | |
668 | for (object *tmp = op->inv; tmp; tmp = tmp->below) |
670 | for (object *tmp = op->inv; tmp; tmp = tmp->below) |
669 | { |
671 | { |
670 | if (tmp->type == SKILL) |
672 | if (tmp->type == SKILL) |
671 | { |
673 | { |
… | |
… | |
716 | |
718 | |
717 | msg << "Your equipped item power is " << (int)op->contr->item_power |
719 | msg << "Your equipped item power is " << (int)op->contr->item_power |
718 | << " out of " << int (op->level * settings.item_power_factor) |
720 | << " out of " << int (op->level * settings.item_power_factor) |
719 | << ".\n"; |
721 | << ".\n"; |
720 | |
722 | |
721 | op->contr->infobox (MSG_CHANNEL ("skills"), msg); |
723 | pl->contr->infobox (MSG_CHANNEL ("skills"), msg); |
722 | } |
724 | } |
723 | |
725 | |
724 | /* use_skill() - similar to invoke command, it executes the skill in the |
726 | /* use_skill() - similar to invoke command, it executes the skill in the |
725 | * direction that the user is facing. Returns false if we are unable to |
727 | * direction that the user is facing. Returns false if we are unable to |
726 | * change to the requested skill, or were unable to use the skill properly. |
728 | * change to the requested skill, or were unable to use the skill properly. |