Ejemplo n.º 1
0
    public static void SetStatusItems(KSelectable selectable, bool refrigerated, RotAtmosphereQuality atmoshpere)
    {
        selectable.SetStatusItem(Db.Get().StatusItemCategories.PreservationTemperature, (!refrigerated) ? Db.Get().CreatureStatusItems.Unrefrigerated : Db.Get().CreatureStatusItems.Refrigerated, selectable);
        switch (atmoshpere)
        {
        case RotAtmosphereQuality.Normal:
            selectable.SetStatusItem(Db.Get().StatusItemCategories.PreservationAtmosphere, null, null);
            break;

        case RotAtmosphereQuality.Contaminating:
            selectable.SetStatusItem(Db.Get().StatusItemCategories.PreservationAtmosphere, Db.Get().CreatureStatusItems.ContaminatedAtmosphere, null);
            break;

        case RotAtmosphereQuality.Sterilizing:
            selectable.SetStatusItem(Db.Get().StatusItemCategories.PreservationAtmosphere, Db.Get().CreatureStatusItems.SterilizingAtmosphere, null);
            break;
        }
    }
Ejemplo n.º 2
0
    public static RotAtmosphereQuality AtmosphereQuality(GameObject gameObject)
    {
        int                  num   = Grid.PosToCell(gameObject);
        int                  num2  = Grid.CellAbove(num);
        SimHashes            id    = Grid.Element[num].id;
        RotAtmosphereQuality value = RotAtmosphereQuality.Normal;

        AtmosphereModifier.TryGetValue((int)id, out value);
        SimHashes            simHashes = SimHashes.Unobtanium;
        RotAtmosphereQuality value2    = RotAtmosphereQuality.Normal;

        if (Grid.IsValidCell(num2))
        {
            simHashes = Grid.Element[num2].id;
            if (!AtmosphereModifier.TryGetValue((int)simHashes, out value2))
            {
                value2 = value;
            }
        }
        else
        {
            value2 = value;
        }
        if (value == value2)
        {
            return(value);
        }
        if (value == RotAtmosphereQuality.Contaminating || value2 == RotAtmosphereQuality.Contaminating)
        {
            return(RotAtmosphereQuality.Contaminating);
        }
        if (value == RotAtmosphereQuality.Normal || value2 == RotAtmosphereQuality.Normal)
        {
            return(RotAtmosphereQuality.Normal);
        }
        return(RotAtmosphereQuality.Sterilizing);
    }