Back to Index Page generated: Nov 12, 2024, 11:02:04 PM

Expansion King Cobra

Content

Warnings

  1. Unknown key 'upload_date' at https://wiki.alioth.net/img_auth.php/a/ae/KingCobra_1.2.oxz!manifest.plist

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Adds the King Cobra to the Ooniverse. Adds the King Cobra to the Ooniverse.
Identifier oolite.oxp.KillerWolf.KingCobra oolite.oxp.KillerWolf.KingCobra
Title King Cobra King Cobra
Category Ships Ships
Author KillerWolf KillerWolf
Version 1.2.1 1.2.1
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/King_Cobra n/a
Download URL https://wiki.alioth.net/img_auth.php/a/ae/KingCobra_1.2.oxz http://wiki.alioth.net/img_auth.php/a/ae/KingCobra_1.2.oxz
License CC-BY-NC-SA 3.0 CC-BY-NC-SA 3.0
File Size n/a
Upload date 1610873409

Documentation

Also read http://wiki.alioth.net/index.php/King%20Cobra

ReadMe & License.txt

King Cobra OXP v1.0 by Killer Wolf

------------------------------------------------------------------------

Overview
========
King Cobra ~ Cobra MK VI From Isis Interstellar. This ship comes with new missiles and an integrated hardened Escape pod as well as other goodies.

Wiki pages
==========
http://wiki.alioth.net/index.php/King_Cobra

License
=======
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

Discussion
==========
This OXP is discussed at this forum links: http://www.aegidian.org/bb/viewtopic.php?f=4&t=11226

Download
========
The OXP's files will updated on the Oolite Wiki and forums.
 - http://wiki.alioth.net/img_auth.php/a/ae/KingCobra_1.2.oxz

Temporary links:
 - OXP: https://app.box.com/s/sht8fmbrx7hd9o0ywcfbewpj6tps7myx
 - OXZ: https://app.box.com/s/7xcec4og72gr52rjaw6rzglwn5bsx1pz


Version History
===============

 28.01.2019 - Version 1.2.1 --tweaks by rustem--
 - Added a materials.
 - Fix roles.

 11.12.2018 - Version 1.2.0 --tweaks by rustem--
 - Adds a manifest.plist file.
 - Tweaks to shipdata.plist files: edits a roles for last oolite version, text formatting.
 - Corrected a vars for: ASM-12B Jida Missile, escape-capsule.
 - Tweaks to equipment.plist, adds the condition script for KingCobra HUD equipment.
 - Tweaks to shipyard.plist file: edits a chance, techlevel.
 - Fixes a shaders vars to last correctly version.
 - Other a small text formatting fixes.

 23.11.2011 - Version 1.1.0.
 - ship mesh amended cos of some effing reversed normals that didn't show up in the modeller >:-/
 - loads of stuff removed from the HUD script that i left in by mistake.
 - HUD brightness amended

 22.11.2011 - Version 1.0.0. Initial release.

------------------------------------------------------------------------


Use an unzipper to unpack the Zip file. if it goes silly and splits up the files to separate folders, you'll need to create a folder called "King Cobra.OXP" and stick em all back in there. Unzippers go silly w/ my OXPs, sometimes. Stick your OXP folder in the game's AddOns folder and you're good to go. hopefully.

Massive thanks to Griff as always for his shaders, and help. Massive thanks to CommonSense OTB for allowing people to mess w/ his awesome curvey gauge HUD routines, and his pointers in the right direction when i was stumbling.

cheers as always to the board community for general help and freindship.

KW
22-11-2011


KING COBRA v1.1 (that didn't take long, did it?)
- ship mesh amended cos of some effing reversed normals that didn't show up in the modeller >:-/
- loads of stuff removed from the HUD script that i left in by mistake.
- HUD brightness amended

CommonSense ~ many thnks for your help, debugging and feedback. Much appreciated :-)
KW
23-11-2011


Licence :
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. To view a copy of this license, visit "http://creativecommons.org/licenses/by-nc-sa/3.0/'' or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

some plists and script by CommonSenseOTB, butchered in a half-ar$ed amateurish fashion by Killer Wolf.

------------------------------------------------------------------------

Equipment

Name Visible Cost [deci-credits] Tech-Level
EQ_KINGCOBRA_GREEN_10_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_10_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_11_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_11_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_12_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_12_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_13_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_13_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_14_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_14_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_15_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_15_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_16_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_16_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_17_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_17_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_18_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_18_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_19_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_19_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_1_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_1_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_20_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_20_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_21_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_21_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_22_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_22_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_23_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_23_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_24_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_24_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_25_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_25_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_26_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_26_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_27_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_27_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_28_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_28_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_29_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_29_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_2_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_2_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_30_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_30_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_31_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_31_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_32_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_32_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_33_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_33_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_34_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_34_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_35_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_35_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_36_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_36_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_37_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_37_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_38_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_38_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_39_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_39_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_3_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_3_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_40_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_40_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_4_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_4_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_5_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_5_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_6_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_6_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_7_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_7_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_8_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_8_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_9_AFTSHIELD no 0 1+
EQ_KINGCOBRA_GREEN_9_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_10_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_10_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_11_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_11_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_12_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_12_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_13_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_13_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_14_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_14_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_15_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_15_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_16_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_16_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_17_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_17_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_18_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_18_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_19_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_19_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_1_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_1_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_20_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_20_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_21_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_21_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_22_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_22_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_23_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_23_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_24_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_24_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_25_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_25_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_26_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_26_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_27_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_27_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_28_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_28_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_29_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_29_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_2_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_2_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_30_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_30_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_31_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_31_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_32_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_32_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_33_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_33_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_34_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_34_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_35_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_35_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_36_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_36_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_37_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_37_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_38_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_38_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_39_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_39_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_3_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_3_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_40_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_40_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_4_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_4_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_5_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_5_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_6_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_6_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_7_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_7_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_8_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_8_FORWARDSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_9_AFTSHIELD no 0 1+
EQ_KINGCOBRA_YELLOW_9_FORWARDSHIELD no 0 1+
ASM-12B Jida Missile yes 800 9+

Ships

Name
Cobra MkVI King
Jida Missile ASM-12B
King Cobra
King Cobra
Escape Vessel
Cobra MkVI King
Cobra MkVI Star Snake

Models

This expansion declares no models. This may be related to warnings.

Scripts

Path
Scripts/kchud_conditions.js
"use strict";
this.name        = "kchud_Equipment";
this.author      = "gsagostinho, based on work by phkb";
this.copyright   = "2015 phkb, 2017 gsagostinho";
this.description = "Condition script for KingCobra HUD equipment";
this.licence     = "CC BY-NC-SA 4.0";

this.allowAwardEquipment = function(equipment, ship, context) {
	if (context != "scripted") return false;
	return true;
}
Scripts/kw-kchud.js
/*

kw-kchud.js

Script for the animation of numeric gauges on your ship.


Oolite
Copyright � 2003-2010 Giles C Williams and contributors

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.


kingcobrahud.oxp
Copyright � 2011 "CommonSenseOTB" modified by Killer Wolf

This work is licensed under the Creative Commons
Attribution-Noncommercial-Share Alike 3.0 Unported License.

To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter
to Creative Commons, 171 Second Street, Suite 300, San Francisco,
California, 94105, USA.

*/

this.name               = "kw-kchud.js";
this.author             = "CommonSenseOTB";
this.copyright          = "Copyright 2011 by CommonSenseOTB, modified by KW CC-by-nc-sa-3.0";
this.description        = "kingcobrahud Animation Script";
this.version            = "1.0";

this.kctradhud = 1;

this.alertConditionChanged = function (newCondition, oldCondition) {
   switch (newCondition) {
      case 0: // we're docked
         {
            kctradhud = 1;
            player.ship.hud = "kw-kctrad.plist"; // set the docked HUD
            break;
         }
      case 1: // we're at green alert
      case 2: // or we're at yellow alert
      case 3: // we're at red alert
         {
            kctradhud = 0;
         }
         break;
   }
}


this.shipWillLaunchFromStation = function () //overides for the shield equalizer and capacitors oxp countdown timer, alarm and messages are below
{
   if (this.kingcobrastartupflag !== 1.0) { //overides for the shield equalizer and capacitors oxp countdown timer, alarm and messages are farther below
      this.kingcobragaugevalue = 0.0; // number to be displayed on current gauge
      this.kingcobragaugeselector = "NONE"; // current gauge to be displayed
      this.kingcobragaugecolor = "NONE"; // current gauge color to be used
      this.kingcobragaugechanged = "FALSE"; // current gauge state decides whether to draw
      this.kingcobragaugecolorchanged = "FALSE"; // current gauge state decides whether to erase previous color
      this.kingcobragaugeflashcounter = 1.0; // counter to flash the between colors
      this.kingcobragaugelastflashcounter = 1.0; // last value of flash counter
      this.kingcobragaugeframecounter = 1.0; // frame counter for gauge control
      this.kingcobragaugelastframecounter = 1.0; // last value of frame counter for gauge control
      this.kingcobragaugelastforwardshieldvalue = 0.0; // last value of forward shield
      this.kingcobragaugelastforwardshieldcolor = "NONE"; // last color of forward shield
      this.kingcobragaugelastaftshieldvalue = 0.0; // last value of aft shield
      this.kingcobragaugelastaftshieldcolor = "NONE"; // last color of aft shield
      this.kingcobrastartupflag = 1.0; // prevent setting variables more than once
   }
   player.ship.hud = "kw-kcHUD.plist";
   this.refresh();
   this.pfsr = addFrameCallback(this.prepareForwardShieldReadout.bind(this)); //----------   
   this.pfsrdg = addFrameCallback(this.displayGauge.bind(this));
   this.pasr = addFrameCallback(this.prepareAftShieldReadout.bind(this)); //----------
   this.pasrdg = addFrameCallback(this.displayGauge.bind(this));
   if (this.kingcobragaugeCheckTimer) {
      this.kingcobragaugeCheckTimer.start();
   } else {
      this.kingcobragaugeCheckTimer = new Timer(this, this.kingcobragaugeCheck, 0, 0.25); // use a timer to update the numeric gauge flash counter
   }
}

this.kingcobragaugeCheck = function ()
{
   if (player.ship.docked) {
      removeFrameCallback(this.pfsr); //----------
      removeFrameCallback(this.pfsrdg);
      removeFrameCallback(this.pasr); //----------
      removeFrameCallback(this.pasrdg);
      this.kingcobragaugeCheckTimer.stop();
   } else {
      this.kingcobragaugeflashcounter += 1.0;
      if (this.kingcobragaugeflashcounter > 8.0) {
         this.kingcobragaugeflashcounter = 1.0;
         return;
      }
      return;
   }
   return;
}

this.shipWillEnterWitchspace = function ()
{
   player.ship.hud = "kw-kcHUD.plist";
   removeFrameCallback(this.pfsr); //----------
   removeFrameCallback(this.pfsrdg);
   removeFrameCallback(this.pasr); //----------
   removeFrameCallback(this.pasrdg);
   this.kingcobragaugeCheckTimer.stop();
}

this.shipExitedWitchspace = function ()
{
   this.pfsr = addFrameCallback(this.prepareForwardShieldReadout.bind(this)); //----------   
   this.pfsrdg = addFrameCallback(this.displayGauge.bind(this));
   this.pasr = addFrameCallback(this.prepareAftShieldReadout.bind(this)); //----------
   this.pasrdg = addFrameCallback(this.displayGauge.bind(this));
   if (this.kingcobragaugeCheckTimer) {
      this.kingcobragaugeCheckTimer.start();
   } else {
      this.kingcobragaugeCheckTimer = new Timer(this, this.kingcobragaugeCheck, 0, 0.25); // use a timer to update the numeric gauge flash counter
   }
}


this.prepareForwardShieldReadout = function ()
{
   this.kingcobragaugeframecounter += 1.0;
   if (this.kingcobragaugeframecounter >= 3.0) {
      this.kingcobragaugeframecounter = 1.0;
   }
   if (this.kingcobragaugeframecounter !== 2.0) {
      this.kingcobragaugechanged = "FALSE";
      return;
   }
   this.kingcobragaugevalue = ((player.ship.forwardShield / player.ship.maxForwardShield) * 40);
   mfs = 40;
   this.kingcobragaugeselector = "FORWARDSHIELD";
   if (this.kingcobragaugevalue < (mfs * 0.25)) {
      if ((this.kingcobragaugeflashcounter === 1.0) || (this.kingcobragaugeflashcounter === 3.0) || (this.kingcobragaugeflashcounter === 5.0) || (this.kingcobragaugeflashcounter === 7.0)) // flash fast
      {
         this.kingcobragaugecolor = "GREEN";
         if (this.kingcobragaugelastforwardshieldcolor === this.kingcobragaugecolor) {
            this.kingcobragaugecolorchanged = "FALSE";
         } else {
            this.kingcobragaugecolorchanged = "TRUE";
         }
         if ((this.kingcobragaugelastforwardshieldvalue === this.kingcobragaugevalue) && (this.kingcobragaugelastforwardshieldcolor === this.kingcobragaugecolor)) {
            this.kingcobragaugechanged = "FALSE";
            this.kingcobragaugecolorchanged = "FALSE";
            this.kingcobragaugelastforwardshieldvalue = this.kingcobragaugevalue;
            this.kingcobragaugelastforwardshieldcolor = this.kingcobragaugecolor;
            return;
         } else {
            this.kingcobragaugechanged = "TRUE";
            this.kingcobragaugelastforwardshieldvalue = this.kingcobragaugevalue;
            this.kingcobragaugelastforwardshieldcolor = this.kingcobragaugecolor;
            return;
         }
      } else {
         this.kingcobragaugecolor = "YELLOW";
         if (this.kingcobragaugelastforwardshieldcolor === this.kingcobragaugecolor) {
            this.kingcobragaugecolorchanged = "FALSE";
         } else {
            this.kingcobragaugecolorchanged = "TRUE";
         }
         if ((this.kingcobragaugelastforwardshieldvalue === this.kingcobragaugevalue) && (this.kingcobragaugelastforwardshieldcolor === this.kingcobragaugecolor)) {
            this.kingcobragaugechanged = "FALSE";
            this.kingcobragaugelastforwardshieldvalue = this.kingcobragaugevalue;
            this.kingcobragaugelastforwardshieldcolor = this.kingcobragaugecolor;
            return;
         } else {
            this.kingcobragaugechanged = "TRUE";
            this.kingcobragaugelastforwardshieldvalue = this.kingcobragaugevalue;
            this.kingcobragaugelastforwardshieldcolor = this.kingcobragaugecolor;
            return;
         }
      }
   }
   if (this.kingcobragaugevalue > (mfs * 0.8)) {
      this.kingcobragaugecolor = "GREEN";
      if (this.kingcobragaugelastforwardshieldcolor === this.kingcobragaugecolor) {
         this.kingcobragaugecolorchanged = "FALSE";
      } else {
         this.kingcobragaugecolorchanged = "TRUE";
      }
      if ((this.kingcobragaugelastforwardshieldvalue === this.kingcobragaugevalue) && (this.kingcobragaugelastforwardshieldcolor === this.kingcobragaugecolor)) {
         this.kingcobragaugechanged = "FALSE";
         this.kingcobragaugelastforwardshieldvalue = this.kingcobragaugevalue;
         this.kingcobragaugelastforwardshieldcolor = this.kingcobragaugecolor;
         return;
      } else {
         this.kingcobragaugechanged = "TRUE";
         this.kingcobragaugelastforwardshieldvalue = this.kingcobragaugevalue;
         this.kingcobragaugelastforwardshieldcolor = this.kingcobragaugecolor;
         return;
      }
   } else {
      this.kingcobragaugecolor = "YELLOW";
      if (this.kingcobragaugelastforwardshieldcolor === this.kingcobragaugecolor) {
         this.kingcobragaugecolorchanged = "FALSE";
      } else {
         this.kingcobragaugecolorchanged = "TRUE";
      }
      if ((this.kingcobragaugelastforwardshieldvalue === this.kingcobragaugevalue) && (this.kingcobragaugelastforwardshieldcolor === this.kingcobragaugecolor)) {
         this.kingcobragaugechanged = "FALSE";
         this.kingcobragaugelastforwardshieldvalue = this.kingcobragaugevalue;
         this.kingcobragaugelastforwardshieldcolor = this.kingcobragaugecolor;
         return;
      } else {
         this.kingcobragaugechanged = "TRUE";
         this.kingcobragaugelastforwardshieldvalue = this.kingcobragaugevalue;
         this.kingcobragaugelastforwardshieldcolor = this.kingcobragaugecolor;
         return;
      }
      return;
   }
   return;
}

this.prepareAftShieldReadout = function ()
{
   if (this.kingcobragaugeframecounter !== 2.0) {
      this.kingcobragaugechanged = "FALSE";
      return;
   }
   this.kingcobragaugevalue = ((player.ship.aftShield / player.ship.maxAftShield) * 40);
   mas = 40;
   this.kingcobragaugeselector = "AFTSHIELD";
   if (this.kingcobragaugevalue < (mas * 0.25)) {
      if ((this.kingcobragaugeflashcounter === 1.0) || (this.kingcobragaugeflashcounter === 3.0) || (this.kingcobragaugeflashcounter === 5.0) || (this.kingcobragaugeflashcounter === 7.0)) // flash fast
      {
         this.kingcobragaugecolor = "GREEN";
         if (this.kingcobragaugelastaftshieldcolor === this.kingcobragaugecolor) {
            this.kingcobragaugecolorchanged = "FALSE";
         } else {
            this.kingcobragaugecolorchanged = "TRUE";
         }
         if ((this.kingcobragaugelastaftshieldvalue === this.kingcobragaugevalue) && (this.kingcobragaugelastaftshieldcolor === this.kingcobragaugecolor)) {
            this.kingcobragaugechanged = "FALSE";
            this.kingcobragaugelastaftshieldvalue = this.kingcobragaugevalue;
            this.kingcobragaugelastaftshieldcolor = this.kingcobragaugecolor;
            return;
         } else {
            this.kingcobragaugechanged = "TRUE";
            this.kingcobragaugelastaftshieldvalue = this.kingcobragaugevalue;
            this.kingcobragaugelastaftshieldcolor = this.kingcobragaugecolor;
            return;
         }
      } else {
         this.kingcobragaugecolor = "YELLOW";
         if (this.kingcobragaugelastaftshieldcolor === this.kingcobragaugecolor) {
            this.kingcobragaugecolorchanged = "FALSE";
         } else {
            this.kingcobragaugecolorchanged = "TRUE";
         }
         if ((this.kingcobragaugelastaftshieldvalue === this.kingcobragaugevalue) && (this.kingcobragaugelastaftshieldcolor === this.kingcobragaugecolor)) {
            this.kingcobragaugechanged = "FALSE";
            this.kingcobragaugelastaftshieldvalue = this.kingcobragaugevalue;
            this.kingcobragaugelastaftshieldcolor = this.kingcobragaugecolor;
            return;
         } else {
            this.kingcobragaugechanged = "TRUE";
            this.kingcobragaugelastaftshieldvalue = this.kingcobragaugevalue;
            this.kingcobragaugelastaftshieldcolor = this.kingcobragaugecolor;
            return;
         }
      }
   }
   if (this.kingcobragaugevalue > (mas * 0.8)) {
      this.kingcobragaugecolor = "GREEN";
      if (this.kingcobragaugelastaftshieldcolor === this.kingcobragaugecolor) {
         this.kingcobragaugecolorchanged = "FALSE";
      } else {
         this.kingcobragaugecolorchanged = "TRUE";
      }
      if ((this.kingcobragaugelastaftshieldvalue === this.kingcobragaugevalue) && (this.kingcobragaugelastaftshieldcolor === this.kingcobragaugecolor)) {
         this.kingcobragaugechanged = "FALSE";
         this.kingcobragaugelastaftshieldvalue = this.kingcobragaugevalue;
         this.kingcobragaugelastaftshieldcolor = this.kingcobragaugecolor;
         return;
      } else {
         this.kingcobragaugechanged = "TRUE";
         this.kingcobragaugelastaftshieldvalue = this.kingcobragaugevalue;
         this.kingcobragaugelastaftshieldcolor = this.kingcobragaugecolor;
         return;
      }
   } else {
      this.kingcobragaugecolor = "YELLOW";
      if (this.kingcobragaugelastaftshieldcolor === this.kingcobragaugecolor) {
         this.kingcobragaugecolorchanged = "FALSE";
      } else {
         this.kingcobragaugecolorchanged = "TRUE";
      }
      if ((this.kingcobragaugelastaftshieldvalue === this.kingcobragaugevalue) && (this.kingcobragaugelastaftshieldcolor === this.kingcobragaugecolor)) {
         this.kingcobragaugechanged = "FALSE";
         this.kingcobragaugelastaftshieldvalue = this.kingcobragaugevalue;
         this.kingcobragaugelastaftshieldcolor = this.kingcobragaugecolor;
         return;
      } else {
         this.kingcobragaugechanged = "TRUE";
         this.kingcobragaugelastaftshieldvalue = this.kingcobragaugevalue;
         this.kingcobragaugelastaftshieldcolor = this.kingcobragaugecolor;
         return;
      }
      return;
   }
   return;
}


this.displayGauge = function ()
{
   if (this.kingcobragaugechanged === "FALSE") {
      return;
   }
   let g1 = this.kingcobragaugevalue;
   let g2 = this.kingcobragaugeselector;
   let c1 = this.kingcobragaugecolor;
   if ((c1 === "YELLOW") && (this.kingcobragaugecolorchanged === "TRUE")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_1_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_2_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_3_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_4_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_5_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_6_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_7_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_8_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_9_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_10_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_11_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_12_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_13_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_14_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_15_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_16_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_17_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_18_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_19_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_20_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_21_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_22_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_23_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_24_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_25_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_26_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_27_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_28_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_29_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_30_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_31_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_32_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_33_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_34_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_35_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_36_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_37_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_38_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_39_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_GREEN_40_" + g2);
   }
   if ((c1 === "GREEN") && (this.kingcobragaugecolorchanged === "TRUE")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_1_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_2_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_3_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_4_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_5_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_6_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_7_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_8_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_9_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_10_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_11_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_12_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_13_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_14_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_15_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_16_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_17_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_18_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_19_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_20_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_21_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_22_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_23_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_24_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_25_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_26_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_27_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_28_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_29_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_30_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_31_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_32_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_33_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_34_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_35_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_36_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_37_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_38_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_39_" + g2);
      player.ship.removeEquipment("EQ_KINGCOBRA_YELLOW_40_" + g2);
   }
   if ((g1 > 1) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_1_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_1_" + g2);
   }
   if ((g1 <= 1) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_1_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_1_" + g2);
   }
   if ((g1 > 2) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_2_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_2_" + g2);
   }
   if ((g1 <= 2) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_2_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_2_" + g2);
   }
   if ((g1 > 3) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_3_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_3_" + g2);
   }
   if ((g1 <= 3) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_3_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_3_" + g2);
   }
   if ((g1 > 4) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_4_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_4_" + g2);
   }
   if ((g1 <= 4) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_4_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_4_" + g2);
   }
   if ((g1 > 5) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_5_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_5_" + g2);
   }
   if ((g1 <= 5) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_5_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_5_" + g2);
   }
   if ((g1 > 6) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_6_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_6_" + g2);
   }
   if ((g1 <= 6) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_6_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_6_" + g2);
   }
   if ((g1 > 7) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_7_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_7_" + g2);
   }
   if ((g1 <= 7) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_7_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_7_" + g2);
   }
   if ((g1 > 8) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_8_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_8_" + g2);
   }
   if ((g1 <= 8) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_8_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_8_" + g2);
   }
   if ((g1 > 9) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_9_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_9_" + g2);
   }
   if ((g1 <= 9) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_9_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_9_" + g2);
   }
   if ((g1 > 10) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_10_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_10_" + g2);
   }
   if ((g1 <= 10) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_10_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_10_" + g2);
   }
   if ((g1 > 11) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_11_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_11_" + g2);
   }
   if ((g1 <= 11) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_11_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_11_" + g2);
   }
   if ((g1 > 12) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_12_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_12_" + g2);
   }
   if ((g1 <= 12) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_12_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_12_" + g2);
   }
   if ((g1 > 13) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_13_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_13_" + g2);
   }
   if ((g1 <= 13) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_13_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_13_" + g2);
   }
   if ((g1 > 14) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_14_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_14_" + g2);
   }
   if ((g1 <= 14) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_14_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_14_" + g2);
   }
   if ((g1 > 15) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_15_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_15_" + g2);
   }
   if ((g1 <= 15) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_15_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_15_" + g2);
   }
   if ((g1 > 16) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_16_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_16_" + g2);
   }
   if ((g1 <= 16) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_16_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_16_" + g2);
   }
   if ((g1 > 17) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_17_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_17_" + g2);
   }
   if ((g1 <= 17) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_17_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_17_" + g2);
   }
   if ((g1 > 18) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_18_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_18_" + g2);
   }
   if ((g1 <= 18) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_18_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_18_" + g2);
   }
   if ((g1 > 19) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_19_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_19_" + g2);
   }
   if ((g1 <= 19) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_19_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_19_" + g2);
   }
   if ((g1 > 20) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_20_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_20_" + g2);
   }
   if ((g1 <= 20) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_20_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_20_" + g2);
   }
   if ((g1 > 21) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_21_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_21_" + g2);
   }
   if ((g1 <= 21) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_21_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_21_" + g2);
   }
   if ((g1 > 22) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_22_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_22_" + g2);
   }
   if ((g1 <= 22) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_22_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_22_" + g2);
   }
   if ((g1 > 23) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_23_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_23_" + g2);
   }
   if ((g1 <= 23) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_23_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_23_" + g2);
   }
   if ((g1 > 24) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_24_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_24_" + g2);
   }
   if ((g1 <= 24) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_24_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_24_" + g2);
   }
   if ((g1 > 25) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_25_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_25_" + g2);
   }
   if ((g1 <= 25) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_25_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_25_" + g2);
   }
   if ((g1 > 26) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_26_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_26_" + g2);
   }
   if ((g1 <= 26) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_26_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_26_" + g2);
   }
   if ((g1 > 27) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_27_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_27_" + g2);
   }
   if ((g1 <= 27) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_27_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_27_" + g2);
   }
   if ((g1 > 28) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_28_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_28_" + g2);
   }
   if ((g1 <= 28) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_28_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_28_" + g2);
   }
   if ((g1 > 29) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_29_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_29_" + g2);
   }
   if ((g1 <= 29) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_29_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_29_" + g2);
   }
   if ((g1 > 30) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_30_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_30_" + g2);
   }
   if ((g1 <= 30) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_30_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_30_" + g2);
   }
   if ((g1 > 31) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_31_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_31_" + g2);
   }
   if ((g1 <= 31) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_31_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_31_" + g2);
   }
   if ((g1 > 32) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_32_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_32_" + g2);
   }
   if ((g1 <= 32) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_32_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_32_" + g2);
   }
   if ((g1 > 33) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_33_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_33_" + g2);
   }
   if ((g1 <= 33) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_33_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_33_" + g2);
   }
   if ((g1 > 34) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_34_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_34_" + g2);
   }
   if ((g1 <= 34) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_34_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_34_" + g2);
   }
   if ((g1 > 35) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_35_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_35_" + g2);
   }
   if ((g1 <= 35) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_35_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_35_" + g2);
   }
   if ((g1 > 36) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_36_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_36_" + g2);
   }
   if ((g1 <= 36) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_36_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_36_" + g2);
   }
   if ((g1 > 37) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_37_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_37_" + g2);
   }
   if ((g1 <= 37) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_37_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_37_" + g2);
   }
   if ((g1 > 38) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_38_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_38_" + g2);
   }
   if ((g1 <= 38) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_38_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_38_" + g2);
   }
   if ((g1 > 39) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_39_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_39_" + g2);
   }
   if ((g1 <= 39) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_39_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_39_" + g2);
   }
   if ((g1 >= 40) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_40_" + g2) !== "EQUIPMENT_OK")) {
      player.ship.awardEquipment("EQ_KINGCOBRA_" + c1 + "_40_" + g2);
   }
   if ((g1 < 40) && (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_40_" + g2) === "EQUIPMENT_OK")) {
      player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_40_" + g2);
   }
}


this.refresh = function ()
{
   this.kingcobragaugelastframecounter = this.kingcobragaugeframecounter;
   this.kingcobragaugeframecounter = 1.0; //normally should be 2 but the counter will add 1 when it goes to prepareForwardShield function, remark just to avoid confusion
   this.prepareForwardShieldReadout();
   this.kingcobragaugechanged = "TRUE";
   this.displayGauge();
   this.kingcobragaugeframecounter = 2.0;
   this.prepareAftShieldReadout();
   this.kingcobragaugechanged = "TRUE";
   this.displayGauge();
   this.kingcobragaugeframecounter = this.kingcobragaugelastframecounter;
}


this.viewDirectionChanged = function (to, from)
{
   if (from === "VIEW_GUI_DISPLAY" && to !== "VIEW_GUI_DISPLAY") {
      player.ship.hud = "kw-kcHUD.plist"; // set the standard HUD
   }
}

this.guiScreenChanged = function (to, from)
{
   if (to === "GUI_SCREEN_STATUS") {
      if (kctradhud == 0) {
         player.ship.hud = "kw-kcGUI.plist";
      } else {
         player.ship.hud = "kw-kctrad.plist";
      }
   } else if (to === "GUI_SCREEN_SHORT_RANGE_CHART" || "GUI_SCREEN_LONG_RANGE_CHART") {
      if (kctradhud == 0) {
         player.ship.hud = "kw-kcGUI.plist";
      } else {
         player.ship.hud = "kw-kctrad.plist";
      }
   } else if (to === "GUI_SCREEN_MANIFEST") {
      if (kctradhud == 0) {
         player.ship.hud = "kw-kcGUI.plist";
      } else {
         player.ship.hud = "kw-kctrad.plist";
      }
   } else if (to === "GUI_SCREEN_SYSTEM_DATA") {
      if (kctradhud == 0) {
         player.ship.hud = "kw-kcGUI.plist";
      } else {
         player.ship.hud = "kw-kctrad.plist";
      }
   } else if (to === "GUI_SCREEN_MARKET") {
      if (kctradhud == 0) {
         player.ship.hud = "kw-kcGUI.plist";
      } else {
         player.ship.hud = "kw-kctrad.plist";
      }
   }
}



this.playerWillSaveGame = function ()
{
   this.cleanUp();
}

this.cleanUp = function ()
{
   this.kingcobragaugeselector = "FORWARDSHIELD";
   this.kingcobragaugecolor = "GREEN";
   this.removeLeftovers();
   this.kingcobragaugecolor = "YELLOW";
   this.removeLeftovers();
   this.kingcobragaugeselector = "AFTSHIELD";
   this.kingcobragaugecolor = "GREEN";
   this.removeLeftovers();
   this.kingcobragaugecolor = "YELLOW";
   this.removeLeftovers();
}

this.removeLeftovers = function ()
{
   let c1 = this.kingcobragaugecolor;
   let g2 = this.kingcobragaugeselector;
   for (counter = 0; counter < 41; counter++) {
      if (player.ship.equipmentStatus("EQ_KINGCOBRA_" + c1 + "_" + counter + "_" + g2) === "EQUIPMENT_OK") {
         player.ship.removeEquipment("EQ_KINGCOBRA_" + c1 + "_" + counter + "_" + g2);
      }
   }
}


this.shipDied = function ()
{
   removeFrameCallback(this.pfsr); //----------
   removeFrameCallback(this.pfsrdg);
   removeFrameCallback(this.pasr); //----------
   removeFrameCallback(this.pasrdg);
   if (this.kingcobragaugeCheckTimer) {
      this.kingcobragaugeCheckTimer.stop();
   }
}