0

I basically need something that modifies existing code without the need to go back and change it. So for instance, if I have a game where the player or NPS can eat food to gain health back, and eating a banana gives five health, how can I make a trait that will make the banana gives ten health instead of five without going back into the original code that makes the banana award five health? Thanks.

1 Answers1

0

I would suggest adding a conditional to the action, so if the player has that trait it would raise a flag, and every time the character eats a banana it would check using a if else and if the user has that trait it would heal the 10 instead of 5, hope that helps.