-
Notifications
You must be signed in to change notification settings - Fork 0
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
And the UN help increase in money didn't worked... because all the Action Buttons are bugged and using fixed values #32
Comments
So, here's the problem's cause: ...the Action is created with a fixed value. Calling it later uses that fixed value. |
Possible solutions: 1 - Change that value when any other value related changes. |
Damn. I just realized, but this means that ALL THE ACTION BUTTONS ARE BROKEN. Every single one of them uses numbers created in the start of the game. Their equations... all their equations... don't reflect values that change while the game goes. Dammit. |
More work than initially expected, since the Action Buttons system works with constants created at game start, and they should work with variables. In other words, the PlayerAction now has to work in a way that calls for functions with values, instead of values. |
Fine. To solve this, the solution is to make the events work with Delegates. The delegates will store functions and that functions will be used in realtime. |
Ok, to make everything more organized (considering that I will have to create... 7 new functions to be called by Actions...) I will create a new class called ActionConstructor, to deal with creating Actions and their respective functions. |
So. Yeah. The "calculations only at the start" doesn't apply only to the values created when the buttons are pressed, but also to the cooldown period. This doesn't look much like a problem and is not... until the time is changed to pass faster... but the cooldowns are all using the first "time speed" value. I'm creating another issue, to avoid bogging down too much this page. |
ActionConstructor creates the PlayerActions that the player will use in the game and also stores the functions that will be called by the actions.
...both constructors were using the RESULTS of the functions, instead of the functions themselves.
And that's that, bug finally fixed. |
The bug is: after increasing the UNHelpVariation by 1, the value given by the United Nations does not increase.
The text was updated successfully, but these errors were encountered: