ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/living.C
(Generate patch)

Comparing deliantra/server/common/living.C (file contents):
Revision 1.76 by root, Tue Aug 7 22:57:57 2007 UTC vs.
Revision 1.79 by root, Thu Nov 8 01:14:12 2007 UTC

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.
1354 /* f is a number the represents the number of kg above (positive num) 1350 /* f is a number the represents the number of kg above (positive num)
1355 * or below (negative number) that the player is carrying. If above 1351 * or below (negative number) that the player is carrying. If above
1356 * weight limit, then player suffers a speed reduction based on how 1352 * weight limit, then player suffers a speed reduction based on how
1357 * much above he is, and what is max carry is 1353 * much above he is, and what is max carry is
1358 */ 1354 */
1359 f = (carrying / 1000) - max_carry[stats.Str]; 1355 float f = (carrying / 1000) - max_carry[stats.Str];
1360 if (f > 0) 1356 if (f > 0.f)
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 */
1361 speed *= speed_reduce_from_disease;
1365 1362
1366 /* Put a lower limit on speed. Note with this speed, you move once every 1363 /* 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. 1364 * 25 ticks or so. This amounts to once every 3 seconds of realtime.
1368 */ 1365 */
1369 speed = speed * speed_reduce_from_disease;
1370
1371 if (speed < 0.01f && type == PLAYER) 1366 if (speed < 0.04f && type == PLAYER)
1372 speed = 0.01f; 1367 speed = 0.04f;
1368
1369 if (speed != old_speed)
1370 set_speed (speed);
1373 1371
1374 if (type == PLAYER) 1372 if (type == PLAYER)
1375 { 1373 {
1376 /* (This formula was made by vidarl@ifi.uio.no) 1374 /* (This formula was made by vidarl@ifi.uio.no)
1377 * Note that we never used these values again - basically 1375 * Note that we never used these values again - basically
1409 if (move_type == 0) 1407 if (move_type == 0)
1410 move_type = MOVE_WALK; 1408 move_type = MOVE_WALK;
1411 else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) 1409 else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH))
1412 move_type &= ~MOVE_WALK; 1410 move_type &= ~MOVE_WALK;
1413 1411
1414 if (speed != old_speed)
1415 set_speed (speed);
1416
1417 /* It is quite possible that a player's spell costing might have changed, 1412 /* It is quite possible that a player's spell costing might have changed,
1418 * so we will check that now. 1413 * so we will check that now.
1419 */ 1414 */
1420 if (type == PLAYER) 1415 if (type == PLAYER)
1421 { 1416 {
1484 atnr = abil->stats.exp; 1479 atnr = abil->stats.exp;
1485 1480
1486 level = (int) (level / 5.); 1481 level = (int) (level / 5.);
1487 1482
1488 /* now set the new title */ 1483 /* now set the new title */
1489 if (pl->contr != NULL) 1484 if (pl->contr)
1490 { 1485 {
1491 if (level == 0) 1486 if (level == 0)
1492 sprintf (pl->contr->title, "%s hatchling", attacks[atnr]); 1487 sprintf (pl->contr->title, "%s hatchling", attacks[atnr]);
1493 else if (level == 1) 1488 else if (level == 1)
1494 sprintf (pl->contr->title, "%s wyrm", attacks[atnr]); 1489 sprintf (pl->contr->title, "%s wyrm", attacks[atnr]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines