Ejemplo n.º 1
0
        public static void ApplyBaseAttack(ISimulationData data, SimulationSampleSet sampleSet, IEntity target)
        {
            float min = GetMinDamage(data);
            float max = GetMaxDamage(data);

            bool isCritical = ApplyCritical(data, ref min, ref max);

            float damage = data.Random(min, max);
            ApplyDamage(data, target, damage);
            sampleSet.AddDamage(D3DamageType.Physical, damage, isCritical);
        }
Ejemplo n.º 2
0
        public static void ApplySkillAttack(ISimulationData data, SimulationSampleSet sampleSet, IEntity target, bool isPrimary)
        {
            float skillMultiplier = data.SelectedSkill.GetValue(D3SkillAttribute.DmgBonusPrimary) / 100.0f;
            if (!isPrimary)
            {
                float secondaryMultiplier = data.SelectedSkill.GetValue(D3SkillAttribute.DmgBonusSecondary) / 100.0f;
                if (secondaryMultiplier > 0.0f)
                {
                    skillMultiplier = secondaryMultiplier;
                }
            }

            float min = GetMinDamage(data) * skillMultiplier;
            float max = GetMaxDamage(data) * skillMultiplier;

            bool isCritical = ApplyCritical(data, ref min, ref max);

            float damage = data.Random(min, max);
            ApplyDamage(data, target, damage);
            sampleSet.AddDamage(D3DamageType.Physical, damage, isCritical);
        }