… | |
… | |
858 | * then calls this function. |
858 | * then calls this function. |
859 | */ |
859 | */ |
860 | if (QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->type == POTION) |
860 | if (QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->type == POTION) |
861 | continue; |
861 | continue; |
862 | |
862 | |
863 | /* See note in map.c:update_position about making this additive |
|
|
864 | * since light sources are never applied, need to put check here. |
|
|
865 | */ |
|
|
866 | glow_radius = max (glow_radius, tmp->glow_radius); |
863 | glow_radius += tmp->glow_radius; |
867 | |
864 | |
868 | /* For some things, we don't care what is equipped */ |
865 | /* For some things, we don't care what is equipped */ |
869 | if (tmp->type == SKILL) |
866 | if (tmp->type == SKILL) |
870 | { |
867 | { |
871 | /* Want to take the highest skill here. */ |
868 | /* Want to take the highest skill here. */ |
… | |
… | |
1137 | else /* To nullify the below effect */ |
1134 | else /* To nullify the below effect */ |
1138 | ac += tmp->stats.ac + tmp->magic; |
1135 | ac += tmp->stats.ac + tmp->magic; |
1139 | } |
1136 | } |
1140 | |
1137 | |
1141 | if (tmp->stats.wc) |
1138 | if (tmp->stats.wc) |
1142 | wc -= (tmp->stats.wc + tmp->magic); |
1139 | wc -= tmp->stats.wc + tmp->magic; |
1143 | |
1140 | |
1144 | if (tmp->stats.ac) |
1141 | if (tmp->stats.ac) |
1145 | ac -= (tmp->stats.ac + tmp->magic); |
1142 | ac -= tmp->stats.ac + tmp->magic; |
1146 | |
1143 | |
1147 | if (ARMOUR_SPEED (tmp)) |
1144 | if (ARMOUR_SPEED (tmp)) |
1148 | max_speed = min (max_speed, ARMOUR_SPEED (tmp) / 10.f); |
1145 | max_speed = min (max_speed, ARMOUR_SPEED (tmp) / 10.f); |
1149 | |
1146 | |
1150 | break; |
1147 | break; |
1151 | } /* switch tmp->type */ |
1148 | } /* switch tmp->type */ |
1152 | } /* item is equipped */ |
1149 | } /* item is equipped */ |
1153 | } /* for loop of items */ |
1150 | } /* for loop of items */ |
|
|
1151 | |
|
|
1152 | glow_radius = min (glow_radius, MAX_LIGHT_RADIUS); |
1154 | |
1153 | |
1155 | /* We've gone through all the objects the player has equipped. For many things, we |
1154 | /* We've gone through all the objects the player has equipped. For many things, we |
1156 | * have generated intermediate values which we now need to assign. |
1155 | * have generated intermediate values which we now need to assign. |
1157 | */ |
1156 | */ |
1158 | |
1157 | |
… | |
… | |
1328 | |
1327 | |
1329 | speed = 1.f + speed_bonus[stats.Dex]; |
1328 | speed = 1.f + speed_bonus[stats.Dex]; |
1330 | |
1329 | |
1331 | if (settings.search_items && contr->search_str[0]) |
1330 | if (settings.search_items && contr->search_str[0]) |
1332 | speed -= 1; |
1331 | speed -= 1; |
1333 | |
|
|
1334 | if (attacktype == 0) |
|
|
1335 | attacktype = arch->attacktype; |
|
|
1336 | } /* End if player */ |
1332 | } /* End if player */ |
1337 | |
1333 | |
1338 | if (added_speed >= 0) |
1334 | if (added_speed >= 0) |
1339 | speed += added_speed / 10.f; |
1335 | speed += added_speed / 10.f; |
1340 | else /* Something wrong here...: */ |
1336 | else /* Something wrong here...: */ |
… | |
… | |
1417 | } |
1413 | } |
1418 | |
1414 | |
1419 | // update the mapspace, if we are on a map |
1415 | // update the mapspace, if we are on a map |
1420 | if (!flag [FLAG_REMOVED] && map) |
1416 | if (!flag [FLAG_REMOVED] && map) |
1421 | map->at (x, y).flags_ = 0; |
1417 | map->at (x, y).flags_ = 0; |
|
|
1418 | } |
|
|
1419 | |
|
|
1420 | void |
|
|
1421 | object::set_glow_radius (sint8 rad) |
|
|
1422 | { |
|
|
1423 | glow_radius = rad; |
|
|
1424 | |
|
|
1425 | if (is_on_map ()) |
|
|
1426 | update_all_los (map, x, y); |
|
|
1427 | else if (object *env = outer_env ()) |
|
|
1428 | { |
|
|
1429 | env->update_stats (); |
|
|
1430 | |
|
|
1431 | if (env->is_on_map ()) |
|
|
1432 | update_all_los (env->map, env->x, env->y); |
|
|
1433 | } |
1422 | } |
1434 | } |
1423 | |
1435 | |
1424 | /* |
1436 | /* |
1425 | * Returns true if the given player is a legal class. |
1437 | * Returns true if the given player is a legal class. |
1426 | * The function to add and remove class-bonuses to the stats doesn't |
1438 | * The function to add and remove class-bonuses to the stats doesn't |