2019-08-18 18:41:06 -04:00
|
|
|
-- -*- mode:sql sql-product:sqlite -*-
|
|
|
|
|
|
|
|
PRAGMA foreign_keys = ON;
|
|
|
|
|
2019-08-18 20:20:49 -04:00
|
|
|
-- TODO needs data
|
|
|
|
|
2019-08-18 20:41:50 -04:00
|
|
|
-- Rarity will be by trait
|
|
|
|
-- Monster 'type' will be by trait
|
2019-08-18 20:48:36 -04:00
|
|
|
-- Monster category is also by trait
|
|
|
|
|
|
|
|
-- So the bestiary breaks down trait versus category or family, but then sticks
|
|
|
|
-- them all in the trait position on the stat block, so I think we just do it
|
|
|
|
-- all with traits. Thoughts?
|
2019-08-18 20:41:50 -04:00
|
|
|
|
2019-08-18 18:41:06 -04:00
|
|
|
CREATE TABLE monsters (
|
2019-08-25 23:33:15 -04:00
|
|
|
monster_id INTEGER PRIMARY KEY,
|
2019-08-18 18:41:06 -04:00
|
|
|
is_comty_use BOOLEAN NOT NULL, -- false = no community use policy req
|
2019-08-25 23:33:15 -04:00
|
|
|
sourceentry_id INTEGER, -- new style source entries
|
2019-08-18 20:48:36 -04:00
|
|
|
-- monstercategories_id INTEGER, -- Humanoid etc..
|
2019-08-18 18:41:06 -04:00
|
|
|
"name" TEXT NOT NULL UNIQUE,
|
|
|
|
"level" INTEGER,
|
|
|
|
alignment_id INTEGER, -- i.e. NG, LE etc..
|
|
|
|
perception INTEGER,
|
2019-08-25 23:33:15 -04:00
|
|
|
size_id INTEGER, -- i.e. large medium small etc..
|
2019-08-18 18:41:06 -04:00
|
|
|
ac INTEGER,
|
|
|
|
fortitude INTEGER,
|
|
|
|
reflex INTEGER,
|
|
|
|
will INTEGER,
|
|
|
|
hp INTEGER,
|
2019-08-19 13:40:24 -04:00
|
|
|
land_speed INTEGER, -- we decided to make the speeds flattened as they don't
|
|
|
|
-- save much extra space
|
|
|
|
burrow_speed INTEGER,
|
|
|
|
climb_speed INTEGER,
|
|
|
|
fly_speed INTEGER,
|
|
|
|
swim_speed INTEGER,
|
2019-08-18 18:41:06 -04:00
|
|
|
str_mod INTEGER,
|
|
|
|
dex_mod INTEGER,
|
|
|
|
con_mod INTEGER,
|
|
|
|
int_mod INTEGER,
|
|
|
|
wis_mod INTEGER,
|
|
|
|
cha_mod INTEGER,
|
2019-08-25 23:33:15 -04:00
|
|
|
specific_monster_flavortext TEXT,
|
|
|
|
FOREIGN KEY (alignment_id) REFERENCES alignments(alignments_id),
|
|
|
|
FOREIGN KEY (size_id) REFERENCES sizes(size_id),
|
|
|
|
FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
|
2019-08-18 18:41:06 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE monsterflavortexttypes (
|
2019-08-25 23:33:15 -04:00
|
|
|
monsterflavortexttype_id INTEGER PRIMARY KEY,
|
2019-08-18 18:41:06 -04:00
|
|
|
"name" TEXT NOT NULL UNIQUE
|
|
|
|
-- page 7 Bestiary
|
|
|
|
-- 'Monster Category' -- i.e. "Bear"
|
2019-08-25 23:33:15 -04:00
|
|
|
-- THE FOLLOWING ARE THE SIDEBAR CONTENT FROM BESTIARY
|
2019-08-18 18:41:06 -04:00
|
|
|
-- 'Advice and Rules'
|
|
|
|
-- 'Related Creatures'
|
|
|
|
-- 'Additional Lore'
|
|
|
|
-- 'Treasure and Rewards'
|
|
|
|
-- 'Locations'
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE monsterflavortexts (
|
2019-08-25 23:33:15 -04:00
|
|
|
monsterflavortext_id INTEGER PRIMARY KEY,
|
|
|
|
monsterflavortexttype_id INTEGER,
|
2019-08-18 18:41:06 -04:00
|
|
|
heading TEXT NOT NULL,
|
|
|
|
mft_text TEXT NOT NULL,
|
2019-08-25 23:33:15 -04:00
|
|
|
FOREIGN KEY (monsterflavortexttype_id) REFERENCES monsterflavortexttypes(monsterflavortexttype_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE monsters_monsterflavortexts (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
monster_id,
|
|
|
|
monsterflavortext_id,
|
|
|
|
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
|
|
|
|
FOREIGN KEY (monsterflavortext_id) REFERENCES monsterflavortexts(monsterflavortext_id)
|
2019-08-18 18:41:06 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE monsters_senses (
|
|
|
|
id INTEGER PRIMARY KEY,
|
2019-08-25 23:33:15 -04:00
|
|
|
monster_id INTEGER NOT NULL,
|
|
|
|
sense_id INTEGER NOT NULL,
|
|
|
|
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
|
|
|
|
FOREIGN KEY (sense_id) REFERENCES senses(senses_id)
|
2019-08-18 18:41:06 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE monsters_immunities (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
monsters_id INTEGER NOT NULL,
|
|
|
|
immunities_id INTEGER NOT NULL,
|
|
|
|
FOREIGN KEY (monsters_id) REFERENCES monsters(monsters_id),
|
|
|
|
FOREIGN KEY (immunities_id) REFERENCES immunities(immunities_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE monsters_skills (
|
|
|
|
id INTEGER PRIMARY KEY,
|
2019-08-25 23:33:15 -04:00
|
|
|
monster_id INTEGER NOT NULL,
|
2019-08-18 19:57:58 -04:00
|
|
|
skills_id INTEGER NOT NULL, -- will ID the specific skill
|
|
|
|
skill_mod INTEGER NOT NULL, -- will hold the modifier value
|
2019-08-25 23:33:15 -04:00
|
|
|
UNIQUE(monster_id, skills_id), -- so we don't get duplicate rows for a specific monster
|
|
|
|
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
|
2019-08-18 18:41:06 -04:00
|
|
|
FOREIGN KEY (skills_id) REFERENCES skills(skills_id)
|
|
|
|
);
|
|
|
|
|
2019-08-18 18:45:10 -04:00
|
|
|
CREATE TABLE monsters_traits (
|
|
|
|
id INTEGER PRIMARY KEY,
|
2019-08-25 23:33:15 -04:00
|
|
|
monster_id INTEGER NOT NULL,
|
2019-08-18 19:57:58 -04:00
|
|
|
trait_id INTEGER NOT NULL,
|
2019-08-25 23:33:15 -04:00
|
|
|
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
|
|
|
|
FOREIGN KEY (trait_id) REFERENCES traits(trait_id)
|
2019-08-18 18:45:10 -04:00
|
|
|
);
|
|
|
|
|
2019-08-25 23:33:15 -04:00
|
|
|
CREATE TABLE monsters_langs (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
monster_id INTEGER NOT NULL,
|
|
|
|
lang_id INTEGER NOT NULL,
|
|
|
|
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
|
|
|
|
FOREIGN KEY (lang_id) REFERENCES langs(lang_id)
|
|
|
|
);
|
2019-08-18 20:32:06 -04:00
|
|
|
|
2019-08-18 18:41:06 -04:00
|
|
|
CREATE TABLE monsteractions (
|
2019-08-25 23:33:15 -04:00
|
|
|
monsteraction_id INTEGER PRIMARY KEY,
|
|
|
|
"name" TEXT
|
2019-08-18 18:41:06 -04:00
|
|
|
-- TODO
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE monsters_actions (
|
|
|
|
id INTEGER PRIMARY KEY,
|
2019-08-25 23:33:15 -04:00
|
|
|
monster_id INTEGER NOT NULL,
|
|
|
|
monsteraction_id INTEGER NOT NULL
|
2019-08-18 18:41:06 -04:00
|
|
|
);
|