Audio bus implemented and test pawn intro sound clips added. PawnBodies hooked up to PawnBaseData but not yet implemented.
This commit is contained in:
@@ -19,5 +19,7 @@ class_name PawnBaseData extends Resource
|
||||
var model
|
||||
@export var portrait : Texture2D
|
||||
@export var nameplate : Texture2D
|
||||
@export var name_audio : AudioStream
|
||||
@export var pawn_body : PackedScene
|
||||
|
||||
@export var starting_hacks : Array[HackSet] = [null, null, null]
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=7 format=3 uid="uid://yosnkcj4ci4v"]
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=9 format=3 uid="uid://yosnkcj4ci4v"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://3dj2p3xerc45" path="res://visuals/images/temp_portraits/tg-abdoll-relin.jpg" id="1_4g7al"]
|
||||
[ext_resource type="AudioStream" uid="uid://dhlg3pk3tbirp" path="res://external/sample audio/a.wav" id="1_32lt6"]
|
||||
[ext_resource type="Script" uid="uid://b0b1107c0d807" path="res://data/hackset.gd" id="2_4g7al"]
|
||||
[ext_resource type="Script" uid="uid://c53ohdio1ksp1" path="res://data/pawn_base_data.gd" id="2_8dqhi"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3s6gqy0s5kus" path="res://templates/pawns/glitch.tscn" id="2_ptqwn"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4g7al"]
|
||||
script = ExtResource("2_4g7al")
|
||||
@@ -36,5 +38,7 @@ range_time = 1.0
|
||||
melee_time = 1.25
|
||||
reload_time = 1.75
|
||||
portrait = ExtResource("1_4g7al")
|
||||
name_audio = ExtResource("1_32lt6")
|
||||
pawn_body = ExtResource("2_ptqwn")
|
||||
starting_hacks = Array[ExtResource("2_4g7al")]([SubResource("Resource_4g7al"), SubResource("Resource_8dqhi"), SubResource("Resource_32lt6")])
|
||||
metadata/_custom_type_script = "uid://c53ohdio1ksp1"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=7 format=3 uid="uid://df4gqi1us2dwu"]
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=9 format=3 uid="uid://df4gqi1us2dwu"]
|
||||
|
||||
[ext_resource type="AudioStream" uid="uid://7dsv6kcptvar" path="res://external/sample audio/b.wav" id="1_idp5c"]
|
||||
[ext_resource type="Texture2D" uid="uid://2qoouiv1cf0i" path="res://visuals/images/temp_portraits/tg-john-bishous.jpg" id="1_sb8f5"]
|
||||
[ext_resource type="PackedScene" uid="uid://bum67b50tn8ye" path="res://templates/pawns/veil.tscn" id="2_rv56g"]
|
||||
[ext_resource type="Script" uid="uid://b0b1107c0d807" path="res://data/hackset.gd" id="2_sb8f5"]
|
||||
[ext_resource type="Script" uid="uid://c53ohdio1ksp1" path="res://data/pawn_base_data.gd" id="2_tu5w7"]
|
||||
|
||||
@@ -35,5 +37,7 @@ range_time = 0.75
|
||||
melee_time = 1.0
|
||||
reload_time = 1.75
|
||||
portrait = ExtResource("1_sb8f5")
|
||||
name_audio = ExtResource("1_idp5c")
|
||||
pawn_body = ExtResource("2_rv56g")
|
||||
starting_hacks = Array[ExtResource("2_sb8f5")]([SubResource("Resource_sb8f5"), SubResource("Resource_tu5w7"), SubResource("Resource_idp5c")])
|
||||
metadata/_custom_type_script = "uid://c53ohdio1ksp1"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=7 format=3 uid="uid://dnty6gi4s2vdl"]
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=9 format=3 uid="uid://dnty6gi4s2vdl"]
|
||||
|
||||
[ext_resource type="AudioStream" uid="uid://dr3jq3tnvtwu" path="res://external/sample audio/c.wav" id="1_6f6nq"]
|
||||
[ext_resource type="Texture2D" uid="uid://db0n6kjwucthf" path="res://visuals/images/temp_portraits/tg-lou-riche.jpg" id="1_onotk"]
|
||||
[ext_resource type="Script" uid="uid://c53ohdio1ksp1" path="res://data/pawn_base_data.gd" id="2_7kyxn"]
|
||||
[ext_resource type="PackedScene" uid="uid://c6hojd4o764oc" path="res://templates/pawns/miko.tscn" id="2_54xui"]
|
||||
[ext_resource type="Script" uid="uid://b0b1107c0d807" path="res://data/hackset.gd" id="2_onotk"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_onotk"]
|
||||
@@ -34,5 +36,7 @@ range_damage = 4
|
||||
range_time = 0.4
|
||||
melee_time = 1.25
|
||||
portrait = ExtResource("1_onotk")
|
||||
name_audio = ExtResource("1_6f6nq")
|
||||
pawn_body = ExtResource("2_54xui")
|
||||
starting_hacks = Array[ExtResource("2_onotk")]([SubResource("Resource_onotk"), SubResource("Resource_7kyxn"), SubResource("Resource_6f6nq")])
|
||||
metadata/_custom_type_script = "uid://c53ohdio1ksp1"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=7 format=3 uid="uid://bpb2nok3rqm1g"]
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=9 format=3 uid="uid://bpb2nok3rqm1g"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ci86bksme5114" path="res://visuals/images/temp_portraits/tg-tenrou-ugetsu.jpg" id="1_fm4bf"]
|
||||
[ext_resource type="AudioStream" uid="uid://dsikjobcle18a" path="res://external/sample audio/d.wav" id="1_vnwdb"]
|
||||
[ext_resource type="Script" uid="uid://c53ohdio1ksp1" path="res://data/pawn_base_data.gd" id="2_0fl5x"]
|
||||
[ext_resource type="PackedScene" uid="uid://bqg51qfb0cj8y" path="res://templates/pawns/mr_tingles.tscn" id="2_4mj1t"]
|
||||
[ext_resource type="Script" uid="uid://b0b1107c0d807" path="res://data/hackset.gd" id="3_fm4bf"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0fl5x"]
|
||||
@@ -27,7 +29,6 @@ script = ExtResource("2_0fl5x")
|
||||
name = "Tenrou Ugetsu"
|
||||
move_speed = 3.5
|
||||
life = 100
|
||||
max_life = null
|
||||
ammo = 7
|
||||
max_ammo = 7
|
||||
melee_damage = 15
|
||||
@@ -36,5 +37,7 @@ range_time = 0.3
|
||||
melee_time = 1.25
|
||||
reload_time = 0.6
|
||||
portrait = ExtResource("1_fm4bf")
|
||||
name_audio = ExtResource("1_vnwdb")
|
||||
pawn_body = ExtResource("2_4mj1t")
|
||||
starting_hacks = Array[ExtResource("3_fm4bf")]([SubResource("Resource_0fl5x"), SubResource("Resource_vnwdb"), SubResource("Resource_4mj1t")])
|
||||
metadata/_custom_type_script = "uid://c53ohdio1ksp1"
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=7 format=3 uid="uid://casciqabe0wgo"]
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=9 format=3 uid="uid://casciqabe0wgo"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bsug1ur2gifkh" path="res://visuals/images/temp_portraits/tg-tico.jpg" id="1_o3qj5"]
|
||||
[ext_resource type="AudioStream" uid="uid://dornjmfg37bv0" path="res://external/sample audio/e.wav" id="1_o75pd"]
|
||||
[ext_resource type="Script" uid="uid://c53ohdio1ksp1" path="res://data/pawn_base_data.gd" id="2_cxp03"]
|
||||
[ext_resource type="Script" uid="uid://b0b1107c0d807" path="res://data/hackset.gd" id="2_o3qj5"]
|
||||
[ext_resource type="PackedScene" uid="uid://bb6a6wu2kc3fr" path="res://templates/pawns/pawn_body.tscn" id="2_wsuu3"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o3qj5"]
|
||||
script = ExtResource("2_o3qj5")
|
||||
@@ -36,5 +38,7 @@ range_time = 1.0
|
||||
melee_time = 1.25
|
||||
reload_time = 2.0
|
||||
portrait = ExtResource("1_o3qj5")
|
||||
name_audio = ExtResource("1_o75pd")
|
||||
pawn_body = ExtResource("2_wsuu3")
|
||||
starting_hacks = Array[ExtResource("2_o3qj5")]([SubResource("Resource_o3qj5"), SubResource("Resource_cxp03"), SubResource("Resource_o75pd")])
|
||||
metadata/_custom_type_script = "uid://c53ohdio1ksp1"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=7 format=3 uid="uid://6s8tqfssrt5i"]
|
||||
[gd_resource type="Resource" script_class="PawnBaseData" load_steps=9 format=3 uid="uid://6s8tqfssrt5i"]
|
||||
|
||||
[ext_resource type="AudioStream" uid="uid://bqu2otr8b1oj6" path="res://external/sample audio/f.wav" id="1_2pr8m"]
|
||||
[ext_resource type="Texture2D" uid="uid://bp6wc55s2t4si" path="res://visuals/images/temp_portraits/tg-van-raily.jpg" id="1_crpmc"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwrxbjgwbiv81" path="res://templates/pawns/zero.tscn" id="2_1yw33"]
|
||||
[ext_resource type="Script" uid="uid://b0b1107c0d807" path="res://data/hackset.gd" id="2_crpmc"]
|
||||
[ext_resource type="Script" uid="uid://c53ohdio1ksp1" path="res://data/pawn_base_data.gd" id="2_nf0ju"]
|
||||
|
||||
@@ -32,5 +34,7 @@ range_damage = 5
|
||||
range_time = 0.5
|
||||
melee_time = 1.0
|
||||
portrait = ExtResource("1_crpmc")
|
||||
name_audio = ExtResource("1_2pr8m")
|
||||
pawn_body = ExtResource("2_1yw33")
|
||||
starting_hacks = Array[ExtResource("2_crpmc")]([SubResource("Resource_crpmc"), SubResource("Resource_nf0ju"), SubResource("Resource_2pr8m")])
|
||||
metadata/_custom_type_script = "uid://c53ohdio1ksp1"
|
||||
|
||||
27
default_bus_layout.tres
Normal file
27
default_bus_layout.tres
Normal file
@@ -0,0 +1,27 @@
|
||||
[gd_resource type="AudioBusLayout" format=3 uid="uid://ck35ska6sr17h"]
|
||||
|
||||
[resource]
|
||||
bus/1/name = &"Voice"
|
||||
bus/1/solo = false
|
||||
bus/1/mute = false
|
||||
bus/1/bypass_fx = false
|
||||
bus/1/volume_db = 4.4334908
|
||||
bus/1/send = &"Master"
|
||||
bus/2/name = &"Music"
|
||||
bus/2/solo = false
|
||||
bus/2/mute = false
|
||||
bus/2/bypass_fx = false
|
||||
bus/2/volume_db = -8.793672
|
||||
bus/2/send = &"Master"
|
||||
bus/3/name = &"SFX"
|
||||
bus/3/solo = false
|
||||
bus/3/mute = false
|
||||
bus/3/bypass_fx = false
|
||||
bus/3/volume_db = 0.0
|
||||
bus/3/send = &"Master"
|
||||
bus/4/name = &"UI"
|
||||
bus/4/solo = false
|
||||
bus/4/mute = false
|
||||
bus/4/bypass_fx = false
|
||||
bus/4/volume_db = 0.0
|
||||
bus/4/send = &"Master"
|
||||
BIN
external/sample audio/a.wav
vendored
Normal file
BIN
external/sample audio/a.wav
vendored
Normal file
Binary file not shown.
24
external/sample audio/a.wav.import
vendored
Normal file
24
external/sample audio/a.wav.import
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dhlg3pk3tbirp"
|
||||
path="res://.godot/imported/a.wav-512eaf7f1be1e1dbb02db32d769d1e7c.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://external/sample audio/a.wav"
|
||||
dest_files=["res://.godot/imported/a.wav-512eaf7f1be1e1dbb02db32d769d1e7c.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
external/sample audio/b.wav
vendored
Normal file
BIN
external/sample audio/b.wav
vendored
Normal file
Binary file not shown.
24
external/sample audio/b.wav.import
vendored
Normal file
24
external/sample audio/b.wav.import
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://7dsv6kcptvar"
|
||||
path="res://.godot/imported/b.wav-c59cd0574c9eda65844ca10622a04f6a.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://external/sample audio/b.wav"
|
||||
dest_files=["res://.godot/imported/b.wav-c59cd0574c9eda65844ca10622a04f6a.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
external/sample audio/c.wav
vendored
Normal file
BIN
external/sample audio/c.wav
vendored
Normal file
Binary file not shown.
24
external/sample audio/c.wav.import
vendored
Normal file
24
external/sample audio/c.wav.import
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dr3jq3tnvtwu"
|
||||
path="res://.godot/imported/c.wav-95e1dea73d2cd00bc271f8a5505d51d0.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://external/sample audio/c.wav"
|
||||
dest_files=["res://.godot/imported/c.wav-95e1dea73d2cd00bc271f8a5505d51d0.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
external/sample audio/d.wav
vendored
Normal file
BIN
external/sample audio/d.wav
vendored
Normal file
Binary file not shown.
24
external/sample audio/d.wav.import
vendored
Normal file
24
external/sample audio/d.wav.import
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dsikjobcle18a"
|
||||
path="res://.godot/imported/d.wav-85e5f5f34f2501a9d76f76f4be908185.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://external/sample audio/d.wav"
|
||||
dest_files=["res://.godot/imported/d.wav-85e5f5f34f2501a9d76f76f4be908185.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
external/sample audio/e.wav
vendored
Normal file
BIN
external/sample audio/e.wav
vendored
Normal file
Binary file not shown.
24
external/sample audio/e.wav.import
vendored
Normal file
24
external/sample audio/e.wav.import
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dornjmfg37bv0"
|
||||
path="res://.godot/imported/e.wav-33e3ff5e179b6933a12f0965dbee05eb.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://external/sample audio/e.wav"
|
||||
dest_files=["res://.godot/imported/e.wav-33e3ff5e179b6933a12f0965dbee05eb.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
external/sample audio/f.wav
vendored
Normal file
BIN
external/sample audio/f.wav
vendored
Normal file
Binary file not shown.
24
external/sample audio/f.wav.import
vendored
Normal file
24
external/sample audio/f.wav.import
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://bqu2otr8b1oj6"
|
||||
path="res://.godot/imported/f.wav-e8b08693b137a9f5e83ffd51a7709a8e.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://external/sample audio/f.wav"
|
||||
dest_files=["res://.godot/imported/f.wav-e8b08693b137a9f5e83ffd51a7709a8e.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
@@ -485,18 +485,25 @@ theme_override_font_sizes/font_size = 40
|
||||
text = "CHARACTER SELECT"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
[node name="Music" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("3_bow2h")
|
||||
volume_db = -5.0
|
||||
autoplay = true
|
||||
bus = &"Music"
|
||||
|
||||
[node name="SelectSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("7_bqp8h")
|
||||
|
||||
[node name="Announcer" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
volume_db = 12.381
|
||||
bus = &"Voice"
|
||||
|
||||
[node name="SwitchSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("8_5cdo8")
|
||||
bus = &"SFX"
|
||||
|
||||
[connection signal="spawned" from="SelectorSpawner" to="." method="_on_selector_spawner_spawned"]
|
||||
[connection signal="child_entered_tree" from="Panel2/SelectorStart" to="." method="_on_selector_start_child_entered_tree"]
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_dw7u0"]
|
||||
size = Vector3(0.8, 1, 0.8)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_6h4aj"]
|
||||
resource_local_to_scene = true
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_oyohn"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_odo83"]
|
||||
resource_local_to_scene = true
|
||||
@@ -109,7 +108,7 @@ collision_mask = 6
|
||||
[node name="RangeShape" type="CollisionShape3D" parent="RangeArea"]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
shape = SubResource("BoxShape3D_6h4aj")
|
||||
shape = SubResource("SphereShape3D_oyohn")
|
||||
|
||||
[node name="ActivationTimer" type="Timer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
@@ -5,27 +5,35 @@
|
||||
[ext_resource type="Texture2D" uid="uid://c4r0yuw28xqrc" path="res://visuals/textures/explosive_noise.tres" id="3_2bjjq"]
|
||||
[ext_resource type="Script" uid="uid://w801e8ko5s5d" path="res://scripts/range_sphere.gd" id="4_mfswp"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_besml"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("2_oohvj")
|
||||
shader_parameter/amount = 3.295
|
||||
shader_parameter/intensity = 3.775
|
||||
shader_parameter/fresnel_color = Color(0.73333335, 0.4745098, 0, 1)
|
||||
shader_parameter/noise_texture = ExtResource("3_2bjjq")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0nmat"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("1_besml")
|
||||
shader_parameter/intersection_color = Color(1, 1, 0, 1)
|
||||
shader_parameter/intersection_thickness = 0.05
|
||||
shader_parameter/intersection_thickness = 0.08
|
||||
shader_parameter/intensity = 5.0
|
||||
shader_parameter/dots_per_radian = 10.0
|
||||
shader_parameter/dots_per_radian = 50.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0fg7r"]
|
||||
render_priority = 0
|
||||
next_pass = SubResource("ShaderMaterial_0nmat")
|
||||
shader = ExtResource("2_oohvj")
|
||||
shader_parameter/amount = 2.335
|
||||
shader_parameter/intensity = 4.54
|
||||
shader_parameter/fresnel_color = Color(0.73333335, 0.4745098, 0, 1)
|
||||
shader_parameter/noise_texture = ExtResource("3_2bjjq")
|
||||
[node name="RangeSphere" type="Node3D"]
|
||||
script = ExtResource("4_mfswp")
|
||||
radius = 8.0
|
||||
|
||||
[node name="RangeSphere" type="CSGSphere3D"]
|
||||
[node name="RimSphere" type="CSGSphere3D" parent="."]
|
||||
radius = 1.5
|
||||
radial_segments = 36
|
||||
rings = 36
|
||||
smooth_faces = false
|
||||
material = SubResource("ShaderMaterial_0fg7r")
|
||||
script = ExtResource("4_mfswp")
|
||||
material = SubResource("ShaderMaterial_besml")
|
||||
|
||||
[node name="IntersectSphere" type="CSGSphere3D" parent="."]
|
||||
radius = 1.5
|
||||
radial_segments = 36
|
||||
rings = 36
|
||||
material = SubResource("ShaderMaterial_0nmat")
|
||||
|
||||
@@ -38,16 +38,18 @@ void fragment() {
|
||||
|
||||
ALPHA = max(.05, intersect * intersection_color.a * strength);
|
||||
float angle = atan(v_normal.z, v_normal.x);
|
||||
float dot_step = (2.0f * PI) / dots_per_radian;
|
||||
float dot_step = PI / dots_per_radian;
|
||||
angle = round(angle / dot_step + 0.5f);
|
||||
if(mod(angle,2.0) == 0.0){
|
||||
ALPHA = 0.0;
|
||||
}
|
||||
|
||||
if(ALPHA == .05){
|
||||
ALBEDO = intersection_color.rgb;
|
||||
ALPHA = 0.01;
|
||||
}else{
|
||||
ALBEDO = intersection_color.rgb * strength;
|
||||
EMISSION = intersection_color.rgb * intensity * strength; // Glow effect
|
||||
if(mod(angle,2.0) == 0.0){
|
||||
ALPHA = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user