2020-12-18 23:15:29 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "dolphin_deed.h"
|
2021-01-08 07:42:48 +03:00
|
|
|
#include <stdbool.h>
|
2020-12-18 23:15:29 +03:00
|
|
|
#include <stdint.h>
|
2021-10-07 16:32:37 +03:00
|
|
|
#include <time.h>
|
2020-12-18 23:15:29 +03:00
|
|
|
|
|
|
|
typedef struct DolphinState DolphinState;
|
2021-11-24 19:21:12 +03:00
|
|
|
typedef struct {
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
uint8_t icounter_daily_limit[DolphinAppMAX];
|
|
|
|
uint8_t butthurt_daily_limit;
|
2021-11-24 19:21:12 +03:00
|
|
|
|
|
|
|
uint32_t flags;
|
|
|
|
uint32_t icounter;
|
2022-05-06 16:37:10 +03:00
|
|
|
int32_t butthurt;
|
2021-11-24 19:21:12 +03:00
|
|
|
uint64_t timestamp;
|
|
|
|
} DolphinStoreData;
|
|
|
|
|
|
|
|
struct DolphinState {
|
|
|
|
DolphinStoreData data;
|
|
|
|
bool dirty;
|
|
|
|
};
|
2020-12-18 23:15:29 +03:00
|
|
|
|
|
|
|
DolphinState* dolphin_state_alloc();
|
|
|
|
|
2021-04-13 21:06:25 +03:00
|
|
|
void dolphin_state_free(DolphinState* dolphin_state);
|
2020-12-18 23:15:29 +03:00
|
|
|
|
2021-01-08 07:42:48 +03:00
|
|
|
bool dolphin_state_save(DolphinState* dolphin_state);
|
2020-12-18 23:15:29 +03:00
|
|
|
|
2021-01-08 07:42:48 +03:00
|
|
|
bool dolphin_state_load(DolphinState* dolphin_state);
|
2020-12-18 23:15:29 +03:00
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
void dolphin_state_clear_limits(DolphinState* dolphin_state);
|
2020-12-18 23:15:29 +03:00
|
|
|
|
2021-10-07 16:32:37 +03:00
|
|
|
uint64_t dolphin_state_timestamp();
|
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
void dolphin_state_on_deed(DolphinState* dolphin_state, DolphinDeed deed);
|
2020-12-18 23:15:29 +03:00
|
|
|
|
2021-10-07 16:32:37 +03:00
|
|
|
void dolphin_state_butthurted(DolphinState* dolphin_state);
|
|
|
|
|
2021-11-24 19:21:12 +03:00
|
|
|
uint32_t dolphin_state_xp_to_levelup(uint32_t icounter);
|
2020-12-18 23:15:29 +03:00
|
|
|
|
2021-12-07 16:13:07 +03:00
|
|
|
uint32_t dolphin_state_xp_above_last_levelup(uint32_t icounter);
|
|
|
|
|
2021-11-24 19:21:12 +03:00
|
|
|
bool dolphin_state_is_levelup(uint32_t icounter);
|
2021-03-25 20:48:58 +03:00
|
|
|
|
2021-11-24 19:21:12 +03:00
|
|
|
void dolphin_state_increase_level(DolphinState* dolphin_state);
|
2021-10-07 16:32:37 +03:00
|
|
|
|
2021-11-24 19:21:12 +03:00
|
|
|
uint8_t dolphin_get_level(uint32_t icounter);
|