三消段位奖励追加consumeexp
This commit is contained in:
parent
2de5010d8f
commit
2998555e67
@ -472,6 +472,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
||||
func (this *Room) GameOver(winner *pb.PlayerData) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
atno []*pb.UserAtno
|
||||
consumeexp int32
|
||||
winindex int32
|
||||
res []*cfg.Gameatn
|
||||
lostPlayer *pb.PlayerData // 输的玩家
|
||||
@ -510,6 +511,7 @@ func (this *Room) GameOver(winner *pb.PlayerData) (errdata *pb.ErrorData) {
|
||||
if v.A == "attr" && v.T == "consumeexp" {
|
||||
list.Consumeexp += int32(v.N*pro) / 1000
|
||||
winScore = int32(v.N*pro) / 1000
|
||||
consumeexp += winScore
|
||||
update["consumeexp"] = list.Consumeexp
|
||||
winner.Consumeexp = list.Consumeexp
|
||||
if list.Consumeexp > list.Maxconsumeexp { // 写最高积分
|
||||
@ -520,6 +522,7 @@ func (this *Room) GameOver(winner *pb.PlayerData) (errdata *pb.ErrorData) {
|
||||
list.Maxsocre = winner.Score
|
||||
update["maxsocre"] = list.Maxsocre
|
||||
}
|
||||
|
||||
} else {
|
||||
res = append(res, v)
|
||||
}
|
||||
@ -527,6 +530,13 @@ func (this *Room) GameOver(winner *pb.PlayerData) (errdata *pb.ErrorData) {
|
||||
if errdata, atno = this.module.DispenseAtno(this.szSession[winindex], res, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
if consumeexp > 0 {
|
||||
atno = append(atno, &pb.UserAtno{
|
||||
A: "attr",
|
||||
T: "consumeexp",
|
||||
N: consumeexp,
|
||||
})
|
||||
}
|
||||
this.szSession[winindex].Push()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user