猜颜色活动优化
This commit is contained in:
parent
8522a99dd6
commit
985f5ad0c9
@ -72,6 +72,7 @@ func (g *GuessColorMod) Login(Id int) int {
|
||||
g.Guess = 0
|
||||
g.MapList = make([]map[int32]int32, 0)
|
||||
g.OMap = make(map[int32]int32)
|
||||
g.WinTime = guesscolorCfg.GetWinTime(g.Pass)
|
||||
return OldId
|
||||
}
|
||||
|
||||
@ -96,6 +97,14 @@ func (g *GuessColorMod) Take(Map map[int32]int32, OMap map[int32]int32) {
|
||||
func (g *GuessColorMod) GetLoseItem() []*item.Item {
|
||||
Items := guesscolorCfg.GetLoseItem(g.Id)
|
||||
Num := guesscolorCfg.GetPassNum(g.Pass)
|
||||
if len(g.MapList) > 0 {
|
||||
LastMap := g.MapList[len(g.MapList)-1]
|
||||
for _, v := range LastMap {
|
||||
if v > 10 {
|
||||
Num--
|
||||
}
|
||||
}
|
||||
}
|
||||
return item.MutilItem(Items, Num)
|
||||
}
|
||||
|
||||
@ -103,7 +112,7 @@ func (g *GuessColorMod) GetReward() ([]*item.Item, error) {
|
||||
if g.Pass == 0 {
|
||||
return nil, fmt.Errorf("not pass")
|
||||
}
|
||||
// Num := guesscolorCfg.GetPassNum(g.Pass)
|
||||
// Num := guesscolorCfg.GetPassNum(g.Pass)
|
||||
if g.Guess < g.WinTime {
|
||||
return nil, fmt.Errorf("guess process not finish")
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user