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); }
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); }
public static bool CheckForCritical(ISimulationData data) { float rate = data.AttributeSet.GetValue(D3Attribute.CritRate) / 100.0f; return data.Random() <= rate; }