Files
i-mic-fps/lib/sound_effects/shield_regen.rb
2020-12-02 17:37:48 -06:00

28 lines
497 B
Ruby

# frozen_string_literal: true
class IMICFPS
class SoundEffect
class ShieldRegen < SoundEffect
def setup
@sound = SoundManager.sound("base", :shield_regen)
@player = @options[:player]
@channel = @sound.play(0.0, 0.0, true)
end
def ratio
@player.health
end
def update
@channel.speed = 0.5 + ratio / 2
@channel.volume = 1.0 - ratio / 2
end
def done?
ratio >= 1.0
end
end
end
end