public void setModifier(ContainerModifier mod) { currentModifierName = mod.name; internalUpdateVolumeUnits(); internalUpdateMassAndCost(); resourcesDirty = true; }
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]); } }
public void setFromContainer(ContainerModifier mod) { boiloffModifier = mod.boiloffModifier; activeInsulationPercent = mod.activeInsulationPercent; activeECCost = mod.activeECCost; activeInsulationPrevention = mod.activeInsulationPrevention; inactiveInsulationPrevention = mod.inactiveInsulationPrevention; passiveInsulationPrevention = mod.passiveInsulationPrevention; }
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); }
/// <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; }
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(); }