コード例 #1
0
        protected double ComputeGain(int stack, DamageLog dl)
        {
            if (DLChecker != null && !DLChecker(dl))
            {
                return(-1.0);
            }
            double gain = GainComputer.ComputeGain(GainPerStack, stack);

            return(gain > 0.0 ? gain * dl.Damage : -1.0);
        }
コード例 #2
0
        protected DamageModifier(string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, string url, GainComputer gainComputer, DamageLogChecker dlChecker = null)
        {
            Tooltip      = tooltip;
            Name         = name;
            _dmgSrc      = damageSource;
            GainPerStack = gainPerStack;
            _compareType = compareType;
            _srcType     = srctype;
            Src          = src;
            Url          = url;
            GainComputer = gainComputer;
            DLChecker    = dlChecker;
            switch (_dmgSrc)
            {
            case DamageSource.All:
                Tooltip += "<br>Actor + Minions";
                break;

            case DamageSource.NoPets:
                Tooltip += "<br>No Minions";
                break;
            }
            switch (_srcType)
            {
            case DamageType.All:
                Tooltip += "<br>All Damage type";
                break;

            case DamageType.Power:
                Tooltip += "<br>Power Damage only";
                break;

            case DamageType.Condition:
                Tooltip += "<br>Condition Damage only";
                break;
            }
            switch (_compareType)
            {
            case DamageType.All:
                Tooltip += "<br>Compared against All Damage";
                break;

            case DamageType.Power:
                Tooltip += "<br>Compared against Power Damage";
                break;

            case DamageType.Condition:
                Tooltip += "<br>Compared against Condition Damage";
                break;
            }
        }
コード例 #3
0
        public override void ComputeDamageModifier(Dictionary <string, List <DamageModifierData> > data, Dictionary <Target, Dictionary <string, List <DamageModifierData> > > dataTarget, Player p, ParsedLog log)
        {
            List <PhaseData> phases = log.FightData.GetPhases(log);
            double           gain   = double.IsPositiveInfinity(GainPerStack) ? 1.0 : GainComputer.ComputeGain(GainPerStack, 1);

            if (!p.GetDamageLogs(null, log, phases[0]).Exists(x => DLChecker(x)))
            {
                return;
            }
            foreach (Target target in log.FightData.Logic.Targets)
            {
                if (!dataTarget.TryGetValue(target, out var extra))
                {
                    dataTarget[target] = new Dictionary <string, List <DamageModifierData> >();
                }
                Dictionary <string, List <DamageModifierData> > dict = dataTarget[target];
                if (!dict.TryGetValue(Name, out var list))
                {
                    List <DamageModifierData> extraDataList = new List <DamageModifierData>();
                    for (int i = 0; i < phases.Count; i++)
                    {
                        int totalDamage           = GetTotalDamage(p, log, target, i);
                        List <DamageLog> typeHits = GetDamageLogs(p, log, target, phases[i]);
                        List <DamageLog> effect   = typeHits.Where(x => DLChecker(x)).ToList();
                        extraDataList.Add(new DamageModifierData(effect.Count, typeHits.Count, gain * effect.Sum(x => x.Damage), totalDamage));
                    }
                    dict[Name] = extraDataList;
                }
            }
            data[Name] = new List <DamageModifierData>();
            for (int i = 0; i < phases.Count; i++)
            {
                int totalDamage           = GetTotalDamage(p, log, null, i);
                List <DamageLog> typeHits = GetDamageLogs(p, log, null, phases[i]);
                List <DamageLog> effect   = typeHits.Where(x => DLChecker(x)).ToList();
                data[Name].Add(new DamageModifierData(effect.Count, typeHits.Count, gain * effect.Sum(x => x.Damage), totalDamage));
            }
        }
コード例 #4
0
 public DamageLogDamageModifier(Boon boon, string tooltip, long id, DamageSource damageSource, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer) : base(boon.Name, tooltip, damageSource, double.PositiveInfinity, srctype, compareType, src, boon.Link, gainComputer)
 {
     DLChecker = (dl => dl.SkillId == id);
 }
コード例 #5
0
 public DamageLogDamageModifier(string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, string url, DamageLogChecker checker, GainComputer gainComputer) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, url, gainComputer)
 {
     DLChecker = checker;
 }
コード例 #6
0
 public BuffDamageModifier(Boon buff, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, string url, DamageLogChecker dlChecker) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, url, gainComputer, dlChecker)
 {
     BuffsChecker = new BuffsTrackerSingle(buff);
 }
コード例 #7
0
 public BuffDamageModifierTarget(Boon buff, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, string url, DamageLogChecker dlChecker) : base(buff, name, tooltip, damageSource, gainPerStack, srctype, compareType, src, gainComputer, url, dlChecker)
 {
 }