This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 技能信息应该每回合进行深拷贝,保证每次的技能效果都是不一样的
|
||||
|
||||
Reference in New Issue
Block a user