Added table and general functions for stats system #21

Merged
waifu merged 16 commits from stats_system into dev 2025-06-25 20:45:13 -07:00
Owner

Created the table for the stats system, added some generalized functions that work with any amount of stats in case we want to change the stats in the future.

Solving issue #19

Created the table for the stats system, added some generalized functions that work with any amount of stats in case we want to change the stats in the future. Solving issue #19
waifu added the
Feature
label 2025-05-22 19:09:34 -07:00
waifu added 1 commit 2025-05-22 19:09:36 -07:00
requested review from nai 2025-05-22 19:09:48 -07:00
waifu added a new dependency 2025-05-22 19:10:26 -07:00
waifu removed a dependency 2025-05-22 19:10:46 -07:00
waifu added 2 commits 2025-05-23 22:11:43 -07:00
waifu added 1 commit 2025-05-24 13:36:32 -07:00
waifu added 3 commits 2025-05-24 13:59:48 -07:00
VD15 reviewed 2025-05-24 15:21:31 -07:00
db.py Outdated
@ -42,2 +42,4 @@
""")
cursor.execute('''
CREATE TABLE IF NOT EXISTS character_stats (
Collaborator

Would we not want to extend the characters table? We could just sub in random values for stats:

power INTEGER NOT NULL DEFAULT abs(random() % 9999),

Replace 9999 with whatever the limit for that stat is

Would we not want to extend the characters table? We could just sub in random values for stats: `power INTEGER NOT NULL DEFAULT abs(random() % 9999),` Replace 9999 with whatever the limit for that stat is
Author
Owner

Perfect, I'll add a new section in the config file for this so we can change it later.

Perfect, I'll add a new section in the config file for this so we can change it later.
VD15 reviewed 2025-05-24 15:30:40 -07:00
bot/db_utils.py Outdated
@ -69,0 +79,4 @@
# Character stat functions
def add_character_stats(character_id, stats):
Collaborator

Bundle stats into character creation. Unless there's a case where a character will exist without having stats, it doesn't make a great deal of sense to have them separate.

Bundle stats into character creation. Unless there's a case where a character will exist without having stats, it doesn't make a great deal of sense to have them separate.
Author
Owner

I just realized that if we bundle it into the card creation we also need to add the changes to the do_create function, which seems logical since that's the way we create cards... I'll work on adding it there.
Also thanks for the feedback king.

I just realized that if we bundle it into the card creation we also need to add the changes to the do_create function, which seems logical since that's the way we create cards... I'll work on adding it there. Also thanks for the feedback king.
VD15 reviewed 2025-05-24 15:34:24 -07:00
bot/db_utils.py Outdated
@ -69,0 +106,4 @@
conn.close()
def update_character_stat(character_id, stat_name, value):
Collaborator

We don't need three different methods of retrieving the same data. We can get away with just get_character_stats(...) or ideally a get_character(...) function that returns the lot.

We don't need three different methods of retrieving the same data. We can get away with just `get_character_stats(...)` or ideally a `get_character(...)` function that returns the lot.
Author
Owner

Turning these into a get_characters(...) instead, we don't have a function that receives the ids and retrieves the character(s) information, seemed more useful.

Turning these into a get_characters(...) instead, we don't have a function that receives the ids and retrieves the character(s) information, seemed more useful.
waifu added 7 commits 2025-05-28 18:09:32 -07:00
waifu added 2 commits 2025-05-28 19:31:57 -07:00
waifu added 1 commit 2025-06-21 20:54:54 -07:00
waifu added 3 commits 2025-06-24 20:21:43 -07:00
waifu added 1 commit 2025-06-24 20:26:25 -07:00
waifu added 2 commits 2025-06-24 21:12:42 -07:00
waifu added 1 commit 2025-06-25 20:37:54 -07:00
waifu merged commit c59edbcf4f into dev 2025-06-25 20:45:13 -07:00
Sign in to join this conversation.
No reviewers
nai
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: waifu/kemoverse#21
No description provided.