void beDead()
    {
        eHP = 0;

        soulsAlive = 0;
        dying      = true;

        condition = mobCondition.dead;

        splode.SetActive(true);
    }
    void EnginesDisabled()
    {
        if (condition == mobCondition.active)
        {
            ShipDialogue(gameObject.name + " Engines: DISABLED");

            //Raimi Commentary
            NarrationWriter.PopDialogue(string.Format("<b><i>{0}</i></b> Engines: DISABLED", gameObject.name), "Raimi", 3);
            NarrationWriter.Ambience(moodEdge.getMoods().relief);

            condition = mobCondition.adrift;
        }
    }
    void ConditionUpdate()
    {
        if (condition == mobCondition.waiting)
        {
            if (eHP > 0)
            {
                if (navigatingTo)
                {
                    condition = mobCondition.active;
                }
                else
                {
                    condition = mobCondition.anchored;
                }
            }

            else
            {
                condition = mobCondition.dead;
            }
        }


        if (condition == mobCondition.adrift)
        {
            if (!WeaponsActive())
            {
                Disabled();
            }
        }

        if (condition == mobCondition.disabled)
        {
            beDisabled();
        }

        if (condition == mobCondition.dead)
        {
            beDead();
        }
    }
    void beDisabled()
    {
        Color disabledColor = new Vector4(48.0f / 255.0f, 172.0f / 255.0f, 234.0f / 255.0f, 255.0f / 255.0f);

        //    gameObject.tag = "NonThreat";
        //	fillBar.color = disabledColor;

        //   enginesDisabledFlag = true;

        //   iff = mobAffiliation.NonThreat;
        //active = false;

        condition = mobCondition.disabled;

        ShipDialogue(gameObject.name + ": DISABLED");

        if (disSplode != null)
        {
            disSplode.SetActive(true);
        }
    }
    public void RestoreShip()
    {
        transform.position = new Vector3(PlayerPrefs.GetFloat(gameObject.name.ToString() + "x"), PlayerPrefs.GetFloat(gameObject.name.ToString() + "y"), PlayerPrefs.GetFloat(gameObject.name.ToString() + "z"));
        transform.rotation = new Quaternion(PlayerPrefs.GetFloat(gameObject.name.ToString() + "rx"), PlayerPrefs.GetFloat(gameObject.name.ToString() + "ry"),
                                            PlayerPrefs.GetFloat(gameObject.name.ToString() + "rz"), PlayerPrefs.GetFloat(gameObject.name.ToString() + "rw"));

        int recallTag = PlayerPrefs.GetInt(gameObject.name.ToString() + "alignment");

        SetAlignment(recallTag);


        //restoreShipToLife
        //condition = mobCondition.waiting;

        condition = (mobCondition)PlayerPrefs.GetInt(gameObject.name.ToString() + "Condition");

        if (condition == mobCondition.dead)
        {
            //restore as dead

            eHP = 0;

            splode.SetActive(true);

            return;
        }

        dying    = false;
        disabled = false;

        eHP = maxHP;

        if (splode)
        {
            splode.SetActive(false);
        }

        if (disSplode)
        {
            disSplode.SetActive(false);
        }

        navigatingTo = nextDestination;

        restore = false;

        for (int i = 0; i < engines.Length; i++)
        {
            engines[i].RestoreEngines();
        }

        //restore all guns
        EnemyWeaponsModule[] armament = transform.GetComponentsInChildren <EnemyWeaponsModule>(true);
        if (armament.Length > 0)
        {
            for (int i = 0; i < armament.Length; i++)
            {
                armament[i].RestoreGun();
            }
        }

        if (reset)
        {
            SaveShipSpot(0, 0, 0, 0, 0, 0, 0);
            reset = false;
            //PlayerPrefs.SetInt(gameObject.name.ToString() + "alignment", 0);
        }
    }
 void WarmActive()
 {
     condition = mobCondition.active;
     //active = true;
 }