db_init module

core.characterCreation.db_init.initialize_db()

Initializes the SQLite database for the DnD project by creating the necessary tables if they do not exist.

The following tables are created: - characters: Stores character information such as name, class, level, HP, stats, inventory, and spells. - enemies: Stores enemy information including name, HP, stats, and abilities. - spells: Stores spell details such as name, duration, damage, effect, range, and area of effect. - world_info: Stores world-related information like description, map, time of day, and weather conditions. - combat_log: Stores combat log entries including turn number, attacker and target IDs, damage dealt, and used spells or abilities. - damage_types: Stores types of damage and their resistance factors.

Returns:

The connection object to the initialized SQLite database.

Return type:

sqlite3.Connection