public static readonly float DefaultMaxVelocity = 20.0f; // ? public float GetMaxMissileRange() { var weapon = GetEquippedWeapon(); var maxVelocity = weapon != null?weapon.GetProperty(PropertyFloat.MaximumVelocity) ?? DefaultMaxVelocity : DefaultMaxVelocity; //var missileRange = (float)Math.Pow(maxVelocity, 2.0f) * 0.1020408163265306f; var missileRange = (float)Math.Pow(maxVelocity, 2.0f) * 0.0682547266398198f; var strengthMod = SkillFormula.GetAttributeMod(PropertyAttribute.Strength, (int)Strength.Current); var maxRange = Math.Min(missileRange * strengthMod, MissileRangeCap); // any kind of other caps for monsters specifically? // throwing lugian rocks @ 85 yards seems a bit far... //Console.WriteLine($"{Name}.GetMaxMissileRange(): maxVelocity={maxVelocity}, strengthMod={strengthMod}, maxRange={maxRange}"); // for client display /*var maxRangeYards = maxRange * MetersToYards; * if (maxRangeYards >= 10.0f) * maxRangeYards -= maxRangeYards % 5.0f; * else * maxRangeYards = (float)Math.Ceiling(maxRangeYards);*/ return(maxRange); }
/// <summary> /// Returns the attribute damage bonus for a physical attack /// </summary> /// <param name="attackType">Uses strength for melee, coordination for missile</param> public float GetAttributeMod(WorldObject weapon) { var isBow = weapon != null && weapon.IsBow; //var attribute = isBow || GetCurrentWeaponSkill() == Skill.FinesseWeapons ? Coordination : Strength; var attribute = isBow || weapon?.WeaponSkill == Skill.FinesseWeapons ? Coordination : Strength; return(SkillFormula.GetAttributeMod((int)attribute.Current, isBow)); }
/// <summary> /// Returns the attribute damage bonus for a physical attack /// </summary> /// <param name="attackType">Uses strength for melee, coordination for missile</param> public float GetAttributeMod(WorldObject weapon) { if (weapon != null && weapon.IsBow) { return(SkillFormula.GetAttributeMod(PropertyAttribute.Coordination, (int)Coordination.Current)); } else { return(SkillFormula.GetAttributeMod(PropertyAttribute.Strength, (int)Strength.Current)); } }
/// <summary> /// Returns the attribute damage bonus for a physical attack /// </summary> /// <param name="attackType">Uses strength for melee, coordination for missile</param> public float GetAttributeMod(AttackType attackType) { if (attackType == AttackType.Melee) { return(SkillFormula.GetAttributeMod(PropertyAttribute.Strength, (int)Strength.Current)); } else if (attackType == AttackType.Missile) { return(SkillFormula.GetAttributeMod(PropertyAttribute.Coordination, (int)Coordination.Current)); } else { return(1.0f); } }