Files
bl/logic/service/task/task.go
昔念 d88a2d19ea ```
feat(fight): 支持勇者之塔和试炼之塔战斗功能

- 实现勇者之塔(CMD 2414)和试炼之塔(CMD 2428)的战斗逻辑
- 添加Tower500Service和Tower600Service的Boss查询功能
- 统一处理两个塔的BossId
2026-01-01 15:37:43 +08:00

37 lines
908 B
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 task
import (
"blazing/common/data"
"blazing/modules/blazing/model"
"blazing/modules/config/service"
)
type TaskResult struct {
Pet *model.PetInfo `json:"petTypeId" description:"发放的精灵ID"` // 发放的精灵ID
ItemList []data.ItemInfo `json:"itemList" description:"发放物品的数组"` // 发放物品的数组,
}
func GetTaskInfo(id, ot uint32) *TaskResult {
ret := &TaskResult{}
r := service.NewTaskService().Get(id, ot)
if r == nil {
return nil
}
pet := service.NewPetRewardService().Get(r.ElfRewardIds)
if pet != nil {
ret.Pet = model.GenPetInfo(int(pet.MonID), int(pet.DV), int(pet.Nature), int(pet.Effect), int(pet.Lv), nil)
}
for _, itemID := range r.ItemRewardIds {
iteminfo := service.NewItemService().GetItemCount(itemID)
ret.ItemList = append(ret.ItemList, data.ItemInfo{ItemId: iteminfo.ItemId, ItemCnt: iteminfo.ItemCnt})
}
return ret
}