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
[RDY] Enhancement - Extinguishers reduce chance of machines exploding #1648
Conversation
50/50 if there is an extinguisher present in the room with a machine about to break
I feel that 50% is too generous given how inexpensive and small extinguishers are. Maybe 10-25% Thoughts? |
I don't have a problem per se reducing percentage but given the catastrophic nature of earthquakes I would say reducing it too much would nullify any effect of this enhancement.
|
What about 33%? If it survives one use, it's second use puts the chance at ~11%. (Even though that's technically not real maths) |
This is why I indicated what the original code does as the chance starts out say between 11% and 25% of crashing, to 80-90% and then guaranteed. The stronger a machine is - the more researched it is - the more likely its to survive. Could have something like 20% chance for each use above the strength value and potentially additional extinguishers, reduce that by 5%, maybe or diminishing return for each extinquisher. Obviously have to track additional information to record this. |
Do we want a calculation of that complexity these days? That's my own concern. |
I like the escalating chance for all machines with a slight reduction for extinguishers. As I said, I don't think the effect of extinguishers should be nearly as pronounced as this PR makes them; and that would also help balance against earthquakes a bit. |
This comment has been minimized.
This comment has been minimized.
As to be more accurate to original game.
I have implemented the old TH method as above. I think we might need to cap the grant from extinguishers in the room; as currently it reduces explosion chance by 5% for every extinguisher in the room. Maybe it should be capped at 4, so there is still 5% chance of exploding minimum. |
That looks like a reasonable compromise between the too harsh now and the original, that was my suggestion and not exactly how TH works - there appears increased surivability chances with TH as strength is used in the calculation. An approximation to that would be to change the 0.25 constant to roughly 2 / strength instead. |
Sounds like a good consideration to me (a constant of 0.05 is still needed to offset the first extinguisher). I would also like to ensure that explosion_chance can never get to 0 though. So I would suggest there's a minimum value of 0.05 at all times. And maybe also maxing out at 0.95 until we reach the guaranteed explosion conditions... |
Calculation now 2/strength Also explosion_chance capped to not go below 0.05 or exceed 0.95. Guaranteed explosion reserved for the must explode criteria.
This is ready for review again |
Noticed they weren't matching up with coding change
Marking as ready as I don't perceive we need any more changes here |
Would resolve #994
PR will implement a variable saved_by_extinguisher to each machine/object defaulted at 0.
When machine threshold falls <1, the variable is recalculated by math.random(0,1) to see if an extinguisher in the room will save the room (saved_by_extinguisher == 1 is a success). Variable is saved until the machine is next used (inc. earthquake tick), in which case it sets back to 0.
The addition of self.saved_by_extinguisher may not be needed in object.lua... it was added more as a safeguard.
As for machine_dialog.lua nothing needs to be changed. The health marker in the dialogue is not affected if the number of times a machine is used is higher than its strength.