Closed NathanLovato closed 4 years ago
@Razoric480 could you take a look and tell me if the code makes sense to you? I recommend checking the two commits separately, the second one is dedicated to the UI code changes.
For the upgrades, I'm not sure where to put the code. I think this makes the most sense:
Connect the signal when the player picks an upgrade to PlayerShip and Cargo, and update stats from there, e.g. stats.add_modifier("max_health", 15)
would upgrade the health by 15 points.
With the way the stats and ui work, the UI will auto-update.
I've not dug into it at a personal depth, but looking over the architecture in the review section and over both commits, it's looking pretty sane to me.
And yeah, keeping cargo upgrading in cargo and player upgrading in player makes sense; especially since they're the ones that have access to their stats
variable to begin with.
This PR is meant to close #24. It was longer than I expected as to make this flexible, we needed a solution to store arbitrary stats and apply upgrades to them. This is done with 9cc1bbe1e1eb23fe0206dd4d063d424849594e7e
This PR integrates Stats into the game. It:
Left to do
Refactor and restore upgrades.