mirror of
https://github.com/thecatontheceiling/buckshotroulette-decomp.git
synced 2024-11-25 23:17:22 +00:00
18 lines
500 B
GDScript3
18 lines
500 B
GDScript3
|
class_name DefibBlade extends Node
|
||
|
|
||
|
@export var anim : AnimationPlayer
|
||
|
@export var speaker : AudioStreamPlayer2D
|
||
|
@export var sound_open : AudioStream
|
||
|
@export var sound_close : AudioStream
|
||
|
@export var wire_normal : Node3D
|
||
|
@export var wire_broken : Node3D
|
||
|
|
||
|
func Blade(state : String, playSound : bool):
|
||
|
anim.play(state)
|
||
|
if (state == "open"): speaker.stream = sound_open
|
||
|
else:
|
||
|
speaker.stream = sound_close
|
||
|
wire_normal.visible = false
|
||
|
wire_broken.visible = true
|
||
|
if (playSound): speaker.play()
|