Exemplo n.º 1
0
        protected DamageModifier(string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, string url, GainComputer gainComputer, DamageLogChecker dlChecker, ulong minBuild, ulong maxBuild)
        {
            Tooltip      = tooltip;
            Name         = name;
            _dmgSrc      = damageSource;
            GainPerStack = gainPerStack;
            _compareType = compareType;
            _srcType     = srctype;
            Src          = src;
            Url          = url;
            GainComputer = gainComputer;
            DLChecker    = dlChecker;
            MaxBuild     = maxBuild;
            MinBuild     = minBuild;
            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;
            }
            if (!Multiplier)
            {
                Tooltip += "<br>Non multiplier";
            }
        }
Exemplo n.º 2
0
        protected double ComputeGain(int stack, AbstractDamageEvent dl)
        {
            if (DLChecker != null && !DLChecker(dl))
            {
                return(-1.0);
            }
            double gain = GainComputer.ComputeGain(GainPerStack, stack);

            return(gain > 0.0 ? gain * dl.Damage : -1.0);
        }
Exemplo n.º 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   = 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 <AbstractDamageEvent> typeHits = GetDamageLogs(p, log, target, phases[i]);
                        List <AbstractDamageEvent> 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 <AbstractDamageEvent> typeHits = GetDamageLogs(p, log, null, phases[i]);
                List <AbstractDamageEvent> effect   = typeHits.Where(x => DLChecker(x)).ToList();
                data[Name].Add(new DamageModifierData(effect.Count, typeHits.Count, gain * effect.Sum(x => x.Damage), totalDamage));
            }
        }
Exemplo n.º 4
0
 public BuffDamageModifierTarget(long[] ids, long[] playerIds, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, GainComputer gainComputerPlayer, string url, ulong minBuild, ulong maxBuild, DamageLogChecker dlChecker = null) : this(ids, name, tooltip, damageSource, gainPerStack, srctype, compareType, src, gainComputer, url, minBuild, maxBuild, dlChecker)
 {
     _trackerPlayer      = new BuffsTrackerMulti(new List <long>(playerIds));
     _gainComputerPlayer = gainComputerPlayer;
 }
Exemplo n.º 5
0
 public BuffDamageModifierTarget(long[] ids, long playerId, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, GainComputer gainComputerPlayer, string url, DamageLogChecker dlChecker = null) : this(ids, name, tooltip, damageSource, gainPerStack, srctype, compareType, src, gainComputer, url, dlChecker)
 {
     _trackerPlayer      = new BuffsTrackerSingle(playerId);
     _gainComputerPlayer = gainComputerPlayer;
 }
Exemplo n.º 6
0
 public BuffDamageModifierTarget(long[] ids, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, string url, ulong minBuild, ulong maxBuild, DamageLogChecker dlChecker = null) : base(ids, name, tooltip, damageSource, gainPerStack, srctype, compareType, src, gainComputer, url, minBuild, maxBuild, dlChecker)
 {
 }
Exemplo n.º 7
0
 public BuffDamageModifier(long[] ids, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, string url, ulong minBuild, ulong maxBuild, DamageLogChecker dlChecker = null) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, url, gainComputer, dlChecker, minBuild, maxBuild)
 {
     Tracker = new BuffsTrackerMulti(new List <long>(ids));
 }
Exemplo n.º 8
0
 public BuffDamageModifier(long id, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, string url, DamageLogChecker dlChecker = null) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, url, gainComputer, dlChecker, ulong.MinValue, ulong.MaxValue)
 {
     Tracker = new BuffsTrackerSingle(id);
 }
Exemplo n.º 9
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, checker, ulong.MinValue, ulong.MaxValue)
 {
 }
Exemplo n.º 10
0
 public DamageLogDamageModifier(string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, string url, DamageLogChecker checker, GainComputer gainComputer, ulong minBuild, ulong maxBuild) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, url, gainComputer, checker, minBuild, maxBuild)
 {
 }