Пример #1
0
        public async Task ReportProgress(int id)
        {
            if (!Targets.Contains(id) || Progress.Contains(id))
            {
                return;
            }

            AddProgress(id);

            if (Completed)
            {
                await CheckMissionCompletedAsync();
            }
        }
Пример #2
0
        public override void AddGumpLayout()
        {
            int size;

            switch (Count)
            {
            default:
            case CircuitCount.Nine: size = 150; break;

            case CircuitCount.Sixteen: size = 190; break;

            case CircuitCount.TwentyFive: size = 230; break;

            case CircuitCount.ThirtySix: size = 270; break;
            }

            AddBackground(50, 0, 530, 410, 0xA28);
            AddBackground(95, 20, 442, 90, 0xA28);
            AddBackground(90, 115, size, size, 0xA28);
            AddBackground(100, 125, size - 20, size - 20, 0x1400);
            AddBackground(365, 120, 178, 210, 0x1400);

            AddImage(0, 0, 0x28C8);
            AddImage(547, 0, 0x28C9);
            AddImage(140, 40, 0x28D3);
            AddImage(420, 40, 0x28D3);
            AddImage(365, 115, 0x28D4);
            AddImage(365, 288, 0x28D4);
            AddImage(414, 189, 0x589);
            AddImage(435, 210, 0xA52);

            if (Path == null || Path.Count == 0)
            {
                Trap.Path = GetRandomPath();
            }

            if (Progress == null || Progress.Count == 0)
            {
                Trap.Progress = new List <int>();
                Trap.Progress.Add(0);
            }

            var sx    = 110;
            var sy    = 135;
            var count = (int)Count;
            var sq    = Math.Sqrt(count);

            for (int i = 0; i < count; i++)
            {
                int line = (int)(i / sq);
                int col  = (int)(i % sq);

                var x = sx + (col * 40);
                var y = sy + (line * 40);

                AddImage(x, y, i == count - 1 ? 0x9A8 : Progress.Contains(i) ? 0x868 : 0x25F8);

                if (line + 1 < sq)
                {
                    AddImage(x + 10, y + 27, 0x13F9);
                }

                if (col + 1 < sq)
                {
                    AddImage(x + 18, y + 12, 0x13FD);
                }

                if (i == Progress[Progress.Count - 1])
                {
                    AddImage(x + 8, y + 8, 0x13A8);
                }

                if (ShowNext && Progress.Count <= Path.Count && i == Path[Progress.Count])
                {
                    AddImage(x + 8, y + 8, 2361);
                }
            }

            if (ShowNext)
            {
                ShowNext = false;
            }

            AddHtmlLocalized(210, 35, 212, 45, Trap.GumpTitle, false, false);
            AddHtmlLocalized(210, 60, 212, 70, 1153748, false, false); // <center>Use the Directional Controls to</center>
            AddHtmlLocalized(210, 75, 212, 85, Trap.GumpDescription, false, false);

            if (Trap.CanDecipher && User.Skills[SkillName.Lockpicking].Base >= 100)
            {
                AddHtmlLocalized(405, 355, 150, 32, 1153750, false, false); // Attempt to Decipher the Circuit Path
                AddButton(365, 355, 4005, 4005, 5, GumpButtonType.Reply, 0);
            }

            AddButton(448, 185, 10700, 10701, 1, GumpButtonType.Reply, 0); // up
            AddButton(473, 222, 10710, 10711, 2, GumpButtonType.Reply, 0); // right
            AddButton(448, 243, 10720, 10721, 3, GumpButtonType.Reply, 0); // down
            AddButton(408, 222, 10730, 10731, 4, GumpButtonType.Reply, 0); // left
        }