refactor: 重构战斗属性和特效应用逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -44,6 +44,27 @@ func (p *baseplayer) GetPetInfo(limitlevel uint32) []model.PetInfo {
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func (p *baseplayer) AddBattleProp(index int, level int8) {
|
||||
if p == nil || index < 0 || index >= len(p.Prop) || level == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
p.Prop[index] += level
|
||||
if p.Prop[index] > 6 {
|
||||
p.Prop[index] = 6
|
||||
}
|
||||
if p.Prop[index] < -6 {
|
||||
p.Prop[index] = -6
|
||||
}
|
||||
}
|
||||
|
||||
func (p *baseplayer) ApplyBattleProps(target *model.AttackValue) {
|
||||
if p == nil || target == nil {
|
||||
return
|
||||
}
|
||||
target.Prop = p.Prop
|
||||
}
|
||||
func (f *baseplayer) InvitePlayer(ff common.PlayerI) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user