stationeers_ic10/storm_warning.ic10

43 lines
1.1 KiB
Plaintext
Raw Normal View History

2021-08-30 15:28:11 +00:00
# needs a Weather Station
# a siren and an announcer (2x Kit (Speaker))
# and a display of some sort (Kit (Console))
alias weather d0 # Weather Station
alias readout d1 # Kit (Console)
alias announcer d2 # Kit (Speaker)
alias siren d3 # Kit (Speaker)
alias storm_mode r0
alias minutes r1
alias siren_high r2
alias siren_low r3
alias siren_on r4
s announcer Mode 18 # "StormIncoming"
s siren Mode 10 # "Alarm8"
2021-08-30 15:28:11 +00:00
start:
2021-09-04 11:06:00 +00:00
yield
2021-08-30 15:28:11 +00:00
l storm_mode weather Mode # check weather
s announcer On 0 # reset announcer
beq storm_mode 1 countdown # countdown if incoming
j start # else return to start
countdown:
2021-09-04 11:06:00 +00:00
yield
2021-08-30 15:28:11 +00:00
l storm_mode weather Mode # check weather
s announcer On 1 # announce storm
# get countdown value
l minutes weather NextWeatherEventTime
div minutes minutes 60 # convert to minutes
trunc minutes minutes # drop decimals
s readout Setting minutes # send to display
j warning
warning:
slt siren_high minutes 3 # got less than 3m?
sgt siren_low minutes 0 # got more than 60s?
2021-09-17 09:36:35 +00:00
and siren_on siren_high siren_low # sound siren?
2021-08-30 15:28:11 +00:00
s siren On siren_on # start siren if 1<minutes<3
beq storm_mode 1 countdown # still waiting? go back
j start # reset and start waiting again