feat: stat screen on toilet with Focus overlay, screen draw callback added to manager, meter decay now only on timer revolution, timer visible on stat screen not minigames, Meter.get_timer_decay_percentage() added, Context.stat_screen_active flag added
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -17,6 +17,7 @@ Context = {}
|
||||
--- @return result.minigame_button_mash table Button mash minigame state (see Minigame.get_default_button_mash).
|
||||
--- @return result.minigame_rhythm table Rhythm minigame state (see Minigame.get_default_rhythm).
|
||||
--- @return result.meters table Meter values (see Meter.get_initial).
|
||||
--- @return result.stat_screen_active boolean Whether the stat screen overlay is currently shown.
|
||||
--- @return result.game table Current game progress state. Contains: `current_screen` (string) active screen ID, `current_situation` (string|nil) active situation ID.
|
||||
function Context.initial_data()
|
||||
return {
|
||||
@@ -27,6 +28,7 @@ function Context.initial_data()
|
||||
content = {}
|
||||
},
|
||||
game_in_progress = false,
|
||||
stat_screen_active = false,
|
||||
minigame_ddr = Minigame.get_default_ddr(),
|
||||
minigame_button_mash = Minigame.get_default_button_mash(),
|
||||
minigame_rhythm = Minigame.get_default_rhythm(),
|
||||
|
||||
@@ -89,9 +89,6 @@ function Meter.update()
|
||||
local m = Context.meters
|
||||
local in_minigame = string.find(Window.get_current_id(), "^minigame_") ~= nil
|
||||
if not in_minigame then
|
||||
m.ism = math.max(0, m.ism - METER_DECAY_PER_FRAME)
|
||||
m.wpm = math.max(0, m.wpm - METER_DECAY_PER_FRAME)
|
||||
m.bm = math.max(0, m.bm - METER_DECAY_PER_FRAME)
|
||||
if m.combo > 0 then
|
||||
m.combo_timer = m.combo_timer + 1
|
||||
if m.combo_timer >= COMBO_TIMEOUT_FRAMES then
|
||||
@@ -121,6 +118,13 @@ function Meter.add(key, amount)
|
||||
end
|
||||
end
|
||||
|
||||
--- Gets the timer decay as a percentage of the max meter value.
|
||||
--- @within Meter
|
||||
--- @return number The decay percentage per revolution (e.g. 2 means -2%).
|
||||
function Meter.get_timer_decay_percentage()
|
||||
return math.floor(meter_timer_decay_per_revolution / METER_MAX * 100)
|
||||
end
|
||||
|
||||
--- Called on minigame completion.
|
||||
--- @within Meter
|
||||
function Meter.on_minigame_complete()
|
||||
|
||||
Reference in New Issue
Block a user