Wizards learn what spellbooks look like based on their skill in the spell's school */
| 861 | /* Wizards learn what spellbooks look like based on their skill in the |
| 862 | spell's school */ |
| 863 | void |
| 864 | skill_based_spellbook_id(void) |
| 865 | { |
| 866 | if (!Role_if(PM_WIZARD)) |
| 867 | return; |
| 868 | |
| 869 | int booktype; |
| 870 | const uchar spbook_class = (uchar) SPBOOK_CLASS; |
| 871 | |
| 872 | for (booktype = svb.bases[spbook_class]; |
| 873 | booktype < svb.bases[spbook_class + 1]; |
| 874 | booktype++) { |
| 875 | int known_up_to_level; |
| 876 | int skill = spell_skilltype(booktype); |
| 877 | |
| 878 | if (skill == P_NONE) |
| 879 | continue; |
| 880 | |
| 881 | switch (P_SKILL(skill)) { |
| 882 | case P_BASIC: |
| 883 | known_up_to_level = 3; |
| 884 | break; |
| 885 | case P_SKILLED: |
| 886 | known_up_to_level = 5; |
| 887 | break; |
| 888 | case P_EXPERT: |
| 889 | case P_MASTER: |
| 890 | case P_GRAND_MASTER: |
| 891 | known_up_to_level = 7; |
| 892 | break; |
| 893 | case P_UNSKILLED: |
| 894 | default: |
| 895 | /* paupers need more skill than this to ID books, but most wizards |
| 896 | know the basics */ |
| 897 | known_up_to_level = u.uroleplay.pauper ? 0 : 1; |
| 898 | break; |
| 899 | } |
| 900 | |
| 901 | if (objects[booktype].oc_level <= known_up_to_level) |
| 902 | /* makeknown(booktype) but don't exercise Wisdom or mark as |
| 903 | encountered */ |
| 904 | discover_object(booktype, TRUE, FALSE, FALSE); |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | |
| 909 | /* Limit the total area chain lightning can cover; this is both for |
no test coverage detected