Audio bus implemented and test pawn intro sound clips added. PawnBodies hooked up to PawnBaseData but not yet implemented.

This commit is contained in:
2026-03-07 03:33:59 -05:00
parent 52fe2f58d4
commit 984567cf96
28 changed files with 296 additions and 43 deletions

View File

@@ -26,6 +26,9 @@ var selector_wait : float = 0
var selected : int = -1
var selectors : Dictionary[int,PawnSelector] = {}
var displays : Dictionary[int, PawnDisplay] = {}
var announce_tween : Tween = null
@onready var announcer : AudioStreamPlayer = %Announcer
@onready var selector_start : Control = %SelectorStart
@onready var switch_sound : AudioStreamPlayer = %SwitchSound
@onready var select_sound : AudioStreamPlayer = %SelectSound
@@ -105,6 +108,14 @@ func move_selector(peer_id : int, selection : int) -> void:
var v = Vector2(175 * selector.selection, 0)
selector.position = Vector2(175 * selector.selection, 0)
switch_sound.play()
if announce_tween != null and announce_tween.is_running():
announce_tween.stop()
if announcer.playing:
announcer.stop()
announce_tween = create_tween()
announce_tween.tween_interval(.25)
announcer.stream = pawns[selection].name_audio
announce_tween.tween_callback(announcer.play)
@rpc("any_peer","call_local","reliable")
func lock_selector(peer_id : int) -> void:

View File

@@ -9,13 +9,13 @@ enum Type{
CONTAIN
}
const range_shapes : Dictionary = {
Hack.Type.DESTROY : Vector3(4.25,3,4.25),
Hack.Type.INFECT : Vector3(1,1,1),
Hack.Type.CONTAIN : Vector3(1,1,1),
Hack.Type.REDIRECT : Vector3(1,1,1),
Hack.Type.TRIGGER : Vector3(3,1,3),
Hack.Type.PURGE : Vector3(4.25,3,4.25),
const range_radius : Dictionary = {
Hack.Type.DESTROY : 2,
Hack.Type.INFECT : .5,
Hack.Type.CONTAIN : .5,
Hack.Type.REDIRECT : .5,
Hack.Type.TRIGGER : 1,
Hack.Type.PURGE : 1.5,
}
const hack_icons : Dictionary = {
Hack.Type.DESTROY : preload("res://external/destroy-icon.png"),
@@ -34,7 +34,7 @@ const infect_emitter_template = preload("res://templates/gas_emitter.tscn")
const force_activate_sound = preload("res://audio/sounds/TomWinandySFX_UI_ScifiTech_Start_06.wav")
@onready var range_area : Area3D = %RangeArea
@onready var range_shape : BoxShape3D = %RangeShape.shape
@onready var range_shape : SphereShape3D = %RangeShape.shape
@onready var model : MeshInstance3D = %Model
@onready var icon : Sprite3D = %Icon
@onready var force_strip : Sprite3D = %ForceStrip
@@ -113,7 +113,7 @@ func _ready() -> void:
icon.texture = hack_icons[type]
model.visible = owns_hack
icon.visible = owns_hack
range_shape.size = range_shapes[type]
range_shape.radius = range_radius[type]
match(type):
Type.DESTROY:
damage = 15

View File

@@ -180,7 +180,8 @@ func _physics_process(delta: float) -> void:
if detecting:
update_detect_region.rpc(true)
if range_sphere:
update_range_sphere()
#Deal with the rest of the buttons
if !input_locked:
if modal:
@@ -241,19 +242,30 @@ func update_actions() -> void:
if range_sphere != null:
range_sphere.queue_free()
range_sphere = range_sphere_template.instantiate()
Game.level.add_child(range_sphere)
#Set the range sphere size based upon the current hack
update_range_sphere()
if input.is_action_just_released("install"):
installing = false
range_sphere.queue_free()
range_sphere = null
try_install_hack()
elif input.is_action_pressed("attack"):
attack()
elif input.is_action_just_released("install"):
installing = false
range_sphere.queue_free()
range_sphere = null
try_install_hack()
func update_range_sphere() -> void:
pass
var new_pos = (global_position - Vector3.ONE * .5).round() + Vector3(0.5, 0, 0.5)
if range_sphere.global_position != new_pos:
range_sphere.global_position = new_pos
var type = data.hacks[data.active_hack].type
if range_sphere.type != type:
range_sphere.set_range(Hack.range_radius[data.hacks[data.active_hack].type])
range_sphere.type = type
func update_struggle(delta : float) -> bool:
if struggle_timer > 0:
@@ -351,12 +363,13 @@ func try_install_hack() -> void:
action_tween = create_tween()
input_locked = true
body.travel_animation("Install")
#body.travel_animation("Install")
action_tween.tween_interval(.2)
action_tween.tween_callback(Callable(install_hack).bind(square, data.active_hack))
action_tween.tween_interval(.25)
action_tween.tween_callback(clear_action)
func install_hack(square : Vector3i, idx : int) -> void:
var type : Hack.Type = data.hacks[idx].type
var hack = hack_template.instantiate()

View File

@@ -1,5 +1,22 @@
class_name RangeSphere extends CSGSphere3D
@tool
class_name RangeSphere extends Node3D
var _radius : float = 1
var type : Hack.Type = -1
@onready var rim_sphere : CSGSphere3D = $RimSphere
@onready var intersect_sphere : CSGSphere3D = $IntersectSphere
func set_range(range : int) -> void:
@export_range(0.1, 10.0, 0.1) var radius : float :
get:
return _radius
set(value):
_radius = value
if rim_sphere != null:
rim_sphere.radius = _radius
if intersect_sphere != null:
intersect_sphere.radius = _radius
func set_range(range : float) -> void:
radius = range