猜颜色
This commit is contained in:
parent
a9e52dc1e6
commit
de271d25ef
@ -56,34 +56,55 @@ func GetActivityItemId(Id int) int {
|
||||
}
|
||||
|
||||
func GetRewardItem(Id int, Type int) []*item.Item {
|
||||
data, err := gamedata.GetDataByIntKey(CFG_GUESS_COLOR_REWARD, Id)
|
||||
data, err := gamedata.GetData(CFG_GUESS_COLOR_REWARD)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
if Type == 1 {
|
||||
return gamedata.GetItemList(data, "Items1")
|
||||
for k, v := range data {
|
||||
min := GoUtil.Int(k)
|
||||
max := gamedata.GetIntValue(v, "Max")
|
||||
if Id >= min && Id <= max {
|
||||
if Type == 1 {
|
||||
return gamedata.GetItemList(v, "Items1")
|
||||
}
|
||||
return gamedata.GetItemList(v, "Items2")
|
||||
}
|
||||
}
|
||||
return gamedata.GetItemList(data, "Items2")
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetPassNum(Pass int) int {
|
||||
data, err := gamedata.GetDataByIntKey(CFG_GUESS_COLOR_REWARD, Pass)
|
||||
func GetPassNum(Id int) int {
|
||||
data, err := gamedata.GetData(CFG_GUESS_COLOR_REWARD)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return gamedata.GetIntValue(data, "Num")
|
||||
for k, v := range data {
|
||||
min := GoUtil.Int(k)
|
||||
max := gamedata.GetIntValue(v, "Max")
|
||||
if Id >= min && Id <= max {
|
||||
return gamedata.GetIntValue(v, "Num")
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func GetWinTime(Pass int) int {
|
||||
data, err := gamedata.GetDataByIntKey(CFG_GUESS_COLOR_REWARD, Pass)
|
||||
func GetWinTime(Id int) int {
|
||||
data, err := gamedata.GetData(CFG_GUESS_COLOR_REWARD)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
Type := gamedata.GetIntValue(data, "Type")
|
||||
if Type == 1 {
|
||||
return gamedata.GetIntValue(data, "Win")
|
||||
for k, v := range data {
|
||||
min := GoUtil.Int(k)
|
||||
max := gamedata.GetIntValue(v, "Max")
|
||||
if Id >= min && Id <= max {
|
||||
Type := gamedata.GetIntValue(v, "Type")
|
||||
if Type == 1 {
|
||||
return gamedata.GetIntValue(v, "Win")
|
||||
}
|
||||
str := gamedata.GetStringValue(v, "Win")
|
||||
arr := strings.Split(str, "|")
|
||||
return GoUtil.RandNum(GoUtil.Int(arr[0]), GoUtil.Int(arr[1]))
|
||||
}
|
||||
}
|
||||
str := gamedata.GetStringValue(data, "Win")
|
||||
arr := strings.Split(str, "|")
|
||||
return GoUtil.RandNum(GoUtil.Int(arr[0]), GoUtil.Int(arr[1]))
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ func (g *GuessColorMod) InitData() {
|
||||
if g.OMap == nil {
|
||||
g.OMap = make(map[int32]int32)
|
||||
}
|
||||
if g.Pass == 0 {
|
||||
if g.Pass == 0 || g.WinTime == 0 {
|
||||
g.Pass = 1
|
||||
g.WinTime = guesscolorCfg.GetWinTime(g.Pass)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user