猜颜色活动优化

This commit is contained in:
hahwu 2025-04-27 15:54:28 +08:00
parent 8522a99dd6
commit 985f5ad0c9

View File

@ -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)
}