… | |
… | |
16 | |
16 | |
17 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | |
20 | |
21 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
22 | */ |
22 | */ |
23 | |
23 | |
24 | #include <global.h> |
24 | #include <global.h> |
25 | #include <funcpoint.h> |
25 | #include <funcpoint.h> |
26 | |
26 | |
… | |
… | |
158 | * -b.t. |
158 | * -b.t. |
159 | */ |
159 | */ |
160 | |
160 | |
161 | #define MAX_EXP_IN_OBJ levels[settings.max_level]/(MAX_EXP_CAT - 1) |
161 | #define MAX_EXP_IN_OBJ levels[settings.max_level]/(MAX_EXP_CAT - 1) |
162 | |
162 | |
163 | #ifndef WIN32 |
|
|
164 | extern uint64 *levels; |
|
|
165 | #else |
|
|
166 | extern sint64 *levels; |
163 | extern sint64 *levels; |
167 | #endif |
|
|
168 | |
164 | |
169 | #define MAX_SAVE_LEVEL 110 |
165 | #define MAX_SAVE_LEVEL 110 |
170 | |
166 | |
171 | /* This no longer needs to be changed anytime the number of |
167 | /* This no longer needs to be changed anytime the number of |
172 | * levels is increased - rather, did_make_save will do the |
168 | * levels is increased - rather, did_make_save will do the |
… | |
… | |
995 | /* these are the items that currently can change digestion, regeneration, |
991 | /* these are the items that currently can change digestion, regeneration, |
996 | * spell point recovery and mana point recovery. Seems sort of an arbitary |
992 | * spell point recovery and mana point recovery. Seems sort of an arbitary |
997 | * list, but other items store other info into stats array. |
993 | * list, but other items store other info into stats array. |
998 | */ |
994 | */ |
999 | if ((tmp->type == EXPERIENCE) || (tmp->type == WEAPON) || |
995 | if ((tmp->type == EXPERIENCE) || (tmp->type == WEAPON) || |
1000 | (tmp->type == ARMOUR) || (tmp->type == HELMET) || |
996 | (tmp->type == ARMOUR) || (tmp->type == HELMET) || |
1001 | (tmp->type == SHIELD) || (tmp->type == RING) || |
997 | (tmp->type == SHIELD) || (tmp->type == RING) || |
1002 | (tmp->type == BOOTS) || (tmp->type == GLOVES) || |
998 | (tmp->type == BOOTS) || (tmp->type == GLOVES) || |
1003 | (tmp->type == AMULET) || (tmp->type == GIRDLE) || |
999 | (tmp->type == AMULET) || (tmp->type == GIRDLE) || |
1004 | (tmp->type == BRACERS) || (tmp->type == CLOAK) || (tmp->type == DISEASE) || (tmp->type == FORCE) || (tmp->type == SKILL)) |
1000 | (tmp->type == BRACERS) || (tmp->type == CLOAK) || |
|
|
1001 | (tmp->type == DISEASE) || (tmp->type == FORCE) || |
|
|
1002 | (tmp->type == SKILL)) |
1005 | { |
1003 | { |
1006 | op->contr->digestion += tmp->stats.food; |
1004 | op->contr->digestion += tmp->stats.food; |
1007 | op->contr->gen_hp += tmp->stats.hp; |
1005 | op->contr->gen_hp += tmp->stats.hp; |
1008 | op->contr->gen_sp += tmp->stats.sp; |
1006 | op->contr->gen_sp += tmp->stats.sp; |
1009 | op->contr->gen_grace += tmp->stats.grace; |
1007 | op->contr->gen_grace += tmp->stats.grace; |
1010 | op->contr->gen_sp_armour += tmp->gen_sp_armour; |
1008 | op->contr->gen_sp_armour += tmp->gen_sp_armour; |
1011 | op->contr->item_power += tmp->item_power; |
1009 | op->contr->item_power += tmp->item_power; |
1012 | } |
1010 | } |
1013 | } /* if this is a player */ |
1011 | } /* if this is a player */ |
1014 | |
1012 | |
1015 | /* Update slots used for items */ |
1013 | /* Update slots used for items */ |
1016 | if (QUERY_FLAG (tmp, FLAG_APPLIED)) |
1014 | if (QUERY_FLAG (tmp, FLAG_APPLIED)) |
… | |
… | |
1959 | void |
1957 | void |
1960 | change_exp (object *op, sint64 exp, const char *skill_name, int flag) |
1958 | change_exp (object *op, sint64 exp, const char *skill_name, int flag) |
1961 | { |
1959 | { |
1962 | |
1960 | |
1963 | #ifdef EXP_DEBUG |
1961 | #ifdef EXP_DEBUG |
1964 | # ifndef WIN32 |
|
|
1965 | LOG (llevDebug, "change_exp() called for %s, exp = %lld\n", query_name (op), exp); |
|
|
1966 | # else |
|
|
1967 | LOG (llevDebug, "change_exp() called for %s, exp = %I64d\n", query_name (op), exp); |
1962 | LOG (llevDebug, "change_exp() called for %s, exp = %" PRId64 "\n", query_name (op), exp); |
1968 | # endif |
|
|
1969 | #endif |
1963 | #endif |
1970 | |
1964 | |
1971 | /* safety */ |
1965 | /* safety */ |
1972 | if (!op) |
1966 | if (!op) |
1973 | { |
1967 | { |