# Description

Adds some logging and sanity checking to the inputs for the glimmer
system in an attempt to get it to stop outputting NaN glimmer.
# Changelog
No CL this isn't player facing.
---------
Co-authored-by: Timfa <timfalken@hotmail.com>
(cherry picked from commit 64c6c7b87568b52dd91ed22d94672f89c4f88794)
# Description
Fixes two bugs with Psionics, namely that the "Roller Exempt" psionic
variants were infact still able to roll new powers. Now the Roller
Exemption cuts them off completely from generating Potentia. I'll
probably revisit this exit at a later date if I come up with some
alternative uses for Potentia.
I also fixed a bug where probers would lock glimmer into one place,
rather than cause glimmer to steadily increase towards a given
equilibrium point(vs. the current linear decay rate).
# Changelog
🆑
- fix: Fixed a bug where Probers were locking glimmer at a set number.
- fix: Fixed a bug where Elementalists could still roll for new powers.
(cherry picked from commit 559c04fb5b55f65f0db34833282b4e92b801dc49)
# Description
This isn't fixing all of them by the way, I still need to completely
rewrite the equations for the glimmer generating structures so the math
there isn't completely terrible. This fixes a few bugs related to the
glimmer system, such as linear decay not being consistent regardless of
server ping, and also glimmer generating structures also not being
consistent based on server ping. Both are now correctly differentiated
with respect to time.
Problem though is that the glimmer generator math is still extremely
awful, so that's going to need a rewrite.
After deeply analyzing the glimmer equations, I figured out that they
were being screwed over by floating point precision limits, so to
address this I made Glimmer work on doubles instead.
I also fixed a bug where generating enough Potentia to gain two or more
powers in a single draw caused the user to permanently lose their
ability to generate new powers. It's not abundantly clear why this was
happening, because nothing changed this code at all since I last touched
it.
# Changelog
🆑
- fix: Fixed various bugs with psionics.
- fix: Fixed a bug where if you generated enough Potentia during a drug
induced psionics roll to gain two powers, you would only gain one power
instead, while permanently losing the ability to gain new powers.
- fix: Fixed glimmer being permanently stuck between 500 and 600 by
revisiting the math and discovering an algebra error I made a year ago.
- tweak: Glimmer now operates on double precision. Have fun with that
breaking change if you made any psionic code downstream. Hint, you can
cast doubles into a (float) if you don't wish to convert your system to
double.
(cherry picked from commit 43e333ec41ca1706f3c204ef994351d69fd5c28c)
# Description
These weren't sanitized because I woefully assumed that nothing could
actually escape the bounds of an asymptote equation. Lo' and behold
floating point precision rounding errors can.

# Changelog
🆑
- fix: Fixed an issue where Glimmer can reach infinite values under
certain conditions.
(cherry picked from commit 641b99d5689a423c38a728ecaf8c4c2b4db13053)

# Changelog
<!--
You can add an author after the `🆑` to change the name that appears
in the changelog (ex: `🆑 Death`)
Leaving it blank will default to your GitHub display name
This includes all available types for the changelog
-->
🆑
- fix: Fixed full glimmer float being displayed to chat by Sophia.
(cherry picked from commit 3a6de6ca83649efe5d46e9c6ab880d747c2e1a0a)
# Description
This PR brings back a feature that was present in the Psionic Refactor
Version 1, which ultimately never made it into the game. I have
substantially reworked the underlying math behind Glimmer, such that it
operates on a Logistic Curve described by this equation:

Instead of 0 being the "Normal" amount of glimmer, the "Normal" amount
is the "seemingly arbitrary" number 502.941. This number is measured
first by taking the derivative of the Glimmer Equation, and then solving
for the derivative equal to 1. Above this constant, glimmer grows
exponentially more difficult to increase. Below this constant, glimmer
grows exponentially easier to increase. It will thus constantly attempt
to trend towards the "Glimmer Equilibrium".
Probers, Drainers, Anomalies, and Glimmer Mites all cause glimmer to
"Fluctuate", either up or down the graph. This gives a glimmer that
swings constantly to both high and low values, with more violent swings
being caused by having more probers/anomalies etc. A great deal of math
functions have been implemented that allow for various uses for glimmer
measurements, and psionic powers can even have their effects modified by
said measurements.
The most significant part of this rework is what's facing Epistemics.
It's essentially no longer possible for Probers to cause a round-ending
chain of events known as "Glimmerloose". You can ALWAYS recover from
high glimmer, no matter how high it gets. As a counterpart to this,
Probers have had the math behind their research point generation
reworked. Research output follows an inverse log base 4 curve. Which can
be found here: https://www.desmos.com/calculator/q183tseun8
I wouldn't drop this massive update on people without a way for them to
understand what's going on. So this PR also features the return(and
expansion of), the much-demanded Psionics Guidebook.
<details><summary><h1>Media</h1></summary>
<p>
Psionics Guidebook


</p>
</details>
# Changelog
🆑 VMSolidus, Gollee
- add: Glimmer has been substantially reworked. Please read the new
Psionics Guidebook for more information. In short: "500 is the new
normal glimmer. Stop panicking if Sophia says the glimmer is 500. Call
code white if it gets to 750 and stays above that level."
- add: The much-requested Psionics Guidebook has returned, now with all
new up-to-date information.
- remove: Removed "GLIMMERLOOSE". It's no longer possible for glimmer to
start a chain of events that ends the round if epistemics isn't
destroyed. You can ALWAYS recover from high glimmer now.
- tweak: All glimmer events have had their thresholds tweaked to reflect
the fact that 500 is the new "Normal" amount of glimmer.
---------
Signed-off-by: VMSolidus <evilexecutive@gmail.com>
(cherry picked from commit 638071c48fe3ac7c727a1294de3b6d5d8136e79f)
# Description
Due to some inherent limitations of maintenance, code review, and me
having both severely crippling ADHD and a lifelong adderal dependency,
I've made the executive decision to break apart the Psionic Refactor
into a multitude of smaller, bite sized PRs. I'm keeping the original
Psionic Refactor PR open, because I'm going to need it for code
reference to keep track of the changes I had originally worked on, but I
need to essentially restart the entire refactor from scratch, and
approach it from a new angle that's going to make everything actually
way easier. I also need to be able to work on each available system
individually wherever possible, and this fact is most readily shown by
how the Lightning Refactor and Oracle Refactor were both done
separately.
To start off, this PR is ONLY moving all of the relevant psionics code
to core folders, and nothing more. I'm doing this first so that I can
immediately cut down massively on the "Files Changed" with the simplest,
most basic change necessary to start my work.
No changelog because this isn't player facing, and no media because
there's literally nothing to show.