Skip to content

SwingHandlers refactor / audit

Doggo requested to merge itsmedoggo/2009scape:max-hit-audit into master

What has been done in this MR?

  • Rewrote the main swing handlers' formula functions to match the best known authentic formulae, and to follow pleasingly similar flows and appearance.
  • Fixed many issues in the swing handlers.
    • Most special swing handlers and the range swing handler had 1 less max hit than they should because RandomFunction.random() uses an exclusive upper bound, as well as other accuracy and damage inconsistencies.
    • Fixed what might be a confidential issue involving the strength skill cape.
    • Fixed the void ranger bonus, which should be 20%. This can be proven as the authentic max hit with a dark bow spec with dragon arrows, 99 range, ranging potion, eagle eye, and void ranger is 48, which is exactly the case only with the above changes. Video
    • Fixed granite maul spec not giving xp and ignoring protection prayers.
    • Fixed magic accuracy being too high.
    • Fixed all accuracy being too high.
    • Fixed set bonuses that boost Attack or Defence being applied twice or to all attacks.
    • Fixed ranged attacks not taking into account prayers that boost Defence or defensive attack styles.
    • Fixed red chinchompa having the same damage as normal chinchompas. Ammo slot ranged strength is only considered if the weapon uses it.
    • Fixed some specs being boosted by offensive prayers when they shouldn't be.
  • Misc.
    • ::calcmaxhit now says the max hit before the handler because it often gets cut off.
    • ::calc_accuracy renamed to ::calcaccuracy for consistency with other commands, and now also gives the actual hit chance.

What should testers check?

  • Combat should generally function the same as before.
  • Max hits for melee and ranged, for both players and monsters, should be exactly as you'd expect given the stats. Note that some monsters have swing handlers that were not included in this, like GWD bosses (perhaps a part 2 in the future).
  • All specs affected by the MR should work as documented and intended.
  • Ranged weapons that do not use ammo from the ammo slot (e.g. throwing knives, crystal bow, chins) should not benefit from ammo in the ammo slot.
  • I have tested these changes thoroughly.

  • I used the relevant Zaros tool for any JSON edits where possible, and have attached screenshots of any changes.

Edited by Doggo

Merge request reports