Exemple #1
0
    public void Disappear() // INDEV
                            // экспедиция исчезает
    {
        if (stage == ExpeditionStage.Dismissed | stage == ExpeditionStage.Disappeared)
        {
            return;
        }
        else
        {
            if (crew != null)
            {
                crew.Disappear();
            }
            QuantumTransmitter.StopTransmission(transmissionID);
            Hangar.ReturnShuttle(shuttleID);
            if (destination != null)
            {
                destination.DeassignExpedition(this);
            }
            //if (expeditionsList.Contains(this)) expeditionsList.Remove(this);
            stage = ExpeditionStage.Disappeared;

            if (subscribedToUpdate & !GameMaster.sceneClearing)
            {
                GameMaster.realMaster.labourUpdateEvent -= this.LabourUpdate;
                subscribedToUpdate = false;
            }
            expeditionsList.Remove(this);
            changesMarkerValue++;
        }
        changesMarkerValue++;
        GlobalMapCanvasController.needExpeditionsRedraw = true;
    }
Exemple #2
0
    public void Dismiss() // экспедиция вернулась домой и распускается
    {
        //зависимость : Disappear()
        if (stage == ExpeditionStage.Disappeared | stage == ExpeditionStage.Dismissed)
        {
            return;
        }
        else
        {
            GameLogUI.MakeAnnouncement(Localization.GetCrewAction(LocalizedCrewAction.Returned, crew));
            if (crew != null)
            {
                crew.CountMission(missionCompleted);
                crew.SetCurrentExpedition(null);
                crew = null;
            }
            QuantumTransmitter.StopTransmission(transmissionID);
            Hangar.ReturnShuttle(shuttleID);
            if (destination != null)
            {
                destination.DeassignExpedition(this);
            }
            if (suppliesCount > 0)
            {
                GameMaster.realMaster.colonyController.storage.AddResource(ResourceType.Supplies, suppliesCount);
            }
            if (expeditionsList.Contains(this))
            {
                expeditionsList.Remove(this);
            }
            if (crystalsCollected > 0)
            {
                GameMaster.realMaster.colonyController.AddEnergyCrystals(crystalsCollected);
                crystalsCollected = 0;
            }
            stage = ExpeditionStage.Dismissed;
            if (missionCompleted)
            {
                expeditionsSucceed++;
                Knowledge.GetCurrent()?.ExpeditionsCheck(expeditionsSucceed);
            }

            expeditionsList.Remove(this);

            if (subscribedToUpdate & !GameMaster.sceneClearing)
            {
                GameMaster.realMaster.labourUpdateEvent -= this.LabourUpdate;
                subscribedToUpdate = false;
            }
            changesMarkerValue++;
        }
    }