# 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 # "Storm Incoming!" s siren Mode 10 # nice siren sound start: l storm_mode weather Mode # check weather s announcer On 0 # reset announcer yield beq storm_mode 1 countdown # countdown if incoming j start # else return to start countdown: 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: sgt siren_high minutes 2 # got more than 2m59s? slt siren_low minutes 1 # got less than 60s? nor siren_on siren_high siren_low # sound siren? s siren On siren_on # start siren if 1