.SFRMIS LDX #MSL \ Set X to the ship type of a missile, and call SFS1-2 JSR SFS1-2 \ to add a missile to our universe that has AI (bit 7 \ set), is hostile (bit 6 set) and has been launched \ (bit 0 clear); the target slot number is set to 31, \ but this is ignored as the hostile flags means we \ are the target BCC KYTB \ The C flag will be set if the call to SFS1-2 was a \ success, so if it's clear, jump to KYTB to return from \ the subroutine (as KYTB contains an RTS) IF _EXECUTIVE LDX #1 \ Call TALK with X = 1 to say "Incoming missile" using JSR TALK \ the Watford Electronics Beeb Speech Synthesiser (if \ one is fitted and speech has been enabled) ENDIF LDA #120 \ Print recursive token 120 ("INCOMING MISSILE") as an JSR MESS \ in-flight message LDA #48 \ Call the NOISE routine with A = 48 to make the sound BNE NOISE \ of the missile being launched and return from the \ subroutine using a tail call (this BNE is effectively \ a JMP as A will never be zero)Name: SFRMIS [Show more] Type: Subroutine Category: Tactics Summary: Add an enemy missile to our local bubble of universeContext: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * TACTICS (Part 5 of 7) calls SFRMIS
An enemy has fired a missile, so add the missile to our universe if there is room, and if there is, make the appropriate warnings and noises.
[X]
Variable KYTB (category: Keyboard)
Lookup table for in-flight keyboard controls
[X]
Subroutine MESS (category: Flight)
Display an in-flight message
[X]
Configuration variable MSL = 1
Ship type for a missile
[X]
Subroutine NOISE (category: Sound)
Make the sound whose number is in A
[X]
Subroutine TALK (category: Sound)
Speak using the Watford Electronics Beeb Speech Synthesiser