Added joining table and created staff_staffactivations table
Also cleaned some redundant NOT NULL and improved commentsmerge-requests/36/head
parent
bb40d9c39c
commit
d9c1cd44ce
131
data/staves.sql
131
data/staves.sql
|
@ -81,73 +81,88 @@ VALUES
|
||||||
------------------------------
|
------------------------------
|
||||||
-- staff activations insert --
|
-- staff activations insert --
|
||||||
------------------------------
|
------------------------------
|
||||||
INSERT INTO staff_activations (
|
INSERT INTO staffactivations (
|
||||||
staff_id,
|
staffactivations_id,
|
||||||
"activation",
|
"activation",
|
||||||
effect
|
effect
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
-- Animal Staff --
|
-- Most staves --
|
||||||
(1, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
(1, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
||||||
,(2, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
-- Staff of Illumination --
|
||||||
,(3, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
,(2, 'Interact', 'The gem at the top of the staff glows as a torch, shedding bright light in a 20-foot radius (and dim light to the next 20 feet) for 10 minutes.')
|
||||||
-- Mentalist's Staff --
|
|
||||||
,(4, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(5, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(6, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Abjuration --
|
|
||||||
,(7, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(8, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(9, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Conjuration --
|
|
||||||
,(10, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(11, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(12, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Divination -
|
|
||||||
,(13, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(14, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(15, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Enchantment --
|
|
||||||
,(16, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(17, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(18, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Evocation --
|
|
||||||
,(19, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(20, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(21, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Fire --
|
|
||||||
,(22, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(23, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(24, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Healing --
|
|
||||||
,(25, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(26, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(27, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(28, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Illumination --
|
|
||||||
,(29, 'Interact', 'The gem at the top of the staff glows as a torch, shedding bright light in a 20-foot radius (and dim light to the next 20 feet) for 10 minutes.')
|
|
||||||
,(29, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Illusion --
|
|
||||||
,(30, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(31, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(32, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Necromancy --
|
|
||||||
,(33, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(34, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
,(35, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of Power --
|
-- Staff of Power --
|
||||||
,(36, 'Interact', 'This releases a 30-foot-burst magical explosion centered on the staff. This deals 2d8 force damage per charge remaining in the staff (DC 40 basic Reflex save). You automatically critically fail your save. A creature reduced to 0 Hit Points by this damage dies instantly; this is a death effect.')
|
,(3, 'Interact', 'This releases a 30-foot-burst magical explosion centered on the staff. This deals 2d8 force damage per charge remaining in the staff (DC 40 basic Reflex save). You automatically critically fail your save. A creature reduced to 0 Hit Points by this damage dies instantly; this is a death effect.')
|
||||||
,(36, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
|
||||||
-- Staff of the Magi --
|
-- Staff of the Magi --
|
||||||
,(37, 'Interact', 'This releases a 30-foot‑burst magical explosion centered on the staff. This deals 2d10 force damage per charge remaining in the staff (DC 40 basic Reflex save), You automatically critically fail your save. The explosion continues to echo beyond the initial blast zone, dealing half as much damage to creatures beyond 30 feet but within a 60-foot burst. A creature reduced to 0 Hit Points by this damage dies instantly; this is a death effect.')
|
,(4, 'Interact', 'This releases a 30-foot‑burst magical explosion centered on the staff. This deals 2d10 force damage per charge remaining in the staff (DC 40 basic Reflex save), You automatically critically fail your save. The explosion continues to echo beyond the initial blast zone, dealing half as much damage to creatures beyond 30 feet but within a 60-foot burst. A creature reduced to 0 Hit Points by this damage dies instantly; this is a death effect.')
|
||||||
,(37, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
;
|
||||||
|
|
||||||
|
INSERT INTO staff_staffactivations (
|
||||||
|
staff_id,
|
||||||
|
staffactivations_id
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
-- Animal Staff --
|
||||||
|
(1, 1)
|
||||||
|
,(2, 1)
|
||||||
|
,(3, 1)
|
||||||
|
-- Mentalist's Staff --
|
||||||
|
,(4, 1)
|
||||||
|
,(5, 1)
|
||||||
|
,(6, 1)
|
||||||
|
-- Staff of Abjuration --
|
||||||
|
,(7, 1)
|
||||||
|
,(8, 1)
|
||||||
|
,(9, 1)
|
||||||
|
-- Staff of Conjuration --
|
||||||
|
,(10, 1)
|
||||||
|
,(11, 1)
|
||||||
|
,(12, 1)
|
||||||
|
-- Staff of Divination -
|
||||||
|
,(13, 1)
|
||||||
|
,(14, 1)
|
||||||
|
,(15, 1)
|
||||||
|
-- Staff of Enchantment --
|
||||||
|
,(16, 1)
|
||||||
|
,(17, 1)
|
||||||
|
,(18, 1)
|
||||||
|
-- Staff of Evocation --
|
||||||
|
,(19, 1)
|
||||||
|
,(20, 1)
|
||||||
|
,(21, 1)
|
||||||
|
-- Staff of Fire --
|
||||||
|
,(22, 1)
|
||||||
|
,(23, 1)
|
||||||
|
,(24, 1)
|
||||||
|
-- Staff of Healing --
|
||||||
|
,(25, 1)
|
||||||
|
,(26, 1)
|
||||||
|
,(27, 1)
|
||||||
|
,(28, 1)
|
||||||
|
-- Staff of Illumination --
|
||||||
|
,(29, 2)
|
||||||
|
,(29, 1)
|
||||||
|
-- Staff of Illusion --
|
||||||
|
,(30, 1)
|
||||||
|
,(31, 1)
|
||||||
|
,(32, 1)
|
||||||
|
-- Staff of Necromancy --
|
||||||
|
,(33, 1)
|
||||||
|
,(34, 1)
|
||||||
|
,(35, 1)
|
||||||
|
-- Staff of Power --
|
||||||
|
,(36, 3)
|
||||||
|
,(36, 1)
|
||||||
|
-- Staff of the Magi --
|
||||||
|
,(37, 4)
|
||||||
|
,(37, 1)
|
||||||
-- Staff of Transmutation --
|
-- Staff of Transmutation --
|
||||||
,(38, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
,(38, 1)
|
||||||
,(39, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
,(39, 1)
|
||||||
,(40, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
,(40, 1)
|
||||||
-- Verdant Staff --
|
-- Verdant Staff --
|
||||||
,(41, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
,(41, 1)
|
||||||
,(42, 'Cast a Spell', 'You expend a number of charges from the staff to cast a spell from its list.')
|
,(42, 1)
|
||||||
;
|
;
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
-- Parent table -- Table for Staves --
|
-- Parent table -- Table for Staves --
|
||||||
CREATE TABLE staff (
|
CREATE TABLE staff (
|
||||||
staff_id INTEGER PRIMARY KEY NOT NULL,
|
staff_id INTEGER PRIMARY KEY,
|
||||||
"name" TEXT NOT NULL UNIQUE, -- every staff should have a name --
|
"name" TEXT NOT NULL UNIQUE, -- every staff should have a name --
|
||||||
"level" INTEGER NOT NULL, -- every staff should have a level --
|
"level" INTEGER NOT NULL, -- every staff should have a level --
|
||||||
price INTEGER, /* stored in GP
|
price INTEGER, /* stored in GP
|
||||||
|
@ -19,31 +19,37 @@ CREATE TABLE staff (
|
||||||
FOREIGN KEY (source_id) REFERENCES sources(sources_id)
|
FOREIGN KEY (source_id) REFERENCES sources(sources_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Child table -- many-to-many -- staff-to-spells --
|
-- Child table -- many-to-many --
|
||||||
CREATE TABLE staff_spell (
|
CREATE TABLE staffactivations (
|
||||||
staff_id INTEGER NOT NULL,
|
staffactivations_id INTEGER PRIMARY KEY,
|
||||||
"level" INTEGER NOT NULL, -- This represents the level of the spell in the staff where 0 = cantrip --
|
|
||||||
-- Consider renaming this column --
|
|
||||||
spell_id INTEGER NOT NULL,
|
|
||||||
PRIMARY KEY (staff_id, "level", spell_id),
|
|
||||||
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
|
|
||||||
FOREIGN KEY (spell_id) REFERENCES spells(spells_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
-- Child table -- one-to-many --
|
|
||||||
CREATE TABLE staff_activations (
|
|
||||||
staff_id INTEGER NOT NULL,
|
|
||||||
"activation" TEXT NOT NULL,
|
"activation" TEXT NOT NULL,
|
||||||
effect TEXT NOT NULL,
|
effect TEXT NOT NULL
|
||||||
PRIMARY KEY (staff_id, "activation", effect),
|
|
||||||
FOREIGN KEY (staff_id) REFERENCES staff(staff_id)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Child table -- many-to-many -- staff-to-traits --
|
-- Joining table --
|
||||||
|
CREATE TABLE staff_staffactivations (
|
||||||
|
staff_id INTEGER,
|
||||||
|
staffactivations_id INTEGER,
|
||||||
|
PRIMARY KEY (staff_id, staffactivations_id),
|
||||||
|
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
|
||||||
|
FOREIGN KEY (staffactivations_id) REFERENCES staffactivations(staffactivations_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Joining table --
|
||||||
CREATE TABLE staff_trait (
|
CREATE TABLE staff_trait (
|
||||||
staff_id INTEGER NOT NULL,
|
staff_id INTEGER,
|
||||||
trait_id INTEGER NOT NULL,
|
trait_id INTEGER,
|
||||||
PRIMARY KEY (staff_id, trait_id),
|
PRIMARY KEY (staff_id, trait_id),
|
||||||
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
|
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
|
||||||
FOREIGN KEY (trait_id) REFERENCES traits(trait_id)
|
FOREIGN KEY (trait_id) REFERENCES traits(trait_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Joining table --
|
||||||
|
CREATE TABLE staff_spell (
|
||||||
|
staff_id INTEGER,
|
||||||
|
"level" INTEGER NOT NULL, -- This represents the level of the spell in the staff where 0 = cantrip --
|
||||||
|
spell_id INTEGER,
|
||||||
|
PRIMARY KEY (staff_id, "level", spell_id),
|
||||||
|
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
|
||||||
|
FOREIGN KEY (spell_id) REFERENCES spells(spells_id)
|
||||||
);
|
);
|
Loading…
Reference in New Issue