2026-02-22 07:51:37 +08:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"blazing/cool"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
2026-04-01 06:27:03 +08:00
|
|
|
|
TableNameMapNode = "config_map_node"
|
2026-02-22 07:51:37 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
2026-04-01 06:27:03 +08:00
|
|
|
|
MapNodeTypeBoss = 1
|
|
|
|
|
|
MapNodeTypeNPC = 2
|
|
|
|
|
|
MapNodeTypeScene = 3
|
|
|
|
|
|
MapNodeTypePortal = 4
|
2026-02-22 07:51:37 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
2026-04-01 06:27:03 +08:00
|
|
|
|
// MapNode stores map node config used by the existing boss/node flow.
|
2026-02-22 07:51:37 +08:00
|
|
|
|
type MapNode struct {
|
|
|
|
|
|
*BaseConfig
|
2026-04-01 06:27:03 +08:00
|
|
|
|
*Event
|
|
|
|
|
|
|
2026-02-25 16:18:10 +08:00
|
|
|
|
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"`
|
2026-02-25 13:20:38 +08:00
|
|
|
|
|
2026-02-27 23:13:50 +08:00
|
|
|
|
NodeID uint32 `gorm:"not null;default:0;comment:'节点ID'" json:"node_id" description:"节点ID"`
|
2026-02-22 07:51:37 +08:00
|
|
|
|
|
2026-02-27 23:13:50 +08:00
|
|
|
|
NodeName string `gorm:"type:varchar(100);default:'';comment:'节点名称'" json:"node_name" description:"节点名称"`
|
2026-02-22 07:51:37 +08:00
|
|
|
|
|
2026-02-25 13:20:38 +08:00
|
|
|
|
WinBonusID int `gorm:"type:int;default:0;comment:'胜利奖励ID'" json:"win_bonus_id"`
|
|
|
|
|
|
FailBonusID int `gorm:"type:int;default:0;comment:'失败奖励ID'" json:"fail_bonus_id"`
|
2026-04-01 06:27:03 +08:00
|
|
|
|
|
2026-04-01 20:10:29 +08:00
|
|
|
|
IsBroadcast uint32 `gorm:"type:int;default:0;comment:'广播模型ID(0表示不广播)'" json:"is_broadcast"`
|
2026-04-01 06:27:03 +08:00
|
|
|
|
|
2026-04-08 01:28:55 +08:00
|
|
|
|
IsGroupBoss uint32 `gorm:"type:int;default:0;comment:'是否为组队Boss(0否1是)'" json:"is_group_boss" description:"是否为组队Boss"`
|
|
|
|
|
|
|
2026-02-25 13:20:38 +08:00
|
|
|
|
TriggerPlotID uint32 `gorm:"default:0;comment:'触发剧情ID(0表示无剧情)'" json:"trigger_plot_id" description:"触发剧情ID"`
|
2026-03-21 01:06:59 +08:00
|
|
|
|
|
2026-04-01 06:27:03 +08:00
|
|
|
|
BossIds []uint32 `gorm:"type:jsonb;comment:'塔层BOSS ID列表'" json:"boss_ids"`
|
2026-02-22 07:51:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (*MapNode) TableName() string {
|
|
|
|
|
|
return TableNameMapNode
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (*MapNode) GroupName() string {
|
|
|
|
|
|
return "default"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func NewMapNode() *MapNode {
|
|
|
|
|
|
return &MapNode{
|
|
|
|
|
|
BaseConfig: NewBaseConfig(),
|
2026-04-01 06:27:03 +08:00
|
|
|
|
Event: &Event{},
|
2026-02-22 07:51:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
cool.CreateTable(&MapConfig{})
|
|
|
|
|
|
cool.CreateTable(&MapNode{})
|
|
|
|
|
|
}
|