-
Notifications
You must be signed in to change notification settings - Fork 354
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
Refactor earthquakes to its own class #2573
base: master
Are you sure you want to change the base?
Conversation
I had originally planned myself to make an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're definitely moving a lot around, so it's going to be a little challenging to make sure it's all correct.
ui:playSound("quake.wav") | ||
end | ||
else | ||
print("Unknown stage: " .. stage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If stage is nil won't this crash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an assert, to always crash on bad input, with a fix for nil stage.
--!param old (integer) The old version of the save game. | ||
--!param new (integer) The current version of the save game format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parent of all afterLoad
s is App
. But it does need defining somewhere.
self.remaining_damage = self.remaining_damage - 1 | ||
self.damage_timer = self.damage_timer + damage_time | ||
|
||
-- Patient falling: work in progress, see PR 1848 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*tips hat*
@@ -774,6 +774,47 @@ function PlayerHospital:playSound(sound) | |||
end | |||
end | |||
|
|||
--! The UI parts of earthquake ticks | |||
--!param stage (string) Stage of the active earthquake | |||
function PlayerHospital:tickEarthquake(stage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trouble here is an earthquake is a world event. The announcements aren't though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the UI parts of the world event, though there may be more from competitor hospitals later.
Made changes from feedback. |
---@type Earthquake | ||
local Earthquake = _G["Earthquake"] | ||
|
||
-- All fields relating to the current or next earthquake: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tobylane a nit but out of curiosity would a block quote be more sufficient here?
Describe what the proposed change does
a sub class ofan instance that belongs to World, with ongoing/next quakes transferred. No additional features. The old recount for current_map_earthquake was faulty so it wasn't copied over (World:afterLoad).