get stashed gold

This commit is contained in:
Héctor Giménez
2024-05-15 17:23:53 +09:00
parent ffae8296af
commit 2a5f31885e
7 changed files with 48 additions and 31 deletions

View File

@@ -31,7 +31,7 @@ type Data struct {
CollisionGrid [][]bool
PlayerUnit PlayerUnit
NPCs NPCs
Items Items
Inventory Inventory
Objects Objects
AdjacentLevels []Level
Rooms []Room
@@ -163,8 +163,8 @@ func (pu PlayerUnit) MaxGold() int {
return goldPerLevel * lvl.Value
}
// TotalGold returns the amount of gold, including inventory and stash
func (pu PlayerUnit) TotalGold() int {
// TotalPlayerGold returns the amount of gold, including inventory and player stash (excluding shared stash)
func (pu PlayerUnit) TotalPlayerGold() int {
gold, _ := pu.FindStat(stat.Gold, 0)
stashGold, _ := pu.FindStat(stat.StashGold, 0)