40 lines
1.6 KiB
Python
40 lines
1.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
from odoo import models, fields
|
|
|
|
|
|
class YtCodexTalent(models.Model):
|
|
"""图鉴-天赋(全局配置)。每个玩家在 yt.world.character.talent 中拥有
|
|
自己的激活记录与等级,但配置本身全局共享。"""
|
|
_name = 'yt.codex.talent'
|
|
_description = '图鉴-天赋'
|
|
_order = 'sequence, id'
|
|
|
|
name = fields.Char(string='名称', required=True, translate=True)
|
|
code = fields.Char(string='编码', required=True, index=True)
|
|
icon = fields.Char(string='图标', default='🌟')
|
|
quality = fields.Selection([
|
|
('common', '普通'),
|
|
('uncommon', '优秀'),
|
|
('rare', '精良'),
|
|
('epic', '史诗'),
|
|
('legendary', '传说'),
|
|
('mythic', '神话'),
|
|
], string='品质', default='common', required=True)
|
|
trigger = fields.Char(string='触发方式', default='被动')
|
|
effect = fields.Char(string='效果')
|
|
description = fields.Char(string='描述')
|
|
max_level = fields.Integer(string='最大等级', default=1)
|
|
cost_type = fields.Selection([
|
|
('point', '天赋点'),
|
|
('gold', '金币'),
|
|
('exp', '经验'),
|
|
('item', '道具'),
|
|
], string='升级消耗类型', default='point')
|
|
cost_value = fields.Integer(string='每级消耗', default=0)
|
|
unlock_condition = fields.Char(string='解锁条件')
|
|
prerequisite_talent_id = fields.Many2one(
|
|
'yt.codex.talent', string='前置天赋', ondelete='set null',
|
|
help='激活本天赋前必须先激活的天赋'
|
|
)
|
|
sequence = fields.Integer(string='排序', default=10)
|