Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
52fbce426e
@ -14,6 +14,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
game_block = "game_block.json"
|
game_block = "game_block.json"
|
||||||
game_consumehero = "game_consumehero.json"
|
game_consumehero = "game_consumehero.json"
|
||||||
|
game_integral = "game_integral.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
// /配置管理组件
|
// /配置管理组件
|
||||||
@ -31,6 +32,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
this.module = module.(*Entertainment)
|
this.module = module.(*Entertainment)
|
||||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||||
game_consumehero: cfg.NewGameConsumeHero,
|
game_consumehero: cfg.NewGameConsumeHero,
|
||||||
|
// game_integral: cfg.NewGameInitial,
|
||||||
})
|
})
|
||||||
|
|
||||||
configure.RegisterConfigure(game_block, cfg.NewGameBlock, this.LoadGameBlock)
|
configure.RegisterConfigure(game_block, cfg.NewGameBlock, this.LoadGameBlock)
|
||||||
@ -90,3 +92,18 @@ func (this *configureComp) GetGameConsumeHero(heroid string) (conf *cfg.GameCons
|
|||||||
err = comm.NewNotFoundConfErr(moduleName, game_consumehero, heroid)
|
err = comm.NewNotFoundConfErr(moduleName, game_consumehero, heroid)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *configureComp) GetGameConsumeintegral(key int32) (conf *cfg.GameIntegralData, err error) {
|
||||||
|
var (
|
||||||
|
v interface{}
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_integral); err == nil {
|
||||||
|
if configure, ok := v.(*cfg.GameIntegral); ok {
|
||||||
|
if conf = configure.Get(key); conf != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err = comm.NewNotFoundConfErr(moduleName, game_consumehero, key)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -128,6 +128,11 @@ func (this *Room) AiOperator() {
|
|||||||
if this.NexPower != this.curPower {
|
if this.NexPower != this.curPower {
|
||||||
this.round++
|
this.round++
|
||||||
}
|
}
|
||||||
|
for _, v := range szMap { //
|
||||||
|
if v.Xgrid > 0 {
|
||||||
|
this.player2.Energy += v.Xgrid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.player2.Score += curScore
|
this.player2.Score += curScore
|
||||||
// 广播消息
|
// 广播消息
|
||||||
@ -192,8 +197,18 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if this.player1.Energy >= conf.Skillload {
|
if this.player1.Energy >= conf.Skillload {
|
||||||
this.player1.Energy = conf.Skillload // 清零
|
this.player1.Energy = 0 // 清零
|
||||||
curScore, szMap = this.chessboard.SkillUp(conf.Skilleffect, conf.Skillvalue)
|
|
||||||
|
if score, m := this.chessboard.SkillUp(conf.Skilleffect, conf.Skillvalue); score > 0 {
|
||||||
|
curScore += score
|
||||||
|
szMap = append(szMap, m...)
|
||||||
|
} else {
|
||||||
|
szMap = append(szMap, &pb.MapData{
|
||||||
|
Data: this.chessboard.GetPalatData(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.player1.Score += curScore
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_EntertainNoEnergy,
|
Code: pb.ErrorCode_EntertainNoEnergy,
|
||||||
@ -264,7 +279,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
|||||||
this.player1.Ps = MaxPs
|
this.player1.Ps = MaxPs
|
||||||
}
|
}
|
||||||
for _, v := range szMap { //
|
for _, v := range szMap { //
|
||||||
if v.Xgrid >= 4 {
|
if v.Xgrid > 0 {
|
||||||
if color == 1 {
|
if color == 1 {
|
||||||
this.player1.Energy += v.Xgrid
|
this.player1.Energy += v.Xgrid
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user