WIP: Damage/frag system is implemented without ragdolls
This commit is contained in:
@ -1,9 +1,14 @@
|
||||
[gd_scene format=3 uid="uid://b0k17hibnhnv4"]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b0k17hibnhnv4"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ddwrs0so7swxn" path="res://scenes/characters/y-bot/character.tscn" id="1_87hqt"]
|
||||
|
||||
[node name="ObjectSpawner" type="Node3D"]
|
||||
|
||||
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
|
||||
_spawnable_scenes = PackedStringArray("res://scenes/characters/y-bot/character.tscn")
|
||||
spawn_path = NodePath("../Objects")
|
||||
spawn_limit = 10000
|
||||
|
||||
[node name="Objects" type="Node3D" parent="."]
|
||||
|
||||
[node name="Character" parent="Objects" instance=ExtResource("1_87hqt")]
|
||||
|
@ -1,9 +1,8 @@
|
||||
[gd_scene load_steps=79 format=4 uid="uid://dddu0t2sdcy8h"]
|
||||
[gd_scene load_steps=78 format=4 uid="uid://dddu0t2sdcy8h"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/maps/base/map_loader.gd" id="1_innhj"]
|
||||
[ext_resource type="Script" path="res://scenes/maps/base/spawn_controller.gd" id="2_1ss1b"]
|
||||
[ext_resource type="PackedScene" uid="uid://cdcbn8mglqlyh" path="res://scenes/maps/tools/hit_detector.tscn" id="3_hjypr"]
|
||||
[ext_resource type="PackedScene" uid="uid://b7vj5j6wxqrfr" path="res://scenes/characters/npc/zombie/zombie.tscn" id="4_32d4x"]
|
||||
[ext_resource type="PackedScene" uid="uid://ddwrs0so7swxn" path="res://scenes/characters/y-bot/character.tscn" id="3_nqyim"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_umuqw"]
|
||||
resource_name = "Material_146"
|
||||
@ -758,7 +757,6 @@ ambient_light_source = 3
|
||||
ambient_light_color = Color(1, 1, 1, 1)
|
||||
reflected_light_source = 2
|
||||
glow_enabled = true
|
||||
fog_enabled = true
|
||||
fog_density = 0.103
|
||||
fog_height = 1.5
|
||||
fog_height_density = 2.0
|
||||
@ -1026,8 +1024,5 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -42.595, -0.0187502, -17.3639
|
||||
environment = SubResource("Environment_3ha0j")
|
||||
camera_attributes = SubResource("CameraAttributesPractical_402xp")
|
||||
|
||||
[node name="HitDetector" parent="." instance=ExtResource("3_hjypr")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 32.1837, 9.29777, -7.02714)
|
||||
|
||||
[node name="Zombie" parent="." instance=ExtResource("4_32d4x")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 32.4367, -0.00937653, -3.80586)
|
||||
[node name="Character" parent="." instance=ExtResource("3_nqyim")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.46435, -0.00937462, 0.132427)
|
||||
|
@ -3,14 +3,10 @@ class_name HitDetector
|
||||
|
||||
var health = 5
|
||||
|
||||
@export var color: Color = Color(0, 0, 0)
|
||||
@export var color: Color = Color(0.0, 0.0, 0.0, 0)
|
||||
|
||||
var colors = [Color(1.0, 0.0, 0.0, 1.0),
|
||||
Color(0.0, 1.0, 0.0, 1.0),
|
||||
Color(0.0, 0.0, 1.0, 0.0)]
|
||||
|
||||
func hit(damage: int):
|
||||
color = Color(randf(), randf(), randf())
|
||||
color = Color(randf(), randf(), randf(), randi())
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
@ -19,6 +15,6 @@ func _ready() -> void:
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
material_override.albedo_color = color
|
||||
material.albedo_color = color
|
||||
if health < 1:
|
||||
queue_free()
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cdcbn8mglqlyh"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cdcbn8mglqlyh"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/maps/tools/hit_detector.gd" id="1_4w4v8"]
|
||||
|
||||
@ -7,9 +7,7 @@ properties/0/path = NodePath("Box:color")
|
||||
properties/0/spawn = true
|
||||
properties/0/replication_mode = 1
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_petk4"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5m44n"]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_r26tj"]
|
||||
|
||||
[node name="HitDetector" type="Node3D"]
|
||||
|
||||
@ -17,8 +15,7 @@ properties/0/replication_mode = 1
|
||||
replication_config = SubResource("SceneReplicationConfig_8tws6")
|
||||
|
||||
[node name="Box" type="CSGBox3D" parent="." groups=["target"]]
|
||||
material_override = SubResource("StandardMaterial3D_petk4")
|
||||
use_collision = true
|
||||
collision_layer = 9
|
||||
material = SubResource("StandardMaterial3D_5m44n")
|
||||
material = SubResource("StandardMaterial3D_r26tj")
|
||||
script = ExtResource("1_4w4v8")
|
||||
|
Reference in New Issue
Block a user