private static GearTypeEnum GetGearType(ModComponent modComponent) { if (modComponent.InventoryCategory != InventoryCategory.Auto) { return(ModUtils.TranslateEnumValue <GearTypeEnum, InventoryCategory>(modComponent.InventoryCategory)); } if (modComponent is ModToolComponent) { return(GearTypeEnum.Tool); } if (modComponent is ModFoodComponent || modComponent is ModCookableComponent || (modComponent as ModLiquidItemComponent)?.LiquidType == LiquidType.Water) { return(GearTypeEnum.Food); } if (modComponent is ModClothingComponent) { return(GearTypeEnum.Clothing); } if (ModUtils.GetComponent <ModFireStartingComponent>(modComponent) != null || ModUtils.GetComponent <ModBurnableComponent>(modComponent) != null) { return(GearTypeEnum.Firestarting); } return(GearTypeEnum.Other); }
private static void ConfigureClothing(ModComponent modComponent) { ModClothingComponent modClothingItem = modComponent as ModClothingComponent; if (modClothingItem == null) { return; } ClothingItem clothingItem = ModUtils.GetOrCreateComponent <ClothingItem>(modClothingItem); clothingItem.m_DailyHPDecayWhenWornInside = GetDecayPerStep(modClothingItem.DaysToDecayWornInside, modClothingItem.MaxHP); clothingItem.m_DailyHPDecayWhenWornOutside = GetDecayPerStep(modClothingItem.DaysToDecayWornOutside, modClothingItem.MaxHP); clothingItem.m_DryBonusWhenNotWorn = 1.5f; clothingItem.m_DryPercentPerHour = 100f / modClothingItem.HoursToDryNearFire; clothingItem.m_DryPercentPerHourNoFire = 100f / modClothingItem.HoursToDryWithoutFire; clothingItem.m_FreezePercentPerHour = 100f / modClothingItem.HoursToFreeze; clothingItem.m_Region = ModUtils.TranslateEnumValue <ClothingRegion, Region>(modClothingItem.Region); clothingItem.m_MaxLayer = ModUtils.TranslateEnumValue <ClothingLayer, Layer>(modClothingItem.MaxLayer); clothingItem.m_MinLayer = ModUtils.TranslateEnumValue <ClothingLayer, Layer>(modClothingItem.MinLayer); clothingItem.m_FootwearType = ModUtils.TranslateEnumValue <FootwearType, Footwear>(modClothingItem.Footwear); clothingItem.m_WornMovementSoundCategory = ModUtils.TranslateEnumValue <ClothingMovementSound, MovementSound>(modClothingItem.MovementSound); clothingItem.m_PaperDollTextureName = modClothingItem.MainTexture; clothingItem.m_PaperDollBlendmapName = modClothingItem.BlendTexture; clothingItem.m_Warmth = modClothingItem.Warmth; clothingItem.m_WarmthWhenWet = modClothingItem.WarmthWhenWet; clothingItem.m_Waterproofness = modClothingItem.Waterproofness / 100f; clothingItem.m_Windproof = modClothingItem.Windproof; clothingItem.m_SprintBarReductionPercent = modClothingItem.SprintBarReduction; clothingItem.m_Toughness = modClothingItem.Toughness; }
private static void ConfigureLiquidItem(ModComponent modComponent) { ModLiquidItemComponent modLiquidItemComponent = modComponent as ModLiquidItemComponent; if (modLiquidItemComponent == null) { return; } LiquidItem liquidItem = ModUtils.GetOrCreateComponent <LiquidItem>(modComponent); liquidItem.m_LiquidCapacityLiters = modLiquidItemComponent.MaxLiters; liquidItem.m_LiquidType = ModUtils.TranslateEnumValue <GearLiquidTypeEnum, LiquidType>(modLiquidItemComponent.LiquidType); liquidItem.m_RandomizeQuantity = false; liquidItem.m_LiquidLiters = 0; liquidItem.m_DrinkingAudio = "Play_DrinkWater"; liquidItem.m_TimeToDrinkSeconds = 4; }
private static void ConfigureGearItem(ModComponent modComponent) { GearItem gearItem = ModUtils.GetOrCreateComponent <GearItem>(modComponent); gearItem.m_Type = GetGearType(modComponent); gearItem.m_WeightKG = modComponent.WeightKG; gearItem.m_MaxHP = modComponent.MaxHP; gearItem.m_DailyHPDecay = GetDecayPerStep(modComponent.DaysToDecay, modComponent.MaxHP); gearItem.OverrideGearCondition(ModUtils.TranslateEnumValue <GearStartCondition, InitialCondition>(modComponent.InitialCondition)); gearItem.m_LocalizedDisplayName = CreateLocalizedString(modComponent.DisplayNameLocalizationId); gearItem.m_LocalizedDescription = CreateLocalizedString(modComponent.DescriptionLocalizatonId); gearItem.m_PickUpAudio = modComponent.PickUpAudio; gearItem.m_StowAudio = modComponent.StowAudio; gearItem.m_PutBackAudio = modComponent.PickUpAudio; gearItem.m_WornOutAudio = modComponent.WornOutAudio; gearItem.m_ConditionTableType = GetConditionTableType(modComponent); gearItem.m_ScentIntensity = ScentMapper.GetScentIntensity(modComponent); gearItem.Awake(); }