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.55 by root, Sat May 12 19:41:02 2007 UTC vs.
Revision 1.56 by root, Sun May 13 15:13:57 2007 UTC

1360 * that would just be a real pain to read. 1360 * that would just be a real pain to read.
1361 */ 1361 */
1362 float M = (max_carry[stats.Str] - 121) / 121.f; 1362 float M = (max_carry[stats.Str] - 121) / 121.f;
1363 float M2 = max_carry[stats.Str] / 100.f; 1363 float M2 = max_carry[stats.Str] / 100.f;
1364 float W = weapon_weight / 20000.f; 1364 float W = weapon_weight / 20000.f;
1365 float s = 2 - weapon_speed / 10.f; 1365 float s = (20 - weapon_speed) / 10.f;
1366 float D = (stats.Dex - 14) / 14.f; 1366 float D = (stats.Dex - 14) / 14.f;
1367 float K = 1 + M / 3.f - W / (3 * M2) + speed / 5.f + D / 2.f; 1367 float K = 1 + M / 3.f - W / (3 * M2) + speed / 5.f + D / 2.f;
1368 1368
1369 K *= (4 + level) *1.2f / (6 + level); 1369 K *= (4 + level) * 1.2f / (6 + level);
1370 1370
1371 if (K <= 0.f) 1371 if (K <= 0.01f)
1372 K = 0.01f; 1372 K = 0.01f;
1373 1373
1374 float S = speed / (K * s); 1374 float S = speed / (K * s);
1375 1375
1376 contr->weapon_sp = S; 1376 contr->weapon_sp = S;
1378 1378
1379 /* I want to limit the power of small monsters with big weapons: */ 1379 /* I want to limit the power of small monsters with big weapons: */
1380 if (type != PLAYER && arch && stats.dam > arch->clone.stats.dam * 3) 1380 if (type != PLAYER && arch && stats.dam > arch->clone.stats.dam * 3)
1381 stats.dam = arch->clone.stats.dam * 3; 1381 stats.dam = arch->clone.stats.dam * 3;
1382 1382
1383 /* Prevent overflows of wc - best you can get is ABS(120) - this 1383 stats.wc = clamp (wc, MIN_WC, MAX_WC);
1384 * should be more than enough - remember, AC is also in 8 bits, 1384 stats.ac = clamp (ac, MIN_AC, MAX_AC);
1385 * so its value is the same.
1386 */
1387 if (wc > 120)
1388 wc = 120;
1389 else if (wc < -120)
1390 wc = -120;
1391
1392 stats.wc = wc;
1393
1394 if (ac > 120)
1395 ac = 120;
1396 else if (ac < -120)
1397 ac = -120;
1398
1399 stats.ac = ac;
1400 1385
1401 /* if for some reason the creature doesn't have any move type, 1386 /* if for some reason the creature doesn't have any move type,
1402 * give them walking as a default. 1387 * give them walking as a default.
1403 * The second case is a special case - to more closely mimic the 1388 * The second case is a special case - to more closely mimic the
1404 * old behaviour - if your flying, your not walking - just 1389 * old behaviour - if your flying, your not walking - just

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines