feat(pet): 优化精灵生成逻辑,支持随机个体与特性配置

- 修改 `GenPetInfo` 函数参数类型,从数组改为单个整数,简化调用方式
- 支持传入 -1 表示随机生成个体值、性格等属性
- 统一战斗野怪和任务精灵的生成逻辑,确保一致性
- 添加注释说明参数含义,提升代码可读性
- 修复野怪无特性时的处理逻辑,避免空数组引发问题
This commit is contained in:
2025-09-20 13:12:45 +08:00
parent 85ccf751de
commit 892f9207df
3 changed files with 52 additions and 23 deletions

View File

@@ -102,7 +102,7 @@ func (h Controller) Complete_Task(data *task.CompleteTaskInboundInfo, c *player.
case 3:
petid = 4
}
r := model.GenPetInfo(petid, []int{0, 31}, []int{0, 24}, []int{0, 39}, []int{0}, []int{5})
r := model.GenPetInfo(petid, 31, -1, 0, 0, 5)
result.CaptureTime = r.CatchTime
result.PetTypeId = r.ID
c.Service.PetAdd(*r)