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.58 by root, Wed May 16 23:40:06 2007 UTC

866 && tmp->subtype == SK_PRAYING)) 866 && tmp->subtype == SK_PRAYING))
867 { 867 {
868 if (type == PLAYER) 868 if (type == PLAYER)
869 { 869 {
870 if (tmp == contr->combat_ob || tmp == contr->ranged_ob) 870 if (tmp == contr->combat_ob || tmp == contr->ranged_ob)
871 if (tmp != current_weapon
871 if (tmp != current_weapon && (tmp->type != SKILL || tmp->subtype != SK_PRAYING)) 872 && (tmp->type != SKILL || tmp->subtype != SK_PRAYING)
873 && !tmp->flag [FLAG_CURSED]
874 && !tmp->flag [FLAG_DAMNED])
872 continue; 875 continue;
873 876
874 for (i = 0; i < NUM_STATS; i++) 877 for (i = 0; i < NUM_STATS; i++)
875 change_attr_value (&stats, i, tmp->stats.stat (i)); 878 change_attr_value (&stats, i, tmp->stats.stat (i));
876 879
1028 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1031 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1029 contr->encumbrance += (int) 3 *tmp->weight / 1000; 1032 contr->encumbrance += (int) 3 *tmp->weight / 1000;
1030 1033
1031 break; 1034 break;
1032 1035
1033 case SKILL_TOOL:
1034 if (chosen_skill)
1035 LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &name);
1036
1037 chosen_skill = tmp;
1038 break;
1039
1040 case SHIELD: 1036 case SHIELD:
1041 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1037 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1042 contr->encumbrance += (int) tmp->weight / 2000; 1038 contr->encumbrance += (int) tmp->weight / 2000;
1043 case RING: 1039 case RING:
1044 case AMULET: 1040 case AMULET:
1360 * that would just be a real pain to read. 1356 * that would just be a real pain to read.
1361 */ 1357 */
1362 float M = (max_carry[stats.Str] - 121) / 121.f; 1358 float M = (max_carry[stats.Str] - 121) / 121.f;
1363 float M2 = max_carry[stats.Str] / 100.f; 1359 float M2 = max_carry[stats.Str] / 100.f;
1364 float W = weapon_weight / 20000.f; 1360 float W = weapon_weight / 20000.f;
1365 float s = 2 - weapon_speed / 10.f; 1361 float s = (20 - weapon_speed) / 10.f;
1366 float D = (stats.Dex - 14) / 14.f; 1362 float D = (stats.Dex - 14) / 14.f;
1367 float K = 1 + M / 3.f - W / (3 * M2) + speed / 5.f + D / 2.f; 1363 float K = 1 + M / 3.f - W / (3 * M2) + speed / 5.f + D / 2.f;
1368 1364
1369 K *= (4 + level) *1.2f / (6 + level); 1365 K *= (4 + level) * 1.2f / (6 + level);
1370 1366
1371 if (K <= 0.f) 1367 if (K <= 0.01f)
1372 K = 0.01f; 1368 K = 0.01f;
1373 1369
1374 float S = speed / (K * s); 1370 float S = speed / (K * s);
1375 1371
1376 contr->weapon_sp = S; 1372 contr->weapon_sp = S;
1378 1374
1379 /* I want to limit the power of small monsters with big weapons: */ 1375 /* I want to limit the power of small monsters with big weapons: */
1380 if (type != PLAYER && arch && stats.dam > arch->clone.stats.dam * 3) 1376 if (type != PLAYER && arch && stats.dam > arch->clone.stats.dam * 3)
1381 stats.dam = arch->clone.stats.dam * 3; 1377 stats.dam = arch->clone.stats.dam * 3;
1382 1378
1383 /* Prevent overflows of wc - best you can get is ABS(120) - this 1379 stats.wc = clamp (wc, MIN_WC, MAX_WC);
1384 * should be more than enough - remember, AC is also in 8 bits, 1380 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 1381
1401 /* if for some reason the creature doesn't have any move type, 1382 /* if for some reason the creature doesn't have any move type,
1402 * give them walking as a default. 1383 * give them walking as a default.
1403 * The second case is a special case - to more closely mimic the 1384 * The second case is a special case - to more closely mimic the
1404 * old behaviour - if your flying, your not walking - just 1385 * old behaviour - if your flying, your not walking - just
1593 CLEAR_FLAG (skill_obj, FLAG_CAN_USE_SKILL); 1574 CLEAR_FLAG (skill_obj, FLAG_CAN_USE_SKILL);
1594 skill_obj->stats.exp = 0; 1575 skill_obj->stats.exp = 0;
1595 skill_obj->level = 1; 1576 skill_obj->level = 1;
1596 insert_ob_in_ob (skill_obj, op); 1577 insert_ob_in_ob (skill_obj, op);
1597 1578
1598 if (op->contr) 1579 if (player *pl = op->contr)
1599 { 1580 {
1600 op->contr->last_skill_ob [skill_obj->subtype] = skill_obj; 1581 pl->last_skill_ob [skill_obj->subtype] = skill_obj;
1601 if (op->contr->ns) 1582 if (pl->ns)
1602 op->contr->ns->last_skill_exp[skill_obj->subtype] = -1;//TODO: should be made superfluous 1583 pl->ns->last_skill_exp[skill_obj->subtype] = -1;//TODO: should be made superfluous
1603 } 1584 }
1604 1585
1605 return skill_obj; 1586 return skill_obj;
1606} 1587}
1607 1588

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines