diff --git a/modules/config/model/boss_pet.go b/modules/config/model/boss_pet.go index 1b2404b76..5a70540eb 100644 --- a/modules/config/model/boss_pet.go +++ b/modules/config/model/boss_pet.go @@ -12,6 +12,9 @@ const ( type BossConfig struct { *cool.Model // 嵌入通用Model(包含ID/创建时间/更新时间等通用字段) PetBaseConfig + //绑定地图地图ID + MapID []int32 `gorm:"type:int[];comment:'绑定地图地图ID'" json:"map_id"` + *Event Script string `gorm:"size:1024;default:'';comment:'BOSS脚本'" json:"script"` //boss出招逻辑做成js脚本 // ISboss uint32 `gorm:"not null;default:0;comment:'是否是Boss'" json:"is_boss"` @@ -33,6 +36,7 @@ func (*BossConfig) GroupName() string { func NewBossConfig() *BossConfig { return &BossConfig{ Model: cool.NewModel(), + Event: &Event{}, } } diff --git a/modules/config/model/map_moster_node.go b/modules/config/model/map_moster_node.go index e83462575..666cfcb32 100644 --- a/modules/config/model/map_moster_node.go +++ b/modules/config/model/map_moster_node.go @@ -8,10 +8,22 @@ const ( TableNameMapPit = "config_map_pit" // 地图坑位配置表(记录坑位归属、类型、属性、关联刷新规则等) ) +type Event struct { + //携带精灵数组Event + Sprites []int32 `gorm:"type:int[];comment:'携带精灵数组'" json:"sprites"` + //触发开始时间Event + StartTime int32 `gorm:"type:int;default:0;comment:'触发开始时间'" json:"start_time"` + //触发结束时间Event + EndTime int32 `gorm:"type:int;default:0;comment:'触发结束时间'" json:"end_time"` + //触发天气Event + Weather []int32 `gorm:"type:int[];comment:'触发天气'" json:"weather"` +} + // MapPit 地图坑位核心配置模型(参照MonsterRefresh实现风格) type MapPit struct { - *BaseConfig // 复用通用基础配置(ID/创建时间/更新时间等) - + *BaseConfig // 复用通用基础配置(ID/创建时间/更新时间等) + MapID []int32 `gorm:"type:int[];comment:'绑定地图地图ID'" json:"map_id"` + *Event PitName string `gorm:"type:varchar(100);default:'';comment:'坑位名称'" json:"pit_name"` RefreshID []int `gorm:"type:int[];comment:'关联刷新规则ID列表'" json:"refresh_id"` @@ -19,8 +31,8 @@ type MapPit struct { MinLevel int `gorm:"type:int;default:0;comment:'最小等级'" json:"min_level"` //最大等级 MaxLevel int `gorm:"type:int;default:0;comment:'最大等级'" json:"max_level"` - - Script string `gorm:"type:text;not null;comment:'刷新脚本(JS格式,对应前端编辑器配置)'" json:"value"` + //是否可捕捉MapPit + IsCapture int `gorm:"type:int;default:0;comment:'是否可捕捉'" json:"is_capture"` } // TableName 指定MapPit对应的数据库表名(遵循原模型规范) @@ -37,6 +49,7 @@ func (*MapPit) GroupName() string { func NewMapPit() *MapPit { return &MapPit{ BaseConfig: NewBaseConfig(), + Event: &Event{}, } } diff --git a/modules/config/model/mapnode.go b/modules/config/model/mapnode.go index 503d643fa..4b51befd5 100644 --- a/modules/config/model/mapnode.go +++ b/modules/config/model/mapnode.go @@ -27,7 +27,8 @@ type MapNode struct { MapID uint32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"` NodeName string `gorm:"type:varchar(100);default:'';comment:'节点名称'" json:"node_name" description:"节点名称"` //节点激活脚本 - NodeActiveScript string `gorm:"type:text;comment:'节点激活脚本'" json:"node_active_script" description:"节点激活脚本"` + // NodeActiveScript string `gorm:"type:text;comment:'节点激活脚本'" json:"node_active_script" description:"节点激活脚本"` + // // 节点核心配置 NodeType int `gorm:"not null;default:0;comment:'节点类型(1-BOSS,2-NPC,3-场景触发,4-传送门)'" json:"node_type" description:"节点类型"`