2.5 Practice

Controlling Python’s Flow

Using the text-based fighting game we created in the project, you need to add money to the character’s attributes. You will need to modify the character dictionary to include a new key for money that defaults at 8 money, and then allow the user to add money to their character from the available points variable during the character build section (do not change the amount of points available). Then update the fighting sequence to allow the player to buy a potion that will heal them for 25 health points at a cost of 10 money as an option of what to do during the user’s turn in the battle sequence. If the player does not have enough money, they will not be able to buy the potion, and they will have to choose another action. If they do buy the potion, it will heal them for 25 health points, but it will cost them 10 money.