上传装备pro属性计算
This commit is contained in:
parent
ed7ad30f95
commit
0c39c60bff
@ -10,6 +10,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
"go_dreamfactory/sys/db"
|
"go_dreamfactory/sys/db"
|
||||||
|
"math"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
@ -735,33 +736,55 @@ func (this *modelBattleComp) createBattleRole(hero *pb.DBHero, vlv int32, tid, p
|
|||||||
|
|
||||||
for k, v := range hero.Property {
|
for k, v := range hero.Property {
|
||||||
arrt := AttributesTransBase(k)
|
arrt := AttributesTransBase(k)
|
||||||
|
if arrt != 0 {
|
||||||
role.Property[arrt] += v
|
role.Property[arrt] += v
|
||||||
if k == comm.Hp {
|
if k == comm.Hp {
|
||||||
role.Currhp += v
|
role.Currhp += v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range hero.AddProperty {
|
||||||
|
switch k {
|
||||||
|
case comm.HpPro:
|
||||||
|
hero.AddProperty[comm.Hp] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[comm.Hp])))
|
||||||
|
case comm.AtkPro:
|
||||||
|
hero.AddProperty[comm.Atk] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[comm.Atk])))
|
||||||
|
case comm.DefPro:
|
||||||
|
hero.AddProperty[comm.Def] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[comm.Def])))
|
||||||
|
case comm.SpeedPro:
|
||||||
|
hero.AddProperty[comm.Speed] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[comm.Speed])))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for k, v := range hero.AddProperty {
|
for k, v := range hero.AddProperty {
|
||||||
arrt := AttributesTransExt(k)
|
arrt := AttributesTransExt(k)
|
||||||
|
if arrt != 0 {
|
||||||
role.Property[arrt] += v
|
role.Property[arrt] += v
|
||||||
if k == comm.Hp {
|
if k == comm.Hp {
|
||||||
role.Currhp += v
|
role.Currhp += v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for k, v := range hero.JuexProperty {
|
for k, v := range hero.JuexProperty {
|
||||||
arrt := AttributesTransExt(k)
|
arrt := AttributesTransExt(k)
|
||||||
|
if arrt != 0 {
|
||||||
role.Property[arrt] += v
|
role.Property[arrt] += v
|
||||||
if k == comm.Hp {
|
if k == comm.Hp {
|
||||||
role.Currhp += v
|
role.Currhp += v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for k, v := range hero.HoroscopeProperty {
|
for k, v := range hero.HoroscopeProperty {
|
||||||
arrt := AttributesTransExt(k)
|
arrt := AttributesTransExt(k)
|
||||||
|
if arrt != 0 {
|
||||||
role.Property[arrt] += v
|
role.Property[arrt] += v
|
||||||
if k == comm.Hp {
|
if k == comm.Hp {
|
||||||
role.Currhp += v
|
role.Currhp += v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for _, v := range hero.Suits {
|
for _, v := range hero.Suits {
|
||||||
if sconf, err := this.module.configure.Getequipsuit(v.Suitid); err != nil {
|
if sconf, err := this.module.configure.Getequipsuit(v.Suitid); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user