namespace Eco.Mods.TechTree { using System; using System.Collections.Generic; using Eco.Gameplay.Components; using Eco.Gameplay.Components.Auth; using Eco.Gameplay.DynamicValues; using Eco.Gameplay.Items; using Eco.Gameplay.Objects; using Eco.Gameplay.Players; using Eco.Gameplay.Skills; using Eco.Gameplay.Systems.TextLinks; using Eco.Shared.Math; using Eco.Shared.Networking; using Eco.Shared.Localization; using Eco.Shared.Serialization; using Eco.Shared.Utils; [Serialized] [Weight(15000)] public class PoweredCartItem : WorldObjectItem { public override string FriendlyName { get { return "Powered Cart"; } } public override string Description { get { return "Large cart for hauling sizable loads."; } } } [RequiresSkill(typeof(MechanicalEngineeringSkill), 0)] public class PoweredCartRecipe : Recipe { public PoweredCartRecipe() { this.Products = new CraftingElement[] { new CraftingElement(), }; this.Ingredients = new CraftingElement[] { new CraftingElement(typeof(MechanicsAssemblyEfficiencySkill), 20, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy), new CraftingElement(typeof(MechanicsAssemblyEfficiencySkill), 20, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy), new CraftingElement(typeof(MechanicsAssemblyEfficiencySkill), 1, MechanicsAssemblyEfficiencySkill.MultiplicativeStrategy), }; this.CraftMinutes = new ConstantValue(25); this.Initialize("Powered Cart", typeof(PoweredCartRecipe)); CraftingComponent.AddRecipe(typeof(WainwrightTableObject), this); } } [Serialized] [RequireComponent(typeof(StandaloneAuthComponent))] [RequireComponent(typeof(PublicStorageComponent))] [RequireComponent(typeof(MovableLinkComponent))] [RequireComponent(typeof(FuelSupplyComponent))] [RequireComponent(typeof(FuelConsumptionComponent))] [RequireComponent(typeof(AirPollutionComponent))] [RequireComponent(typeof(VehicleComponent))] [RequireComponent(typeof(TailingsReportComponent))] public class PoweredCartObject : PhysicsWorldObject { private static Dictionary roadEfficiency = new Dictionary() { { typeof(DirtRoadBlock), 1.0f }, { typeof(DirtRoadWorldObjectBlock), 1.0f }, { typeof(StoneRoadBlock), 1.4f }, { typeof(StoneRoadWorldObjectBlock), 1.4f }, { typeof(AsphaltRoadBlock), 1.8f }, { typeof(AsphaltRoadWorldObjectBlock), 1.8f } }; public override string FriendlyName { get { return "Powered Cart"; } } private static Type[] fuelTypeList = new Type[] { typeof(PetroleumItem), typeof(GasolineItem), }; private PoweredCartObject() { } protected override void Initialize() { base.Initialize(); this.GetComponent().Initialize(20, 3000000); this.GetComponent().Initialize(2, fuelTypeList); this.GetComponent().Initialize(25); this.GetComponent().Initialize(0.1f); this.GetComponent().Initialize(20, 1, roadEfficiency); } } }