[2.0.12] LuaEntity.max_health to include evolution scaling factor
Posted: Wed Oct 30, 2024 4:52 pm
Problem: When evolution has increased a spawner's max health, there's no reliable way to get it's real max health. LuaEntity.max_health is equal to LuaEntity.prototype.max_health (assuming normal quality)
Observed behavior:
Expected behavior:
3500
Solution: Update LuaEntity.max_health to include the evolution scaling factor, if appropriate.
Alternate solution: Expose LuaForce Evolution Health Scaling.
Observed behavior:
Code: Select all
/c game.player.surface.pollute({0,0}, 1000000000) --This sets evolution to 1
/c game.print(game.player.selected.max_health)
> 350
3500
Solution: Update LuaEntity.max_health to include the evolution scaling factor, if appropriate.
Alternate solution: Expose LuaForce Evolution Health Scaling.