Files
bl/modules/blazing/model/task.go
昔念 11f6817d62 feat(fight): 优化战斗逻辑与精灵切换流程
- 在多个战斗控制器方法中添加 defer 调用,确保战斗操作正确延迟执行
- 修改 ChangePet 方法返回值类型,增强接口一致性
- 修复战斗准备阶段逻辑,重构战斗开始信息构建过程
- 移除冗余广播调用,调整 PVE 战斗初始化流程
- 更新 README 中的 pprof 命令地址并完善项目介绍部分

fix(effect): 修复效果叠加逻辑与ID解析问题

- 效果叠加时默认增加一层,而非直接相加参数
- 修正 EffectIDCombiner 类型、CatchTime 的掩码偏移计算错误
- 添加重复效果日志输出,便于调试追踪

feat(boss): 完善BOSS特性实现逻辑

- 修正 NewSel17 特性
2025-11-29 19:26:56 +08:00

56 lines
1.4 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"
)
// todo 还需要做一个记录任务奖励的表
const TableNameTask = "task"
// Task mapped from table <task>
type Task struct {
*cool.Model
PlayerID uint64 `gorm:"not null;index:idx_task_by_player_id;comment:'所属玩家ID'" json:"player_id"`
TaskID uint32 `gorm:"not null;comment:'任务ID'" json:"task_id"`
Data string `gorm:"type:jsonb;not null;comment:'全部数据'" json:"data"`
}
// TaskEX 单个任务的详细信息,包含任务步骤状态和整体状态
type TaskEX struct {
Task
Data []uint32 `struc:"[20]byte" orm:"data" json:"data"`
//LastResetTime time.Time `gorm:"not null;comment:'上次重置时间UTC'" json:"last_reset_time"` //这里是每天重置
// Status 任务整体状态0-未接受1-已接受2-已完成未领取3-已完成已领取
// json标签指定JSON字段名与业务状态说明保持一致
//Status byte `json:"status"`
}
// TableName PlayerInfo's table name
func (*Task) TableName() string {
return TableNameTask
}
// GroupName PlayerInfo's table group
func (*Task) GroupName() string {
return "default"
}
func (t *Task) GetData() string {
return t.Data
}
func (t *Task) SetData(t1 string) {
t.Data = t1
}
// NewPlayerInfo create a new PlayerInfo
func NewTask() *Task {
return &Task{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&Task{})
}