-- tyl 性格系统

DROP TABLE IF EXISTS `role_nature`;
CREATE TABLE `role_nature` (
  `rid` bigint(20) unsigned NOT NULL COMMENT '玩家id',
  `intellect` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '总理性值',
  `nastic` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '总感性值',
  `neutral` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '总中性值',
  `left_intellect` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '剩余理性值',
  `left_nastic` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '剩余感性值',
  `left_neutral` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '剩余中性值',
  `free_value` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '自由性格点',
  `level` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '突破等级',
  `overflow_value` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '溢出点数(用于提升等级)',
  `add_value` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '当前点击的加点数',
  PRIMARY KEY (`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='玩家人格数据';

CREATE TABLE `role_nature_reward` (
  `role_id` bigint(20) unsigned NOT NULL COMMENT '角色Id',
  `category` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '章节',
  `nature_type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '性格类型',
  `spot` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '点位',
  `light_times` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '点亮次数',
  `reward_status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '领奖状态',
  PRIMARY KEY (`role_id`,`category`,`nature_type`,`spot`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='性格-奖励领取状态';

CREATE TABLE `role_nature_tips` (
  `role_id` bigint(20) unsigned NOT NULL COMMENT '角色Id',
  `nature_type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '性格类型',
  `tips` varchar(250) NOT NULL DEFAULT '[]' COMMENT '标签',
  PRIMARY KEY (`role_id`,`nature_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='性格标签';

