… | |
… | |
937 | if (QUERY_FLAG (tmp, FLAG_APPLIED)) |
937 | if (QUERY_FLAG (tmp, FLAG_APPLIED)) |
938 | for (int i = 0; i < NUM_BODY_LOCATIONS; i++) |
938 | for (int i = 0; i < NUM_BODY_LOCATIONS; i++) |
939 | slot[i].used += tmp->slot[i].info; |
939 | slot[i].used += tmp->slot[i].info; |
940 | |
940 | |
941 | if (tmp->type == SYMPTOM) |
941 | if (tmp->type == SYMPTOM) |
942 | { |
|
|
943 | speed_reduce_from_disease = tmp->last_sp / 100.f; |
|
|
944 | |
|
|
945 | if (speed_reduce_from_disease == 0) |
|
|
946 | speed_reduce_from_disease = 1; |
942 | speed_reduce_from_disease = |
947 | } |
943 | min (speed_reduce_from_disease, tmp->last_sp ? tmp->last_sp / 100.f : 1.f); |
948 | |
944 | |
949 | /* Pos. and neg. protections are counted seperate (-> pro/vuln). |
945 | /* Pos. and neg. protections are counted seperate (-> pro/vuln). |
950 | * (Negative protections are calculated exactly like positive.) |
946 | * (Negative protections are calculated exactly like positive.) |
951 | * Resistance from potions are treated special as well. If there's |
947 | * Resistance from potions are treated special as well. If there's |
952 | * more than one potion-effect, the bigger prot.-value is taken. |
948 | * more than one potion-effect, the bigger prot.-value is taken. |
… | |
… | |
1361 | speed = speed / (1.f + f / max_carry[stats.Str]); |
1357 | speed = speed / (1.f + f / max_carry[stats.Str]); |
1362 | } |
1358 | } |
1363 | |
1359 | |
1364 | speed += bonus_speed / 10.f; /* Not affected by limits */ |
1360 | speed += bonus_speed / 10.f; /* Not affected by limits */ |
1365 | |
1361 | |
|
|
1362 | speed = speed * speed_reduce_from_disease; |
|
|
1363 | |
1366 | /* Put a lower limit on speed. Note with this speed, you move once every |
1364 | /* Put a lower limit on speed. Note with this speed, you move once every |
1367 | * 100 ticks or so. This amounts to once every 12 seconds of realtime. |
1365 | * 100 ticks or so. This amounts to once every 12 seconds of realtime. |
1368 | */ |
1366 | */ |
1369 | speed = speed * speed_reduce_from_disease; |
|
|
1370 | |
|
|
1371 | if (speed < 0.01f && type == PLAYER) |
1367 | if (speed < 0.01f && type == PLAYER) |
1372 | speed = 0.01f; |
1368 | speed = 0.01f; |
|
|
1369 | |
|
|
1370 | if (speed != old_speed) |
|
|
1371 | set_speed (speed); |
1373 | |
1372 | |
1374 | if (type == PLAYER) |
1373 | if (type == PLAYER) |
1375 | { |
1374 | { |
1376 | /* (This formula was made by vidarl@ifi.uio.no) |
1375 | /* (This formula was made by vidarl@ifi.uio.no) |
1377 | * Note that we never used these values again - basically |
1376 | * Note that we never used these values again - basically |
… | |
… | |
1408 | */ |
1407 | */ |
1409 | if (move_type == 0) |
1408 | if (move_type == 0) |
1410 | move_type = MOVE_WALK; |
1409 | move_type = MOVE_WALK; |
1411 | else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) |
1410 | else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) |
1412 | move_type &= ~MOVE_WALK; |
1411 | move_type &= ~MOVE_WALK; |
1413 | |
|
|
1414 | if (speed != old_speed) |
|
|
1415 | set_speed (speed); |
|
|
1416 | |
1412 | |
1417 | /* It is quite possible that a player's spell costing might have changed, |
1413 | /* It is quite possible that a player's spell costing might have changed, |
1418 | * so we will check that now. |
1414 | * so we will check that now. |
1419 | */ |
1415 | */ |
1420 | if (type == PLAYER) |
1416 | if (type == PLAYER) |