```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

refactor(common/data/xmlres): 注释掉未使用的MonsterMap配置变量

- 将MonsterMap配置变量注释掉,因为当前不再使用该配置
- 相应地注释掉了初始化代码中的MonsterMap赋值逻辑

feat(logic/controller): 统一CanFight方法返回值为ErrorCode

- 修改PlayerFightBoss等战斗控制器中的Can
This commit is contained in:
昔念
2026-02-25 16:18:10 +08:00
parent 5e9ac0bef5
commit 7c1540ff6d
20 changed files with 284 additions and 272 deletions

View File

@@ -24,8 +24,9 @@ type MapNode struct {
*BaseConfig
*Event // 嵌入BOSS事件配置
// 基础关联字段
NodeType int `gorm:"not null;default:0;comment:'节点类型0是游戏自带分支,其余自增)'" json:"node_type" description:"节点类型"`
NodeID uint32 `gorm:"not null;default:0;comment:'节点ID'" json:"node_id" description:"节点ID"`
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_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:"节点名称"`
//节点激活脚本
@@ -42,7 +43,7 @@ type MapNode struct {
//回调通boss打完给前端发送固定事件
//PlotFinishScript string `gorm:"type:text;comment:'剧情完成后脚本回调'" json:"plot_finish_script" description:"剧情完成后脚本回调"`
BindBossID uint32 `gorm:"default:0;comment:'绑定的BOSS ID0表示无BOSS'" json:"bind_boss_id" description:"绑定BOSS ID"`
BossIds []uint32 `gorm:"type:jsonb; ;comment:'塔层BOSS ID列表'" json:"boss_ids"`
}
// -------------------------- MapNode 配套方法(遵循项目规范)--------------------------
@@ -64,20 +65,6 @@ func NewMapNode() *MapNode {
}
// GetNodeTypeName 获取节点类型的中文名称(方便展示)
func (m *MapNode) GetNodeTypeName() string {
switch m.NodeType {
case MapNodeTypeBoss:
return "BOSS节点"
case MapNodeTypeNPC:
return "NPC节点"
case MapNodeTypeScene:
return "场景触发节点"
case MapNodeTypePortal:
return "传送门节点"
default:
return "未知节点"
}
}
// -------------------------- 表结构自动同步 --------------------------
func init() {