package space import ( "blazing/logic/service/maps/info" "sync/atomic" "time" "github.com/gogf/gf/v2/util/grand" ) func (s *Space) getwerboss() { switch s.ID { case 12: case 32: atomic.StoreUint32(&s.CanWeather, 1) s.MapBossInfo = info.MapBossInfo{ Id: 70, } var t info.MapBossSInfo if s.Weather == 1 { s.MapBossInfo.Id = 70 } else { s.MapBossInfo.Id = 0 s.MapBossInfo.Pos = 200 } t.INFO = append(t.INFO, s.MapBossInfo) s.Broadcast(nil, 2021, &t) } } func (t *Space) Next(time.Time) time.Time { if t.CanWeather == 1 { var neww uint32 = 0 if grand.Meet(1, 10) { neww = uint32(grand.N(1, 2)) } if neww != t.Weather { t.Broadcast(nil, 50004, &info.S2C_50004{Id: uint32(neww)}) t.Weather = neww t.getwerboss() } } return time.Now().Add(grand.D(6*time.Second, 30*time.Second)) }