Work on vfx and sfx for traps.
This commit is contained in:
@@ -10,27 +10,27 @@ const action_value : Dictionary[String, int] = {
|
||||
|
||||
const icon_textures : Array = [
|
||||
{
|
||||
"normal" : preload("res://visuals/images/icons/switch button.png"),
|
||||
"pressed" : preload("res://visuals/images/icons/lit switch button.png")
|
||||
"normal" : preload("res://visuals/images/icons/button-detonate.png"),
|
||||
"pressed" : preload("res://visuals/images/icons/button-detonate-hit.png")
|
||||
},
|
||||
{
|
||||
"normal" : preload("res://visuals/images/icons/trap button.png"),
|
||||
"pressed" : preload("res://visuals/images/icons/lit trap button.png")
|
||||
"normal" : preload("res://visuals/images/icons/button-trap.png"),
|
||||
"pressed" : preload("res://visuals/images/icons/button-trap-hit.png")
|
||||
},
|
||||
{
|
||||
"normal" : preload("res://visuals/images/icons/detect button.png"),
|
||||
"pressed" : preload("res://visuals/images/icons/lit detect button.png")
|
||||
"normal" : preload("res://visuals/images/icons/button-detect.png"),
|
||||
"pressed" : preload("res://visuals/images/icons/button-detect-hit.png")
|
||||
},
|
||||
{
|
||||
"normal" : preload("res://visuals/images/icons/ranged attack button.png"),
|
||||
"pressed" : preload("res://visuals/images/icons/lit ranged attack button.png")
|
||||
"normal" : preload("res://visuals/images/icons/button-attack.png"),
|
||||
"pressed" : preload("res://visuals/images/icons/button-attack-hit.png")
|
||||
},
|
||||
]
|
||||
|
||||
const disarm_icon_template = preload("res://templates/disarm_icon.tscn")
|
||||
const success_sound = preload("res://audio/sounds/menu select.wav")
|
||||
const fail_sound = preload("res://audio/sounds/134688__otbtechno__bike-bell.wav")
|
||||
const progress_sound = preload("res://audio/sounds/BUTTON Generic Metal Medium High Mechanics 02.wav")
|
||||
const success_sound = preload("res://audio/sounds/TomWinandySFX_UI_ScifiTech_Notification_13.wav")
|
||||
const fail_sound = preload("res://audio/sounds/TomWinandySFX_UI_ScifiTech_Cancel_05.wav")
|
||||
const progress_sound = preload("res://audio/sounds/metal_tiny_hit_impact_01.wav")
|
||||
|
||||
@onready var confirmation_dialog : ConfirmationDialog = %ConfirmationDialog
|
||||
@onready var disarm_window : PanelContainer = %DisarmWindow
|
||||
@@ -56,7 +56,7 @@ func start_disarming() -> void:
|
||||
progress = 0
|
||||
disarm_icons = []
|
||||
disarm_buttons = []
|
||||
for i in range(difficulty):
|
||||
for i in range(Game.level.difficulty):
|
||||
var btn = randi_range(0,3)
|
||||
var icon : TextureButton = disarm_icon_template.instantiate()
|
||||
icon.texture_normal = icon_textures[btn].normal
|
||||
@@ -71,7 +71,7 @@ func start_disarming() -> void:
|
||||
func try_advance(btn : int) -> void:
|
||||
|
||||
if btn == disarm_buttons[progress]:
|
||||
disarm_icons[progress].set_pressed_no_signal(true)
|
||||
disarm_icons[progress].button_pressed = true
|
||||
progress += 1
|
||||
if progress >= len(disarm_buttons):
|
||||
Game.player.close_modal()
|
||||
|
||||
@@ -59,6 +59,10 @@ func is_valid_trap_square(crd : Vector3i) -> bool:
|
||||
return false
|
||||
return true
|
||||
|
||||
func activate_trap(crd : Vector3i) -> void:
|
||||
var trap = traps[crd]
|
||||
#if trap:
|
||||
|
||||
|
||||
func generate_trap(type : Trap.Type, square : Vector3i):
|
||||
var trap = trap_template.instantiate()
|
||||
|
||||
11
scripts/trap_fx.gd
Normal file
11
scripts/trap_fx.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Node3D
|
||||
|
||||
@onready var anim_player : AnimationPlayer = $AnimationPlayer
|
||||
|
||||
func _ready() -> void:
|
||||
anim_player.play("default")
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
print("Done")
|
||||
queue_free()
|
||||
1
scripts/trap_fx.gd.uid
Normal file
1
scripts/trap_fx.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dq4fq3sdlrtt2
|
||||
Reference in New Issue
Block a user