Only in tome-223-src/lib/mods: NoLimits diff -r tome-223-org/src/cmd6.c tome-223-src/src/cmd6.c 369c369 < (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 399c399 < (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 429c429 < (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 459c459 < (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 619c619 < lose_exp(200 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE); --- > lose_exp(200 + (p_ptr->exp2 / 1000) * MON_DRAIN_LIFE); 624c624 < lose_exp(200 + (p_ptr->exp / 100) * MON_DRAIN_LIFE); --- > lose_exp(200 + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE); 680c680 < lose_exp(500 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE); --- > lose_exp(500 + (p_ptr->exp2 / 1000) * MON_DRAIN_LIFE); 685c685 < lose_exp(5000 + (p_ptr->exp / 100) * MON_DRAIN_LIFE); --- > lose_exp(5000 + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE); 1914c1914 < if (!p_ptr->hold_life && (p_ptr->exp > 0)) --- > if (!p_ptr->hold_life && (p_ptr->exp2 > 0)) 1917c1917 < lose_exp(p_ptr->exp / 4); --- > lose_exp(p_ptr->exp2 / 4); 2335c2335 < if (p_ptr->exp < PY_MAX_EXP) --- > if (p_ptr->exp1 < (PY_MAX_EXP/1000000001L)) 2337,2338c2337,2338 < s32b ee = (p_ptr->exp / 2) + 10; < if (ee > 100000L) ee = 100000L; --- > s32b ee = (p_ptr->exp2 / 2) + 10; > if ((ee > 100000L) || (p_ptr->exp1 > 0)) ee = 100000L; 7174c7174 < lose_exp(p_ptr->exp / 20); --- > lose_exp(p_ptr->exp2 / 20); 7184c7184 < lose_exp(p_ptr->exp / 10); --- > lose_exp(p_ptr->exp2 / 10); diff -r tome-223-org/src/defines.h tome-223-src/src/defines.h 462c462 < #define PY_MAX_EXP 99999999L /* Maximum exp */ --- > #define PY_MAX_EXP 9999999999999999L /* Maximum exp ;-) */ 464c464 < #define PY_MAX_LEVEL 50 /* Maximum level */ --- > #define PY_MAX_LEVEL 100 /* Maximum level */ diff -r tome-223-org/src/dungeon.c tome-223-src/src/dungeon.c 2937c2937 < if ((rand_int(100) < chance) && (p_ptr->exp > 0)) --- > if ((rand_int(100) < chance) && (p_ptr->exp2 > 0)) 2939,2940c2939 < p_ptr->exp -= 1 + plev / 5; < p_ptr->max_exp -= 1 + plev / 5; --- > lose_exp(1 + plev / 5); /* (I hope the strange stuff here wasn't important) */ 3007c3006 < if ((rand_int(100) < 10) && (p_ptr->exp > 0)) --- > if ((rand_int(100) < 10) && (p_ptr->exp2 > 0)) 3009,3010c3008 < p_ptr->exp--; < p_ptr->max_exp--; --- > lose_exp(1); 5676a5675 > 5839a5839,5863 > > /* Adjust player_exp based on race/class. If calculated on the fly, > * nasty overflow bugs occur. This is likely to be more efficient, > * anyway. The first 30 levels are calcualated differently > * to prevent underflow bugs. */ > for (i = 0; i <= 30; i++) > { > player_exp2[i] = (player_exp2[i] * p_ptr->expfact / 100L) + > ((player_exp1[i] * p_ptr->expfact) % 100L) * 1000000; > player_exp1[i] = (player_exp1[i] * p_ptr->expfact / 100L) + > (player_exp2[i] / 100000000); > player_exp2[i] %= 100000000L; > } > > while (i <= PY_MAX_LEVEL) > { > player_exp2[i] = ((player_exp2[i] / 100L) * p_ptr->expfact) + > ((player_exp1[i] * p_ptr->expfact) % 100L) * 1000000; > player_exp1[i] = (player_exp1[i] * p_ptr->expfact / 100L) + > (player_exp2[i] / 100000000L); > player_exp2[i] %= 100000000L; > i++; > } > > diff -r tome-223-org/src/externs.h tome-223-src/src/externs.h 55c55,56 < extern s32b player_exp[PY_MAX_LEVEL]; --- > extern s32b player_exp1[PY_MAX_LEVEL]; > extern s32b player_exp2[PY_MAX_LEVEL]; 1622a1624,1625 > extern int lose_experience_funct(int gained); > extern int gain_experience_funct(int gained); diff -r tome-223-org/src/files.c tome-223-src/src/files.c 1457c1457 < if (p_ptr->exp >= p_ptr->max_exp) --- > if ((p_ptr->exp1 - p_ptr->max_exp1) * 100000000L >= p_ptr->max_exp2 - p_ptr->exp2) 1459c1459,1483 < prt_lnum("Experience ", p_ptr->exp, 10, 28, TERM_L_GREEN); --- > if (p_ptr->exp1 > 0) > { > if (p_ptr->exp1 > 1000) > { > if (p_ptr->exp1 > 1000000000) > { > prt_lnum("Experience ", > (p_ptr->exp1 / 10000L), 10, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "T", 10, 48); > } else > { > prt_lnum("Experience ", > (p_ptr->exp1 / 10L), 10, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "B", 10, 48); > } > } > else > { > prt_lnum("Experience ", (p_ptr->exp1 * 100L) > + (p_ptr->exp2 / 1000000L), 10, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "M", 10, 48); > } > } > else > prt_lnum("Experience ", p_ptr->exp2, 10, 28, TERM_L_GREEN); 1463c1487,1511 < prt_lnum("Experience ", p_ptr->exp, 10, 28, TERM_YELLOW); --- > if (p_ptr->exp1 > 0) > { > if (p_ptr->exp1 > 1000) > { > if (p_ptr->exp1 > 1000000000) > { > prt_lnum("Experience ", > (p_ptr->exp1 / 10000L), 10, 28, TERM_YELLOW); > c_put_str(TERM_L_GREEN, "T", 10, 48); > } else > { > prt_lnum("Experience ", > (p_ptr->exp1 / 10L), 10, 28, TERM_YELLOW); > c_put_str(TERM_L_GREEN, "B", 10, 48); > } > } > else > { > prt_lnum("Experience ", (p_ptr->exp1 * 100L) > + (p_ptr->exp2 / 1000000L), 10, 28, TERM_YELLOW); > c_put_str(TERM_L_GREEN, "M", 10, 48); > } > } > else > prt_lnum("Experience ", p_ptr->exp2, 10, 28, TERM_YELLOW); 1466c1514,1543 < prt_lnum("Max Exp ", p_ptr->max_exp, 11, 28, TERM_L_GREEN); --- > > if (p_ptr->max_exp1 > 0) > { > if (p_ptr->max_exp1 > 1000) > { > if (p_ptr->max_exp1 > 1000000000) > { > prt_lnum("Max Exp ", > (p_ptr->max_exp1 / 10000L), 11, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "T", 11, 48); > } else > { > prt_lnum("Max Exp ", > (p_ptr->max_exp1 / 10L), 11, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "B", 11, 48); > } > } > else > { > prt_lnum("Max Exp ", (p_ptr->max_exp1 * 100L) > + (p_ptr->max_exp2 / 1000000L), 11, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "M", 11, 48); > } > } > else > prt_lnum("Max Exp ", p_ptr->max_exp2, 11, 28, TERM_L_GREEN); > > > > 1475,1477c1552,1581 < prt_lnum("Exp to Adv.", < (s32b)(player_exp[p_ptr->lev - 1] * p_ptr->expfact / 100L), < 12, 28, TERM_L_GREEN); --- > if (player_exp1[p_ptr->lev - 1] > 0) > { > if (player_exp1[p_ptr->lev - 1] > 1000) > { > if (player_exp1[p_ptr->lev - 1] > 1000000000) > { > prt_lnum("Exp to Adv.", player_exp1[p_ptr->lev - 1] > / 10000L, 12, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "T", 12, 48); > } else > { > prt_lnum("Exp to Adv.", player_exp1[p_ptr->lev - 1] > / 10L, 12, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "B", 12, 48); > } > } > else > { > prt_lnum("Exp to Adv.", > player_exp2[p_ptr->lev - 1] / 1000000L + player_exp1[p_ptr->lev - 1] > * 100L, 12, 28, TERM_L_GREEN); > c_put_str(TERM_L_GREEN, "M", 12, 48); > } > } > else > { > prt_lnum("Exp to Adv.", > player_exp2[p_ptr->lev - 1] + player_exp1[p_ptr->lev - 1] > * 100000000L, 12, 28, TERM_L_GREEN); > } 1479a1584 > 4936c5041 < temp += p_ptr->max_exp / 5; --- > temp += (p_ptr->max_exp1 * 200000000L) + p_ptr->max_exp2 / 5; 5132c5237 < (void)sprintf(tmp, "Exp: %ld", (long)p_ptr->exp); --- > (void)sprintf(tmp, "Exp: %ld", (long)p_ptr->exp1 * 1000000000L + p_ptr->exp2); 6188c6293,6295 < p_ptr->exp = p_ptr->max_exp; --- > p_ptr->exp1 = p_ptr->max_exp1; > p_ptr->exp2 = p_ptr->max_exp2; > 6902c7009,7010 < --- > flush(); > get_check("Exit"); 6904c7012 < quit(format("software bug %d %d", p_ptr->px, p_ptr->py)); --- > quit(format("software bug %d %d %d", p_ptr->px, p_ptr->py, sig)); diff -r tome-223-org/src/loadsave.c tome-223-src/src/loadsave.c 480,481c480,483 < do_u32b(&p_ptr->max_exp, flag); < do_u32b(&p_ptr->exp, flag); --- > do_u32b(&p_ptr->max_exp1, flag); > do_u32b(&p_ptr->max_exp2, flag); > do_u32b(&p_ptr->exp1, flag); > do_u32b(&p_ptr->exp2, flag); diff -r tome-223-org/src/main-ami.c tome-223-src/src/main-ami.c 1969c1969 < sprintf( tmp, "Exp: %ld", (long)p_ptr->exp ); --- > sprintf( tmp, "Exp: %ld", (long)(p_ptr->exp1* 100000000L + p_ptr->exp2) ); diff -r tome-223-org/src/melee1.c tome-223-src/src/melee1.c 959c959 < s32b d = damroll(10, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > s32b d = damroll(10, 6) + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 989c989 < s32b d = damroll(20, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > s32b d = damroll(20, 6) + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 1019c1019 < s32b d = damroll(40, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > s32b d = damroll(40, 6) + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 1049c1049 < s32b d = damroll(80, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > s32b d = damroll(80, 6) + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 1125c1125 < lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE); --- > lose_exp(100 + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE); 2592c2592 < s32b d = damroll(10, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > s32b d = damroll(10, 6) + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 2621c2621 < s32b d = damroll(20, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > s32b d = damroll(20, 6) + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 2650c2650 < s32b d = damroll(40, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > s32b d = damroll(40, 6) + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 2679c2679 < s32b d = damroll(80, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE; --- > s32b d = damroll(80, 6) + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE; 2749c2749 < lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE); --- > lose_exp(100 + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE); diff -r tome-223-org/src/object2.c tome-223-src/src/object2.c 2010c2010 < o_ptr->exp = player_exp[o_ptr->elevel - 1]; --- > o_ptr->exp = player_exp2[o_ptr->elevel - 1] + player_exp1[o_ptr->elevel - 1] * 100000000; 2335c2335 < o_ptr->exp = player_exp[o_ptr->elevel - 1]; --- > o_ptr->exp = player_exp2[o_ptr->elevel - 1] + player_exp1[o_ptr->elevel - 1] * 100000000; 2413c2413 < o_ptr->exp = player_exp[o_ptr->elevel - 1]; --- > o_ptr->exp = player_exp2[o_ptr->elevel - 1] + player_exp1[o_ptr->elevel - 1] * 100000000; 4167c4167 < o_ptr->exp = player_exp[o_ptr->elevel - 1]; --- > o_ptr->exp = player_exp2[o_ptr->elevel - 1] + player_exp1[o_ptr->elevel - 1] * 100000000; 4359c4359 < o_ptr->exp = player_exp[o_ptr->elevel - 1]; --- > o_ptr->exp = player_exp2[o_ptr->elevel - 1] + player_exp1[o_ptr->elevel - 1] * 100000000; diff -r tome-223-org/src/player.pkg tome-223-src/src/player.pkg 48c48 < /** @var player_exp[PY_MAX_LEVEL] --- > /** @var player_exp1[PY_MAX_LEVEL] 52c52,58 < extern s32b player_exp[PY_MAX_LEVEL]; --- > extern s32b player_exp1[PY_MAX_LEVEL]; > > /** @var player_exp2[PY_MAX_LEVEL] > * @brief Number > * @note Array of experience points per level. > */ > extern s32b player_exp2[PY_MAX_LEVEL]; 109c115 < #define PR1_EXPERIMENTAL 0x00000001L --- > #define PR1_EXPERIMENTAL 0x00000001L 311c317 < * @note Display Experience --- > * @note Display Experience 313c319 < #define PR_EXP 0x00000008L --- > #define PR_EXP 0x00000008L 595c601 < * @note Experience factor --- > * @note Experience factor 633c639,649 < /** @structvar max_exp --- > /** @structvar max_exp1 > * @brief Number > * @note Max experience 1 > */ > s32b max_exp1; > /** @structvar max_exp2 > * @brief Number > * @note Max experience 2 > */ > s32b max_exp2; > /** @structvar exp1 635c651 < * @note Max experience --- > * @note Cur experience 1 637,638c653,654 < s32b max_exp; < /** @structvar exp --- > s32b exp1; > /** @structvar exp2 640c656 < * @note Cur experience --- > * @note Cur experience 2 642c658 < s32b exp; --- > s32b exp2; 645c661 < * @note Cur exp frac (times 2^16) --- > * @note Cur exp frac (times 2^16) 1482c1498 < * @note Experience draining --- > * @note Experience draining diff -r tome-223-org/src/spells1.c tome-223-src/src/spells1.c 7503c7503 < lose_exp(200 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE); --- > lose_exp(200 + (p_ptr->exp2 / 1000) * MON_DRAIN_LIFE); 7508c7508 < lose_exp(200 + (p_ptr->exp / 100) * MON_DRAIN_LIFE); --- > lose_exp(200 + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE); 7567c7567 < lose_exp(500 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE); --- > lose_exp(500 + (p_ptr->exp2 / 1000) * MON_DRAIN_LIFE); 7572c7572 < lose_exp(5000 + (p_ptr->exp / 100) * MON_DRAIN_LIFE); --- > lose_exp(5000 + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE); 7882c7882 < lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE); --- > lose_exp(100 + (p_ptr->exp2 / 100) * MON_DRAIN_LIFE); diff -r tome-223-org/src/spells2.c tome-223-src/src/spells2.c 536c536 < if (p_ptr->exp < p_ptr->max_exp) --- > if ((p_ptr->exp1 < p_ptr->max_exp1) || (p_ptr->exp2 < p_ptr->max_exp2)) 542c542,543 < p_ptr->exp = p_ptr->max_exp; --- > p_ptr->exp1 = p_ptr->max_exp1; > p_ptr->exp2 = p_ptr->max_exp2; 7123c7124 < lose_exp(p_ptr->exp / 16); --- > lose_exp(p_ptr->exp2 / 16); 7208c7209 < lose_exp(p_ptr->exp / 12); --- > lose_exp(p_ptr->exp2 / 12); diff -r tome-223-org/src/tables.c tome-223-src/src/tables.c 1162c1162,1163 < * Base experience levels, may be adjusted up for race and/or class --- > * Base experience levels, may be adjusted up or down for race and/or class. > * To get exp, use player_exp1[level] * 100000000 + player_exp2[level] 1164c1165 < s32b player_exp[PY_MAX_LEVEL] = --- > s32b player_exp2[PY_MAX_LEVEL] = 1166,1215c1167,1215 < 10, < 25, < 45, < 70, < 100, < 140, < 200, < 280, < 380, < 500, < 650, < 850, < 1100, < 1400, < 1800, < 2300, < 2900, < 3600, < 4400, < 5400, < 6800, < 8400, < 10200, < 12500, < 17500, < 25000, < 35000L, < 50000L, < 75000L, < 100000L, < 150000L, < 200000L, < 275000L, < 350000L, < 450000L, < 550000L, < 700000L, < 850000L, < 1000000L, < 1250000L, < 1500000L, < 1800000L, < 2100000L, < 2400000L, < 2700000L, < 3000000L, < 3500000L, < 4000000L, < 4500000L, < 5000000L --- > 10, 25, 45, 70, 100, > 140, 200, 280, 380, 500, > 650, 850, 1100, 1400, 1800, > 2300, 2900, 3600, 4400, 5400, > 6800, 8400, 10200, 12500, 17500, > > 25000L, 35000L, 50000L, 75000L, 100000L, > 150000L, 200000L, 275000L, 350000L, 450000L, > 550000L, 700000L, 850000L, 1000000L, 1250000L, > 1500000L, 1800000L, 2100000L, 2400000L, 2700000L, > 3000000L, 3500000L, 4000000L, 4500000L, 5000000L, > > 6000000L, 7000000L, 8000000L, 9000000L, 10000000L, > 12000000L, 14000000L, 16000000L, 18000000L, 20000000L, > 24000000L, 28000000L, 32000000L, 36000000L, 40000000L, > 48000000L, 56000000L, 64000000L, 72000000L, 80000000L, > 90000000L, 0L, 10000000L, 20000000L, 30000000L, > > 50000000L, 70000000L, 90000000L, 10000000L, 30000000L, > 60000000L, 90000000L, 20000000L, 50000000L, 80000000L, > 20000000L, 60000000L, 0L, 40000000L, 80000000L, > 40000000L, 0L, 60000000L, 20000000L, 80000000L, > 40000000L, 0L, 0L, 0L, 0L > }; > s32b player_exp1[PY_MAX_LEVEL] = > { > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, > 0, 1, 1, 1, 1, > > 1, 1, 1, 2, 2, > 2, 2, 3, 3, 3, > 4, 4, 5, 5, 5, > 6, 7, 7, 8, 8, > 9, 10, 11, 12, 13 1218d1217 < diff -r tome-223-org/src/traps.c tome-223-src/src/traps.c 667c667 < lose_exp(p_ptr->exp / 4); --- > lose_exp(p_ptr->exp2 / 4); diff -r tome-223-org/src/types.h tome-223-src/src/types.h 1490,1492c1490,1497 < s32b max_exp; /* Max experience */ < s32b exp; /* Cur experience */ < u16b exp_frac; /* Cur exp frac (times 2^16) */ --- > /* Think of exp1 and exp2 as two halves of a s64b. exp2 > * holds the smaller part, and exp1 the larger. */ > s32b max_exp1; /* Max experience 1*/ > s32b max_exp2; /* Max experience 2*/ > > s32b exp1; /* Cur experience 1*/ > s32b exp2; /* Cur experience 2*/ > u16b exp_frac; /* Cur exp frac (times 2^16) */ diff -r tome-223-org/src/w_dun.c tome-223-src/src/w_dun.c 3c3 < ** Generated automatically by tolua 4.0a - angband on Mon Sep 15 21:49:15 2003. --- > ** Generated automatically by tolua 4.0a - angband on Tue Oct 7 00:25:39 2003. diff -r tome-223-org/src/w_player.c tome-223-src/src/w_player.c 3c3 < ** Generated automatically by tolua 4.0a - angband on Mon Jul 14 20:42:59 2003. --- > ** Generated automatically by tolua 4.0a - angband on Sat Oct 4 10:42:52 2003. 39c39 < tolua_pushnumber(tolua_S,(long)player_exp[toluaI_index]); --- > tolua_pushnumber(tolua_S,(long)player_exp2[toluaI_index] + player_exp1[toluaI_index] * 100000000); 52c52 < player_exp[toluaI_index] = ((s32b) tolua_getnumber(tolua_S,3,0)); --- > player_exp2[toluaI_index] = ((s32b) tolua_getnumber(tolua_S,3,0)); 536,537c536,537 < /* get function: max_exp of class player_type */ < static int toluaI_get_player_player_type_max_exp(lua_State* tolua_S) --- > /* get function: max_exp1 of class player_type */ > static int toluaI_get_player_player_type_max_exp1(lua_State* tolua_S) 541c541 < tolua_pushnumber(tolua_S,(long)self->max_exp); --- > tolua_pushnumber(tolua_S,(long)self->max_exp1); 545,546c545,546 < /* set function: max_exp of class player_type */ < static int toluaI_set_player_player_type_max_exp(lua_State* tolua_S) --- > /* set function: max_exp1 of class player_type */ > static int toluaI_set_player_player_type_max_exp1(lua_State* tolua_S) 552c552 < self->max_exp = ((s32b) tolua_getnumber(tolua_S,2,0)); --- > self->max_exp1 = ((s32b) tolua_getnumber(tolua_S,2,0)); 556,557c556,557 < /* get function: exp of class player_type */ < static int toluaI_get_player_player_type_exp(lua_State* tolua_S) --- > /* get function: max_exp2 of class player_type */ > static int toluaI_get_player_player_type_max_exp2(lua_State* tolua_S) 561c561 < tolua_pushnumber(tolua_S,(long)self->exp); --- > tolua_pushnumber(tolua_S,(long)self->max_exp2); 565,566c565,566 < /* set function: exp of class player_type */ < static int toluaI_set_player_player_type_exp(lua_State* tolua_S) --- > /* set function: max_exp2 of class player_type */ > static int toluaI_set_player_player_type_max_exp2(lua_State* tolua_S) 572c572,612 < self->exp = ((s32b) tolua_getnumber(tolua_S,2,0)); --- > self->max_exp2 = ((s32b) tolua_getnumber(tolua_S,2,0)); > return 0; > } > > /* get function: exp1 of class player_type */ > static int toluaI_get_player_player_type_exp1(lua_State* tolua_S) > { > player_type* self = (player_type*) tolua_getusertype(tolua_S,1,0); > if (!self) TOLUA_ERR_SELF; > tolua_pushnumber(tolua_S,(long)self->exp1); > return 1; > } > > /* set function: exp1 of class player_type */ > static int toluaI_set_player_player_type_exp1(lua_State* tolua_S) > { > player_type* self = (player_type*) tolua_getusertype(tolua_S,1,0); > if (!self) TOLUA_ERR_SELF; > if (!tolua_istype(tolua_S,2,LUA_TNUMBER,0)) > TOLUA_ERR_ASSIGN; > self->exp1 = ((s32b) tolua_getnumber(tolua_S,2,0)); > return 0; > } > > /* get function: exp2 of class player_type */ > static int toluaI_get_player_player_type_exp2(lua_State* tolua_S) > { > player_type* self = (player_type*) tolua_getusertype(tolua_S,1,0); > if (!self) TOLUA_ERR_SELF; > tolua_pushnumber(tolua_S,(long)self->exp2); > return 1; > } > > /* set function: exp2 of class player_type */ > static int toluaI_set_player_player_type_exp2(lua_State* tolua_S) > { > player_type* self = (player_type*) tolua_getusertype(tolua_S,1,0); > if (!self) TOLUA_ERR_SELF; > if (!tolua_istype(tolua_S,2,LUA_TNUMBER,0)) > TOLUA_ERR_ASSIGN; > self->exp2 = ((s32b) tolua_getnumber(tolua_S,2,0)); 8755,8756c8795,8798 < tolua_tablevar(tolua_S,"player_type","max_exp",toluaI_get_player_player_type_max_exp,toluaI_set_player_player_type_max_exp); < tolua_tablevar(tolua_S,"player_type","exp",toluaI_get_player_player_type_exp,toluaI_set_player_player_type_exp); --- > tolua_tablevar(tolua_S,"player_type","max_exp1",toluaI_get_player_player_type_max_exp1,toluaI_set_player_player_type_max_exp1); > tolua_tablevar(tolua_S,"player_type","max_exp2",toluaI_get_player_player_type_max_exp2,toluaI_set_player_player_type_max_exp2); > tolua_tablevar(tolua_S,"player_type","exp1",toluaI_get_player_player_type_exp1,toluaI_set_player_player_type_exp1); > tolua_tablevar(tolua_S,"player_type","exp2",toluaI_get_player_player_type_exp2,toluaI_set_player_player_type_exp2); diff -r tome-223-org/src/wizard2.c tome-223-src/src/wizard2.c 353a354 > char tmp_val2[16]; 398c399 < sprintf(tmp_val, "%ld", (long)(p_ptr->max_exp)); --- > sprintf(tmp_val, "%ld", (long)(p_ptr->max_exp1 * 100000000L + p_ptr->max_exp2)); 401c402,417 < if (!get_string("Experience: ", tmp_val, 9)) return; --- > if (!get_string("Experience: ", tmp_val, 18)) return; > > /* get exp2. This grabs (up to) the last 8 digits of tmp_val, > erasing so that exp1 is grabbed properly */ > tmp_int = 0; > while (tmp_val[tmp_int]) tmp_int++; > if (tmp_int < 8) tmp_int = 8; > > i = tmp_int - 8; > tmp_val2[i - tmp_int + 8] = tmp_val[i]; > while(tmp_val[i] > '\0') > { > i++; > tmp_val[i - 1] = '\0'; > tmp_val2[i - tmp_int + 8] = tmp_val[i]; > } 404c420,441 < tmp_long = atol(tmp_val); --- > tmp_long = atol(tmp_val2); > > /* Verify */ > if (tmp_long < 0) tmp_long = 0L; > > /* Save */ > p_ptr->max_exp2 = tmp_long; > p_ptr->exp2 = p_ptr->max_exp2; > > > > /* get exp1 */ > i = 0; > tmp_val2[i] = tmp_val[i]; > while(tmp_val[i] > '\0') > { > i++; > tmp_val2[i] = tmp_val[i]; > } > > /* Extract */ > tmp_long = atol(tmp_val2); 410,411c447,449 < p_ptr->max_exp = tmp_long; < p_ptr->exp = tmp_long; --- > p_ptr->max_exp1 = tmp_long; > p_ptr->exp1 = p_ptr->max_exp1; > 1993c2031 < gain_exp(p_ptr->exp + 1); --- > gain_exp(p_ptr->exp2 + 1); diff -r tome-223-org/src/xtra1.c tome-223-src/src/xtra1.c 317c317,332 < (void)sprintf(out_val, "%8ld", (long)p_ptr->exp); --- > if ((p_ptr->exp1 > 0) || (p_ptr->exp2 > 100000000)) > { > if (p_ptr->exp1 > 10000) > { > if (p_ptr->exp1 > 10000000) > (void)sprintf(out_val, "%8ldT", (long)(p_ptr->exp1 / 1000)); > else > (void)sprintf(out_val, "%8ldB", (long)(p_ptr->exp1)); > } > else > (void)sprintf(out_val, "%8ldM", (long)((p_ptr->exp1 * 1000L) + (p_ptr->exp2 / 1000000L))); > } > else > { > (void)sprintf(out_val, "%8ld", (long)(p_ptr->exp2)); > } 327c342,343 < (void)sprintf(out_val, "%8ld", (long)(player_exp[p_ptr->lev - 1] * p_ptr->expfact / 100L) - p_ptr->exp); --- > (void)sprintf(out_val, "%8ld", (long)(player_exp2[p_ptr->lev - 1] - p_ptr->exp2 > + (player_exp1[p_ptr->lev - 1] - p_ptr->exp1) * 100000000L)); 331c347 < if (p_ptr->exp >= p_ptr->max_exp) --- > if ((p_ptr->exp1 >= p_ptr->max_exp1) && (p_ptr->exp2 >= p_ptr->max_exp2)) diff -r tome-223-org/src/xtra2.c tome-223-src/src/xtra2.c 3516,3517d3515 < bool level_reward = FALSE; < bool level_corruption = FALSE; 3524c3522,3523 < if (p_ptr->exp < 0) p_ptr->exp = 0; --- > if (p_ptr->exp1 < 0) p_ptr->exp1 = 0; > if (p_ptr->exp2 < 0) p_ptr->exp2 = 0; 3527c3526,3527 < if (p_ptr->max_exp < 0) p_ptr->max_exp = 0; --- > if (p_ptr->max_exp1 < 0) p_ptr->max_exp1 = 0; > if (p_ptr->max_exp2 < 0) p_ptr->max_exp2 = 0; 3530c3530,3534 < if (p_ptr->exp > PY_MAX_EXP) p_ptr->exp = PY_MAX_EXP; --- > if (p_ptr->exp1 > (PY_MAX_EXP - p_ptr->exp2) / 100000000L ) > { > p_ptr->exp1 = (PY_MAX_EXP - p_ptr->exp2) / 100000000L; > p_ptr->exp2 = PY_MAX_EXP - p_ptr->exp1 * 100000000L; > } 3533c3537,3541 < if (p_ptr->max_exp > PY_MAX_EXP) p_ptr->max_exp = PY_MAX_EXP; --- > if (p_ptr->max_exp1 > (PY_MAX_EXP - p_ptr->max_exp2) / 100000000L ) > { > p_ptr->max_exp1 = (PY_MAX_EXP - p_ptr->max_exp2) / 100000000L; > p_ptr->max_exp2 = PY_MAX_EXP - p_ptr->max_exp1 * 100000000L; > } 3536c3544,3548 < if (p_ptr->exp > p_ptr->max_exp) p_ptr->max_exp = p_ptr->exp; --- > if ((p_ptr->exp1 - p_ptr->max_exp1) * 100000000L > p_ptr->max_exp2 - p_ptr->exp2) > { > p_ptr->max_exp1 = p_ptr->exp1; > p_ptr->max_exp2 = p_ptr->exp2; > } 3544,3547c3556,3557 < < /* Lose levels while possible */ < while ((p_ptr->lev > 1) && < (p_ptr->exp < (player_exp[p_ptr->lev - 2] * p_ptr->expfact / 100L))) --- > /* move high experience from exp2 to exp1 */ > while (p_ptr->exp2 > 99999999L) 3549,3555c3559,3566 < /* Lose a level */ < p_ptr->lev--; < gained--; < lite_spot(p_ptr->py, p_ptr->px); < < /* Update some stuff */ < p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_SANITY); --- > p_ptr->exp1++; > p_ptr->exp2 -= 100000000L; > } > while (p_ptr->max_exp2 > 99999999L) > { > p_ptr->max_exp1++; > p_ptr->max_exp2 -= 100000000L; > } 3557,3558c3568,3586 < /* Redraw some stuff */ < p_ptr->redraw |= (PR_LEV | PR_TITLE | PR_EXP); --- > /* move low experience from exp1 to exp2 */ > while (p_ptr->exp2 < 0L) > { > if (p_ptr->max_exp1 > 0L) > { > p_ptr->exp1--; > p_ptr->exp2 += 100000000L; > } > else p_ptr->exp2 = 0; > } > while (p_ptr->max_exp2 < 0L) > { > if (p_ptr->max_exp1 > 0L) > { > p_ptr->max_exp1--; > p_ptr->max_exp2 += 100000000L; > } > else p_ptr->max_exp2 = 0; > } 3560,3561d3587 < /* Window stuff */ < p_ptr->window |= (PW_PLAYER); 3563,3564c3589,3598 < /* Handle stuff */ < handle_stuff(); --- > /* Lose levels while possible */ > while (p_ptr->lev > 1) > { > if (p_ptr->exp1 > player_exp1[p_ptr->lev - 2]) break; > else if (p_ptr->exp1 == player_exp1[p_ptr->lev - 2]) > { > if (p_ptr->exp2 > player_exp2[p_ptr->lev - 2]) break; > else gained = lose_experience_funct(gained); > } > else gained = lose_experience_funct(gained); 3569,3570c3603 < while ((p_ptr->lev < PY_MAX_LEVEL) && (p_ptr->lev < max_plev) && < (p_ptr->exp >= (player_exp[p_ptr->lev - 1] * p_ptr->expfact / 100L))) --- > while ((p_ptr->lev < PY_MAX_LEVEL) && (p_ptr->lev < max_plev)) 3572,3578c3605,3606 < /* Gain a level */ < p_ptr->lev++; < gained++; < lite_spot(p_ptr->py, p_ptr->px); < < /* Save the highest level */ < if (p_ptr->lev > p_ptr->max_plv) --- > if (p_ptr->exp1 < player_exp1[p_ptr->lev - 1]) break; > else if (p_ptr->exp1 == player_exp1[p_ptr->lev - 1]) 3580,3585c3608,3609 < p_ptr->max_plv = p_ptr->lev; < if ((PRACE_FLAG(PR1_CORRUPT)) && < (randint(3) == 1)) < { < level_corruption = TRUE; < } --- > if (p_ptr->exp2 < player_exp2[p_ptr->lev - 1]) break; > else gained = gain_experience_funct(gained); 3586a3611,3612 > else gained = gain_experience_funct(gained); > } 3588,3592c3614,3616 < /* Sound */ < sound(SOUND_LEVEL); < < /* Message */ < cmsg_format(TERM_L_GREEN, "Welcome to level %d.", p_ptr->lev); --- > /* Hook it! */ > process_hooks(HOOK_PLAYER_LEVEL, "(d)", gained); > } 3594,3597c3618,3623 < if (p_ptr->skill_last_level < p_ptr->lev) < { < s32b pts; < call_lua("exec_module_info", "(s)", "d", "skill_per_level", &pts); --- > /* Lose a level, called from check_experience() */ > int lose_experience_funct(int gained) > { > p_ptr->lev--; > gained--; > lite_spot(p_ptr->py, p_ptr->px); 3599,3603c3625,3626 < p_ptr->skill_last_level = p_ptr->lev; < p_ptr->skill_points += pts; < cmsg_format(TERM_L_GREEN, "You can increase %d more skills.", p_ptr->skill_points); < p_ptr->redraw |= PR_STUDY; < } --- > /* Update some stuff */ > p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_SANITY); 3605,3606c3628,3629 < /* Gain this level's abilities */ < apply_level_abilities(p_ptr->lev); --- > /* Redraw some stuff */ > p_ptr->redraw |= (PR_LEV | PR_TITLE | PR_EXP); 3608,3614c3631,3632 < /* If auto-note taking enabled, write a note to the file. < * Only write this note when the level is gained for the first < * time. < */ < if (take_notes && auto_notes) < { < char note[80]; --- > /* Window stuff */ > p_ptr->window |= (PW_PLAYER); 3616,3619c3634,3637 < /* Write note */ < sprintf(note, "Reached level %d", p_ptr->lev); < add_note(note, 'L'); < } --- > /* Handle stuff */ > handle_stuff(); > return gained; > } 3621,3622d3638 < /* Update some stuff */ < p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_SANITY); 3624,3625c3640,3644 < /* Redraw some stuff */ < p_ptr->redraw |= (PR_LEV | PR_TITLE | PR_EXP); --- > /* gain a level, called from check_experience() */ > int gain_experience_funct(int gained) > { > bool level_reward = FALSE; > bool level_corruption = FALSE; 3627,3628d3645 < /* Window stuff */ < p_ptr->window |= (PW_PLAYER); 3630,3631c3647,3650 < /* Handle stuff */ < handle_stuff(); --- > /* Gain a level */ > p_ptr->lev++; > gained++; > lite_spot(p_ptr->py, p_ptr->px); 3633c3652,3657 < if (level_reward) --- > /* Save the highest level */ > if (p_ptr->lev > p_ptr->max_plv) > { > p_ptr->max_plv = p_ptr->lev; > if ((PRACE_FLAG(PR1_CORRUPT)) && > (randint(3) == 1)) 3635,3636c3659 < gain_level_reward(0); < level_reward = FALSE; --- > level_corruption = TRUE; 3637a3661 > } 3639,3644c3663,3677 < if (level_corruption) < { < msg_print("You feel different..."); < corrupt_corrupted(); < level_corruption = FALSE; < } --- > /* Sound */ > sound(SOUND_LEVEL); > > /* Message */ > cmsg_format(TERM_L_GREEN, "Welcome to level %d.", p_ptr->lev); > > if (p_ptr->skill_last_level < p_ptr->lev) > { > s32b pts; > call_lua("exec_module_info", "(s)", "d", "skill_per_level", &pts); > > p_ptr->skill_last_level = p_ptr->lev; > p_ptr->skill_points += pts; > cmsg_format(TERM_L_GREEN, "You can increase %d more skills.", p_ptr->skill_points); > p_ptr->redraw |= PR_STUDY; 3647,3648c3680,3720 < /* Hook it! */ < process_hooks(HOOK_PLAYER_LEVEL, "(d)", gained); --- > /* Gain this level's abilities */ > apply_level_abilities(p_ptr->lev); > > /* If auto-note taking enabled, write a note to the file. > * Only write this note when the level is gained for the first > * time. > */ > if (take_notes && auto_notes) > { > char note[80]; > > /* Write note */ > sprintf(note, "Reached level %d", p_ptr->lev); > add_note(note, 'L'); > } > > /* Update some stuff */ > p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_SANITY); > > /* Redraw some stuff */ > p_ptr->redraw |= (PR_LEV | PR_TITLE | PR_EXP); > > /* Window stuff */ > p_ptr->window |= (PW_PLAYER); > > /* Handle stuff */ > handle_stuff(); > > if (level_reward) > { > gain_level_reward(0); > level_reward = FALSE; > } > > if (level_corruption) > { > msg_print("You feel different..."); > corrupt_corrupted(); > level_corruption = FALSE; > } > return gained; 3649a3722,3733 > > > > > > > > > > > > 3664c3748 < if (o_ptr->exp > PY_MAX_EXP) o_ptr->exp = PY_MAX_EXP; --- > if (o_ptr->exp > (PY_MAX_EXP / 100000000L) ) o_ptr->exp = (PY_MAX_EXP / 100000000L); 3668c3752,3753 < (o_ptr->exp >= (player_exp[o_ptr->elevel - 1] * 5 / 2))) --- > (o_ptr->exp >= ((player_exp1[o_ptr->elevel - 1] *100000000L + > player_exp2[o_ptr->elevel - 1]) * 5 / 2))) 3720c3805 < if (o_ptr->exp > PY_MAX_EXP) o_ptr->exp = PY_MAX_EXP; --- > if (o_ptr->exp > (PY_MAX_EXP / 100000000L)) o_ptr->exp = (PY_MAX_EXP / 100000000L); 3724c3809 < if ((p_ptr->max_exp > 0) && (PRACE_FLAG(PR1_CORRUPT))) --- > if ((p_ptr->max_exp2 > 0) && (PRACE_FLAG(PR1_CORRUPT))) 3726c3811 < if ((randint(p_ptr->max_exp) < amount) || (randint(12000000) < amount)) --- > if ((randint(p_ptr->exp1 * 100000000L + p_ptr->exp2) < amount) || (randint(12000000) < amount)) 3735c3820 < p_ptr->exp += amount / num; --- > p_ptr->exp2 += amount / num; 3741c3826 < if (p_ptr->exp < p_ptr->max_exp) --- > if ((p_ptr->exp1 - p_ptr->max_exp1) * 100000000L < p_ptr->max_exp2 - p_ptr->exp2) 3744c3829 < p_ptr->max_exp += amount / 5; --- > p_ptr->max_exp2 += amount / 5; 3758c3843 < if (amount > p_ptr->exp) amount = p_ptr->exp; --- > if (amount > p_ptr->exp2) amount = p_ptr->exp2; 3761c3846 < p_ptr->exp -= amount; --- > p_ptr->exp2 -= amount; 6817c6902 < if (p_ptr->exp < PY_MAX_EXP) --- > if (p_ptr->exp1 < (PY_MAX_EXP - p_ptr->exp2) / 100000000L) 6819,6820c6904,6905 < s32b ee = (p_ptr->exp / 2) + 10; < if (ee > 100000L) ee = 100000L; --- > s32b ee = (p_ptr->exp2 / 2) + 10; > if ((ee > 100000L) || (p_ptr->exp1 > 0)) ee = 100000L; 6830c6915 < lose_exp(p_ptr->exp / 6); --- > lose_exp(p_ptr->exp2 / 6);