… | |
… | |
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 | { |
… | |
… | |
889 | tmp->type == AMULET || tmp->type == GIRDLE || |
891 | tmp->type == AMULET || tmp->type == GIRDLE || |
890 | tmp->type == BRACERS || tmp->type == CLOAK || |
892 | tmp->type == BRACERS || tmp->type == CLOAK || |
891 | tmp->type == DISEASE || tmp->type == FORCE || |
893 | tmp->type == DISEASE || tmp->type == FORCE || |
892 | tmp->type == SKILL) |
894 | tmp->type == SKILL) |
893 | { |
895 | { |
894 | contr->digestion += tmp->stats.food; |
896 | digestion += tmp->stats.food; |
895 | contr->gen_hp += tmp->stats.hp; |
897 | contr->gen_hp += tmp->stats.hp; |
896 | contr->gen_sp += tmp->stats.sp; |
898 | contr->gen_sp += tmp->stats.sp; |
897 | contr->gen_grace += tmp->stats.grace; |
899 | contr->gen_grace += tmp->stats.grace; |
898 | contr->gen_sp_armour += tmp->gen_sp_armour; |
900 | contr->gen_sp_armour += tmp->gen_sp_armour; |
899 | } |
901 | } |
… | |
… | |
1133 | break; |
1135 | break; |
1134 | } /* switch tmp->type */ |
1136 | } /* switch tmp->type */ |
1135 | } /* item is equipped */ |
1137 | } /* item is equipped */ |
1136 | } /* for loop of items */ |
1138 | } /* for loop of items */ |
1137 | |
1139 | |
|
|
1140 | // now clamp digestion to our limits |
|
|
1141 | contr->digestion = clamp (digestion, MIN_DIGESTION, MAX_DIGESTION); |
|
|
1142 | |
1138 | /* 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 |
1139 | * have generated intermediate values which we now need to assign. |
1144 | * have generated intermediate values which we now need to assign. |
1140 | */ |
1145 | */ |
1141 | |
1146 | |
1142 | /* 'total resistance = total protections - total vulnerabilities'. |
1147 | /* 'total resistance = total protections - total vulnerabilities'. |
… | |
… | |
1509 | object *skin = NULL; /* pointer to dragon skin force */ |
1514 | object *skin = NULL; /* pointer to dragon skin force */ |
1510 | object *tmp = NULL; /* tmp. object */ |
1515 | object *tmp = NULL; /* tmp. object */ |
1511 | char buf[MAX_BUF]; /* tmp. string buffer */ |
1516 | char buf[MAX_BUF]; /* tmp. string buffer */ |
1512 | |
1517 | |
1513 | /* now grab the 'dragon_ability'-forces from the player's inventory */ |
1518 | /* now grab the 'dragon_ability'-forces from the player's inventory */ |
1514 | shstr_cmp dragon_ability_force ("dragon_ability_force"); |
|
|
1515 | shstr_cmp dragon_skin_force ("dragon_skin_force"); |
|
|
1516 | |
|
|
1517 | for (tmp = who->inv; tmp; tmp = tmp->below) |
1519 | for (tmp = who->inv; tmp; tmp = tmp->below) |
1518 | if (tmp->type == FORCE) |
1520 | if (tmp->type == FORCE) |
1519 | if (tmp->arch->archname == dragon_ability_force) |
1521 | if (tmp->arch->archname == shstr_dragon_ability_force) |
1520 | abil = tmp; |
1522 | abil = tmp; |
1521 | else if (tmp->arch->archname == dragon_skin_force) |
1523 | else if (tmp->arch->archname == shstr_dragon_skin_force) |
1522 | skin = tmp; |
1524 | skin = tmp; |
1523 | |
1525 | |
1524 | /* if the force is missing -> bail out */ |
1526 | /* if the force is missing -> bail out */ |
1525 | if (abil == NULL) |
1527 | if (abil == NULL) |
1526 | return; |
1528 | return; |