private static float AdditionalHeatSinkDissipation(MechDef mechDef)
        {
            var engineHeatSinkDissipation = EngineHeat.GetEngineHeatDissipation(mechDef.Inventory);

            //Control.mod.Logger.LogDebug("engineHeatSinkDissipation=" + engineHeatSinkDissipation);
            return(engineHeatSinkDissipation);
        }
 public static void Validate(MechDef mechDef, ref Dictionary <MechValidationType, List <string> > errorMessages)
 {
     Structure.ValidationRulesCheck(mechDef, ref errorMessages);
     Armor.ValidationRulesCheck(mechDef, ref errorMessages);
     EngineHeat.ValidationRulesCheck(mechDef, ref errorMessages);
     Engine.ValidationRulesCheck(mechDef, ref errorMessages);
     Gyro.ValidationRulesCheck(mechDef, ref errorMessages);
     Cockpit.ValidationRulesCheck(mechDef, ref errorMessages);
 }
Exemple #3
0
 // get heat dissipation rate of the engine by inventory and rating
 public static void Postfix(Mech __instance, ref float __result)
 {
     try
     {
         __result += EngineHeat.GetEngineHeatDissipation(__instance.MechDef.Inventory);
     }
     catch (Exception e)
     {
         Control.mod.Logger.LogError(e);
     }
 }
        // only allow one engine part per specific location
        public static bool Prefix(
            MechLabLocationWidget __instance,
            PointerEventData eventData,
            MechLabDropTargetType addToType,
            MechLabPanel ___mechLab,
            List <MechLabItemSlotElement> ___localInventory,
            ref string ___dropErrorMessage)
        {
            try
            {
                if (___mechLab == null)
                {
                    return(false);
                }

                var dragItem = ___mechLab.DragItem as MechLabItemSlotElement;
                if (dragItem == null)
                {
                    return(false);
                }

                var result = EngineHeat.DropCheck(__instance, ___mechLab, dragItem, ___localInventory);
                var error  = result as ErrorResult;
                var remove = result as RemoveItemResult;
                if (error != null)
                {
                    ___dropErrorMessage = error.errorMessage;
                    ___mechLab.ShowDropErrorMessage(___dropErrorMessage);
                    ___mechLab.OnDrop(eventData);
                    return(false);
                }
                else if (remove != null)
                {
                    // remove item and delete it
                    dragItem.thisCanvasGroup.blocksRaycasts = true;
                    dragItem.MountedLocation = ChassisLocations.None;
                    ___mechLab.dataManager.PoolGameObject(MechLabPanel.MECHCOMPONENT_ITEM_PREFAB, dragItem.gameObject);
                    ___mechLab.ClearDragItem(true);
                    return(false);
                }
            }
            catch (Exception e)
            {
                Control.mod.Logger.LogError(e);
            }

            return(true);
        }
Exemple #5
0
 // invalidate mech loadouts that have more than 0 endo-steel critical slots but not exactly 14
 // invalidate mech loadouts that have more than 0 ff critical slots but not exactly 14
 public static void Postfix(MechDef mechDef, ref Dictionary <MechValidationType, List <string> > errorMessages)
 {
     try
     {
         EndoSteel.ValidationRulesCheck(mechDef, ref errorMessages);
         FerrosFibrous.ValidationRulesCheck(mechDef, ref errorMessages);
         EngineHeat.ValidationRulesCheck(mechDef, ref errorMessages);
         Engine.ValidationRulesCheck(mechDef, ref errorMessages);
         Gyro.ValidationRulesCheck(mechDef, ref errorMessages);
         Cockpit.ValidationRulesCheck(mechDef, ref errorMessages);
     }
     catch (Exception e)
     {
         Control.mod.Logger.LogError(e);
     }
 }