Added global bank balance stat.

This commit is contained in:
Martin Haye 2020-12-31 11:09:53 -08:00
parent b718484d7d
commit 2fb2f3660f
4 changed files with 8 additions and 1 deletions

View File

@ -195,7 +195,8 @@ class A2PackPartitions
"Gold": "@S_GOLD",
"Time": "@S_TIME",
"XP": "@S_XP",
"SP": "@S_SP"
"SP": "@S_SP",
"Bank bal": "@S_BANK_BAL"
]
def predefStrings = stats + [

View File

@ -1 +1,2 @@
*.txt
scripts/

View File

@ -195,6 +195,7 @@ export byte[] S_USE = "Use"
export byte[] S_HIS = "his"
export byte[] S_HER = "her"
export byte[] S_THEIR = "their"
export byte[] S_BANK_BAL = "Bank bal"
word lastTick = 0
@ -3507,6 +3508,7 @@ export def getStat(player, statName)#1
is streqi(statName, @S_XP); return player=>w_curXP
is streqi(statName, @S_SP); return player->b_skillPoints
is streqi(statName, @S_PACK_SIZE); return player->b_packSize
is streqi(statName, @S_BANK_BAL); return global=>w_bankBal
wend
pSkill = scanForNamedObj(player=>p_skills, statName)
if pSkill; return pSkill=>w_modValue; fin
@ -3557,6 +3559,7 @@ export def setStat(player, statName, val)#0
is streqi(statName, @S_XP); addXP(player, val - player=>w_curXP); needShowParty = TRUE; break
is streqi(statName, @S_SP); player->b_skillPoints = clampByte(max(0, val)); needShowParty = TRUE; break
is streqi(statName, @S_PACK_SIZE); player->b_packSize = clampByte(max(player->b_packSize, val)); break
is streqi(statName, @S_BANK_BAL); global=>w_bankBal = val; break
otherwise
pSkill = scanForNamedObj(player=>p_skills, statName)
if pSkill

View File

@ -49,6 +49,8 @@ struc TGlobal
// move mode (1=normal, 2=fast, 4=classic)
byte b_moveMode
word w_bankBal
end
const PLAYER_FLAG_NPC = $01