… | |
… | |
810 | path_repelled = arch->path_repelled; |
810 | path_repelled = arch->path_repelled; |
811 | path_denied = arch->path_denied; |
811 | path_denied = arch->path_denied; |
812 | glow_radius = arch->glow_radius; |
812 | glow_radius = arch->glow_radius; |
813 | move_type = arch->move_type; |
813 | move_type = arch->move_type; |
814 | |
814 | |
815 | chosen_skill = 0; |
815 | object *chosen_skill = 0; |
816 | |
816 | |
817 | /* initializing resistances from the values in player/monster's |
817 | /* initializing resistances from the values in player/monster's |
818 | * archetype clone |
818 | * archetype clone |
819 | */ |
819 | */ |
820 | memcpy (&resist, &arch->resist, sizeof (resist)); |
820 | memcpy (&resist, &arch->resist, sizeof (resist)); |
… | |
… | |
895 | * up, etc. |
895 | * up, etc. |
896 | */ |
896 | */ |
897 | if ((tmp->flag [FLAG_APPLIED] |
897 | if ((tmp->flag [FLAG_APPLIED] |
898 | && tmp->type != CONTAINER |
898 | && tmp->type != CONTAINER |
899 | && tmp->type != CLOSE_CON) |
899 | && tmp->type != CLOSE_CON) |
900 | || (tmp->type == SKILL |
|
|
901 | && tmp->subtype == SK_PRAYING)) |
900 | || (tmp->type == SKILL && tmp->subtype == SK_PRAYING)) |
902 | { |
901 | { |
903 | if (type == PLAYER) |
902 | if (type == PLAYER) |
904 | { |
903 | { |
905 | contr->item_power += tmp->item_power; |
904 | contr->item_power += tmp->item_power; |
906 | |
905 | |
… | |
… | |
998 | added_speed += tmp->stats.exp; |
997 | added_speed += tmp->stats.exp; |
999 | } |
998 | } |
1000 | |
999 | |
1001 | switch (tmp->type) |
1000 | switch (tmp->type) |
1002 | { |
1001 | { |
1003 | #if 0 |
|
|
1004 | case WAND: |
|
|
1005 | case ROD: |
|
|
1006 | case HORN: |
|
|
1007 | if (type != PLAYER || current_weapon == tmp) |
|
|
1008 | chosen_skill = tmp; |
|
|
1009 | break; |
|
|
1010 | #endif |
|
|
1011 | |
|
|
1012 | /* skills modifying the character -b.t. */ |
1002 | /* skills modifying the character -b.t. */ |
1013 | /* for all skills and skill granting objects */ |
1003 | /* for all skills and skill granting objects */ |
1014 | case SKILL: |
1004 | case SKILL: |
1015 | { |
1005 | { |
1016 | if (!QUERY_FLAG (tmp, FLAG_APPLIED) || skill_flags [tmp->subtype] & SF_APPLY) |
1006 | if (!QUERY_FLAG (tmp, FLAG_APPLIED) || skill_flags [tmp->subtype] & SF_APPLY) |
… | |
… | |
1077 | if (tmp->stats.ac) |
1067 | if (tmp->stats.ac) |
1078 | ac -= tmp->stats.ac + tmp->magic; |
1068 | ac -= tmp->stats.ac + tmp->magic; |
1079 | |
1069 | |
1080 | break; |
1070 | break; |
1081 | |
1071 | |
|
|
1072 | case WAND: |
|
|
1073 | case ROD: |
|
|
1074 | case HORN: |
|
|
1075 | case SKILL_TOOL: |
|
|
1076 | if (type != PLAYER) |
|
|
1077 | chosen_skill = find_skill_by_name (this, tmp->skill); |
|
|
1078 | break; |
|
|
1079 | |
1082 | case BOW: |
1080 | case BOW: |
1083 | case WEAPON: |
1081 | case WEAPON: |
1084 | if (type != PLAYER || current_weapon == tmp) |
1082 | if (type != PLAYER || current_weapon == tmp) |
1085 | { |
1083 | { |
|
|
1084 | chosen_skill = find_skill_by_name (this, tmp->skill); |
|
|
1085 | |
1086 | wc -= tmp->stats.wc + tmp->magic; |
1086 | wc -= tmp->stats.wc + tmp->magic; |
1087 | |
1087 | |
1088 | if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) |
1088 | if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) |
1089 | ac -= tmp->stats.ac + tmp->magic; |
1089 | ac -= tmp->stats.ac + tmp->magic; |
1090 | |
1090 | |
… | |
… | |
1148 | |
1148 | |
1149 | break; |
1149 | break; |
1150 | } /* switch tmp->type */ |
1150 | } /* switch tmp->type */ |
1151 | } /* item is equipped */ |
1151 | } /* item is equipped */ |
1152 | } /* for loop of items */ |
1152 | } /* for loop of items */ |
|
|
1153 | |
|
|
1154 | if (type != PLAYER) |
|
|
1155 | this->chosen_skill = chosen_skill; |
1153 | |
1156 | |
1154 | glow_radius = min (glow_radius, MAX_LIGHT_RADIUS); |
1157 | glow_radius = min (glow_radius, MAX_LIGHT_RADIUS); |
1155 | |
1158 | |
1156 | /* We've gone through all the objects the player has equipped. For many things, we |
1159 | /* We've gone through all the objects the player has equipped. For many things, we |
1157 | * have generated intermediate values which we now need to assign. |
1160 | * have generated intermediate values which we now need to assign. |