Files
bl/modules/config/model/map_pit.go
昔念 ef7595a218
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
fix(fight): 移除调试打印语句并修复宠物类型验证逻辑

移除了PetKing函数中的调试打印语句,确保不再输出调试信息到控制台。
同时保持了宠物类型验证的核心逻辑不变。

fix(fight): 修正boss技能伤害计算公式

修改了NewSel323的OnSkill方法中伤害计算的公式,
将原来的百分比计算方式调整为正确的血量差值计算方式。

feat(space): 调整空间定时器间隔时间

将Space.Next方法的时间间隔从6-30秒大幅增加到10-30分钟,
以适应实际的游戏节奏需求。

refactor(config): 更新宠物基础配置模型结构

移除了PetBaseConfig中Hp字段的not null约束,
使配置更加灵活。

feat(config): 扩展地图坑位配置支持新功能

为map_pit配置添加了MustTask必做任务字段和DropItemIds掉落物ID列表,
同时为item和pet服务增加了列表查询操作的等值过滤支持。
```
2026-03-06 23:49:20 +08:00

67 lines
2.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"blazing/cool"
)
const (
TableNameMapPit = "config_map_pit" // 地图坑位配置表(记录坑位归属、类型、属性、关联刷新规则等)
)
type Event struct {
//携带精灵数组Event
Sprites []int32 `gorm:"type:int[];comment:'携带精灵数组'" json:"sprites"`
//触发开始时间Event
StartTime string `gorm:"type:varchar(100);default:'';comment:'触发开始时间'" json:"start_time"`
//触发结束时间Event
EndTime string `gorm:"type:varchar(100);default:'';comment:'触发结束时间'" json:"end_time"`
//触发天气Event
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"`
MustTask []int32 `gorm:"type:int[];comment:'必须任务'" json:"must_task"`
}
// MapPit 地图坑位核心配置模型参照MonsterRefresh实现风格
type MapPit struct {
*BaseConfig
*Event
// 复用通用基础配置ID/创建时间/更新时间等)
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"`
RefreshID []uint32 `gorm:"type:int[];comment:'精灵ID列表'" json:"refresh_id"`
Pos []int `gorm:"type:int[];comment:'坑位位置'" json:"pos"`
//最小等级
MinLevel int `gorm:"type:int;not null;default:1;comment:'最小等级'" json:"min_level"`
//最大等级
MaxLevel int `gorm:"type:int;not null;default:1;comment:'最大等级'" json:"max_level"`
DropItemIds []uint32 `gorm:"type:int[];comment:'掉落物IDs" json:"drop_item_ids"`
//是否可捕捉MapPit
IsCapture int `gorm:"type:int;default:0;comment:'是否可捕捉'" json:"is_capture"`
}
// TableName 指定MapPit对应的数据库表名遵循原模型规范
func (*MapPit) TableName() string {
return TableNameMapPit
}
// GroupName 指定表所属的分组(保持和原模型一致)
func (*MapPit) GroupName() string {
return "default"
}
// NewMapPit 创建一个新的MapPit实例初始化通用BaseConfig
func NewMapPit() *MapPit {
return &MapPit{
BaseConfig: NewBaseConfig(),
Event: &Event{},
}
}
// init 初始化表结构(程序启动时自动创建/同步表)
func init() {
cool.CreateTable(&MapPit{})
}