step 7.1: done
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
-- 005_expeditions.sql — Expedition system: definitions and player expedition records.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS expedition_defs (
|
||||
id INTEGER PRIMARY KEY,
|
||||
slug TEXT NOT NULL UNIQUE,
|
||||
name TEXT NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
min_level INTEGER NOT NULL,
|
||||
duration_sec INTEGER NOT NULL,
|
||||
energy_cost INTEGER NOT NULL,
|
||||
xp_reward INTEGER NOT NULL,
|
||||
gold_min INTEGER NOT NULL,
|
||||
gold_max INTEGER NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS expeditions (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
character_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE,
|
||||
def_id INTEGER NOT NULL REFERENCES expedition_defs(id),
|
||||
started_at INTEGER NOT NULL,
|
||||
ends_at INTEGER NOT NULL,
|
||||
claimed_at INTEGER -- NULL until claimed
|
||||
);
|
||||
|
||||
-- At most one unclaimed (active) expedition per character.
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_one_active_expedition
|
||||
ON expeditions(character_id) WHERE claimed_at IS NULL;
|
||||
|
||||
-- ===== EXPEDITION DEFINITIONS =====
|
||||
-- "Scout the Old Road" — 10 min, low risk/reward
|
||||
INSERT OR IGNORE INTO expedition_defs (id, slug, name, description, min_level, duration_sec, energy_cost, xp_reward, gold_min, gold_max) VALUES
|
||||
(1, 'scout-old-road', 'Scout the Old Road', 'Patrol the abandoned trade route north of Cindergate.', 1, 600, 10, 30, 5, 15),
|
||||
-- "Raid the Bandit Camp" — 1 hour, medium risk/reward (+ loot roll)
|
||||
(2, 'raid-bandit-camp', 'Raid the Bandit Camp', 'Launch a coordinated strike on the bandit encampment in Gloomroot.', 3, 3600, 30, 100, 20, 60),
|
||||
-- "Delve the Hollow" — 4 hours, high risk/reward (+ loot roll)
|
||||
(3, 'delve-the-hollow', 'Delve the Hollow', 'Explore the ancient ruins beneath the Ashfang Crags.', 5, 14400, 60, 300, 50, 150);
|
||||
Reference in New Issue
Block a user