修改技能选择实际
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
昔念
2026-02-20 00:46:48 +08:00
parent 1a6870de69
commit 7996e19900
2 changed files with 12 additions and 5 deletions

View File

@@ -91,9 +91,16 @@ func (f *FightC) UseSkill(c common.PlayerI, id uint32) {
if f.GetInputByPlayer(c, false).CurrentPet.Info.Hp <= 0 {
return
}
t, ok := f.GetInputByPlayer(c, false).CurrentPet.Skills[id]
if ok {
ret.SkillEntity = t
// t, ok := f.GetInputByPlayer(c, false).CurrentPet.Skills[id]
// if ok {
// ret.SkillEntity = t
// }
for _, v := range f.GetInputByPlayer(c, false).CurrentPet.Skills {
if v.ID == int(id) {
ret.SkillEntity = v
break
}
}
f.actionChan <- ret

View File

@@ -19,7 +19,7 @@ type BattlePetEntity struct {
//*input.Input
//PType int
Skills map[uint32]*SkillEntity // 技能槽最多4个技能
Skills []*SkillEntity // 技能槽最多4个技能
//Status StatusDict //精灵的状态
//能力提升属性
//Prop PropDict
@@ -33,7 +33,7 @@ func CreateBattlePetEntity(info model.PetInfo, rand *rand.Rand) *BattlePetEntity
ret.PetInfo = xmlres.PetMAP[int(info.ID)] //注入精灵信息
ret.Info = info
ret.Skills = make(map[uint32]*SkillEntity)
ret.Skills = make([]*SkillEntity, 0)
for i := 0; i < len(info.SkillList); i++ {
//todo 技能信息应该每回合进行深拷贝,保证每次的技能效果都是不一样的