feat(pet): 宠物系统重构和功能增强 - 修复战斗boss中effect ID索引错误问题 - 实现宠物仓库和背包管理功能 - 添加宠物列表排序保存功能 - 重构宠物备份列表同步逻辑 - 优化宠物释放和获取逻辑 - 添加宠物背包仓库切换功能 - 修复地图模型广播信息结构问题 - 调整宠物特效数据库查询逻辑 ```
This commit is contained in:
@@ -12,8 +12,6 @@ const TableNamePlayerPetSpecialEffect = "config_boss_effect"
|
||||
type PlayerPetSpecialEffect struct {
|
||||
*cool.Model // 嵌入基础Model(包含主键、创建/更新时间等通用字段)
|
||||
|
||||
// 严格对应XML的4个核心字段
|
||||
SeIdx uint32 `gorm:"not null;uniqueIndex:idx_se_idx;comment:'精灵特效索引(XML中的Idx)'" json:"se_idx"`
|
||||
//Stat uint32 `gorm:"not null;default:0;comment:'精灵特效状态(XML中的Stat)'" json:"stat"`
|
||||
Eid uint32 `gorm:"not null;index:idx_eid;comment:'精灵特效Eid(XML中的Eid)'" json:"eid"`
|
||||
Args []int `gorm:"type:jsonb;comment:'精灵特效参数(XML中的Args)'" json:"args"`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package model
|
||||
package model
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
// 表名统一改为 map_model
|
||||
const (
|
||||
TableNameMapModel = "map_model"
|
||||
TableNameMapModel = "config_map_model"
|
||||
)
|
||||
|
||||
// 模型类型常量 (0:精灵, 1:NPC)
|
||||
@@ -26,7 +26,7 @@ const (
|
||||
MapModelDirectionRightUp
|
||||
)
|
||||
|
||||
// MapModel 地图模型配置表(NPC/宠物)
|
||||
// MapModel 地图模型配置表 (NPC/宠物)
|
||||
type MapModel struct {
|
||||
*cool.Model // 保留通用Model(ID/创建时间/更新时间等)
|
||||
|
||||
@@ -41,6 +41,7 @@ type MapModel struct {
|
||||
HeadTalk string `gorm:"type:varchar(255);default:'';comment:'头顶对话框内容'" json:"head_talk" description:"头顶对话框内容"`
|
||||
Pos string `gorm:"type:varchar(255);default:'';comment:'位置'" json:"pos" description:"位置"`
|
||||
HP int32 `gorm:"type:int;default:0;comment:'血量'" json:"hp" description:"血量"`
|
||||
Scale float64 `gorm:"type:decimal(6,2);default:1.00;comment:'缩放倍数'" json:"scale" description:"缩放倍数"`
|
||||
Direction int32 `gorm:"type:int;default:2;comment:'方向(0-7)'" json:"direction" description:"BOSS方向"`
|
||||
TriggerPlotID uint32 `gorm:"default:0;comment:'触发剧情ID(0表示无剧情)'" json:"trigger_plot_id" description:"触发剧情ID"`
|
||||
Cloths []uint32 `gorm:"type:varchar(255);default:'';comment:'服装'" json:"cloths" description:"服装"`
|
||||
|
||||
@@ -10,7 +10,7 @@ type EffectService struct {
|
||||
}
|
||||
|
||||
func (s *EffectService) Args(id []uint32) []model.PlayerPetSpecialEffect {
|
||||
m := dbm_notenable(s.Model).WhereIn("se_idx", id)
|
||||
m := dbm_notenable(s.Model).WhereIn("id", id)
|
||||
var tt []model.PlayerPetSpecialEffect
|
||||
m.Scan(&tt)
|
||||
|
||||
@@ -21,8 +21,8 @@ func NewEffectService() *EffectService {
|
||||
return &EffectService{
|
||||
&cool.Service{
|
||||
|
||||
Model: model.NewPlayerPetSpecialEffect(),
|
||||
UniqueKey: map[string]string{"idx_se_idx": "索引不能重复"},
|
||||
Model: model.NewPlayerPetSpecialEffect(),
|
||||
|
||||
PageQueryOp: &cool.QueryOp{
|
||||
KeyWordField: []string{"desc"},
|
||||
},
|
||||
|
||||
@@ -21,6 +21,10 @@ func NewMapmodelService() *MapmodelService {
|
||||
KeyWordField: []string{"remake"},
|
||||
FieldEQ: []string{"map_id"},
|
||||
},
|
||||
ListQueryOp: &cool.QueryOp{
|
||||
KeyWordField: []string{"remake"},
|
||||
FieldEQ: []string{"map_id"},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user