Commit Graph
10 Commits
Author SHA1 Message Date
Levi Schuck 96c3f07c4b Fix level 126 next goal to be max XP (200,000,000) instead of -1 xp 2018-07-24 10:50:36 -05:00
Levi Schuck f0e35fcd6d Add feature to pause skill timers on logout or after idle period 2018-07-18 20:23:26 -04:00
Levi Schuck aa8d2e5b1f Add dimming UI to progress bar 2018-07-18 19:08:20 -04:00
Levi Schuck 18215a070d Switch to safer division method without floats
Use custom formatter since LocalTime.toString rolls over the amount of days.
2018-05-20 15:01:23 -05:00
Levi Schuck d2440f9c66 Fix til next level time for low xp amounts
Cause:
Time til next level relied on xp per hour being divided by 3600
(seconds in an hour). For XP rates under 3600 per hour, this would
result in a divide by zero.

Solution:
Use floats and rely on an xp per second implementation that works on
seconds instead of hours.

It appears to work as expected.
![image](https://user-images.githubusercontent.com/245911/40274136-f8f61314-5b94-11e8-8d22-03b40b6108ff.png)
2018-05-19 18:51:27 -05:00
Levi Schuck b7a59d0558 FPS plugin: fix startup not applying limits
Issue:
@deathbeam reported that the limits were not applying immediately after start up
and this required dirtying the config manually to get it to apply.

Problem:
The draw listener expects `reloadConfig` to be called prior to its active use, so it is also an initalizing method.
`reloadConfig` was only being called if the config changed, and not when the plugin was activated.

Solution:
Call `reloadConfig` when the plugin is activated so it has been initialized.
2018-05-05 12:20:12 -05:00
Levi Schuck b52025ae72 Fix negative total XP calculation when skill starts
Closes #1734

Summary:
If you start a skill like fishing lobster after logging in,
you will have the xpGained value as `90`.
But, since you just started the skill, it will divide by `0`.
This results in the max integer value of `2147483647`.

If you did fletching before fishing, and had a XP per hour of `40000`.
Then when you add the fishing XP per hour of `2147483647`, the
result overflows and you get a negative number as the total XP per hour.

Solution:
Don't divide by zero, instead suppose that the skill has been active
for **at least** 60 seconds. This will result in a fair estimate that
improves as the skill continues to be used, rather than the ridiculous
estimate of 2 Billion one second and 200K the next second.

60 seconds is chosen over 1 or 5 or 10 seconds as the result is more
conservative and closer matches my hourly XP experiences.
2018-05-02 17:42:46 -05:00
Levi Schuck db4830e83a Sort Fishing spots by distance from camera
The default sort of fishing spots ends up drawing further things on top
of closer things, as it has no relation to the camera.

To solve this, convert the camera point to a `LocalPoint` and then
sort by comparing local points from the NPC to the camera's point.
However, the sort is inverted by `-1 *` so that further things are drawn
first, and closer things are drawn last--this way closer things are
always on top.

Fixes #1737
2018-04-21 15:08:35 -05:00
Levi Schuck f287cf7721 Reset XP on log-in of another character / mode 2018-04-09 23:04:28 -05:00
Levi Schuck d184a908f7 Lumbridge npcs have some bad compositions and return null in the dev tools. 2018-04-08 17:25:10 -04:00