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.68 by root, Sun Jul 1 05:00:17 2007 UTC vs.
Revision 1.71 by elmex, Sat Jul 21 14:37:25 2007 UTC

808 ac = arch->stats.ac; 808 ac = arch->stats.ac;
809 809
810 stats.luck = arch->stats.luck; 810 stats.luck = arch->stats.luck;
811 speed = arch->speed; 811 speed = arch->speed;
812 812
813 sint16 digestion = 0; // a local var to add digestion
814
813 /* OK - we've reset most all the objects attributes to sane values. 815 /* OK - we've reset most all the objects attributes to sane values.
814 * now go through and make adjustments for what the player has equipped. 816 * now go through and make adjustments for what the player has equipped.
815 */ 817 */
816 for (tmp = inv; tmp; tmp = tmp->below) 818 for (tmp = inv; tmp; tmp = tmp->below)
817 { 819 {
864 || (tmp->type == SKILL 866 || (tmp->type == SKILL
865 && tmp->subtype == SK_PRAYING)) 867 && tmp->subtype == SK_PRAYING))
866 { 868 {
867 if (type == PLAYER) 869 if (type == PLAYER)
868 { 870 {
871 contr->item_power += tmp->item_power;
872
869 if (tmp == contr->combat_ob || tmp == contr->ranged_ob) 873 if (tmp == contr->combat_ob || tmp == contr->ranged_ob)
870 if (tmp != current_weapon 874 if (tmp != current_weapon
871 && (tmp->type != SKILL || tmp->subtype != SK_PRAYING) 875 && (tmp->type != SKILL || tmp->subtype != SK_PRAYING)
872 && !tmp->flag [FLAG_CURSED] 876 && !tmp->flag [FLAG_CURSED]
873 && !tmp->flag [FLAG_DAMNED]) 877 && !tmp->flag [FLAG_DAMNED])
887 tmp->type == AMULET || tmp->type == GIRDLE || 891 tmp->type == AMULET || tmp->type == GIRDLE ||
888 tmp->type == BRACERS || tmp->type == CLOAK || 892 tmp->type == BRACERS || tmp->type == CLOAK ||
889 tmp->type == DISEASE || tmp->type == FORCE || 893 tmp->type == DISEASE || tmp->type == FORCE ||
890 tmp->type == SKILL) 894 tmp->type == SKILL)
891 { 895 {
892 contr->digestion += tmp->stats.food; 896 digestion += tmp->stats.food;
893 contr->gen_hp += tmp->stats.hp; 897 contr->gen_hp += tmp->stats.hp;
894 contr->gen_sp += tmp->stats.sp; 898 contr->gen_sp += tmp->stats.sp;
895 contr->gen_grace += tmp->stats.grace; 899 contr->gen_grace += tmp->stats.grace;
896 contr->gen_sp_armour += tmp->gen_sp_armour; 900 contr->gen_sp_armour += tmp->gen_sp_armour;
897 contr->item_power += tmp->item_power;
898 } 901 }
899 } /* if this is a player */ 902 } /* if this is a player */
900 else 903 else
901 { 904 {
902 if (tmp->type == WEAPON) 905 if (tmp->type == WEAPON)
1132 break; 1135 break;
1133 } /* switch tmp->type */ 1136 } /* switch tmp->type */
1134 } /* item is equipped */ 1137 } /* item is equipped */
1135 } /* for loop of items */ 1138 } /* for loop of items */
1136 1139
1140 // now clamp digestion to our limits
1141 contr->digestion = clamp (digestion, MIN_DIGESTION, MAX_DIGESTION);
1142
1137 /* We've gone through all the objects the player has equipped. For many things, we 1143 /* We've gone through all the objects the player has equipped. For many things, we
1138 * have generated intermediate values which we now need to assign. 1144 * have generated intermediate values which we now need to assign.
1139 */ 1145 */
1140 1146
1141 /* 'total resistance = total protections - total vulnerabilities'. 1147 /* 'total resistance = total protections - total vulnerabilities'.
1508 object *skin = NULL; /* pointer to dragon skin force */ 1514 object *skin = NULL; /* pointer to dragon skin force */
1509 object *tmp = NULL; /* tmp. object */ 1515 object *tmp = NULL; /* tmp. object */
1510 char buf[MAX_BUF]; /* tmp. string buffer */ 1516 char buf[MAX_BUF]; /* tmp. string buffer */
1511 1517
1512 /* now grab the 'dragon_ability'-forces from the player's inventory */ 1518 /* now grab the 'dragon_ability'-forces from the player's inventory */
1513 shstr_cmp dragon_ability_force ("dragon_ability_force");
1514 shstr_cmp dragon_skin_force ("dragon_skin_force");
1515
1516 for (tmp = who->inv; tmp; tmp = tmp->below) 1519 for (tmp = who->inv; tmp; tmp = tmp->below)
1517 if (tmp->type == FORCE) 1520 if (tmp->type == FORCE)
1518 if (tmp->arch->archname == dragon_ability_force) 1521 if (tmp->arch->archname == shstr_dragon_ability_force)
1519 abil = tmp; 1522 abil = tmp;
1520 else if (tmp->arch->archname == dragon_skin_force) 1523 else if (tmp->arch->archname == shstr_dragon_skin_force)
1521 skin = tmp; 1524 skin = tmp;
1522 1525
1523 /* if the force is missing -> bail out */ 1526 /* if the force is missing -> bail out */
1524 if (abil == NULL) 1527 if (abil == NULL)
1525 return; 1528 return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines