-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdbmodel.sql
More file actions
74 lines (65 loc) · 3.65 KB
/
dbmodel.sql
File metadata and controls
74 lines (65 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-- ------
-- BGA framework: © Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
-- KingOfTokyo implementation : © <Your name here> <Your email address here>
--
-- This code has been produced on the BGA studio platform for use on http://boardgamearena.com.
-- See http://en.boardgamearena.com/#!doc/Studio for more information.
-- -----
-- dbmodel.sql
-- This is the file where you are describing the database schema of your game
-- Basically, you just have to export from PhpMyAdmin your table structure and copy/paste
-- this export here.
-- Note that the database itself and the standard tables ("global", "stats", "gamelog" and "player") are
-- already created and must not be created here
-- Note: The database schema is created from this file when the game starts. If you modify this file,
-- you have to restart a game to see your changes in database.
-- dice_value : 1, 2, 3, 4 : health, 5: energy, 6: smash
CREATE TABLE IF NOT EXISTS `dice` (
`dice_id` TINYINT unsigned NOT NULL AUTO_INCREMENT,
`dice_value` TINYINT unsigned NOT NULL DEFAULT 0,
`extra` TINYINT unsigned NOT NULL DEFAULT false,
`locked` TINYINT unsigned NOT NULL DEFAULT false,
`rolled` TINYINT unsigned NOT NULL DEFAULT true,
`type` TINYINT unsigned NOT NULL DEFAULT 0,
`discarded` TINYINT unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`dice_id`)
) ENGINE=InnoDB;
-- player_location : 0 : outside tokyo, 1 : tokyo city, 2: tokyo bay
ALTER TABLE `player` ADD `player_location` tinyint UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_health` tinyint UNSIGNED NOT NULL DEFAULT 10;
ALTER TABLE `player` ADD `player_turn_health` SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_turn_gained_health` SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_energy` SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_turn_energy` SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_turn_gained_points` SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_monster` tinyint unsigned NOT NULL;
ALTER TABLE `player` ADD `player_poison_tokens` tinyint unsigned NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_shrink_ray_tokens` tinyint unsigned NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `leave_tokyo_under` tinyint unsigned;
ALTER TABLE `player` ADD `stay_tokyo_over` tinyint unsigned;
ALTER TABLE `player` ADD `player_dead` tinyint UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_berserk` tinyint UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_cultists` SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_wickedness` tinyint UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_take_wickedness_tiles` varchar(15) DEFAULT '[]';
ALTER TABLE `player` ADD `player_zombified` tinyint UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_turn_entered_tokyo` tinyint UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `ask_play_evolution` tinyint UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `player` ADD `player_base_dice` tinyint unsigned NOT NULL DEFAULT 6;
CREATE TABLE IF NOT EXISTS `global_variables` (
`name` varchar(50) NOT NULL,
`value` json,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `turn_damages` (
`from` INT(10) unsigned NOT NULL,
`to` INT(10) unsigned NOT NULL,
`damages` TINYINT unsigned NOT NULL,
`claw_damages` tinyint unsigned NOT NULL,
PRIMARY KEY (`from`, `to`)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `tokyo_tower` (
`level` TINYINT unsigned NOT NULL,
`owner` INT(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`level`)
) ENGINE=InnoDB;