配置更新
This commit is contained in:
parent
78c8ba45bf
commit
87cb5dadb9
@ -10,11 +10,13 @@ import (
|
||||
const (
|
||||
DECORATE_COST = "DecorateCost"
|
||||
INDOOR_PROGRESS = "IndoorProgress"
|
||||
DECORATE_CONST = "DecorateConst"
|
||||
)
|
||||
|
||||
func init() {
|
||||
gamedata.InitCfg("DecorateCost")
|
||||
gamedata.InitCfg("IndoorProgress")
|
||||
gamedata.InitCfg(DECORATE_COST)
|
||||
gamedata.InitCfg(INDOOR_PROGRESS)
|
||||
gamedata.InitCfg(DECORATE_CONST)
|
||||
}
|
||||
|
||||
func GetStarCost(AreaId, SortId int) int {
|
||||
@ -93,3 +95,13 @@ func GetProgressReward(Scene, Lv int) []*item.Item {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 获取一键装饰的解锁等级
|
||||
func GetOneKeyDecorateUnlockLv() int {
|
||||
data, err := gamedata.GetDataByKey(DECORATE_CONST, "OneKey")
|
||||
if err != nil {
|
||||
log.Debug("GetOneKeyDecorateUnlockLv err:%v", err)
|
||||
return 0
|
||||
}
|
||||
return gamedata.GetIntValue(data, "Value")
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import (
|
||||
"math"
|
||||
"server/GoUtil"
|
||||
cardCfg "server/conf/card"
|
||||
decorateCfg "server/conf/decorate"
|
||||
mergeDataCfg "server/conf/mergeData"
|
||||
miningCfg "server/conf/mining"
|
||||
playroomCfg "server/conf/playroom"
|
||||
@ -419,7 +420,14 @@ func ReqDecorateAll(args []interface{}) error {
|
||||
req := &msg.ReqDecorateAll{}
|
||||
proto.Unmarshal(buf, req)
|
||||
DecorateMod := player.PlayMod.getDecorateMod()
|
||||
|
||||
UnLockLv := decorateCfg.GetOneKeyDecorateUnlockLv()
|
||||
if player.GetPlayerBaseMod().GetLevel() < UnLockLv {
|
||||
player.SendErrClienRes(&msg.ResDecorateAll{
|
||||
Code: msg.RES_CODE_FAIL,
|
||||
Msg: fmt.Sprintf("等级不足%d级", UnLockLv),
|
||||
})
|
||||
return errors.New("等级不足")
|
||||
}
|
||||
PlayerBaseMod := player.GetPlayerBaseMod()
|
||||
CostItem, AddItem, DecorateNum, DecorateList := DecorateMod.DecorateAll(PlayerBaseMod.GetStar())
|
||||
err := player.HandleItem(CostItem, msg.ITEM_POP_LABEL_DecorateCost.String()) // 扣除道具
|
||||
|
||||
Loading…
Reference in New Issue
Block a user