Increase level cap to 11.

This commit is contained in:
Martin Haye 2021-09-09 10:26:48 -07:00
parent a5fce9a28e
commit 55dd3693a0
2 changed files with 8 additions and 8 deletions

View File

@ -3410,11 +3410,11 @@ def addXP(player, val)#0
if val < 0; return; fin
// Add the value plus an intelligence-based bonus
player=>w_curXP = player=>w_curXP + val + addPercent(val, 10 * player->b_intelligence)
// Enforce cap on number of points to stay well within limit of 15 bits
if player=>w_curXP < 0 or player=>w_curXP >= 30000 // goes neg if wrapped around
player=>w_curXP = 30000
// Enforce cap on number of points to stay within limit of 15 bits
if player=>w_curXP < 0 or player=>w_curXP >= 32760 // goes neg if wrapped around
player=>w_curXP = 32760
fin
while player=>w_curXP >= player=>w_nextXP and player=>w_curXP < 30000
while player=>w_curXP >= player=>w_nextXP and player=>w_curXP < 32761
// Level up!
player->b_level++
player->b_skillPoints = player->b_skillPoints + callGlobalFunc(GS_LEVEL_S_P, player->b_level, 0, 0)
@ -3424,10 +3424,10 @@ def addXP(player, val)#0
// Check XP for next level, and enforce level cap if any
n = callGlobalFunc(GS_LEVEL_X_P, player->b_level + 1, 0, 0)
if n > player=>w_nextXP and n <= 30000
if n > player=>w_nextXP
player=>w_nextXP = n
else
player=>w_nextXP = 30000 // level cap reached
player=>w_nextXP = 32767 // XP cap reached
break
fin
loop

View File

@ -142,7 +142,7 @@ def showDerived(player)#0
fin
rightJustifyNum(player=>w_curXP, STAT_X)
rawDisplayf2(fmt, STATLBL_X, "Current XP")
if player=>w_nextXP < 30000 // check for level cap
if player=>w_nextXP < 32767 // check for level cap
rightJustifyNum(player=>w_nextXP, STAT_X)
else
rightJustifyStr("-----", STAT_X)
@ -858,7 +858,7 @@ def doPlayerSheet(player_num)#1
break
is '+' // level up cheat
if global->b_godmode
adjustPartyStat(@S_XP, player=>w_nextXP - player=>w_curXP)
setStat(player, @S_XP, player=>w_nextXP)
redisplay = 2
fin
break