Added table and general functions for stats system #21

Open
waifu wants to merge 8 commits from stats_system into dev
waifu commented 1 week ago
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 1 week ago
waifu added 1 commit 1 week ago
waifu requested review from nai 1 week ago
waifu added a new dependency 1 week ago
waifu removed a dependency 1 week ago
waifu added 2 commits 1 week ago
waifu added 1 commit 6 days ago
waifu added 3 commits 6 days ago
VD15 reviewed 6 days ago
""")
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
Poster
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 6 days ago
bot/db_utils.py Outdated
# 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.
Poster
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 6 days ago
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.
Poster
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 2 days ago
waifu added 2 commits 2 days ago

Reviewers

nai was requested for review 1 week ago
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: waifu/kemoverse#21
Loading…
There is no content yet.