Added table and general functions for stats system #21
Open
waifu
wants to merge 8 commits from stats_system
into dev
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'stats_system'
Deleting a branch is permanent. It CANNOT be undone. 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
""")
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.
# 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.
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.
Reviewers