From d710e27024c9553a1abe39a5f3b34802349412a1 Mon Sep 17 00:00:00 2001 From: James Miller Date: Thu, 15 Aug 2019 23:26:45 -0500 Subject: [PATCH] add ammunition table and data --- data/ammunition.sql | 11 +++++++++++ gendb.sh | 2 ++ schema/ammunition.sql | 16 ++++++++++++++++ schema/weapons.sql | 1 - 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 data/ammunition.sql create mode 100644 schema/ammunition.sql diff --git a/data/ammunition.sql b/data/ammunition.sql new file mode 100644 index 0000000..9750470 --- /dev/null +++ b/data/ammunition.sql @@ -0,0 +1,11 @@ +-- -*- mode:sql sql-product:sqlite -*- + +PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned + -- on PER CONNECTION + +BEGIN TRANSACTION; +INSERT INTO ammunition VALUES(1,1,'282','Arrows',0.1,10,0.1,'These projectiles are the ammunition for bows. The shaft of an arrow is made of wood. It is stabilized in flight by fletching at one end and bears a metal head on the other.'); +INSERT INTO ammunition VALUES(2,1,'281','Blowgun Darts',0.05,10,0.1,'These thin, light darts are typically made of hardwood and stabilized with fletching of down or fur. They are often hollow so they can be used to deliver poison.'); +INSERT INTO ammunition VALUES(3,1,'281','Bolts',0.1,10,0.1,'Shorter than traditional arrows but similar in construction, bolts are the ammunition used by crossbows.'); +INSERT INTO ammunition VALUES(4,1,'281','Sling Bullets',0.01,10,0.1,'These are small metal balls, typically either iron or lead, designed to be used as ammunition in slings.'); +COMMIT; diff --git a/gendb.sh b/gendb.sh index 21bcde4..042e0bd 100755 --- a/gendb.sh +++ b/gendb.sh @@ -17,6 +17,7 @@ sqlite3 pf2.db < schema/ancestries.sql sqlite3 pf2.db < schema/armor.sql sqlite3 pf2.db < schema/gear.sql sqlite3 pf2.db < schema/weapons.sql +sqlite3 pf2.db < schema/ammunition.sql echo 'loading data' sqlite3 pf2.db < data/sources.sql sqlite3 pf2.db < data/damagetypes.sql @@ -36,6 +37,7 @@ sqlite3 pf2.db < data/armor.sql sqlite3 pf2.db < data/gear.sql sqlite3 pf2.db < data/heritages.sql sqlite3 pf2.db < data/weapons.sql +sqlite3 pf2.db < data/ammunition.sql # Comment out the following three lines if you don't want to generate the spell data. cd data/third_party_json python3 spells.py diff --git a/schema/ammunition.sql b/schema/ammunition.sql new file mode 100644 index 0000000..48d1cd4 --- /dev/null +++ b/schema/ammunition.sql @@ -0,0 +1,16 @@ +-- -*- mode:sql sql-product:sqlite -*- + +PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned + -- on PER CONNECTION + +CREATE TABLE ammunition ( + ammunition_id INTEGER PRIMARY KEY, + sources_id INTEGER, + sources_pages TEXT, + "name" TEXT NOT NULL UNIQUE, + price_gp REAL, + amount INTEGER, + bulk REAL, + descr TEXT, + FOREIGN KEY (sources_id) REFERENCES sources(sources_id) +) diff --git a/schema/weapons.sql b/schema/weapons.sql index b03aaf0..4b34fad 100644 --- a/schema/weapons.sql +++ b/schema/weapons.sql @@ -45,4 +45,3 @@ CREATE TABLE weapons_traits ( FOREIGN KEY (weapons_id) REFERENCES weapons(weapons_id), FOREIGN KEY (trait_id) REFERENCes traits(trait_id) ); -