Пример #1
0
        public static DamageModifierContainer GetWeaponAdvantageModifier(IAbility ability, IGameUnit attacker, IGameUnit target)
        {
            // Get the direction of the advantage of this ability used by the attacker vs the target
            var direction = GetWeaponAdvantageDirection(GetCategoryForAbility(ability, attacker), target.WeaponAdvantageCategory);

            // If there's no advantage thent here's no modifier to apply for weapon triangle purposes
            if (direction == 0)
            {
                return(null);
            }

            // Otherwise create a container based on weapon advantage
            var modifier = new DamageModifierContainer()
            {
                Name = "WEAPON_ADVANTAGE"
            };

            if (direction > 0)
            {
                // Weapon advantage for attacker
                modifier.DamageMultiplier = 1.1f;
                modifier.HitRateModifier  = 10;
            }
            else
            {
                // Weapon advantage for target
                modifier.DamageMultiplier = 0.8f;
                modifier.HitRateModifier  = -10;
            }
            return(modifier);
        }
Пример #2
0
        public ParsedLog(LogData logData, FightData fightData, AgentData agentData, SkillData skillData,
                         CombatData combatData, List <Player> playerList, Target target)
        {
            LogData          = logData;
            FightData        = fightData;
            AgentData        = agentData;
            SkillData        = skillData;
            CombatData       = combatData;
            PlayerList       = playerList;
            BoonSourceFinder = Boon.GetBoonSourceFinder(logData.GW2Version);
            LegacyTarget     = target;
            MechanicData     = new MechanicData(fightData);
            PlayerListBySpec = playerList.GroupBy(x => x.Prof).ToDictionary(x => x.Key, x => x.ToList());
            PlayerIDs        = new HashSet <ushort>(playerList.Select(x => x.InstID));
            FightData.SetSuccess(this);
            FightData.SetCM(this);
            CombatData.Update(FightData.FightEnd);
            if (FightData.FightDuration <= 2200)
            {
                throw new TooShortException();
            }
            if (Properties.Settings.Default.SkipFailedTries && !FightData.Success)
            {
                throw new SkipException();
            }

            // init combat replay
            if (Properties.Settings.Default.ParseCombatReplay && FightData.Logic.CanCombatReplay)
            {
                foreach (Player p in PlayerList)
                {
                    if (p.Account == ":Conjured Sword")
                    {
                        continue;
                    }
                    p.InitCombatReplay(this, GeneralHelper.PollingRate, false, true);
                }
                foreach (Target tar in FightData.Logic.Targets)
                {
                    tar.InitCombatReplay(this, GeneralHelper.PollingRate, true, FightData.GetMainTargets(this).Contains(tar));
                }
                FightData.Logic.InitTrashMobCombatReplay(this, GeneralHelper.PollingRate);

                // Ensuring all combat replays are initialized before extra data (and agent interaction) is computed
                foreach (Player p in PlayerList)
                {
                    if (p.Account == ":Conjured Sword")
                    {
                        continue;
                    }
                    p.ComputeAdditionalCombatReplayData(this);
                }
                foreach (Target tar in FightData.Logic.Targets)
                {
                    tar.ComputeAdditionalCombatReplayData(this);
                }
                foreach (Mob mob in FightData.Logic.TrashMobs)
                {
                    mob.ComputeAdditionalCombatReplayData(this);
                }
            }
            FightData.Logic.ComputeMechanics(this);
            Statistics      = new Statistics(this);
            DamageModifiers = new DamageModifierContainer(logData.GW2Version);
        }