Exemple #1
0
        protected DamageModifier(string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, GeneralHelper.Source src, string icon, GainComputer gainComputer, DamageLogChecker dlChecker, ulong minBuild, ulong maxBuild, DamageModifierMode mode)
        {
            Tooltip      = tooltip;
            Name         = name;
            _dmgSrc      = damageSource;
            GainPerStack = gainPerStack;
            _compareType = compareType;
            _srcType     = srctype;
            Src          = src;
            Icon         = icon;
            GainComputer = gainComputer;
            DLChecker    = dlChecker;
            MaxBuild     = maxBuild;
            MinBuild     = minBuild;
            Mode         = mode;
            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";
            }
        }
        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);
        }
Exemple #3
0
        public override void ComputeDamageModifier(Dictionary <string, List <DamageModifierStat> > data, Dictionary <NPC, Dictionary <string, List <DamageModifierStat> > > 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 (NPC target in log.FightData.Logic.Targets)
            {
                if (!dataTarget.TryGetValue(target, out Dictionary <string, List <DamageModifierStat> > extra))
                {
                    dataTarget[target] = new Dictionary <string, List <DamageModifierStat> >();
                }
                Dictionary <string, List <DamageModifierStat> > dict = dataTarget[target];
                if (!dict.TryGetValue(Name, out List <DamageModifierStat> list))
                {
                    var extraDataList = new List <DamageModifierStat>();
                    for (int i = 0; i < phases.Count; i++)
                    {
                        int totalDamage = GetTotalDamage(p, log, target, i);
                        List <AbstractDamageEvent> typeHits = GetDamageLogs(p, log, target, phases[i]);
                        var effect = typeHits.Where(x => DLChecker(x)).ToList();
                        extraDataList.Add(new DamageModifierStat(effect.Count, typeHits.Count, gain * effect.Sum(x => x.Damage), totalDamage));
                    }
                    dict[Name] = extraDataList;
                }
            }
            data[Name] = new List <DamageModifierStat>();
            for (int i = 0; i < phases.Count; i++)
            {
                int totalDamage = GetTotalDamage(p, log, null, i);
                List <AbstractDamageEvent> typeHits = GetDamageLogs(p, log, null, phases[i]);
                var effect = typeHits.Where(x => DLChecker(x)).ToList();
                data[Name].Add(new DamageModifierStat(effect.Count, typeHits.Count, gain * effect.Sum(x => x.Damage), totalDamage));
            }
        }
Exemple #4
0
 public DamageLogDamageModifier(string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, string icon, DamageLogChecker checker, GainComputer gainComputer, ulong minBuild, ulong maxBuild) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, icon, gainComputer, checker, minBuild, maxBuild)
 {
 }
Exemple #5
0
 public DamageLogDamageModifier(string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, string icon, DamageLogChecker checker, GainComputer gainComputer) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, icon, gainComputer, checker, ulong.MinValue, ulong.MaxValue)
 {
 }
Exemple #6
0
 public BuffDamageModifierTarget(long[] ids, long[] playerIds, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, GeneralHelper.Source src, GainComputer gainComputer, GainComputer gainComputerPlayer, string icon, ulong minBuild, ulong maxBuild, DamageModifierMode mode, DamageLogChecker dlChecker = null) : this(ids, name, tooltip, damageSource, gainPerStack, srctype, compareType, src, gainComputer, icon, minBuild, maxBuild, mode, dlChecker)
 {
     _trackerPlayer      = new BuffsTrackerMulti(new List <long>(playerIds));
     _gainComputerPlayer = gainComputerPlayer;
 }
Exemple #7
0
 public BuffDamageModifierTarget(long id, long playerId, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, GeneralHelper.Source src, GainComputer gainComputer, GainComputer gainComputerPlayer, string icon, DamageModifierMode mode, DamageLogChecker dlChecker = null) : this(id, name, tooltip, damageSource, gainPerStack, srctype, compareType, src, gainComputer, icon, mode, dlChecker)
 {
     _trackerPlayer      = new BuffsTrackerSingle(playerId);
     _gainComputerPlayer = gainComputerPlayer;
 }
Exemple #8
0
 public BuffDamageModifierTarget(long[] ids, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, GeneralHelper.Source src, GainComputer gainComputer, string icon, ulong minBuild, ulong maxBuild, DamageModifierMode mode, DamageLogChecker dlChecker = null) : base(ids, name, tooltip, damageSource, gainPerStack, srctype, compareType, src, gainComputer, icon, minBuild, maxBuild, mode, dlChecker)
 {
 }
 public BuffDamageModifier(long[] ids, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, GeneralHelper.Source src, GainComputer gainComputer, string icon, ulong minBuild, ulong maxBuild, DamageModifierMode mode, DamageLogChecker dlChecker = null) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, icon, gainComputer, dlChecker, minBuild, maxBuild, mode)
 {
     Tracker = new BuffsTrackerMulti(new List <long>(ids));
 }
 public BuffDamageModifier(long id, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, GeneralHelper.Source src, GainComputer gainComputer, string icon, DamageModifierMode mode, DamageLogChecker dlChecker = null) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, icon, gainComputer, dlChecker, ulong.MinValue, ulong.MaxValue, mode)
 {
     Tracker = new BuffsTrackerSingle(id);
 }
Exemple #11
0
 public BuffDamageModifier(long[] ids, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, string icon, DamageLogChecker dlChecker = null) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, icon, gainComputer, dlChecker, ulong.MinValue, ulong.MaxValue)
 {
     Tracker = new BuffsTrackerMulti(new List <long>(ids));
 }
Exemple #12
0
 public BuffDamageModifier(long id, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, string icon, ulong minBuild, ulong maxBuild, DamageLogChecker dlChecker = null) : base(name, tooltip, damageSource, gainPerStack, srctype, compareType, src, icon, gainComputer, dlChecker, minBuild, maxBuild)
 {
     Tracker = new BuffsTrackerSingle(id);
 }
Exemple #13
0
 public BuffDamageModifierTarget(long[] ids, string name, string tooltip, DamageSource damageSource, double gainPerStack, DamageType srctype, DamageType compareType, ModifierSource src, GainComputer gainComputer, string icon, DamageLogChecker dlChecker = null) : base(ids, name, tooltip, damageSource, gainPerStack, srctype, compareType, src, gainComputer, icon, dlChecker)
 {
 }