mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
耐力模块初步完善
This commit is contained in:
@@ -31,6 +31,9 @@ func (t *TickManager) OnGameServerTick() {
|
||||
t.tickCount++
|
||||
now := time.Now().UnixMilli()
|
||||
t.onTick100MilliSecond(now)
|
||||
if t.tickCount%2 == 0 {
|
||||
t.onTick200MilliSecond(now)
|
||||
}
|
||||
if t.tickCount%(10*1) == 0 {
|
||||
t.onTickSecond(now)
|
||||
}
|
||||
@@ -222,6 +225,15 @@ func (t *TickManager) onTickSecond(now int64) {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TickManager) onTick200MilliSecond(now int64) {
|
||||
// 耐力消耗
|
||||
for _, world := range t.gameManager.worldManager.worldMap {
|
||||
for _, player := range world.playerMap {
|
||||
t.gameManager.StaminaHandler(player)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TickManager) onTick100MilliSecond(now int64) {
|
||||
// 伤害处理和转发
|
||||
for _, world := range t.gameManager.worldManager.worldMap {
|
||||
|
||||
Reference in New Issue
Block a user