namespace Eco.Mods.TechTree { using System; using System.Collections.Generic; using System.ComponentModel; using Eco.Gameplay.Blocks; using Eco.Gameplay.Components; using Eco.Gameplay.Components.Auth; using Eco.Gameplay.DynamicValues; using Eco.Gameplay.Economy; using Eco.Gameplay.Housing; using Eco.Gameplay.Interactions; using Eco.Gameplay.Items; using Eco.Gameplay.Minimap; using Eco.Gameplay.Objects; using Eco.Gameplay.Players; using Eco.Gameplay.Property; using Eco.Gameplay.Skills; using Eco.Gameplay.Systems.TextLinks; using Eco.Gameplay.Pipes.LiquidComponents; using Eco.Gameplay.Pipes.Gases; using Eco.Gameplay.Systems.Tooltip; using Eco.Shared; using Eco.Shared.Math; using Eco.Shared.Localization; using Eco.Shared.Serialization; using Eco.Shared.Utils; using Eco.Shared.View; using Eco.Shared.Items; using Eco.Gameplay.Pipes; using Eco.World.Blocks; [Serialized] [RequireComponent(typeof(PropertyAuthComponent))] [RequireComponent(typeof(MinimapComponent))] [RequireComponent(typeof(LinkComponent))] [RequireComponent(typeof(PublicStorageComponent))] [RequireComponent(typeof(SolidGroundComponent))] public partial class ContainerObject : WorldObject { public override string FriendlyName { get { return "Container"; } } protected override void Initialize() { this.GetComponent().Initialize("Storage"); this.GetComponent().Initialize(AuthModeType.Inherited); if (WorldObject.GetOccupancy(typeof(ContainerObject)) == null) WorldObject.AddOccupancy(new List(){ // 9x3x3 new BlockOccupancy(new Vector3i(0, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(0, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(0, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(0, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(0, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(0, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(0, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(0, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(0, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(1, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(2, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(3, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(4, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(5, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(6, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(7, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 0, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 0, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 0, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 1, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 1, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 1, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 2, 0), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 2, 1), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), new BlockOccupancy(new Vector3i(8, 2, 2), typeof(WorldObjectBlock), new Quaternion(0f, 0f, 0f, 1f)), }); var storage = this.GetComponent(); storage.Initialize(70); //Slots storage.Storage.AddInvRestriction(new CarriedRestriction()); // only store blocks and large items } public override void Destroy() { base.Destroy(); } } [Serialized] public partial class ContainerItem : WorldObjectItem { public override string FriendlyName { get { return "Container"; } } public override string Description { get { return "A big container you can store items in."; } } static ContainerItem() { } } [RequiresSkill(typeof(SteelworkingSkill), 1)] public partial class ContainerRecipe : Recipe { public ContainerRecipe() { this.Products = new CraftingElement[] { new CraftingElement(), }; this.Ingredients = new CraftingElement[] { new CraftingElement(typeof(SteelworkingEfficiencySkill), 200, SteelworkingEfficiencySkill.MultiplicativeStrategy), //Number equals the ammount of steel used at 0 efficiency }; SkillModifiedValue value = new SkillModifiedValue(60, SteelworkingSpeedSkill.MultiplicativeStrategy, typeof(SteelworkingSpeedSkill), Localizer.DoStr("craft time")); SkillModifiedValueManager.AddBenefitForObject(typeof(ContainerRecipe), Item.Get().UILink(), value); SkillModifiedValueManager.AddSkillBenefit(Item.Get().UILink(), value); this.CraftMinutes = value; this.Initialize("Container", typeof(ContainerRecipe)); CraftingComponent.AddRecipe(typeof(AnvilObject), this); } } }