feat(build): 更新构建脚本添加资源打包和proto编译 更新build.bat脚本,添加proto文件编译和资源打包功能,调整资源打包顺序。 BREAKING CHANGE: 构建流程发生变化,需要重新生成proto文件和打包资源。 --- refactor(xmlres): 使用gres替换gfile读取资源文件 将xmlres模块中文件读取方式从gfile.GetBytes改为gres.GetContent, 使
39 lines
774 B
Go
39 lines
774 B
Go
package player
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/task"
|
|
"blazing/modules/blazing/model"
|
|
)
|
|
|
|
func (p *Player) CompletedTask(taskID int, ot uint32) {
|
|
|
|
if p.Info.GetTask(taskID) == model.Unaccepted {
|
|
p.Info.SetTask(taskID, model.Completed) //设置完成任务
|
|
|
|
gift := task.GetTaskInfo(uint32(taskID), 0)
|
|
if gift != nil {
|
|
|
|
res := &info.S2C_GET_BOSS_MONSTER{
|
|
BonusID: uint32(taskID),
|
|
}
|
|
if gift.Pet != nil {
|
|
p.Service.Pet.PetAdd(gift.Pet)
|
|
res.PetID = gift.Pet.ID
|
|
res.CaptureTm = gift.Pet.CatchTime
|
|
|
|
}
|
|
for _, item := range gift.ItemList {
|
|
success := p.ItemAdd(item.ItemId, item.ItemCnt)
|
|
if success {
|
|
res.ItemList = append(res.ItemList, item)
|
|
}
|
|
|
|
}
|
|
|
|
p.SendPackCmd(8004, res)
|
|
}
|
|
|
|
}
|
|
}
|