Grimmys / rpg_tactical_fantasy_game

A tactical turn-based game project in pygame, open to support
GNU General Public License v3.0
392 stars 85 forks source link

Shop Balance Feature Implemented #84

Closed Sonny-Cao closed 4 months ago

Sonny-Cao commented 4 months ago

text - New function to display shopkeeper balance, modified STR_THIS_ITEM_CANT_BE_SOLD to better fit context shop - Added new variable shop_balance; initialized to 500 for testing, buy and sell functions adjusted to update vendor amount menu_creator_manager - create_shop_menu updated to show vendor gold in UI load xml, load tmx, level_scene - added shop_balance parameter to constructors

Additional Notes: Shop balance does not show on sell interface. Shop balance value is not updated when saved, may be due to the fact that they were set to 500 in the constructor. The load xml, load tmx, and level_scene files need to be reviewed for confirmation. The basic functionality is there, but tweaks still need to be made.

Excuse the previous PR, there was an uninitialized variable within level_scene that prevented main new game button the function, it is now fixed.

Grimmys commented 4 months ago

Great PR overall, only a few details should be addressed 👍

Suggestion for later improvement: speech from shopkeeper in case of item that cannot be sold should differ depending on the reason of the failure ; it's incoherent for the shopkeeper to yell at the player that item cannot be sold because of insufficient funds while the real reason might be that the item is a key item that the player should not abandon. But don't worry, it doesn't have to be handle in the scope of this PR.

Grimmys commented 4 months ago

Huh huh, looks like a test is failing. @Sonny-Cao could you try to fix it? It's just about providing a default value for the shop balance.

Test is tests.test_shop.TestShop.test_init_shop

Sonny-Cao commented 4 months ago

Yes, I will look into it when I get the chance.