-
-
Notifications
You must be signed in to change notification settings - Fork 3
Intended Operation of the Evolution System
During each run of the update tick (so, massively more often than necessary), the program will interrogate the RTC for what is essentially an epoch time. If this epoch time is later than a timestamp calculated by comparing the date of last evolution to the stage length value in the current stage's data, a flag should be set indicating that an evolution is necessary.
The next time the program sees the following conditions are all true:
- The pet is not currently sick;
- The pet is awake, and;
- The pet is not in a state where the death condition would trigger (this simply takes priority over this check), then;
A routine should calculate which of several evoltions should happen:
- If the health byte is below a certain value and both the hunger and fun nibbles are above half-full, the
high_evoform is triggered. - If the above criteria are met
andthe flag to allow secret evolutions is set at the time, thesecret_evoform is triggered. - If the above criteria are not met at all, the
low_evostage is triggered, regardless of whether or not the secret evolutions flag is set.
In all cases, the device should register an alert, activate the screen (if deactivated), and play through an animation loop dynamically generated for the evolution in question.
Currently, the operation of the secret evolutions flag is to check the state (not an interrupt, but actually check the state) of a potential 0-ohm resister on an otherwise unused pin. This document should be updated when that pin is selected.