Added table and general functions for stats system #21
No reviewers
Labels
No labels
Bug
Feature
Feedback Wanted
Refactoring
Won't Do
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: waifu/kemoverse#21
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "stats_system"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@ -42,2 +42,4 @@
""")
cursor.execute('''
CREATE TABLE IF NOT EXISTS character_stats (
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
Perfect, I'll add a new section in the config file for this so we can change it later.
@ -69,0 +79,4 @@
# Character stat functions
def add_character_stats(character_id, stats):
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.
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.
@ -69,0 +106,4 @@
conn.close()
def update_character_stat(character_id, stat_name, value):
We don't need three different methods of retrieving the same data. We can get away with just
get_character_stats(...)
or ideally aget_character(...)
function that returns the lot.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.