All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat(pet): 宠物系统重构和功能增强 - 修复战斗boss中effect ID索引错误问题 - 实现宠物仓库和背包管理功能 - 添加宠物列表排序保存功能 - 重构宠物备份列表同步逻辑 - 优化宠物释放和获取逻辑 - 添加宠物背包仓库切换功能 - 修复地图模型广播信息结构问题 - 调整宠物特效数据库查询逻辑 ```
68 lines
2.2 KiB
Go
68 lines
2.2 KiB
Go
package model
|
||
|
||
import (
|
||
"blazing/cool"
|
||
)
|
||
|
||
// 表名统一改为 map_model
|
||
const (
|
||
TableNameMapModel = "config_map_model"
|
||
)
|
||
|
||
// 模型类型常量 (0:精灵, 1:NPC)
|
||
const (
|
||
MapModelTypePet = 0
|
||
MapModelTypeNPC = 1
|
||
)
|
||
|
||
const (
|
||
MapModelDirectionRight = iota
|
||
MapModelDirectionRightDown
|
||
MapModelDirectionDown
|
||
MapModelDirectionLeftDown
|
||
MapModelDirectionLeft
|
||
MapModelDirectionLeftUp
|
||
MapModelDirectionUp
|
||
MapModelDirectionRightUp
|
||
)
|
||
|
||
// MapModel 地图模型配置表 (NPC/宠物)
|
||
type MapModel struct {
|
||
*cool.Model // 保留通用Model(ID/创建时间/更新时间等)
|
||
|
||
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"`
|
||
|
||
ModelID uint32 `gorm:"not null;default:0;comment:'模型ID(NPCID或精灵ID)'" json:"model_id" description:"模型ID"`
|
||
|
||
ModelType int32 `gorm:"type:int;default:0;comment:'模型类型(0:精灵,1:NPC)'" json:"model_type" description:"模型类型"`
|
||
|
||
ModelName string `gorm:"type:varchar(100);default:'';comment:'模型名称'" json:"model_name" description:"模型名称"`
|
||
|
||
HeadTalk string `gorm:"type:varchar(255);default:'';comment:'头顶对话框内容'" json:"head_talk" description:"头顶对话框内容"`
|
||
Pos string `gorm:"type:varchar(255);default:'';comment:'位置'" json:"pos" description:"位置"`
|
||
HP int32 `gorm:"type:int;default:0;comment:'血量'" json:"hp" description:"血量"`
|
||
Scale float64 `gorm:"type:decimal(6,2);default:1.00;comment:'缩放倍数'" json:"scale" description:"缩放倍数"`
|
||
Direction int32 `gorm:"type:int;default:2;comment:'方向(0-7)'" json:"direction" description:"BOSS方向"`
|
||
TriggerPlotID uint32 `gorm:"default:0;comment:'触发剧情ID(0表示无剧情)'" json:"trigger_plot_id" description:"触发剧情ID"`
|
||
Cloths []uint32 `gorm:"type:varchar(255);default:'';comment:'服装'" json:"cloths" description:"服装"`
|
||
Shinyid int32 `gorm:"type:int;default:0;comment:'是否发光'" json:"shiny" description:"是否发光"`
|
||
}
|
||
|
||
func (*MapModel) TableName() string {
|
||
return TableNameMapModel
|
||
}
|
||
|
||
func (*MapModel) GroupName() string {
|
||
return "default"
|
||
}
|
||
|
||
func NewMapModel() *MapModel {
|
||
return &MapModel{
|
||
Model: cool.NewModel(),
|
||
}
|
||
}
|
||
|
||
func init() {
|
||
cool.CreateTable(&MapModel{})
|
||
}
|