add movements data

merge-requests/35/merge
James R Miller 2019-08-18 19:32:06 -05:00
parent aa4ae5473f
commit 453dd03232
3 changed files with 22 additions and 1 deletions

View File

@ -2,6 +2,15 @@
PRAGMA foreign_keys = ON;
-- TODO any other movements?
BEGIN TRANSACTION;
INSERT INTO movements VALUES(1, 'Fly');
INSERT INTO movements VALUES(0, 'Land'); -- This is already incorporated into
-- monsters and ancestries but is
-- included here so we have the type of
-- speed
INSERT INTO movements VALUES(1, 'Burrow');
INSERT INTO movements VALUES(2, 'Climb');
INSERT INTO movements VALUES(3, 'Fly');
INSERT INTO movements VALUES(4, 'Swim');
COMMIT;

View File

@ -3,6 +3,7 @@ rm pf2.db
echo 'loading schema'
sqlite3 pf2.db < schema/sources.sql
sqlite3 pf2.db < schema/skills.sql
sqlite3 pf2.db < schema/movements.sql
sqlite3 pf2.db < schema/damagetypes.sql
sqlite3 pf2.db < schema/conditions.sql
sqlite3 pf2.db < schema/backgrounds.sql
@ -23,6 +24,7 @@ sqlite3 pf2.db < schema/ammunition.sql
echo 'loading data'
sqlite3 pf2.db < data/sources.sql
sqlite3 pf2.db < data/skills.sql
sqlite3 pf2.db < data/movements.sql
sqlite3 pf2.db < data/damagetypes.sql
sqlite3 pf2.db < data/conditions.sql
sqlite3 pf2.db < data/backgrounds.sql

View File

@ -98,6 +98,16 @@ CREATE TABLE monsters_traits (
FOREIGN KEY (traits_id) REFERENCES traits(trait_id)
);
CREATE TABLE monster_movements (
id INTEGER PRIMARY KEY,
monsters_id INTEGER NOT NULL,
movements_id INTEGER NOT NULL,
movement_speed INTEGER NOT NULL, -- this is the actual monster speed
UNIQUE (monsters_id, movements_id), -- prevent duplicates
FOREIGN KEY (monsters_id) REFERENCES monsters(monsters_id),
FOREIGN KEY (movements_id) REFERENCES movements(movements_id)
);
-- TODO does this need to be separate table for monsters only or share the main
-- actions table
CREATE TABLE monsteractions (