mirror of
https://github.com/thecatontheceiling/buckshotroulette-decomp.git
synced 2025-02-05 15:37:18 +00:00
6f47bf7fb4
Fixed a possible softlock where item grabbing started when all alive players have full inventories, while dead players had room in their inventory for more items When entering multiplayer without a connection to Steam, the player will get a message prompt which will return them to the menu once closed Fixed final score showing up incorrectly in singleplayer Fixed the magnifying glass sometimes showing the wrong shell in multiplayer
37 lines
774 B
GDScript
37 lines
774 B
GDScript
class_name TimeScaleManager extends Node
|
|
|
|
@export var pitchShiftDuration : float
|
|
@export var timeScaleLerpDuration : float
|
|
|
|
var moving = false
|
|
var elapsed = 0
|
|
var from
|
|
var to
|
|
|
|
func _process(delta):
|
|
LerpTimeScale()
|
|
|
|
func BeginTimeScaleLerp(start : float, end : float):
|
|
moving = false
|
|
elapsed = 0
|
|
from = start
|
|
to = end
|
|
moving = true
|
|
|
|
func LerpTimeScale():
|
|
if (moving):
|
|
elapsed += get_process_delta_time()
|
|
var c = clampf(elapsed / timeScaleLerpDuration, 0.0 , 1.0)
|
|
c = ease(c, 0.4)
|
|
var val = lerpf(from, to, c)
|
|
Engine.time_scale = val
|
|
|
|
func _unhandled_input(event):
|
|
if GlobalVariables.mp_debugging:
|
|
if event.is_action_pressed("-"):
|
|
moving = false
|
|
if event.is_action_pressed(","):
|
|
moving = false
|
|
if event.is_action_pressed("."):
|
|
moving = false
|