2026-04-01 06:27:03 +08:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"blazing/cool"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// 表名统一改为 map_model
|
|
|
|
|
|
const (
|
|
|
|
|
|
TableNameMapModel = "map_model"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-04-01 20:10:29 +08:00
|
|
|
|
// 模型类型常量 (0:精灵, 1:NPC)
|
2026-04-01 06:27:03 +08:00
|
|
|
|
const (
|
2026-04-01 20:10:29 +08:00
|
|
|
|
MapModelTypePet = 0
|
2026-04-01 06:27:03 +08:00
|
|
|
|
MapModelTypeNPC = 1
|
2026-04-01 20:10:29 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
MapModelDirectionRight = iota
|
|
|
|
|
|
MapModelDirectionRightDown
|
|
|
|
|
|
MapModelDirectionDown
|
|
|
|
|
|
MapModelDirectionLeftDown
|
|
|
|
|
|
MapModelDirectionLeft
|
|
|
|
|
|
MapModelDirectionLeftUp
|
|
|
|
|
|
MapModelDirectionUp
|
|
|
|
|
|
MapModelDirectionRightUp
|
2026-04-01 06:27:03 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// 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"`
|
|
|
|
|
|
|
2026-04-01 20:10:29 +08:00
|
|
|
|
ModelType int32 `gorm:"type:int;default:0;comment:'模型类型(0:精灵,1:NPC)'" json:"model_type" description:"模型类型"`
|
2026-04-01 06:27:03 +08:00
|
|
|
|
|
|
|
|
|
|
ModelName string `gorm:"type:varchar(100);default:'';comment:'模型名称'" json:"model_name" description:"模型名称"`
|
|
|
|
|
|
|
2026-04-02 02:33:05 +08:00
|
|
|
|
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:"血量"`
|
|
|
|
|
|
Direction int32 `gorm:"type:int;default:2;comment:'方向(0-7)'" json:"direction" description:"BOSS方向"`
|
2026-04-01 06:27:03 +08:00
|
|
|
|
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{
|
2026-04-02 02:33:05 +08:00
|
|
|
|
Model: cool.NewModel(),
|
2026-04-01 06:27:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
cool.CreateTable(&MapModel{})
|
|
|
|
|
|
}
|