Exemple #1
0
        public static void SwitchCastableToParty()
        {
            ClearCastable();

            foreach (var ally in CastableParty.OrderBy(a => a.GetHealingWeight()))
            {
                AddAllyToCastable(ally);
            }
        }
Exemple #2
0
        public static void UpdateAllies(Action extensions = null)
        {
            CastableParty.Clear();
            ClearCastable();

            if (!Globals.InParty)
            {
                if (Globals.InGcInstance)
                {
                    CastableParty.Add(Core.Me);

                    foreach (var ally in GameObjectManager.GetObjectsOfType <BattleCharacter>().Where(r => !r.CanAttack))
                    {
                        //if (!ally.IsTargetable || !ally.InLineOfSight() || ally.Icon == PlayerIcon.Viewing_Cutscene)
                        //TODO: This is a temporary fix for wrong PlayerIcon Enum: 15 = Viewing_Cutscene
                        if (!ally.IsTargetable || !ally.InLineOfSight() || ally.Icon == (PlayerIcon)15)
                        {
                            continue;
                        }

                        if (BaseSettings.Instance.PartyMemberAuraHistory)
                        {
                            UpdatePartyMemberHistory(ally);
                        }

                        CastableParty.Add(ally);
                    }
                }
            }

            foreach (var ally in PartyManager.RawMembers.Select(r => r.BattleCharacter))
            {
                if (ally == null)
                {
                    continue;
                }

                if (BaseSettings.Instance.DebugHealingListsPrintToLog == true)
                {
                    Logger.WriteInfo($@"[Debug] PartyManager {ally.Name} is a valid Party Member in PartyManager.");
                }

                //if (!ally.IsTargetable || !ally.InLineOfSight() || ally.Icon == PlayerIcon.Viewing_Cutscene)
                //TODO: This is a temporary fix for wrong PlayerIcon Enum: 15 = Viewing_Cutscene
                if (!ally.IsTargetable || !ally.InLineOfSight() || ally.Icon == (PlayerIcon)15)
                {
                    continue;
                }

                if (BaseSettings.Instance.PartyMemberAuraHistory)
                {
                    UpdatePartyMemberHistory(ally);
                }


                if (WorldManager.InPvP)
                {
                    if (ally.HasAura(Auras.MountedPvp))
                    {
                        continue;
                    }
                }

                CastableParty.Add(ally);
            }

            /*if (CastableParty.Count() < PartyManager.NumMembers)
             * {
             *  Logger.WriteInfo("Mismatch in Castable Party Count:");
             *  Logger.WriteInfo($"CastableParty: {String.Join(", ",CastableParty.Select(x => x.Name))}");
             *  Logger.WriteInfo($"PartyManager: {String.Join(", ",PartyManager.AllMembers.Select(x => x.Name))}");
             * }*/

            foreach (var ally in CastableParty.OrderBy(a => a.GetHealingWeight()))
            {
                AddAllyToCastable(ally);
            }

            extensions?.Invoke();
        }