From aad5a1b360f02484a5c55e92699775f51b9497d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Fri, 27 Feb 2026 23:13:50 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(config):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=B9=BF=E6=92=AD=E8=8A=82=E7=82=B9=E7=BB=93=E6=9E=84=E4=BD=93?= =?UTF-8?q?=E5=B9=B6=E9=87=8D=E6=9E=84=E5=9C=B0=E5=9B=BE=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增BroadcastNode结构体,包含触发器ID、位置、血量和方向字段 - 将MapNode结构体嵌入BroadcastNode以支持广播节点功能 - 从MapNode中移除重复的TriggerID、Pos、HP字段 - 在Event结构体中新增 --- modules/config/model/map_node.go | 20 ++++++++++++++------ modules/config/model/map_pit.go | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/config/model/map_node.go b/modules/config/model/map_node.go index 13d182414..71fc20949 100644 --- a/modules/config/model/map_node.go +++ b/modules/config/model/map_node.go @@ -19,21 +19,29 @@ const ( MapNodeTypePortal = 4 // 传送门节点 ) +type BroadcastNode struct { + //节点激活脚本 + TriggerID uint32 `gorm:"comment:'触发器ID'" json:"trigger_id" description:"触发器ID"` + //BOSS位置,多位置就是循环触发,固定点就是单位置,如果要实现原地动,就用2个固定位置来做 + //0:固定点,1:多位置,2:循环触发 赛有随机的boss和伪装的boss,如果是伪装boss,就触发剧情后实现boss的切换后再操作 + Pos string `gorm:"type:varchar(255);default:'';comment:'位置'" json:"pos"` + HP int32 `gorm:"type:int;default:0;comment:'血量'" json:"hp" description:"血量"` + //方向BroadcastNode + Direction int32 `gorm:"type:int;default:0;comment:'方向'" json:"direction" description:"方向"` +} + // MapNode 地图节点配置模型 type MapNode struct { *BaseConfig *Event // 嵌入BOSS事件配置 + *BroadcastNode // 基础关联字段 MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"` //可以是精灵也可以是NPC ,到时候npc用高ID去控制就行 - TriggerID uint32 `gorm:"comment:'触发器ID'" json:"trigger_id" description:"触发器ID"` - NodeID uint32 `gorm:"not null;default:0;comment:'节点ID'" json:"node_id" description:"节点ID"` + + NodeID uint32 `gorm:"not null;default:0;comment:'节点ID'" json:"node_id" description:"节点ID"` NodeName string `gorm:"type:varchar(100);default:'';comment:'节点名称'" json:"node_name" description:"节点名称"` - //节点激活脚本 - - Pos string `gorm:"type:varchar(255);default:'';comment:'位置'" json:"pos"` - HP int32 `gorm:"type:int;default:0;comment:'血量'" json:"hp" description:"血量"` 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"` diff --git a/modules/config/model/map_pit.go b/modules/config/model/map_pit.go index 9455cd2d6..0b7788fde 100644 --- a/modules/config/model/map_pit.go +++ b/modules/config/model/map_pit.go @@ -19,6 +19,8 @@ type Event struct { Weather []int32 `gorm:"type:int[];comment:'触发天气'" json:"weather"` //触发的星期Event Week []int32 `gorm:"type:int[];comment:'触发的星期'" json:"week"` + //首发精灵判断Event + FirstSprites []int32 `gorm:"type:int[];comment:'首发精灵判断'" json:"first_sprites"` } // MapPit 地图坑位核心配置模型(参照MonsterRefresh实现风格)