调整武馆经验收益计算
This commit is contained in:
parent
457ed31fff
commit
078b1af6fc
@ -30,6 +30,7 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls
|
||||
tconfigure *cfg.GamePandamasJxData
|
||||
pconfigure *cfg.GamePandamasJxData
|
||||
_session comm.IUserSession
|
||||
minutes int32
|
||||
filed string
|
||||
exp int32
|
||||
exp1 int32
|
||||
@ -66,10 +67,10 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls
|
||||
|
||||
//计算经验收益
|
||||
if configure.Now().After(time.Unix(pillar.Expend, 0)) {
|
||||
minutes := int32(time.Unix(pillar.Expend, 0).Sub(time.Unix(pillar.Start, 0)).Minutes())
|
||||
minutes = int32(time.Unix(pillar.Expend, 0).Sub(time.Unix(pillar.Start, 0)).Minutes())
|
||||
exp = minutes * pillarconfigure.MinExp
|
||||
} else {
|
||||
minutes := int32(configure.Now().Sub(time.Unix(pillar.Start, 0)).Minutes())
|
||||
minutes = int32(configure.Now().Sub(time.Unix(pillar.Start, 0)).Minutes())
|
||||
exp = minutes * pillarconfigure.MinExp
|
||||
}
|
||||
exp1 += exp
|
||||
@ -83,7 +84,7 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls
|
||||
if hero, code := this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), pillar.Hero); code == pb.ErrorCode_Success {
|
||||
if heroconf := this.module.configure.GetHeroConfig(hero.HeroID); heroconf != nil {
|
||||
if (conf.Camp == 0 || (conf.Camp != 0 && heroconf.Race == conf.Camp)) && (conf.Occupation == 0 || (conf.Occupation != 0 && heroconf.Job == conf.Occupation)) {
|
||||
exp1 += int32(math.Floor(float64(v/conf.Register) * float64(conf.ExpBonus) / float64(100) * float64(exp)))
|
||||
exp1 += minutes * int32(math.Floor(float64(v/conf.Register)*float64(conf.ExpBonus))) * exp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
|
||||
pillarconfigure *cfg.GamePandamasMzData
|
||||
tconfigure *cfg.GamePandamasJxData
|
||||
pconfigure *cfg.GamePandamasJxData
|
||||
minutes int32
|
||||
filed string
|
||||
exp int32
|
||||
exp1 int32
|
||||
@ -93,10 +94,10 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
|
||||
}
|
||||
//计算经验收益
|
||||
if configure.Now().After(time.Unix(pillar.Expend, 0)) {
|
||||
minutes := int32(time.Unix(pillar.Expend, 0).Sub(time.Unix(pillar.Start, 0)).Minutes())
|
||||
minutes = int32(time.Unix(pillar.Expend, 0).Sub(time.Unix(pillar.Start, 0)).Minutes())
|
||||
exp = minutes * pillarconfigure.MinExp
|
||||
} else {
|
||||
minutes := int32(configure.Now().Sub(time.Unix(pillar.Start, 0)).Minutes())
|
||||
minutes = int32(configure.Now().Sub(time.Unix(pillar.Start, 0)).Minutes())
|
||||
exp = minutes * pillarconfigure.MinExp
|
||||
}
|
||||
exp1 += exp
|
||||
@ -110,7 +111,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
|
||||
if hero, code := this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), pillar.Hero); code == pb.ErrorCode_Success {
|
||||
if heroconf := this.module.configure.GetHeroConfig(hero.HeroID); heroconf != nil {
|
||||
if (conf.Camp == 0 || (conf.Camp != 0 && heroconf.Race == conf.Camp)) && (conf.Occupation == 0 || (conf.Occupation != 0 && heroconf.Job == conf.Occupation)) {
|
||||
exp1 += int32(math.Floor(float64(v/conf.Register) * float64(conf.ExpBonus) / float64(100) * float64(exp)))
|
||||
// exp1 += int32(math.Floor(float64(v/conf.Register) * float64(conf.ExpBonus) / float64(100) * float64(exp)))
|
||||
exp1 += minutes * int32(math.Floor(float64(v/conf.Register)*float64(conf.ExpBonus))) * exp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user