diff --git a/database/main/alchemical_recipe.sql b/database/main/alchemical_recipe.sql new file mode 100644 index 0000000..2b6f893 --- /dev/null +++ b/database/main/alchemical_recipe.sql @@ -0,0 +1,17 @@ +create table alchemical_recipe +( + id INTEGER + primary key, + name TEXT not null + unique, + result_item_id INTEGER + references item, + herstellungs_talent_id INTEGER not null + references talent, + herstellungs_probe_mod INTEGER default 0, + labor_schwierigkeit TEXT, + rezept_kosten_heller INTEGER, + wirkungsbeschreibung TEXT, + wirkung_strukturiert TEXT +); + diff --git a/database/main/ammunition.sql b/database/main/ammunition.sql new file mode 100644 index 0000000..030c7f4 --- /dev/null +++ b/database/main/ammunition.sql @@ -0,0 +1,11 @@ +create table ammunition +( + id INTEGER + primary key, + item_id INTEGER not null + unique + references item + on delete cascade, + passend_fuer_fk_waffe_typ TEXT +); + diff --git a/database/main/armor.sql b/database/main/armor.sql new file mode 100644 index 0000000..f1e5b0f --- /dev/null +++ b/database/main/armor.sql @@ -0,0 +1,13 @@ +create table armor +( + id INTEGER + primary key, + item_id INTEGER not null + unique + references item + on delete cascade, + ruestungsschutz INTEGER not null, + behaelinderung REAL not null, + zonen TEXT +); + diff --git a/database/main/availability_level.sql b/database/main/availability_level.sql new file mode 100644 index 0000000..c1a9efb --- /dev/null +++ b/database/main/availability_level.sql @@ -0,0 +1,9 @@ +create table availability_level +( + id INTEGER + primary key, + stufe INTEGER not null + unique, + beschreibung TEXT +); + diff --git a/database/main/crafting_recipe.sql b/database/main/crafting_recipe.sql new file mode 100644 index 0000000..3a3a25d --- /dev/null +++ b/database/main/crafting_recipe.sql @@ -0,0 +1,20 @@ +create table crafting_recipe +( + id INTEGER + primary key, + result_item_id INTEGER not null + references item, + required_talent_id INTEGER not null + references talent, + required_fw INTEGER not null, + zeitaufwand_in_ze TEXT, + benoetigte_materialien TEXT, + anmerkung TEXT +); + +create index idx_crafting_recipe_item + on crafting_recipe (result_item_id); + +create index idx_crafting_recipe_talent + on crafting_recipe (required_talent_id); + diff --git a/database/main/creature.sql b/database/main/creature.sql new file mode 100644 index 0000000..aed972e --- /dev/null +++ b/database/main/creature.sql @@ -0,0 +1,27 @@ +create table creature +( + id INTEGER + primary key, + optolith_key TEXT + unique, + name TEXT not null, + typ TEXT, + groessenkategorie TEXT, + attr_mu INTEGER, + attr_kl INTEGER, + attr_in INTEGER, + attr_ch INTEGER, + attr_ff INTEGER, + attr_ge INTEGER, + attr_ko INTEGER, + attr_kk INTEGER, + le_formel TEXT, + sk_wert INTEGER, + zk_wert INTEGER, + gs_wert INTEGER, + ini_formel TEXT, + rs_wert INTEGER, + beschreibung TEXT, + fluchtverhalten TEXT +); + diff --git a/database/main/creature_attack.sql b/database/main/creature_attack.sql new file mode 100644 index 0000000..9b5ffd7 --- /dev/null +++ b/database/main/creature_attack.sql @@ -0,0 +1,15 @@ +create table creature_attack +( + id INTEGER + primary key, + creature_id INTEGER not null + references creature + on delete cascade, + name TEXT not null, + at_wert INTEGER, + pa_wert INTEGER, + tp_formel TEXT, + reichweite TEXT, + eigenschaften TEXT +); + diff --git a/database/main/creature_attack_has_property.sql b/database/main/creature_attack_has_property.sql new file mode 100644 index 0000000..d7a0e94 --- /dev/null +++ b/database/main/creature_attack_has_property.sql @@ -0,0 +1,14 @@ +create table creature_attack_has_property +( + attack_id INTEGER not null + references creature_attack + on delete cascade, + property_id INTEGER not null + references creature_attack_property + on delete restrict, + primary key (attack_id, property_id) +); + +create index idx_creature_attack_has_prop_prop + on creature_attack_has_property (property_id); + diff --git a/database/main/creature_attack_property.sql b/database/main/creature_attack_property.sql new file mode 100644 index 0000000..3d1ea24 --- /dev/null +++ b/database/main/creature_attack_property.sql @@ -0,0 +1,9 @@ +create table creature_attack_property +( + id INTEGER + primary key, + name TEXT not null + unique, + beschreibung TEXT +); + diff --git a/database/main/creature_special_ability.sql b/database/main/creature_special_ability.sql new file mode 100644 index 0000000..6bc1328 --- /dev/null +++ b/database/main/creature_special_ability.sql @@ -0,0 +1,14 @@ +create table creature_special_ability +( + creature_id INTEGER not null + references creature + on delete cascade, + special_ability_id INTEGER not null + references special_ability + on delete restrict, + primary key (creature_id, special_ability_id) +); + +create index idx_creature_sa_sa + on creature_special_ability (special_ability_id); + diff --git a/database/main/creature_talent.sql b/database/main/creature_talent.sql new file mode 100644 index 0000000..1a751d4 --- /dev/null +++ b/database/main/creature_talent.sql @@ -0,0 +1,15 @@ +create table creature_talent +( + creature_id INTEGER not null + references creature + on delete cascade, + talent_id INTEGER not null + references talent + on delete restrict, + fertigkeitswert INTEGER not null, + primary key (creature_id, talent_id) +); + +create index idx_creature_talent_talent + on creature_talent (talent_id); + diff --git a/database/main/culture_trait.sql b/database/main/culture_trait.sql index 63e4df8..172b633 100644 --- a/database/main/culture_trait.sql +++ b/database/main/culture_trait.sql @@ -16,6 +16,3 @@ create table culture_trait create index idx_culture_trait_trait on culture_trait (trait_id); -create index idx_culture_trait_trait2 - on culture_trait (trait_id); - diff --git a/database/main/deity.sql b/database/main/deity.sql new file mode 100644 index 0000000..c84c307 --- /dev/null +++ b/database/main/deity.sql @@ -0,0 +1,11 @@ +create table deity +( + id INTEGER + primary key, + name TEXT not null + unique, + aspekte TEXT, + herrschaftsbereich TEXT, + heiliges_tier TEXT +); + diff --git a/database/main/item.sql b/database/main/item.sql new file mode 100644 index 0000000..e9752f9 --- /dev/null +++ b/database/main/item.sql @@ -0,0 +1,15 @@ +create table item +( + id INTEGER + primary key, + name TEXT not null, + typ TEXT not null, + gewicht_in_unzen INTEGER default 0, + preis_in_heller INTEGER default 0, + beschreibung TEXT, + verfuegbarkeit TEXT, + availability_id INTEGER + references availability_level, + check (typ IN ('WAFFE', 'RÜSTUNG', 'SCHILD', 'FERNKAMPFWAFFE', 'MUNITION', 'ALLGEMEIN', 'ALCHEMIKA')) +); + diff --git a/database/main/kampftechnik.sql b/database/main/kampftechnik.sql index 96b52dd..3d3fbd2 100644 --- a/database/main/kampftechnik.sql +++ b/database/main/kampftechnik.sql @@ -1,17 +1,19 @@ create table kampftechnik ( - id INTEGER + id INTEGER primary key, - optolith_key TEXT not null + optolith_key TEXT not null unique, - name TEXT not null, - grundwert INTEGER default 6 not null, - probe_attr1_id INTEGER + name TEXT not null, + grundwert INTEGER default 6 not null, + probe_attr1_id INTEGER references attribute, - probe_attr2_id INTEGER + probe_attr2_id INTEGER references attribute, - probe_attr3_id INTEGER + probe_attr3_id INTEGER references attribute, - beschreibung TEXT + beschreibung TEXT, + leiteigenschaft_id INTEGER + references attribute ); diff --git a/database/main/liturgy_modification.sql b/database/main/liturgy_modification.sql new file mode 100644 index 0000000..8ad145b --- /dev/null +++ b/database/main/liturgy_modification.sql @@ -0,0 +1,17 @@ +create table liturgy_modification +( + id INTEGER + primary key, + liturgy_id INTEGER not null + references liturgy + on delete cascade, + name TEXT not null, + wirkung TEXT not null, + voraussetzung TEXT, + kosten_modifikation TEXT, + unique (liturgy_id, name) +); + +create index idx_liturgy_mod_liturgy + on liturgy_modification (liturgy_id); + diff --git a/database/main/poison_disease.sql b/database/main/poison_disease.sql new file mode 100644 index 0000000..8055b64 --- /dev/null +++ b/database/main/poison_disease.sql @@ -0,0 +1,16 @@ +create table poison_disease +( + id INTEGER + primary key, + name TEXT not null + unique, + typ TEXT not null, + art TEXT, + resistenz_probe_attr TEXT not null, + stufe INTEGER, + wirkungsbeginn TEXT, + schaden_wirkung TEXT, + dauer TEXT, + check (typ IN ('GIFT', 'KRANKHEIT')) +); + diff --git a/database/main/profession_trait.sql b/database/main/profession_trait.sql index 90f7f78..aebb8be 100644 --- a/database/main/profession_trait.sql +++ b/database/main/profession_trait.sql @@ -14,6 +14,3 @@ create table profession_trait create index idx_profession_trait_trait on profession_trait (trait_id); -create index idx_profession_trait_trait2 - on profession_trait (trait_id); - diff --git a/database/main/ranged_weapon.sql b/database/main/ranged_weapon.sql new file mode 100644 index 0000000..e793ac9 --- /dev/null +++ b/database/main/ranged_weapon.sql @@ -0,0 +1,18 @@ +create table ranged_weapon +( + id INTEGER + primary key, + item_id INTEGER not null + unique + references item + on delete cascade, + kampftechnik_id INTEGER not null + references kampftechnik + on delete restrict, + schaden_tp_formel TEXT not null, + ladezeit_in_aktionen INTEGER, + reichweite_nah INTEGER, + reichweite_mittel INTEGER, + reichweite_fern INTEGER +); + diff --git a/database/main/service_cost.sql b/database/main/service_cost.sql new file mode 100644 index 0000000..499b7c8 --- /dev/null +++ b/database/main/service_cost.sql @@ -0,0 +1,11 @@ +create table service_cost +( + id INTEGER + primary key, + name TEXT not null, + kategorie TEXT, + preis_in_heller INTEGER, + preis_bemerkung TEXT, + beschreibung TEXT +); + diff --git a/database/main/shield.sql b/database/main/shield.sql new file mode 100644 index 0000000..ec106bc --- /dev/null +++ b/database/main/shield.sql @@ -0,0 +1,17 @@ +create table shield +( + id INTEGER + primary key, + item_id INTEGER not null + unique + references item + on delete cascade, + kampftechnik_id INTEGER not null + references kampftechnik + on delete restrict, + at_mod INTEGER default 0, + pa_mod INTEGER default 0, + zusatz_rs INTEGER default 0, + zusatz_be REAL default 0 +); + diff --git a/database/main/social_status.sql b/database/main/social_status.sql new file mode 100644 index 0000000..5e8e1df --- /dev/null +++ b/database/main/social_status.sql @@ -0,0 +1,10 @@ +create table social_status +( + id INTEGER + primary key, + name TEXT not null + unique, + ap_kosten INTEGER not null, + beschreibung TEXT +); + diff --git a/database/main/special_ability.sql b/database/main/special_ability.sql index 24f7222..47b8676 100644 --- a/database/main/special_ability.sql +++ b/database/main/special_ability.sql @@ -1,14 +1,15 @@ create table special_ability ( - id INTEGER + id INTEGER primary key, - optolith_key TEXT not null + optolith_key TEXT not null unique, - name TEXT not null, - type_code TEXT + name TEXT not null, + type_code TEXT references sa_type on update cascade, - ap_kosten INTEGER, - beschreibung TEXT + ap_kosten INTEGER, + beschreibung TEXT, + benoetigt_parameter BOOLEAN default 0 not null ); diff --git a/database/main/species_trait.sql b/database/main/species_trait.sql index e733083..aec8b42 100644 --- a/database/main/species_trait.sql +++ b/database/main/species_trait.sql @@ -16,6 +16,3 @@ create table species_trait create index idx_species_trait_trait on species_trait (trait_id); -create index idx_species_trait_trait2 - on species_trait (trait_id); - diff --git a/database/main/spell_modification.sql b/database/main/spell_modification.sql new file mode 100644 index 0000000..0733ba6 --- /dev/null +++ b/database/main/spell_modification.sql @@ -0,0 +1,17 @@ +create table spell_modification +( + id INTEGER + primary key, + spell_id INTEGER not null + references spell + on delete cascade, + name TEXT not null, + wirkung TEXT not null, + voraussetzung TEXT, + kosten_modifikation TEXT, + unique (spell_id, name) +); + +create index idx_spell_mod_spell + on spell_modification (spell_id); + diff --git a/database/main/status_effect.sql b/database/main/status_effect.sql new file mode 100644 index 0000000..14d63b8 --- /dev/null +++ b/database/main/status_effect.sql @@ -0,0 +1,10 @@ +create table status_effect +( + id INTEGER + primary key, + name TEXT not null + unique, + max_stufen INTEGER, + regel_beschreibung TEXT +); + diff --git a/database/main/tradition_has_deity.sql b/database/main/tradition_has_deity.sql new file mode 100644 index 0000000..334beb3 --- /dev/null +++ b/database/main/tradition_has_deity.sql @@ -0,0 +1,14 @@ +create table tradition_has_deity +( + tradition_id INTEGER not null + references tradition + on delete cascade, + deity_id INTEGER not null + references deity + on delete restrict, + primary key (tradition_id, deity_id) +); + +create index idx_trad_deity_deity + on tradition_has_deity (deity_id); + diff --git a/database/main/trait.sql b/database/main/trait.sql index 5e5a538..65f4ac7 100644 --- a/database/main/trait.sql +++ b/database/main/trait.sql @@ -1,20 +1,21 @@ create table trait ( - id INTEGER + id INTEGER primary key, - optolith_key TEXT not null + optolith_key TEXT not null unique, - name TEXT not null, - kind TEXT not null, - is_leveled INTEGER default 0 not null, - level_min INTEGER, - level_max INTEGER, - level_step INTEGER, - ap_cost_mode TEXT default 'FIXED' not null, - ap_wert INTEGER, - ap_per_level INTEGER, - ap_formula TEXT, - beschreibung TEXT, + name TEXT not null, + kind TEXT not null, + is_leveled INTEGER default 0 not null, + level_min INTEGER, + level_max INTEGER, + level_step INTEGER, + ap_cost_mode TEXT default 'FIXED' not null, + ap_wert INTEGER, + ap_per_level INTEGER, + ap_formula TEXT, + beschreibung TEXT, + benoetigt_parameter BOOLEAN default 0 not null, check (ap_cost_mode IN ('FIXED', 'PER_LEVEL', 'TABLE', 'FORMULA')), check (is_leveled IN (0, 1)), check (kind IN ('VORTEIL', 'NACHTEIL')) diff --git a/database/main/weapon.sql b/database/main/weapon.sql new file mode 100644 index 0000000..4e5a2f9 --- /dev/null +++ b/database/main/weapon.sql @@ -0,0 +1,18 @@ +create table weapon +( + id INTEGER + primary key, + item_id INTEGER not null + unique + references item + on delete cascade, + kampftechnik_id INTEGER not null + references kampftechnik + on delete restrict, + schaden_tp_formel TEXT not null, + tp_kk_schwelle INTEGER, + tp_kk_schritt INTEGER, + at_mod INTEGER default 0, + pa_mod INTEGER default 0 +); + diff --git a/database/main/weapon_has_property.sql b/database/main/weapon_has_property.sql new file mode 100644 index 0000000..5952c73 --- /dev/null +++ b/database/main/weapon_has_property.sql @@ -0,0 +1,14 @@ +create table weapon_has_property +( + weapon_id INTEGER not null + references weapon + on delete cascade, + property_id INTEGER not null + references weapon_property + on delete restrict, + primary key (weapon_id, property_id) +); + +create index idx_weapon_has_property_prop + on weapon_has_property (property_id); + diff --git a/database/main/weapon_property.sql b/database/main/weapon_property.sql new file mode 100644 index 0000000..d05e7d6 --- /dev/null +++ b/database/main/weapon_property.sql @@ -0,0 +1,9 @@ +create table weapon_property +( + id INTEGER + primary key, + name TEXT not null + unique, + beschreibung TEXT +); + diff --git a/rules.db b/rules.db index bcf6c6a..2dc68b4 100644 Binary files a/rules.db and b/rules.db differ