示例#1
0
 public void setModifier(ContainerModifier mod)
 {
     currentModifierName = mod.name;
     internalUpdateVolumeUnits();
     internalUpdateMassAndCost();
     resourcesDirty = true;
 }
示例#2
0
        public static void loadConfigData()
        {
            ConfigNode[] typeNodes = GameDatabase.Instance.GetConfigNodes("SSTU_CONTAINERTYPE");
            int          len       = typeNodes.Length;

            containerModifiers = new ContainerModifier[len];
            for (int i = 0; i < len; i++)
            {
                containerModifiers[i] = new ContainerModifier(typeNodes[i]);
            }

            ConfigNode[] defNodes = GameDatabase.Instance.GetConfigNodes("SSTU_RESOURCESET");
            len           = defNodes.Length;
            containerDefs = new ContainerResourceSet[len];
            for (int i = 0; i < len; i++)
            {
                containerDefs[i] = new ContainerResourceSet(defNodes[i]);
            }

            ConfigNode[] presetNodes = GameDatabase.Instance.GetConfigNodes("SSTU_FUELTYPE");
            len = presetNodes.Length;
            containerPresets = new ContainerFuelPreset[len];
            for (int i = 0; i < len; i++)
            {
                containerPresets[i] = new ContainerFuelPreset(presetNodes[i]);
            }
        }
示例#3
0
 public void setFromContainer(ContainerModifier mod)
 {
     boiloffModifier              = mod.boiloffModifier;
     activeInsulationPercent      = mod.activeInsulationPercent;
     activeECCost                 = mod.activeECCost;
     activeInsulationPrevention   = mod.activeInsulationPrevention;
     inactiveInsulationPrevention = mod.inactiveInsulationPrevention;
     passiveInsulationPrevention  = mod.passiveInsulationPrevention;
 }
示例#4
0
 public void setFromContainer(ContainerModifier mod, float configMult)
 {
     boiloffModifier              = mod.boiloffModifier;
     activeInsulationPercent      = mod.activeInsulationPercent;
     activeECCost                 = mod.activeECCost;
     activeInsulationPrevention   = mod.activeInsulationPrevention;
     inactiveInsulationPrevention = mod.inactiveInsulationPrevention;
     passiveInsulationPrevention  = mod.passiveInsulationPrevention;
     calcMaxECCost(configMult);
 }
示例#5
0
        /// <summary>
        /// Update part impact tolerance and max temp stats based on first containers modifier values and part prefab values
        /// </summary>
        private void updatePartStats()
        {
            if (part.partInfo == null || part.partInfo.partPrefab == null)
            {
                return;
            }
            ContainerModifier mod = containers[0].currentModifier;

            part.crashTolerance = part.partInfo.partPrefab.crashTolerance * mod.impactModifier;
            part.maxTemp        = part.partInfo.partPrefab.maxTemp * mod.heatModifier;
            part.skinMaxTemp    = part.partInfo.partPrefab.skinMaxTemp * mod.heatModifier;
        }
示例#6
0
        public void containerTypeUpdated(ContainerDefinition container, ContainerModifier newType, bool updateSymmetry = false)
        {
            container.setModifier(newType);
            updatePartStats();

            if (updateSymmetry)
            {
                foreach (Part p in part.symmetryCounterparts)
                {
                    SSTUVolumeContainer mod  = p.GetComponent <SSTUVolumeContainer>();
                    ContainerDefinition def2 = mod.getContainer(container.name);
                    ContainerModifier   mod2 = def2.internalGetModifier(newType.name);
                    mod.containerTypeUpdated(def2, mod2, false);
                }
            }
        }
 public void containerTypeUpdated(ContainerDefinition container, ContainerModifier newType)
 {
     container.setModifier(newType);
     updatePartStats();
 }