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

Shop event #119

Open
Turtyo opened this issue Aug 4, 2024 · 19 comments · May be fixed by #137
Open

Shop event #119

Turtyo opened this issue Aug 4, 2024 · 19 comments · May be fixed by #137
Assignees
Labels
3-Priority: high confirmed Has been approved to make code based on this new feature Ask for a new feature
Milestone

Comments

@Turtyo
Copy link
Collaborator

Turtyo commented Aug 4, 2024

Feature Description

The shop is a place used to buy new cards, torches, items and consumables. You can also remove cards from your deck in the shop.

Motivation

Player get card rewards with fights and items with mini-boss / boss. All fights also yield gold, and the shop is a way to spend it to be able to customize your build / deck more.

Concept art / Designs

The items should be organized on a cat tree (since the shopkeeper is a cat)
image

The card removal should be a box of dirt (the shopkeeper buries the card). Buying a card makes the shopkeeper sweep the card from the tree with its paw.

Those last two points are more on the animation side and should probably not be implemented yet.

Acceptance Criteria

  • The shop allows to buy cards, torches, items and consumables, which are added to the player inventory / deck
  • You can remove a card with the shop
  • You can only remove a card once per shop
  • Removing a card increases the cost of the next card removal from the shop (by a fixed amount, like 25 or 50)

Proposed Solution

Adding torches, items and consumable is already managed by the Inventory, so it should just be a question of linking the visual interface to the inventory.

For adding cards and removing cards, we don't have a proper system yet I think. Need to see how we add or remove cards. We have the current deck as an array of cards I think ? it's a copy of a default deck, so we need to modify this (not the original deck).

Each card, item, consumable should be done with a texture button, as it's probably the easiest way to interact with it.

Additional Context

The interface should have card/items/removal in number 3/2/1 or 3/3/1, probably making the top row 3 cards, then below 2 or 3 items.
The item removal can be at the bottom right; the consumables can be on the last row at the bottom, 3 consumables should be good.
Keep it a bit modular so if we want to change it to have more or less item / cards later we don't need to redo everything.

This probably means that the interface should be a UI control and we spawn buttons in the UI control depending on the number we want. The image for the cat tree will be done later when we decide on the game balance and how many of each we want.

@Turtyo Turtyo added new feature Ask for a new feature 3-Priority: high labels Aug 4, 2024
@Turtyo Turtyo added this to the Alpha 1.1 milestone Aug 30, 2024
@JonaLam
Copy link
Collaborator

JonaLam commented Sep 20, 2024

I don't think we have a proper system for a in game deck yet, the system you mentioned under Proposed Solution I think uses Resources which I don't think is a good solution for decks that change over the course of the game. So unless there is a deck system I'm not aware of I think it would be better to wait with this pr and maybe make a new pr regarding decks and building of the deck

@Turtyo
Copy link
Collaborator Author

Turtyo commented Sep 21, 2024

The default deck is a resource, and it only contains an array of cards. When starting the game, the array of card is copied into the current deck, it's an array.
Adding and removing cards then just comes to adding and removing things from an array. I think we have the tools for this PR already

@JonaLam
Copy link
Collaborator

JonaLam commented Sep 23, 2024

Is the current deck an array in the playermanager? in that case it's probably fine, is there anything else to discuss here?

@Turtyo
Copy link
Collaborator Author

Turtyo commented Sep 26, 2024

It's an array of card in the CardManager: var current_deck: Array[CardBase] = []

For other things to discuss, adding and removing cards from the deck. I'm guessing a simple push_front() to add and erase() to delete would work (removes the first occurrence so we don't delete multiple values)

@JonaLam
Copy link
Collaborator

JonaLam commented Sep 29, 2024

Should probably have some simple helper functions in CardManager like Add_card, and remove_card, but other than that it seems fine

@Turtyo
Copy link
Collaborator Author

Turtyo commented Sep 29, 2024

Yes, helpers to remove torches already exist, but I don't think we have helpers for the inventory apart from that 🤔
So adding those would probably be part of the issue here too

@JonaLam
Copy link
Collaborator

JonaLam commented Sep 30, 2024

Regarding, the price increasing for card removal, do we have a good place to track that. I assume most shop scripts wil be instanced when you come to the shop scene, so I don't think we can track them in any of those scripts unless we use static variables, but I don't think that's a good idea cause it might be a bit bug prone. Probably just somewhere in the player or card manager would be good

@Turtyo
Copy link
Collaborator Author

Turtyo commented Oct 4, 2024

We can even create a new ShopManager, though it would only be used to track the price increase of card removal;
But it would be clear where to go search for that, and it could be used for other stuff next

@JonaLam
Copy link
Collaborator

JonaLam commented Oct 8, 2024

Ye, that seems like a good idea. We also need a good way to chose which card is removed, should we just do a system simmilar to slay the spire, we already have a way to display the deck, so we should be able to use that to chose a card to remove

@Turtyo
Copy link
Collaborator Author

Turtyo commented Oct 8, 2024

I'm wondering if we could re-use the card display but the cards are buttons and you can change the action depending on where you come click to view the deck.
So if you are just viewing it, button does nothing. If you arrived on this screen by clicking on card removal, then the button is active and can be used to remove the card you click on. Probably a good idea to make a little screen display to ask for confirmation also.

@JonaLam
Copy link
Collaborator

JonaLam commented Oct 8, 2024

Yeah, that was the solution I was thinking, I'm not sure if they already are buttons or if we need to change them, and if we do need to change them, should be do it in this issue or should we make a new one, since this is kind of unrelated to the main issue

@Turtyo
Copy link
Collaborator Author

Turtyo commented Oct 8, 2024

I would consider card removal as part of the shop, so it would make sense to do it now

@JonaLam
Copy link
Collaborator

JonaLam commented Oct 8, 2024

For how the player buys items, I propose we make a Shop_Item script which has a price value and when it is clicked on by the player, and the player can afford it, the Shop_Item script sends a signal which another class uses to play animations/ give players items. The reason I want shop_item in it's own script is so that we can easly add diffrent kind of items to buy, as well as reuse the code. What do you think of this solution?

@Turtyo
Copy link
Collaborator Author

Turtyo commented Oct 14, 2024

That seems like a good idea. Initalized as a child of the shop scene ?

@Turtyo
Copy link
Collaborator Author

Turtyo commented Oct 14, 2024

For the positions of the items in the shop, I would say we define a few sets of positions depending on the number of items / cards / consumables ?

Like a 3/4/3 or a 2/4/2 for example ? Or even if we don't define several, at least a system that allows adding new sets of positions in the future ?

@JonaLam
Copy link
Collaborator

JonaLam commented Oct 14, 2024

Yeah, what I was thinking was just having arrays for shop_items for each item type, like a item_shop_item array, a card_shop_items, and consumable_shop_item. Then I'd just connect them in the scene where we could position them how we want.

@Turtyo
Copy link
Collaborator Author

Turtyo commented Oct 16, 2024

What i was saying was that we have some predefined positions for certain number of items, but yes we'll probably have items in arrays in the shop.
A question that we didn't talk about, how do we choose which cards / consumable / items get displayed in a given shop ?

@JonaLam
Copy link
Collaborator

JonaLam commented Oct 16, 2024

It should probably be random, but should we have the same card throughout the run or wil they change depending on floor? We should probably at least have some poools of the diffrent items which the shop can pull from. This is all very heavily dependent on game balance so I sugest we have something modular like, but I also don't think we need anything more than an array of the options. For consumables we can also have the amount of conumables in the same array so we can change that

@Turtyo
Copy link
Collaborator Author

Turtyo commented Oct 16, 2024

mmh i would say we start with making the shop interface before trying more elaborate things for the actual stuff to put into the shop
yes it should be modular, we can start with a simple array of options though

@Turtyo Turtyo added the confirmed Has been approved to make code based on this label Oct 16, 2024
@JonaLam JonaLam self-assigned this Oct 17, 2024
@JonaLam JonaLam linked a pull request Nov 5, 2024 that will close this issue
@Turtyo Turtyo linked a pull request Nov 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3-Priority: high confirmed Has been approved to make code based on this new feature Ask for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants