翻牌游戏数值修复
This commit is contained in:
parent
7c95366d59
commit
ce5c64f789
@ -36,6 +36,21 @@ func GetStarCost(AreaId, SortId int) int {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetStarCostByAreaId(AreaId int) int {
|
||||||
|
data, err := gamedata.GetData(DECORATE_COST)
|
||||||
|
if err != nil {
|
||||||
|
log.Debug("GetStarCost err:%v, AreaId=%d", err, AreaId)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var total int
|
||||||
|
for _, v := range data {
|
||||||
|
if gamedata.GetIntValue(v, "AreaId") == AreaId {
|
||||||
|
total += gamedata.GetIntValue(v, "CostCount")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return total
|
||||||
|
}
|
||||||
|
|
||||||
func GetAreaId(id int) int {
|
func GetAreaId(id int) int {
|
||||||
value, err := gamedata.GetDataByIntKey("DecorateCost", id)
|
value, err := gamedata.GetDataByIntKey("DecorateCost", id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -132,6 +132,10 @@ func (d *Decorate) GetNextNeedStar() int {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *Decorate) GetAreaCost() int {
|
||||||
|
return decorateCfg.GetStarCostByAreaId(d.AreaId)
|
||||||
|
}
|
||||||
|
|
||||||
// 一键装饰
|
// 一键装饰
|
||||||
func (d *Decorate) DecorateAll(Star int, DecorateOffIsExist bool) ([]*item.Item, []*item.Item, int, []int, []interface{}, int) {
|
func (d *Decorate) DecorateAll(Star int, DecorateOffIsExist bool) ([]*item.Item, []*item.Item, int, []int, []interface{}, int) {
|
||||||
DecorateAll := decorateCfg.GetAllSortIdByAreaId(d.AreaId)
|
DecorateAll := decorateCfg.GetAllSortIdByAreaId(d.AreaId)
|
||||||
|
|||||||
@ -3416,7 +3416,7 @@ func ReqPlayroomInfo(player *Player, buf []byte) error {
|
|||||||
} else {
|
} else {
|
||||||
PlayroomMod.SetGameId(playroom.GAME_TYPE_FILP)
|
PlayroomMod.SetGameId(playroom.GAME_TYPE_FILP)
|
||||||
DecorateMod := player.PlayMod.getDecorateMod()
|
DecorateMod := player.PlayMod.getDecorateMod()
|
||||||
needStar := DecorateMod.GetNextNeedStar()
|
needStar := DecorateMod.GetAreaCost()
|
||||||
highReward := int(float64(needStar) * 0.75)
|
highReward := int(float64(needStar) * 0.75)
|
||||||
if highReward < PlayerData.Star {
|
if highReward < PlayerData.Star {
|
||||||
PlayroomMod.SetGameRewardFlip(max(int(float64(needStar)*0.1), 10), max(int(float64(needStar)*0.3), 10), max(int(float64(needStar)*0.75), 10))
|
PlayroomMod.SetGameRewardFlip(max(int(float64(needStar)*0.1), 10), max(int(float64(needStar)*0.3), 10), max(int(float64(needStar)*0.75), 10))
|
||||||
|
|||||||
16
src/server/test/playroom_test.go
Normal file
16
src/server/test/playroom_test.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"server/game"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestPlayroomFlipGame(t *testing.T) {
|
||||||
|
p1 := new(game.Player)
|
||||||
|
p1.InitPlayerByUid(100001)
|
||||||
|
DecorateMod := p1.GetDecorateMod()
|
||||||
|
needStar := DecorateMod.GetAreaCost()
|
||||||
|
highReward := int(float64(needStar) * 0.75)
|
||||||
|
fmt.Printf("needStar: %d, highReward: %d\n", needStar, highReward)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user