feat(common/utils): 添加时间范围检查工具函数 添加了 IsCurrentTimeInRange 函数用于判断当前时间是否在指定的 HH:MM 时间区间内,支持当前日期的时间比较功能。 refactor(logic/controller): 重构 Boss 挑战逻辑并集成配置服务 - 集成 service 模块替代原有硬编码逻辑 - 重构 PlayerFightBoss 方法,使用新的配置数据结构 - 移除已废弃的 processMonID 函数和相关注释代码 refactor(logic/space): 优化地图 Boss 信息管理和天气系统 - 更新地图 Boss 数据
This commit is contained in:
@@ -15,13 +15,14 @@ type MapConfig struct {
|
||||
// 核心字段
|
||||
MapID uint32 `gorm:"not null;primaryKey;comment:'地图唯一ID(主键)'" json:"map_id" description:"地图ID"`
|
||||
|
||||
WeatherType []uint32 `gorm:"type:int[];comment:'天气类型( 1-雨天,2-雪天)'" json:"weather_type"`
|
||||
WeatherType []uint32 `gorm:"type:int[];comment:'天气类型( 0 晴天,1-雨天,2-雪天)'" json:"weather_type"`
|
||||
//是否超时空
|
||||
IsTimeSpace int `gorm:"type:int;default:0;comment:'是否超时空'" json:"is_time_space"`
|
||||
|
||||
// 掉落物配置
|
||||
DropItemIds []uint32 `gorm:"type:int[];comment:'掉落物IDs" json:"drop_item_ids"`
|
||||
Remark string `gorm:"type:varchar(255);default:'';comment:'性别配置备注(如:默认性别规则)'" json:"remark"` // 调整注释
|
||||
|
||||
Remark string `gorm:"type:varchar(255);default:'';comment:'性别配置备注(如:默认性别规则)'" json:"remark"` // 调整注释
|
||||
}
|
||||
|
||||
// -------------------------- 核心配套方法(遵循项目规范)--------------------------
|
||||
|
||||
@@ -31,11 +31,13 @@ type MapNode struct {
|
||||
NodeName string `gorm:"type:varchar(100);default:'';comment:'节点名称'" json:"node_name" description:"节点名称"`
|
||||
//节点激活脚本
|
||||
|
||||
PositionX float64 `gorm:"not null;default:0;comment:'节点X坐标'" json:"position_x" description:"X坐标"`
|
||||
PositionY float64 `gorm:"not null;default:0;comment:'节点Y坐标'" json:"position_y" description:"Y坐标"`
|
||||
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"`
|
||||
//是否需要广播,比如雷伊
|
||||
IsBroadcast int `gorm:"type:int;default:0;comment:'是否需要广播'" json:"is_broadcast"`
|
||||
// 剧情相关配置
|
||||
TriggerPlotID uint32 `gorm:"default:0;comment:'触发剧情ID(0表示无剧情)'" json:"trigger_plot_id" description:"触发剧情ID"`
|
||||
//BindPlotIDs []uint32 `gorm:"type:int[];comment:'绑定的剧情ID列表'" json:"bind_plot_ids" description:"绑定剧情ID列表"`
|
||||
|
||||
@@ -20,10 +20,18 @@ func NewMapNodeService() *MapNodeService {
|
||||
},
|
||||
}
|
||||
}
|
||||
func (s *MapNodeService) GetData(mapid, pos uint32) []model.MapNode {
|
||||
func (s *MapNodeService) GetData(mapid uint32) []model.MapNode {
|
||||
|
||||
var pet []model.MapNode //一个特性应该是唯一的,但是我们要获取默认随机特性
|
||||
dbm_enable(s.Model).Where("map_id", mapid).Wheref(`pos @> ARRAY[?]::integer[]`, pos).Scan(&pet)
|
||||
dbm_enable(s.Model).Where("map_id", mapid).Scan(&pet)
|
||||
|
||||
return pet
|
||||
|
||||
}
|
||||
func (s *MapNodeService) GetDataNode(mapid, node uint32) *model.MapNode {
|
||||
|
||||
var pet *model.MapNode //一个特性应该是唯一的,但是我们要获取默认随机特性
|
||||
dbm_enable(s.Model).Where("map_id", mapid).Where("node_id", node).Scan(&pet)
|
||||
|
||||
return pet
|
||||
|
||||
|
||||
Reference in New Issue
Block a user