Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
e34714b16d
@ -22,6 +22,7 @@ const (
|
|||||||
game_passcheck = "game_passcheck.json"
|
game_passcheck = "game_passcheck.json"
|
||||||
game_consumetask = "game_consumetask.json"
|
game_consumetask = "game_consumetask.json"
|
||||||
consume_rank = "game_consumerank.json"
|
consume_rank = "game_consumerank.json"
|
||||||
|
game_consumetxt = "game_consumetxt.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
// /配置管理组件
|
// /配置管理组件
|
||||||
@ -48,6 +49,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
game_playerskill: cfg.NewGamePlayerSkill,
|
game_playerskill: cfg.NewGamePlayerSkill,
|
||||||
game_consumetask: cfg.NewGameConsumeTask,
|
game_consumetask: cfg.NewGameConsumeTask,
|
||||||
consume_rank: cfg.NewGameConsumeRank,
|
consume_rank: cfg.NewGameConsumeRank,
|
||||||
|
game_consumetxt: cfg.NewGameConsumeTxt,
|
||||||
})
|
})
|
||||||
configure.RegisterConfigure(game_block, cfg.NewGameBlock, this.LoadGameBlock)
|
configure.RegisterConfigure(game_block, cfg.NewGameBlock, this.LoadGameBlock)
|
||||||
configure.RegisterConfigure(game_passcheck, cfg.NewGamePassCheck, this.updatePassCheck)
|
configure.RegisterConfigure(game_passcheck, cfg.NewGamePassCheck, this.updatePassCheck)
|
||||||
@ -410,3 +412,18 @@ func (this *configureComp) getRankReward() (result *cfg.GameConsumeRank, err err
|
|||||||
err = comm.NewNotFoundConfErr(moduleName, consume_rank, nil)
|
err = comm.NewNotFoundConfErr(moduleName, consume_rank, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *configureComp) getLianShengReward() (result []*cfg.GameConsumeTxtData, err error) {
|
||||||
|
var (
|
||||||
|
v interface{}
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_consumetxt); err == nil {
|
||||||
|
if c, ok := v.(*cfg.GameConsumeTxt); ok {
|
||||||
|
if result = c.GetDataList(); len(result) > 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err = comm.NewNotFoundConfErr(moduleName, game_consumetxt, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -505,10 +505,11 @@ func (this *Room) GameOver(winner *pb.PlayerData) (errdata *pb.ErrorData) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if conf, err := this.module.configure.GetGameConsumeintegral(list.Consumeexp); err == nil {
|
if conf, err := this.module.configure.GetGameConsumeintegral(list.Consumeexp); err == nil {
|
||||||
|
pro := this.LianShengAdd(list.Liansheng) // 连胜加成
|
||||||
for _, v := range conf.Rewards {
|
for _, v := range conf.Rewards {
|
||||||
if v.A == "attr" && v.T == "consumeexp" {
|
if v.A == "attr" && v.T == "consumeexp" {
|
||||||
list.Consumeexp += v.N
|
list.Consumeexp += int32(v.N*pro) / 1000
|
||||||
winScore = v.N
|
winScore = int32(v.N*pro) / 1000
|
||||||
update["consumeexp"] = list.Consumeexp
|
update["consumeexp"] = list.Consumeexp
|
||||||
winner.Consumeexp = list.Consumeexp
|
winner.Consumeexp = list.Consumeexp
|
||||||
if list.Consumeexp > list.Maxconsumeexp { // 写最高积分
|
if list.Consumeexp > list.Maxconsumeexp { // 写最高积分
|
||||||
@ -740,6 +741,29 @@ func (this *Room) JoinRoom(module *Entertainment, p *pb.PlayerData) (room *Room,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *Room) LianShengAdd(liansheng int32) (permillage int32) {
|
||||||
|
var (
|
||||||
|
result []*cfg.GameConsumeTxtData
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if result, err = this.module.configure.getLianShengReward(); err == nil {
|
||||||
|
for pos, v := range result {
|
||||||
|
if len(result) > pos+1 {
|
||||||
|
if result[pos+1].Winningstreak >= liansheng { // 下一等级小于当前值
|
||||||
|
permillage = result[pos].Rewarddata
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
permillage = v.Rewarddata
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if permillage == 0 {
|
||||||
|
permillage = 1
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 修改玩家的房间信息
|
// 修改玩家的房间信息
|
||||||
func (this *Room) ModifyUserRoomInfoData() {
|
func (this *Room) ModifyUserRoomInfoData() {
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user