Пример #1
0
        private static void CheckBuildTorch(Vector3 jobPosition, Vector3 torchPosition, Map map)
        {
            MapCell cell = map.GetCell(torchPosition);

            if (!(cell.EmbeddedWall is Torch))
            {
                return;
            }

            BuildConstructionJobData data = new BuildConstructionJobData(ConstructionID.Torch);
            BuildConstructionJob     buildConstructionJob = new BuildConstructionJob(jobPosition, data);

            buildConstructionJob.RequiredComponents.Add(new JobComponent(ItemID.Torch, (int)Material.Count));
            GnomanEmpire.Instance.Fortress.JobBoard.AddJob(buildConstructionJob);
        }
Пример #2
0
        public static void AutomaticallyLitStripMining(BuildConstructionJob buildConstructionJob, Character character)
        {
            Vector3 jobPosition = buildConstructionJob.Position;
            int     depth       = (int)(GnomanEmpire.Instance.Map.SurfaceLevel - jobPosition.Z);

            if (depth > -8)
            {
                return;
            }

            BuildConstructionJobData jobData = (BuildConstructionJobData)buildConstructionJob.Data;

            if (jobData.ConstructionID != ConstructionID.Torch)
            {
                return;
            }

            Map map = GnomanEmpire.Instance.Map;

            int mapWidth  = map.MapWidth;
            int mapHeight = map.MapHeight;

            for (int x = (int)(jobPosition.X - SafeTorchDistance); x <= jobPosition.X + SafeTorchDistance; x++)
            {
                if (x < 1)
                {
                    x = 1;
                }
                if (x > mapHeight - 2)
                {
                    break;
                }
                CreateSafeMineJob(map, new Vector3(x, jobPosition.Y, jobPosition.Z), character);
            }

            for (int y = (int)(jobPosition.Y - SafeTorchDistance); y <= jobPosition.Y + SafeTorchDistance; y++)
            {
                if (y < 1)
                {
                    y = 1;
                }
                if (y > mapWidth - 2)
                {
                    break;
                }
                CreateSafeMineJob(map, new Vector3(jobPosition.X, y, jobPosition.Z), character);
            }
        }
Пример #3
0
        private static void CheckBuildTorch(Vector3 jobPosition, Vector3 torchPosition, Map map)
        {
            MapCell cell = map.GetCell(torchPosition);
            if (!(cell.EmbeddedWall is Torch))
                return;

            BuildConstructionJobData data = new BuildConstructionJobData(ConstructionID.Torch);
            BuildConstructionJob buildConstructionJob = new BuildConstructionJob(jobPosition, data);
            buildConstructionJob.RequiredComponents.Add(new JobComponent(ItemID.Torch, (int)Material.Count));
            GnomanEmpire.Instance.Fortress.JobBoard.AddJob(buildConstructionJob);
        }