Example #1
0
        private void MonitorSystem()
        {
            if (!healthMaster.IsDead)
            {
                Vector3Int   position = objectBehaviour.AssumedWorldPositionServer();
                MetaDataNode node     = MatrixManager.GetMetaDataAt(position);

                if (!IsEVACompatible())
                {
                    healthStateController.SetTemperature(node.GasMix.Temperature);
                    healthStateController.SetPressure(node.GasMix.Pressure);
                    CheckPressureDamage();
                }
                else
                {
                    healthStateController.SetPressure(101.325f);
                    healthStateController.SetTemperature(293.15f);
                }

                // if(healthMaster.OverallHealth >= HealthThreshold.SoftCrit)
                // {
                //  if (Breathe(node))
                //  {
                //      AtmosManager.Update(node);
                //  }
                // }
            }
        }
Example #2
0
        private void MonitorSystem()
        {
            if (healthMaster.IsDead)
            {
                return;
            }

            if (IsEVACompatible())
            {
                healthStateController.SetPressure(AtmosConstants.ONE_ATMOSPHERE);
                healthStateController.SetTemperature(293.15f);
                return;
            }

            GasMix ambientGasMix;

            if (objectBehaviour.parentContainer != null &&
                objectBehaviour.parentContainer.TryGetComponent <GasContainer>(out var gasContainer))
            {
                ambientGasMix = gasContainer.GasMix;
            }
            else
            {
                var        matrix        = healthMaster.RegisterTile.Matrix;
                Vector3Int localPosition = MatrixManager.WorldToLocalInt(objectBehaviour.AssumedWorldPositionServer(), matrix);
                ambientGasMix = matrix.MetaDataLayer.Get(localPosition).GasMix;
            }

            healthStateController.SetTemperature(ambientGasMix.Temperature);
            healthStateController.SetPressure(ambientGasMix.Pressure);
            CheckPressureDamage();
        }