Пример #1
0
        private IFight GetAppropriateFight(Heal line)
        {
            // A heal line just applies to the last fight
            // It's a PC/Merc that's healing another PC/Merc
            // Except when it's a mob healing itself ... or healing a companion fighter...
            // Would a PC ever heal a Mob or vice versa? Maybe for a charmed pet ... but that's going to be a pain in the ass anyway

            if (Fights.Any() && (IsCharacterPlayerOrMerc(line.Healer) || IsCharacterPlayerOrMerc(line.Patient)))
            {
                // Apply the heal to the first active fight, or the last fight (that's inactive)
                return(Fights.FirstOrDefault(x => !x.IsFightOver)
                       ?? Fights.Last());
            }

            return(GetAppropriateFight(line.Healer, line.Patient));
        }
Пример #2
0
 public Combat FindFight(NonPlayer npc)
 {
     return(Fights.FirstOrDefault(f => f.GetMobs().Contains(npc)));
 }
Пример #3
0
 public Combat FindFight(Player player)
 {
     return(Fights.FirstOrDefault(f => f.GetFighters().Contains(player)));
 }