Files
bl/modules/blazing/model/monster_refresh.go
昔念 10eed9418c refactor(common): 重构 Conn 实体并优化地图进入逻辑
- 优化 Conn 实体的 SendPack 方法,提高代码复用性
- 添加 goja 模块到 go.work 文件
- 重构地图进入逻辑,增加玩家广播和刷怪功能
- 调整 OutInfo 结构中的 Vip 和 Viped 字段类型
- 简化 MonsterRefresh 结构体定义
2025-08-18 00:38:14 +08:00

48 lines
1.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"blazing/cool"
)
const (
TableNameMonsterRefresh = "monster_refresh" // 怪物刷新规则表
)
// MonsterRefresh 怪物刷新规则模型对应XML中的<monster>标签)
type MonsterRefresh struct {
*cool.Model
MapID int32 `gorm:"not null;index:idx_refresh_by_map_id;comment:'所属地图ID'" json:"map_id"`
MonsterID int32 `gorm:"not null;comment:'怪物唯一编号'" json:"monster_id"`
//Desc string `gorm:"type:varchar(100);not null;comment:'怪物名称(如皮皮)'" json:"desc"`
MinLevel int32 `gorm:"not null;comment:'最低等级'" json:"min_level"`
MaxLevel int32 `gorm:"not null;comment:'最高等级'" json:"max_level"`
Capturable bool `gorm:"not null;comment:'是否可捕捉'" json:"capturable"`
Rate float64 `gorm:"not null;comment:'刷新概率(百分比)'" json:"rate"` //未设置概率的就是默认刷新
Value string `gorm:"type:text;not null;comment:'限制值如19:00-24:00'" json:"value"` //这里是js文本暂定传入时间
}
// TableName MonsterRefresh's table name
func (*MonsterRefresh) TableName() string {
return TableNameMonsterRefresh
}
// GroupName MonsterRefresh's table group
func (*MonsterRefresh) GroupName() string {
return "default"
}
// NewMonsterRefresh create a new MonsterRefresh
func NewMonsterRefresh() *MonsterRefresh {
return &MonsterRefresh{
Model: cool.NewModel(),
}
}
// 初始化表结构
func init() {
cool.CreateTable(&MonsterRefresh{})
}