コード例 #1
0
ファイル: Guild.cs プロジェクト: tflynt91/TrueUO
        public void RemoveAlly(Guild g)
        {
            if (Allies.Contains(g))
            {
                Allies.Remove(g);

                g.RemoveAlly(this);
            }
        }
コード例 #2
0
        public bool IsAlly(Guild g)
        {
            if (NewGuildSystem)
            {
                return(Alliance != null && Alliance.IsMember(this) && Alliance.IsMember(g));
            }

            return(Allies.Contains(g));
        }
コード例 #3
0
ファイル: Guild.cs プロジェクト: tflynt91/TrueUO
        public void AddAlly(Guild g)
        {
            if (!Allies.Contains(g))
            {
                Allies.Add(g);

                g.AddAlly(this);
            }
        }
コード例 #4
0
        public void RemoveAlly(PoliticalGroup other)
        {
            if (!Allies.Contains(other))
            {
                return;
            }

            Allies.Remove(other);
            AlliesRev.Remove(other);

            other.RemoveAlly(this);
        }
コード例 #5
0
        public void AddAlly(PoliticalGroup other)
        {
            if (Allies.Contains(other))
            {
                return;
            }

            Allies.Add(other);
            AlliesRev.Add(other);

            other.AddAlly(this);
        }
コード例 #6
0
ファイル: FightGame.cs プロジェクト: Kuh4ku/Mercybot
 public void Update(GameFightLeaveMessage message)
 {
     if (PlayedFighter?.ContextualId == message.CharId)
     {
         IsFightStarted = false;
     }
     else
     {
         var fighter = GetFighter(message.CharId);
         _fighters.TryRemove(fighter.ContextualId, out FighterEntry f);
         if (Allies.Contains(fighter))
         {
             _allies.TryRemove(fighter.ContextualId, out FighterEntry a);
         }
         else if (Ennemies.Contains(fighter))
         {
             _ennemies.TryRemove(fighter.ContextualId, out FighterEntry e);
         }
     }
 }
コード例 #7
0
 public bool IsAlly(Guild g) => NewGuildSystem?Alliance?.IsMember(this) == true && Alliance.IsMember(g) : Allies.Contains(g);
コード例 #8
0
        public static void BeforeLogLineRead(bool isImport, Advanced_Combat_Tracker.LogLineEventArgs logInfo)
        {
            string l = logInfo.logLine;

            try
            {
                DateTime timestamp = ParseLogDateTime(l);

                char[]   dt       = { '\t' };
                string[] logParts = l.Split(dt);
                int      flag     = Convert.ToInt32(logParts[2], 16);
                if (flag > 7)
                {
                    return;
                }

                string id = logParts[3];
                l = logParts[7];

                Match m;

                // open
                m = regex_open.Match(l);
                if (m.Success)
                {
                    string target = m.Groups["target"].Success ? DecodeString(m.Groups["target"].Value) : "";
                    encounter = target;
                    Advanced_Combat_Tracker.ActGlobals.oFormActMain.SetEncounter(timestamp, encounter, encounter);
                    NameClass.Clear();
                    Allies.Clear();
                    return;
                }

                // close
                m = regex_close.Match(l);
                if (m.Success)
                {
                    Advanced_Combat_Tracker.ActGlobals.oFormActMain.EndCombat(true);
                    // Advanced_Combat_Tracker.ActGlobals.oFormActMain.ChangeZone(encounter);
                    return;
                }

                // action
                if (!l.StartsWith(" →"))
                {
                    m = regex_action.Match(l);
                    if (m.Success)
                    {
                        actor  = m.Groups["actor"].Success ? DecodeString(m.Groups["actor"].Value) : "";
                        action = m.Groups["action"].Success ? DecodeString(m.Groups["action"].Value) : "";

                        if (!NameClass.ContainsKey(actor))
                        {
                            string raction = regex_rank.Replace(action, "");
                            if (SkillClass.ContainsKey(raction))
                            {
                                NameClass.Add(actor, SkillClass[raction]);
                            }
                        }

                        if ((id.Length > 0) && (actor.Length > 0) && !Allies.Contains(actor))
                        {
                            m = regex_foe.Match(l);
                            if (!m.Success)
                            {
                                // DQX_ACT_Plugin.LogParserMessage(" Add Allies: ." + actor+"."+action+"."+id+".");
                                Allies.Add(actor);
                            }
                        }

                        return;
                    }
                    m = regex_action2.Match(l);
                    if (m.Success)
                    {
                        actor  = "不明";
                        action = m.Groups["action"].Success ? DecodeString(m.Groups["action"].Value) : "";
                        return;
                    }

                    // death
                    m = regex_dead2.Match(l);
                    if (m.Success)
                    {
                        string target = m.Groups["target"].Success ? DecodeString(m.Groups["target"].Value) : "";
                        Advanced_Combat_Tracker.ActGlobals.oFormActMain.AddCombatAction(
                            (int)Advanced_Combat_Tracker.SwingTypeEnum.Healing,
                            false,
                            "",
                            "不明",
                            "Death",
                            Advanced_Combat_Tracker.Dnum.Death,
                            timestamp,
                            Advanced_Combat_Tracker.ActGlobals.oFormActMain.GlobalTimeSorter,
                            target,
                            "");
                        return;
                    }
                    return;
                }

                if (!Advanced_Combat_Tracker.ActGlobals.oFormActMain.InCombat)
                {
                    return;
                }

                // crit
                m = regex_crit.Match(l);
                if (m.Success)
                {
                    isCritical = true;
                    return;
                }

                // damage
                m = regex_hit.Match(l);
                if (m.Success)
                {
                    string target = m.Groups["target"].Success ? DecodeString(m.Groups["target"].Value) : "";

                    // if (Advanced_Combat_Tracker.ActGlobals.oFormActMain.SetEncounter(timestamp, actor, encounter))
                    {
                        MasterSwing ms = new MasterSwing(
                            (int)Advanced_Combat_Tracker.SwingTypeEnum.NonMelee,
                            isCritical,
                            "",
                            new Advanced_Combat_Tracker.Dnum(int.Parse(m.Groups["damage"].Value, System.Globalization.NumberStyles.AllowThousands)),
                            timestamp,
                            Advanced_Combat_Tracker.ActGlobals.oFormActMain.GlobalTimeSorter,
                            action,
                            actor,
                            "",
                            target);

                        Advanced_Combat_Tracker.ActGlobals.oFormActMain.AddCombatAction(ms);
                    }

                    isCritical = false;
                    return;
                }

                // miss
                m = regex_miss.Match(l);
                if (m.Success)
                {
                    string target = m.Groups["target"].Success ? DecodeString(m.Groups["target"].Value) : "";

                    //          if (Advanced_Combat_Tracker.ActGlobals.oFormActMain.SetEncounter(timestamp, actor, encounter))
                    {
                        Advanced_Combat_Tracker.ActGlobals.oFormActMain.AddCombatAction(
                            (int)Advanced_Combat_Tracker.SwingTypeEnum.NonMelee,
                            isCritical,
                            "",
                            actor,
                            action,
                            Advanced_Combat_Tracker.Dnum.Miss,
                            timestamp,
                            Advanced_Combat_Tracker.ActGlobals.oFormActMain.GlobalTimeSorter,
                            target,
                            "");
                    }
                    isCritical = false;
                    return;
                }

                // heal
                m = regex_heal.Match(l);
                if (m.Success)
                {
                    string target = m.Groups["target"].Success ? DecodeString(m.Groups["target"].Value) : "";

                    //          if (Advanced_Combat_Tracker.ActGlobals.oFormActMain.SetEncounter(timestamp, actor, encounter))
                    {
                        MasterSwing ms = new MasterSwing(
                            (int)Advanced_Combat_Tracker.SwingTypeEnum.Healing,
                            isCritical,
                            "",
                            new Advanced_Combat_Tracker.Dnum(int.Parse(m.Groups["damage"].Value, System.Globalization.NumberStyles.AllowThousands)),
                            timestamp,
                            Advanced_Combat_Tracker.ActGlobals.oFormActMain.GlobalTimeSorter,
                            action,
                            actor,
                            "",
                            target);

                        Advanced_Combat_Tracker.ActGlobals.oFormActMain.AddCombatAction(ms);
                    }

                    isCritical = false;
                    return;
                }

                // death
                m = regex_dead.Match(l);
                if (m.Success)
                {
                    string target = m.Groups["target"].Success ? DecodeString(m.Groups["target"].Value) : "";
                    //          if (Advanced_Combat_Tracker.ActGlobals.oFormActMain.SetEncounter(timestamp, actor, encounter))
                    {
                        Advanced_Combat_Tracker.ActGlobals.oFormActMain.AddCombatAction(
                            (int)Advanced_Combat_Tracker.SwingTypeEnum.Healing,
                            isCritical,
                            "",
                            actor,
                            "Death",
                            Advanced_Combat_Tracker.Dnum.Death,
                            timestamp,
                            Advanced_Combat_Tracker.ActGlobals.oFormActMain.GlobalTimeSorter,
                            target,
                            "");
                    }
                    isCritical = false;
                    return;
                }
            }
            catch (Exception ex)
            {
                string exception = ex.ToString().Replace(Environment.NewLine, " ");
                if (ex.InnerException != null)
                {
                    exception += " " + ex.InnerException.ToString().Replace(Environment.NewLine, " ");
                }

                DQX_ACT_Plugin.LogParserMessage("Error [LogParse.BeforeLogLineRead] " + exception + " " + logInfo.logLine);
            }

            // For debugging
            // if (!string.IsNullOrWhiteSpace(l))
            //   DQX_ACT_Plugin.LogParserMessage("Unhandled Line: " + logInfo.logLine);
        }