Compare commits

..

No commits in common. "afe7f632e8e7e347581a03cca0658822b01fc9f7" and "fd73bcd42d70713d02cc4f3ee4e5fbde714c8bad" have entirely different histories.

7 changed files with 8 additions and 90 deletions

View File

@ -1,7 +1,6 @@
[gd_resource type="AudioBusLayout" format=3 uid="uid://dcxpomrfumov"] [gd_resource type="AudioBusLayout" format=3 uid="uid://dcxpomrfumov"]
[resource] [resource]
bus/0/volume_db = -8.00903
bus/1/name = &"SoundEffects" bus/1/name = &"SoundEffects"
bus/1/solo = false bus/1/solo = false
bus/1/mute = false bus/1/mute = false

View File

@ -1,14 +0,0 @@
shader_type spatial;
render_mode blend_mix, cull_front, unshaded;
uniform vec4 color : source_color = vec4(1,0,0,1);
uniform float size : hint_range(1.0, 1.5, 0.01) = 1.05;
void vertex() {
VERTEX *= size;
}
void fragment() {
ALBEDO = color.rgb;
ALPHA = color.a;
}

View File

@ -1,17 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://s2a1pry5fw8f"] [gd_scene load_steps=2 format=3 uid="uid://s2a1pry5fw8f"]
[ext_resource type="Shader" path="res://scenes/interactivity_outline.gdshader" id="1_m18kw"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gi5rt"]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("1_m18kw")
shader_parameter/color = Color(1, 1, 1, 0)
shader_parameter/size = 1.24
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ptaep"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ptaep"]
resource_local_to_scene = true
next_pass = SubResource("ShaderMaterial_gi5rt")
albedo_color = Color(0.0936238, 0.825356, 1, 1) albedo_color = Color(0.0936238, 0.825356, 1, 1)
metallic = 0.8 metallic = 0.8
roughness = 0.4 roughness = 0.4

View File

@ -21,8 +21,6 @@ var _max_speed := 12
var _mouse_sensitivity := 0.008 # radians/pixel var _mouse_sensitivity := 0.008 # radians/pixel
var _projectile_speed := 12.0 var _projectile_speed := 12.0
## Could be only one thing at a time to consider.
var _interaction_selection: Node3D
var controls_disabled := false var controls_disabled := false
var held_thing: String var held_thing: String
@ -54,18 +52,6 @@ func _process(_delta: float) -> void:
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
## Process interactivity selection.
var collider: Object = null
if _line_of_sight.is_colliding():
collider = _line_of_sight.get_collider(0)
if collider != _interaction_selection:
if _interaction_selection != null:
_interaction_selection.get_parent().mark_non_interactive()
if collider != null:
collider.get_parent().mark_interactive()
_interaction_selection = collider
# Add the gravity. # Add the gravity.
if not is_on_floor(): if not is_on_floor():
velocity += get_gravity() * delta velocity += get_gravity() * delta
@ -110,8 +96,12 @@ func _unhandled_input(event: InputEvent) -> void:
return return
if event.is_action_pressed("pick") and held_thing == "": if event.is_action_pressed("pick") and held_thing == "":
if _interaction_selection != null: if _line_of_sight.is_colliding():
_interaction_selection.get_parent().get_picked_up.rpc() if id != 1:
print("test")
# TODO: bad
var picked = _line_of_sight.get_collider(0).get_parent()
picked.get_picked_up.rpc()
hold_thing.rpc() hold_thing.rpc()
if event.is_action_pressed("fire") and held_thing != "": if event.is_action_pressed("fire") and held_thing != "":

View File

@ -77,11 +77,3 @@ func set_global_pos(new: Vector3) -> void:
func get_picked_up() -> void: func get_picked_up() -> void:
if is_multiplayer_authority(): if is_multiplayer_authority():
queue_free() queue_free()
func mark_interactive() -> void:
($Model as CSGSphere3D).material_override.next_pass.set("shader_parameter/color", Color.WHITE)
func mark_non_interactive() -> void:
($Model as CSGSphere3D).material_override.next_pass.set("shader_parameter/color", Color(1, 1, 1, 0))

View File

@ -1,11 +1,9 @@
[gd_scene load_steps=15 format=3 uid="uid://tdsbo3e5ic86"] [gd_scene load_steps=11 format=3 uid="uid://tdsbo3e5ic86"]
[ext_resource type="Script" path="res://src/ingame/water_bomb.gd" id="1_lk5fq"] [ext_resource type="Script" path="res://src/ingame/water_bomb.gd" id="1_lk5fq"]
[ext_resource type="PackedScene" uid="uid://s2a1pry5fw8f" path="res://scenes/water_bomb_model.tscn" id="2_0lxuq"] [ext_resource type="PackedScene" uid="uid://s2a1pry5fw8f" path="res://scenes/water_bomb_model.tscn" id="2_0lxuq"]
[ext_resource type="AudioStream" uid="uid://dtjpv2b74g24m" path="res://assets/sfx/splash-small.wav" id="2_0wk8g"] [ext_resource type="AudioStream" uid="uid://dtjpv2b74g24m" path="res://assets/sfx/splash-small.wav" id="2_0wk8g"]
[ext_resource type="AudioStream" uid="uid://blgrl2wl05feq" path="res://assets/sfx/splash-small-quiet.wav" id="3_hgy7l"] [ext_resource type="AudioStream" uid="uid://blgrl2wl05feq" path="res://assets/sfx/splash-small-quiet.wav" id="3_hgy7l"]
[ext_resource type="Shader" path="res://scenes/interactivity_outline.gdshader" id="3_vfl1p"]
[ext_resource type="Script" path="res://src/lib/item_component.gd" id="5_rpnf2"]
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_0ebrr"] [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_0ebrr"]
properties/0/path = NodePath(".:position") properties/0/path = NodePath(".:position")
@ -27,20 +25,6 @@ properties/5/path = NodePath("SplashParticles:emitting")
properties/5/spawn = true properties/5/spawn = true
properties/5/replication_mode = 2 properties/5/replication_mode = 2
[sub_resource type="ShaderMaterial" id="ShaderMaterial_cpgfr"]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("3_vfl1p")
shader_parameter/color = Color(1, 1, 1, 0)
shader_parameter/size = 1.24
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dykfn"]
resource_local_to_scene = true
next_pass = SubResource("ShaderMaterial_cpgfr")
albedo_color = Color(0.0936238, 0.825356, 1, 1)
metallic = 0.8
roughness = 0.4
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_v7dnr"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_v7dnr"]
albedo_color = Color(0, 1, 1, 1) albedo_color = Color(0, 1, 1, 1)
roughness = 0.2 roughness = 0.2
@ -75,7 +59,6 @@ body = NodePath("RigidBody3D")
replication_config = SubResource("SceneReplicationConfig_0ebrr") replication_config = SubResource("SceneReplicationConfig_0ebrr")
[node name="Model" parent="." instance=ExtResource("2_0lxuq")] [node name="Model" parent="." instance=ExtResource("2_0lxuq")]
material_override = SubResource("StandardMaterial3D_dykfn")
[node name="SplashParticles" type="GPUParticles3D" parent="."] [node name="SplashParticles" type="GPUParticles3D" parent="."]
material_override = SubResource("StandardMaterial3D_v7dnr") material_override = SubResource("StandardMaterial3D_v7dnr")
@ -124,10 +107,6 @@ monitoring = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="PickingArea"] [node name="CollisionShape3D" type="CollisionShape3D" parent="PickingArea"]
shape = SubResource("SphereShape3D_6c830") shape = SubResource("SphereShape3D_6c830")
[node name="ItemComponent" type="Node" parent="."]
script = ExtResource("5_rpnf2")
id = "water"
[connection signal="body_entered" from="RigidBody3D" to="." method="_on_body_entered"] [connection signal="body_entered" from="RigidBody3D" to="." method="_on_body_entered"]
[connection signal="area_entered" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_entered"] [connection signal="area_entered" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_entered"]
[connection signal="area_exited" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_exited"] [connection signal="area_exited" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_exited"]

View File

@ -1,17 +0,0 @@
class_name ItemComponent
extends Node
## Base identity, properties are defined in item db.
@export var id: String
func mark_interactive() -> void:
var parent := get_parent()
if parent.has_method("mark_interactive"):
parent.mark_interactive()
func mark_non_interactive(delta: float) -> void:
var parent := get_parent()
if parent.has_method("mark_non_interactive"):
parent.mark_non_interactive()