Exemple #1
0
        private void OnCastEnded(bool _, LogLineEventArgs logInfo)
        {
            if (state != States.In905P)
            {
                return;
            }
            string log = logInfo.logLine;
            Match  m   = OnCast2.Match(log);

            if (m.Success)
            {
                lock (lock1)
                {
                    uint id = Convert.ToUInt32(m.Groups[1].Value, 16);
                    if (map.ContainsKey(id))
                    {
                        int index = map[id];
                        Pod pod   = pods[index];
                        if (pod.isActive)
                        {
                            pod.isActive = false;
                            count--;
                            PlaceKupo.Log("辅助机" + id.ToString("X") + "已施放" + (pod.isLaser ? "激光。" : "重锤。"));
                        }
                    }
                    if (count == 0)
                    {
                        PlaceKupo.WriteWaymark(Preset.Reset);
                        PlaceKupo.Log("场地标点已重置。");
                    }
                }
            }
        }
Exemple #2
0
        private void OnTeleportCasted(bool _, LogLineEventArgs logInfo)
        {
            if (state != States.In2P)
            {
                return;
            }
            string log = logInfo.logLine;
            Match  m   = OnTeleport.Match(log);

            if (m.Success)
            {
                lock (lock2)
                {
                    uint id1 = Convert.ToUInt32(m.Groups[1].Value, 16);
                    uint id2 = Convert.ToUInt32(m.Groups[2].Value, 16);
                    if (list == null)
                    {
                        list = PlaceKupo.repository.GetCombatantList();
                    }
                    var cmb = list.FirstOrDefault(x => x.ID == id1);
                    if (cmb != null)
                    {
                        MarkExistence(cmb.PosX, cmb.PosY, 1);
                        PlaceKupo.Log(string.Format("已添加 {3}({4}): ({0},{1},{2})", cmb.PosX.ToString(), cmb.PosZ.ToString(), cmb.PosY.ToString(), cmb.Name, cmb.ID.ToString("X")));
                    }
                    cmb = list.FirstOrDefault(x => x.ID == id2);
                    if (cmb != null)
                    {
                        MarkExistence(cmb.PosX, cmb.PosY, -1);
                        PlaceKupo.Log(string.Format("已移除 {3}({4}): ({0},{1},{2})", cmb.PosX.ToString(), cmb.PosZ.ToString(), cmb.PosY.ToString(), cmb.Name, cmb.ID.ToString("X")));
                    }
                    teleport++;
                    if (teleport == 2)
                    {
                        int cnt = 0;
                        for (int i = 0; i < 4; i++)
                        {
                            if (Xnum[i] == 0)
                            {
                                for (int j = 0; j < 4; j++)
                                {
                                    if (Znum[j] == 0)
                                    {
                                        PlaceKupo.WriteWaymark(new Waymark(Xenum[i], -480F, Zenum[j], 0, true), cnt++);
                                        PlaceKupo.Log(string.Format("已标记安全点: ({0},-480,{1})。", Xenum[i], Zenum[j]));
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #3
0
        private void OnCastStarted(uint _, int type, string log)
        {
            if (state != States.In905P)
            {
                return;
            }
            if (type != 20)
            {
                return;            //20
            }
            Match m = OnCast1.Match(log);

            if (m.Success)
            {
                lock (lock1)
                {
                    bool isLaser = m.Groups[2].Value == "4FF0";
                    uint id      = Convert.ToUInt32(m.Groups[1].Value, 16);
                    if (map.ContainsKey(id))
                    {
                        int index = map[id];
                        Pod pod   = pods[index];
                        pod.isActive = true;
                        pod.isLaser  = isLaser;
                        count++;
                        PlaceKupo.Log("辅助机" + id.ToString("X") + "开始咏唱" + (isLaser ? "激光。" : "重锤。"));
                    }
                    if (count == 8)
                    {
                        int cnt = 0;
                        for (int i = 0; i < 8; i++)
                        {
                            var x = pods[i];
                            var y = pods[(i + 1) % 8];
                            if (x.isActive && y.isActive && x.isLaser && y.isLaser)
                            {
                                Point mid = Point.Midpoint(x.Loc, y.Loc);
                                PlaceKupo.WriteWaymark(new Waymark(mid, 0, true), cnt++);
                                PlaceKupo.Log("已标记安全点: " + mid.ToString());
                            }
                        }
                    }
                }
            }
        }