Example #1
0
 public override void UpdateMe()
 {
     if (Connector.canister != null)
     {
         FuelConsumption = MatrixMove.ServerState.Speed / 25f;
         if (MatrixMove.IsMovingServer && MatrixMove.RequiresFuel)
         {
             FuelCalculations();
         }
         if (IsFuelled())
         {
             MatrixMove.IsFueled = true;
         }
         FuelLevel = Connector.canister.GasContainer.GasMix.GetMoles(Gas.Plasma) / 60000;
     }
     else
     {
         FuelLevel           = 0f;
         MatrixMove.IsFueled = false;
         if (MatrixMove.IsMovingServer && MatrixMove.RequiresFuel)
         {
             MatrixMove.StopMovement();
         }
     }
     if (FuelLevel > 1)
     {
         FuelLevel = 1;
     }
     //Logger.Log("FuelLevel " + FuelLevel.ToString());
 }
Example #2
0
    void Update()
    {
        if (spawnedIn && setCourse && Vector2.Distance(transform.position, destination) < 2)         //If shuttle arrived
        {
            arrivedAtStation = true;
            GameManager.Instance.shuttleArrived = true;
            setCourse = false;

            mm.SetPosition(destination);

            mm.StopMovement();
            mm.RotateTo(Orientation.Right);             //Rotate shuttle correctly so doors are facing correctly
            mm.ChangeDir(Orientation.Left);             //Reverse into station evac doors.
            StartCoroutine(ReverseIntoStation(mm));
        }

        if (arrivedAtStation && !departed)
        {
            waitAtStationTime += Time.deltaTime;
            if (waitAtStationTime > 60f)
            {
                DepartStation();
            }
        }

        if (departed && !roundEnded)
        {
            departingFlightTime += Time.deltaTime;
            if (departingFlightTime > 60f)
            {
                roundEnded = true;
                GameManager.Instance.RoundEnd();
            }
        }
    }
Example #3
0
    private void Update()
    {
        if (!CustomNetworkManager.Instance._isServer)
        {
            return;
        }

        if (moving && Vector2.Distance(transform.position, destination) < 2)            //arrived to dest
        {
            moving = false;
            mm.SetPosition(destination);
            mm.StopMovement();
            mm.SteerTo(Orientation.Up);

            if (CargoManager.Instance.ShuttleStatus == ShuttleStatus.OnRouteStation)
            {
                mm.ChangeFlyingDirection(Orientation.Down);
                StartCoroutine(ReverseIntoStation());
            }
        }
        if (CargoManager.Instance.CurrentFlyTime <= 0f &&
            CargoManager.Instance.ShuttleStatus == ShuttleStatus.OnRouteCentcom)
        {
            UnloadCargo();
            CargoManager.Instance.OnShuttleArrival();
        }
    }
Example #4
0
    void Update()
    {
        if (GameManager.Instance.GetRoundTime <= 150f && spawnedIn == false && setCourse == false)        // Warp close to station 2.5 mins before round ends
        {
            SpawnNearStation();
            setCourse = true;
        }

        if (spawnedIn && setCourse && Vector2.Distance(transform.position, destination) < 2)        //If shuttle arrived
        {
            arrivedAtStation = true;
            GameManager.Instance.shuttleArrived = true;
            setCourse = false;

            mm.SetPosition(destination);

            mm.StopMovement();
            mm.RotateTo(Orientation.Right);             //Rotate shuttle correctly so doors are facing correctly
            mm.ChangeDir(Orientation.Left);             //Reverse into station evac doors.
            StartCoroutine(ReverseIntoStation(mm));
        }

        if (GameManager.Instance.GetRoundTime <= 30f && arrivedAtStation == true)         // Depart the shuttle
        {
            mm.ChangeDir(Orientation.Right);
            mm.StartMovement();
        }
    }
 public void LandShuttleOnGround(Vector3 teleportCoordinate)
 {
     matrixMove.IsForceStopped = true;
     matrixMove.StopMovement();
     //Maybe change collision type?
     //matrixMove.matrixColliderType =
     matrixMove.SetPosition(teleportCoordinate);
 }
Example #6
0
 /// <summary>
 /// Starts or stops the shuttle.
 /// </summary>
 /// <param name="off">Toggle parameter</param>
 public void TurnOnOff(bool on)
 {
     if (on && State != TabState.Off && !matrixMove.rcsModeActive)
     {
         MatrixMove.StartMovement();
     }
     else
     {
         MatrixMove.StopMovement();
     }
 }
 /// <summary>
 /// Starts or stops the shuttle.
 /// </summary>
 /// <param name="off">Toggle parameter</param>
 public void TurnOnOff(bool on)
 {
     if (on && State != TabState.Off)
     {
         MatrixMove.StartMovement();
     }
     else
     {
         MatrixMove.StopMovement();
     }
 }
Example #8
0
        private void UpdateMe()
        {
            if (Connector == null)
            {
                //Logger.LogError($"{nameof(Connector)} was null on {this}!");
                return;
            }

            if (Connector.canister != null)
            {
                FuelConsumption = MatrixMove.ServerState.Speed / 25f;
                if (MatrixMove.IsMovingServer && MatrixMove.RequiresFuel)
                {
                    FuelCalculations();
                }
                if (IsFuelled())
                {
                    MatrixMove.IsFueled = true;
                }
                FuelLevel = Connector.canister.GasContainer.GasMix.GetMoles(Gas.Plasma) / Connector.canister.GasContainer.MaximumMoles;
            }
            else
            {
                FuelLevel           = 0f;
                MatrixMove.IsFueled = false;
                if (MatrixMove.IsMovingServer && MatrixMove.RequiresFuel)
                {
                    MatrixMove.StopMovement();
                }
            }
            if (FuelLevel > 1)
            {
                FuelLevel = 1;
            }
            //Logger.Log("FuelLevel " + FuelLevel.ToString());
        }