19 lines
918 B
Python
19 lines
918 B
Python
# -*- coding: utf-8 -*-
|
|
from odoo import api, fields, models
|
|
|
|
class GameNpcKnowledge(models.Model):
|
|
_name = 'game.npc.knowledge'
|
|
_description = 'NPC 所知信息'
|
|
_rec_name = 'topic'
|
|
_order = 'sequence, id'
|
|
|
|
npc_id = fields.Many2one('game.npc', string='角色', required=True, ondelete='cascade', index=True)
|
|
topic = fields.Char(string='知识主题', required=True, help='如:水源位置、人物传闻、古代遗迹')
|
|
content = fields.Text(string='所知内容', required=True)
|
|
accuracy = fields.Float(string='准确性', default=1.0,
|
|
help='0.0=完全错误, 1.0=完全准确。模拟谣言、误解、夸张。')
|
|
source = fields.Char(string='信息来源', help='如:亲眼所见 / 听某人说的 / 古书记载')
|
|
sequence = fields.Integer(string='排序', default=10)
|
|
|
|
discovered_date = fields.Datetime(string='得知时间', default=fields.Datetime.now)
|