Laser Mount Switching System (LMSS)
By phkb

Overview
========
The Laser Mount Switching System (LMSS) provides a way for pilots to have two lasers installed at each laser mount, and easily switch between them. The goal of this system is to give pilots a way of reconfiguring their ship inflight for different roles. For example, some pilots prefer to use a military laser and "snipe" their enemies from a distance. However, not every fight can be done at a distance, and there will inevitably be situations where pilots need to engage in a dogfight at close quarters. Using the LMSS, pilots can switch between their military laser and a beam laser that is more suited for dogfighting. Another example is where a ship has been set up for mining. In this instance the pilot may prefer to have their mining laser installed in the front mount. However, doing so makes it extremely awkward for any sort of battle situation. Using the LMSS, the pilot can easily switch between their mining laser and another laser (like a pulse or beam laser), so they can switch from "mining mode" to "fighting mode".

Installation
============
There are two components to the LMSS system: the assembly, plus an additional laser. The assemblies can be purchased at any system with a techlevel of 8. If the pilot wants switchable lasers in all four laser mounts, then four LMSS systems must be purchased. After the assembly is installed on a laser mount, the pilot can then choose what additional laser they want to install. First, they must switch the current laser to the secondary position via the "LMSS dockside services" F4 interface screen. Once the primary laser is moved into the secondary position, additional lasers can be purchased in the primary position in the normal way.

An additional piece of equipment, the LMSS Actuator Upgrade, can be purchased at techlevel 13 systems. This upgrade speeds up the switching process, almost halving the time it takes to switch between lasers.

The LMSS can be used with all lasers, including all the built it ones (pulse, beam, mining and military lasers), plus any lasers provided by OXP's.

Secondary lasers can't be viewed on the F5 ship equipment list. To see all secondary laser installations, go to the F5 F5 Manifest screen, where the secondary lasers will be listed under the heading "LMSS Secondary Laser Installations".

Flight Operation
================
Once the assembly and secondary lasers are installed, the process to switch lasers is as follows: 
1. Select the view where the assembly is installed (front, aft, port, or starboard).
2. Select the primable equipment "LMSS Activator"
3. Activate the equipment by pressing "n" on the keyboard.
There will be a delay between dismounting the current laser and mounting the secondary one. During that delay no laser can be fired in that position.

Laser Temperature
=================
The LMSS installs an additional laser mount beneath the existing mount, and includes an assembly and actuator to switch the mounts around. However, the heat dispersal system is shared between both mounts. Heat that is accumulated on one laser still needs to be dispersed even if the secondary laser is activated. Switching lasers does not give the pilot more firepower.

Damage
======
If the LMSS assembly is damaged while it is switching lasers, the laser mount will be unavailable until the next time the ship docks. Upon docking, the primary laser will be restored to its mount, but the switching mechanism will be unavailable until repaired.

Licence
=======
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International Public License. To view a copy of this license, visit http://http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. 

Sound files taken from "Large Industrial Robot" WAV file, created by Mike Koenig and sourced from soundbible.com. Licenced under Creative Commons Attribution 3.0.

Version History
===============
2.11
- Updated descriptions.plist with missing elements.

2.10
- Moved final bits of text to descriptions.plist for easier localisation.

2.9
- Darkened overlay images for better compatibility with Oolite 1.92.

2.8
- Moved all text into descriptions.plist for easier localisation.
- Removed old code and equipment items.

2.7
- Tweaks to work with updated Laser Booster.

2.6
- Fixed JS error when attempting to change lasers that can't be switched.

2.5
- Added a message to go along with the sound when lasers cannot be switched.

2.4
- Added a sound for when the player attempts to switch lasers and it cannot be switched (either because there is no secondary laser, or no actuator in that view).
- Removed some debug messages.

2.3
- Fixed issue that was preventing lasers from being switched successfully.

2.2
- Added links for integration with planned OXP's.

2.1
- Integration with Laser Arrangement.
- Code refactoring.

2.0.12
- Improved integration with latest version of Xenon HUD.

2.0.11
- Automatically remove the LMSS Activator when the assembly is removed.
- Code refactoring.

2.0.10
- Bug fixes.

2.0.9
- Trimmed equipment.plist.
- Code refactoring.

2.0.8
- Fixed default setting for the switch that 3rd party lasers can use to detect when lasers are being switched. It was on by default, instead of off.

2.0.7
- Fixed issue where purchasing the actuator upgrade does not impact switch performance until after a save/reload.
- Changed "==" comparisons to "===" for performance improvements.

2.0.6
- Updated screenID to enable BGS background sounds.
- Renamed background overlay image to prevent possibility of future duplication.
- Toned down overlay image.

2.0.5
- Small display tweaks.

2.0.4
- Tweaked the dockside interface screen to work better with long laser names.
- Added switch so that 3rd party lasers can know when the LMSS is operating and provide an override in their condition scripts.
- Added OXP hook code to condition script.

2.0.3
- Made compatible with Ship Storage Helper.
- Made compatible with Laser Cooler OXP.
- Made compatible with Repair Bots OXP.

2.0.2
- Cleaned up some redundant code.

2.0.1
- Fixed incompatibility with Ship Respray OXP.

2.0.0
- Made the LMSS compatible with all OXP lasers.
- Added interface screen to allow dockside laser configuration.
- Added manifest entries to display secondary laser installations.
- Fixed bug where the startUpComplete function wasn't being executed due to badly formed definition.
- Switched terminology from "Front" to "Forward" for better in-game consistency.
- Added compatibility with Xenon HUD's image crosshairs.
- Added the ability to remove all LMSS components. Removing a mount will also remove the secondary laser (if installed) and refund the cost of the laser.

1.0.4
- Fixed techLevel setting for Actuator upgrade
- Fixed damageProbability of the Actuator upgrade so it can be damaged, and added a check to switch the delay back to 10 seconds when it is damaged.

1.0.3
- Fixed a bug where a ship with no laser in a laser mount would cause an error.
- Added maintenance item descriptions for integration with email system maintenance overhaul email
- Adjusted costs of equipment items to be less premium.
- Added sounds to accompany the laser switching process.

1.0.2
- Fixed the "shipDied" function to correctly shut down timers when the player dies.

1.0.1
- Fixed bug where docking (or dying) while switching weapons would cause some unpredictable results.
- If an OXP laser gets installed after the LMSS system, the LMSS will now not switch the laser and potentially lose it.
- If a LMSS laser is purchased to replace an existing laser, a refund is now given on the laser that is removed (100% of standard laser cost).
- Code refactoring
- Put correct tags in manifest file.

1.0
Initial release
