Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define limited stock of money for shops #76

Open
Grimmys opened this issue Aug 17, 2023 · 4 comments
Open

Define limited stock of money for shops #76

Grimmys opened this issue Aug 17, 2023 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers text Relates to text visible in the application ui Relates to changes on the User Interface

Comments

@Grimmys
Copy link
Owner

Grimmys commented Aug 17, 2023

Currently, Shops have infinite amount of money: you can sell them whatever amount of items you want and still get money from it.

My idea would be to define a limited amount of money for Shops, same as what is already the case for the players.

The amount of money owned by the seller should be display in the "Sell" view (and maybe in the "Buy" view as well?).

Selling items to the seller would decrease the money left according to the sell value of the item, and buying items from the seller should increase the money left.
If the seller does not have enough money for buying the item, then something should be happening between:

  1. Forbid the sell (inform the player that seller cannot buy the item)
  2. Allow the sell but only give to the player what the seller had left (0 if the seller already had no money anymore), and maybe ask confirmation to the player that the sell would be "at loss"

I don't have any strong opinion about which behaviour is the best.

Concerned places should be shop.py, menu_creator_manager.py#create_shop_menu (if anything should be updated in the menu) and level_0/map.tmx, level_3/map.tmx (for giving the new "money" property to the shops defined in these levels).

N.B.: I don't know if this feature is a balanced one, I just think it may be funny to implement. Let see after experimenting if it's bringing some value or too boring

@Grimmys Grimmys added enhancement New feature or request good first issue Good for newcomers text Relates to text visible in the application ui Relates to changes on the User Interface labels Aug 17, 2023
@Sonny-Cao
Copy link
Contributor

Hello, I am new to open source and would like to implement the following feature if it is available!

@Grimmys
Copy link
Owner Author

Grimmys commented Jan 30, 2024

Hello @Sonny-Cao , sure, you can start working on it if you want!

Don't hesitate to ask me some questions (by e-mails, or by Discord) if you need help understanding something.

@Elemperor1
Copy link

Hello, I am interested in working on this, has it already been done?

@Grimmys
Copy link
Owner Author

Grimmys commented Feb 21, 2024

Hi @Elemperor1 , in fact someone else just started its implementation, I merged the change today: https://github.com/Grimmys/rpg_tactical_fantasy_game/pull/84/files

But there are still some things to be done :

  • Default balance of any shop is hard-coded to 500, obviously not ideal. The default balance should be read from the level configuration (while parsing the shops entities). For this, TMX maps have to be modified (using Tiled) and src/services/load_from_tmx_manager.py should be adapted to parse the information from the map.
  • Updated balance of the shop should be persisted in the save file. For this, save method in shop.py should be extended, and src/services/load_from_xml_manager.py as well to load the value from the save file.
  • Shop balance should be shown on sell interface as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers text Relates to text visible in the application ui Relates to changes on the User Interface
Projects
None yet
Development

No branches or pull requests

3 participants