sadger / CorsixTH

Open source clone of Theme Hospital
Other
1 stars 0 forks source link

Annoucements should be played on recieving first and last faxes #6

Closed sadger closed 10 years ago

sadger commented 10 years ago

From MarkL


I think there should be announcements when you get the first and last fax. I have added these two functions in epidemic.lua and called them at the same time as the faxes are called. The one thing I can't be sure of right now is whether there is always an announcement if you fail to cover up or you hear it when you succeed as well.
function Epidemic:announceStartOfEpidemic()
local announcements = {"EPID001.wav", "EPID002.wav", "EPID003.wav", "EPID004.wav"}
if announcements and self.hospital:isPlayerHospital() then
self.world.ui:playAnnouncement(announcements[math.random(1, #announcements)])
end
end

function Epidemic:announceEndOfEpidemic()
local announcements = {"EPID005.wav", "EPID006.wav", "EPID007.wav", "EPID008.wav"}
if announcements and self.hospital:isPlayerHospital() then
self.world.ui:playAnnouncement(announcements[math.random(1, #announcements)])
end
end
MarkL1961 commented 10 years ago

I have since noticed that the announcements at the end overlap with the one you added for "there is a man from the ministry in the building" as this one is called when the Inspector leaves reception and the ones I mentioned are called when the results fax is sent. I am not sure how easy this will be, but perhaps your message could be called when he arrives rather when he is leaving the desk so they don't overlap or perhaps you can think of another place to call self:announceEndOfEpidemic()

sadger commented 10 years ago

This has been added by me but needs testing before we close this. If you can confirm it works we can close this issue.

MarkL1961 commented 10 years ago

The messages are as follows: 001 Epidemic alert, standby 002 Staff announcement, epidemic warning 003 Warning, epidemic alert 004 Warning 005 Epidemic over, stand down 006 Epidemic now under control 007 Epidemic contained 008 Epidemic emergency over I split them into 1-4 for the first fax and 5-8 for the second fax. I suppose though the last four could depend on the actual outcome i.e. 6 and 7 for successful cover up, 8 for the evacuation and 5 for a failed cover up - what do you think?

sadger commented 10 years ago

I think how we have done it now is fine, the messages don't seem to be outcome specific. What I added last night should work I hope.

sadger commented 10 years ago

I think how we have done it now is fine, the messages don't seem to be outcome specific. What I added last night should work I hope.

MarkL1961 commented 10 years ago

I am testing it now in a new game. I am going to see how it is in un-altered level without knowing who is the carrier (scary)

sadger commented 10 years ago

I think we know is working in most cases, closing.

MarkL1961 commented 10 years ago

Yes, the messages were fine :+1:

MarkL1961 commented 10 years ago

I notice with my current game that the Inspector did not get announced this time, I think it was after the second epidemic. Did you add something to change inspector.has_been_announced = true back to false when he is destroyed?

MarkL1961 commented 10 years ago

Scrub that, since noticed that I have somehow managed to turn off announcements