update
This commit is contained in:
@@ -3,23 +3,34 @@
|
||||
[ext_resource type="PackedScene" path="res://scenes/player/player.tscn" id="player"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/hud/hud.tscn" id="hud"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/enemy/enemy.tscn" id="enemy"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/enemy/boss.tscn" id="boss"]
|
||||
[ext_resource type="Script" path="res://scenes/dungeon/dungeon_manager.gd" id="dungeon_manager"]
|
||||
[ext_resource type="Resource" path="res://scenes/enemy/boss_stats.tres" id="boss_stats"]
|
||||
[ext_resource type="Script" path="res://systems/dungeon_system.gd" id="dungeon_system"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/portal/gate.tscn" id="gate"]
|
||||
[ext_resource type="Script" path="res://systems/health_system.gd" id="health_system"]
|
||||
[ext_resource type="Script" path="res://systems/shield_system.gd" id="shield_system"]
|
||||
[ext_resource type="Script" path="res://systems/damage_system.gd" id="damage_system"]
|
||||
[ext_resource type="Script" path="res://systems/health_system.gd" id="health_system"]
|
||||
[ext_resource type="Script" path="res://systems/heal_system.gd" id="heal_system"]
|
||||
[ext_resource type="Script" path="res://systems/shield_system.gd" id="shield_system"]
|
||||
[ext_resource type="Script" path="res://systems/role_system.gd" id="role_system"]
|
||||
[ext_resource type="Script" path="res://systems/ability_system.gd" id="ability_system"]
|
||||
[ext_resource type="Script" path="res://systems/attack_system.gd" id="attack_system"]
|
||||
[ext_resource type="Script" path="res://systems/cooldown_system.gd" id="cooldown_system"]
|
||||
[ext_resource type="Script" path="res://systems/targeting_system.gd" id="targeting_system"]
|
||||
[ext_resource type="Script" path="res://systems/aggro/aggro_system.gd" id="aggro_system"]
|
||||
[ext_resource type="Script" path="res://systems/aggro/aggro_tracker.gd" id="aggro_tracker"]
|
||||
[ext_resource type="Script" path="res://systems/aggro/aggro_decay.gd" id="aggro_decay"]
|
||||
[ext_resource type="Script" path="res://systems/aggro/aggro_events.gd" id="aggro_events"]
|
||||
[ext_resource type="Script" path="res://systems/enemy_ai_system.gd" id="enemy_ai_system"]
|
||||
[ext_resource type="Script" path="res://systems/ai_system.gd" id="ai_system"]
|
||||
[ext_resource type="Script" path="res://systems/respawn_system.gd" id="respawn_system"]
|
||||
[ext_resource type="Script" path="res://systems/spawn_system.gd" id="spawn_system"]
|
||||
[ext_resource type="Script" path="res://systems/effect_system.gd" id="effect_system"]
|
||||
[ext_resource type="Script" path="res://systems/aura_system.gd" id="aura_system"]
|
||||
[ext_resource type="Script" path="res://systems/buff_system.gd" id="buff_system"]
|
||||
[ext_resource type="Script" path="res://systems/debuff_system.gd" id="debuff_system"]
|
||||
[ext_resource type="Script" path="res://systems/element_system.gd" id="element_system"]
|
||||
[ext_resource type="Script" path="res://systems/hud_system.gd" id="hud_system"]
|
||||
[ext_resource type="Script" path="res://systems/nameplate_system.gd" id="nameplate_system"]
|
||||
[ext_resource type="Resource" uid="uid://cgxtn7dfs40bh" path="res://scenes/player/role/tank/set.tres" id="tank_set"]
|
||||
[ext_resource type="Resource" uid="uid://beodknb6i1pm4" path="res://scenes/player/role/damage/set.tres" id="damage_set"]
|
||||
[ext_resource type="Resource" uid="uid://kcwuhnqy34mj" path="res://scenes/player/role/healer/set.tres" id="healer_set"]
|
||||
|
||||
[sub_resource type="NavigationMesh" id="NavigationMesh_1"]
|
||||
vertices = PackedVector3Array(-7.0, 0.5, -7.0, -7.0, 0.5, 87.0, 7.0, 0.5, 87.0, 7.0, 0.5, -7.0)
|
||||
@@ -58,18 +69,33 @@ size = Vector3(0.5, 3, 90)
|
||||
[node name="HealthSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("health_system")
|
||||
|
||||
[node name="DamageSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("damage_system")
|
||||
|
||||
[node name="HealSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("heal_system")
|
||||
|
||||
[node name="ShieldSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("shield_system")
|
||||
|
||||
[node name="DamageSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("damage_system")
|
||||
[node name="RoleSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("role_system")
|
||||
tank_set = ExtResource("tank_set")
|
||||
damage_set = ExtResource("damage_set")
|
||||
healer_set = ExtResource("healer_set")
|
||||
|
||||
[node name="AbilitySystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("ability_system")
|
||||
|
||||
[node name="AttackSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("attack_system")
|
||||
|
||||
[node name="CooldownSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("cooldown_system")
|
||||
|
||||
[node name="TargetingSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("targeting_system")
|
||||
|
||||
[node name="AggroSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("aggro_system")
|
||||
|
||||
@@ -82,8 +108,8 @@ script = ExtResource("aggro_decay")
|
||||
[node name="AggroEvents" type="Node" parent="Systems/AggroSystem"]
|
||||
script = ExtResource("aggro_events")
|
||||
|
||||
[node name="EnemyAISystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("enemy_ai_system")
|
||||
[node name="AISystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("ai_system")
|
||||
|
||||
[node name="RespawnSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("respawn_system")
|
||||
@@ -91,12 +117,24 @@ script = ExtResource("respawn_system")
|
||||
[node name="SpawnSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("spawn_system")
|
||||
|
||||
[node name="EffectSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("effect_system")
|
||||
[node name="AuraSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("aura_system")
|
||||
|
||||
[node name="BuffSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("buff_system")
|
||||
|
||||
[node name="DebuffSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("debuff_system")
|
||||
|
||||
[node name="ElementSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("element_system")
|
||||
|
||||
[node name="HudSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("hud_system")
|
||||
|
||||
[node name="NameplateSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("nameplate_system")
|
||||
|
||||
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
|
||||
navigation_mesh = SubResource("NavigationMesh_1")
|
||||
|
||||
@@ -203,13 +241,14 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 60)
|
||||
[node name="Enemy4d" parent="." instance=ExtResource("enemy")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 60)
|
||||
|
||||
[node name="Boss" parent="." instance=ExtResource("boss")]
|
||||
[node name="Boss" parent="." groups=["boss"] instance=ExtResource("enemy")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 75)
|
||||
stats = ExtResource("boss_stats")
|
||||
|
||||
[node name="ExitGate" parent="." instance=ExtResource("gate")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, -4)
|
||||
target_scene = "res://scenes/world/world.tscn"
|
||||
is_exit = true
|
||||
|
||||
[node name="DungeonManager" type="Node" parent="."]
|
||||
script = ExtResource("dungeon_manager")
|
||||
[node name="DungeonSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("dungeon_system")
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
extends Node
|
||||
|
||||
func _ready() -> void:
|
||||
var player: Node = get_tree().get_first_node_in_group("player")
|
||||
if player:
|
||||
GameState.restore_player(player)
|
||||
EventBus.entity_died.connect(_on_entity_died)
|
||||
|
||||
func _on_entity_died(entity: Node) -> void:
|
||||
if entity.is_in_group("boss"):
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
GameState.dungeon_cleared = true
|
||||
GameState.returning_from_dungeon = false
|
||||
GameState.clear()
|
||||
EventBus.dungeon_cleared.emit()
|
||||
get_tree().change_scene_to_file("res://scenes/world/world.tscn")
|
||||
@@ -1 +0,0 @@
|
||||
uid://drn4h1lxx5t1j
|
||||
@@ -1,5 +0,0 @@
|
||||
extends "res://scenes/enemy/enemy.gd"
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
add_to_group("boss")
|
||||
@@ -1 +0,0 @@
|
||||
uid://bkehq3dqyp2yd
|
||||
@@ -1,108 +0,0 @@
|
||||
[gd_scene load_steps=6 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemy/boss.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://scenes/healthbar.gd" id="4"]
|
||||
[ext_resource type="Script" path="res://scenes/enemy/enemy_movement.gd" id="5"]
|
||||
[ext_resource type="Resource" path="res://scenes/enemy/boss_stats.tres" id="8"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1"]
|
||||
radius = 0.6
|
||||
height = 2.0
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_2"]
|
||||
radius = 0.6
|
||||
height = 2.0
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_health_bg"]
|
||||
bg_color = Color(0.3, 0.1, 0.1, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_health_fill"]
|
||||
bg_color = Color(0.2, 0.8, 0.2, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_shield_bg"]
|
||||
bg_color = Color(0.1, 0.1, 0.3, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_shield_fill"]
|
||||
bg_color = Color(0.2, 0.5, 0.9, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1"]
|
||||
albedo_color = Color(0.6, 0.1, 0.6, 1)
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_1"]
|
||||
radius = 0.75
|
||||
height = 1.5
|
||||
material = SubResource("StandardMaterial3D_1")
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_1"]
|
||||
radius = 8.0
|
||||
|
||||
[node name="Boss" type="CharacterBody3D"]
|
||||
script = ExtResource("1")
|
||||
stats = ExtResource("8")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("CapsuleShape3D_1")
|
||||
|
||||
[node name="Mesh" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0)
|
||||
mesh = SubResource("SphereMesh_1")
|
||||
|
||||
[node name="HitArea" type="Area3D" parent="."]
|
||||
collision_layer = 4
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="HitArea"]
|
||||
shape = SubResource("CapsuleShape3D_2")
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
|
||||
[node name="EnemyMovement" type="Node" parent="."]
|
||||
script = ExtResource("5")
|
||||
|
||||
[node name="DetectionArea" type="Area3D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 1
|
||||
monitoring = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="DetectionArea"]
|
||||
shape = SubResource("SphereShape3D_1")
|
||||
|
||||
[node name="Healthbar" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.0, 0)
|
||||
billboard = 1
|
||||
pixel_size = 0.01
|
||||
script = ExtResource("4")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="Healthbar"]
|
||||
transparent_bg = true
|
||||
size = Vector2i(104, 29)
|
||||
|
||||
[node name="Border" type="ColorRect" parent="Healthbar/SubViewport"]
|
||||
offset_right = 104.0
|
||||
offset_bottom = 29.0
|
||||
color = Color(1, 0.9, 0.2, 1)
|
||||
|
||||
[node name="HealthBar" type="ProgressBar" parent="Healthbar/SubViewport"]
|
||||
offset_left = 2.0
|
||||
offset_top = 2.0
|
||||
offset_right = 102.0
|
||||
offset_bottom = 12.0
|
||||
theme_override_styles/background = SubResource("StyleBoxFlat_health_bg")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_health_fill")
|
||||
max_value = 500.0
|
||||
value = 500.0
|
||||
show_percentage = false
|
||||
|
||||
[node name="ShieldBar" type="ProgressBar" parent="Healthbar/SubViewport"]
|
||||
offset_left = 2.0
|
||||
offset_top = 15.0
|
||||
offset_right = 102.0
|
||||
offset_bottom = 27.0
|
||||
theme_override_styles/background = SubResource("StyleBoxFlat_shield_bg")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_shield_fill")
|
||||
max_value = 100.0
|
||||
value = 100.0
|
||||
show_percentage = false
|
||||
|
||||
[connection signal="body_entered" from="DetectionArea" to="." method="_on_detection_area_body_entered"]
|
||||
[connection signal="body_exited" from="DetectionArea" to="." method="_on_detection_area_body_exited"]
|
||||
@@ -1 +1 @@
|
||||
uid://bio01w2gd5e7q
|
||||
uid://dlawq281oesnf
|
||||
|
||||
11
scenes/enemy/detection.gd
Normal file
11
scenes/enemy/detection.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Node
|
||||
|
||||
@onready var entity: CharacterBody3D = get_parent()
|
||||
|
||||
func _on_detection_area_body_entered(body: Node3D) -> void:
|
||||
if body is CharacterBody3D and body.name == "Player":
|
||||
EventBus.enemy_detected.emit(entity, body)
|
||||
|
||||
func _on_detection_area_body_exited(body: Node3D) -> void:
|
||||
if body is CharacterBody3D and body.name == "Player":
|
||||
EventBus.enemy_lost.emit(entity, body)
|
||||
1
scenes/enemy/detection.gd.uid
Normal file
1
scenes/enemy/detection.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b07aajhufqvb3
|
||||
@@ -1,37 +0,0 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
enum State { IDLE, CHASE, ATTACK, RETURN }
|
||||
|
||||
@export var stats: BaseStats
|
||||
|
||||
var state: int = State.IDLE
|
||||
var target: Node3D = null
|
||||
var spawn_position: Vector3
|
||||
var portal: Node3D = null
|
||||
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
|
||||
func _ready() -> void:
|
||||
spawn_position = global_position
|
||||
add_to_group("enemies")
|
||||
Stats.register(self, stats)
|
||||
EventBus.entity_died.connect(_on_entity_died)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
Stats.deregister(self)
|
||||
|
||||
func _on_entity_died(entity: Node) -> void:
|
||||
if entity == self:
|
||||
queue_free()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if not is_on_floor():
|
||||
velocity.y -= gravity * delta
|
||||
move_and_slide()
|
||||
|
||||
func _on_detection_area_body_entered(body: Node3D) -> void:
|
||||
if body is CharacterBody3D and body.name == "Player":
|
||||
EventBus.enemy_detected.emit(self, body)
|
||||
|
||||
func _on_detection_area_body_exited(body: Node3D) -> void:
|
||||
if body is CharacterBody3D and body.name == "Player":
|
||||
EventBus.enemy_lost.emit(self, body)
|
||||
@@ -1 +0,0 @@
|
||||
uid://bwi75jx0agktd
|
||||
@@ -1,18 +1,26 @@
|
||||
[gd_scene load_steps=6 format=3]
|
||||
[gd_scene format=3 uid="uid://db8pa55ev4l4a"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemy/enemy.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://scenes/healthbar.gd" id="4"]
|
||||
[ext_resource type="Script" path="res://scenes/enemy/enemy_movement.gd" id="5"]
|
||||
[ext_resource type="Resource" path="res://scenes/enemy/enemy_stats.tres" id="8"]
|
||||
[ext_resource type="Script" uid="uid://vy6hyqok0p8b" path="res://scenes/enemy/init.gd" id="1"]
|
||||
[ext_resource type="Script" uid="uid://b07aajhufqvb3" path="res://scenes/enemy/detection.gd" id="2"]
|
||||
[ext_resource type="Resource" uid="uid://cj1shmjwf0xeo" path="res://scenes/enemy/enemy_stats.tres" id="8"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1"]
|
||||
radius = 0.4
|
||||
height = 1.5
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1"]
|
||||
albedo_color = Color(0.8, 0.1, 0.1, 1)
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_1"]
|
||||
material = SubResource("StandardMaterial3D_1")
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_2"]
|
||||
radius = 0.4
|
||||
height = 1.5
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_1"]
|
||||
radius = 10.0
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_health_bg"]
|
||||
bg_color = Color(0.3, 0.1, 0.1, 1)
|
||||
|
||||
@@ -25,74 +33,58 @@ bg_color = Color(0.1, 0.1, 0.3, 1)
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_shield_fill"]
|
||||
bg_color = Color(0.2, 0.5, 0.9, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1"]
|
||||
albedo_color = Color(0.8, 0.1, 0.1, 1)
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_1"]
|
||||
radius = 0.5
|
||||
height = 1.0
|
||||
material = SubResource("StandardMaterial3D_1")
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_1"]
|
||||
radius = 10.0
|
||||
|
||||
[node name="Enemy" type="CharacterBody3D"]
|
||||
[node name="Enemy" type="CharacterBody3D" unique_id=1724620529]
|
||||
script = ExtResource("1")
|
||||
stats = ExtResource("8")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1011138038]
|
||||
shape = SubResource("CapsuleShape3D_1")
|
||||
|
||||
[node name="Mesh" type="MeshInstance3D" parent="."]
|
||||
[node name="Mesh" type="MeshInstance3D" parent="." unique_id=1598094615]
|
||||
mesh = SubResource("SphereMesh_1")
|
||||
|
||||
[node name="HitArea" type="Area3D" parent="."]
|
||||
[node name="HitArea" type="Area3D" parent="." unique_id=893463784]
|
||||
collision_layer = 4
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="HitArea"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="HitArea" unique_id=984781962]
|
||||
shape = SubResource("CapsuleShape3D_2")
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="." unique_id=440641945]
|
||||
|
||||
[node name="EnemyMovement" type="Node" parent="."]
|
||||
script = ExtResource("5")
|
||||
[node name="Detection" type="Node" parent="." unique_id=534240144]
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="DetectionArea" type="Area3D" parent="."]
|
||||
[node name="DetectionArea" type="Area3D" parent="." unique_id=1955178598]
|
||||
collision_layer = 0
|
||||
collision_mask = 1
|
||||
monitoring = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="DetectionArea"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="DetectionArea" unique_id=557461347]
|
||||
shape = SubResource("SphereShape3D_1")
|
||||
|
||||
[node name="Healthbar" type="Sprite3D" parent="."]
|
||||
[node name="Healthbar" type="Sprite3D" parent="." unique_id=1008728031]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||
billboard = 1
|
||||
pixel_size = 0.01
|
||||
script = ExtResource("4")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="Healthbar"]
|
||||
[node name="SubViewport" type="SubViewport" parent="Healthbar" unique_id=1219060718]
|
||||
transparent_bg = true
|
||||
size = Vector2i(104, 29)
|
||||
|
||||
[node name="Border" type="ColorRect" parent="Healthbar/SubViewport"]
|
||||
[node name="Border" type="ColorRect" parent="Healthbar/SubViewport" unique_id=848146848]
|
||||
offset_right = 104.0
|
||||
offset_bottom = 29.0
|
||||
color = Color(1, 0.9, 0.2, 1)
|
||||
|
||||
[node name="HealthBar" type="ProgressBar" parent="Healthbar/SubViewport"]
|
||||
[node name="HealthBar" type="ProgressBar" parent="Healthbar/SubViewport" unique_id=1206434403]
|
||||
offset_left = 2.0
|
||||
offset_top = 2.0
|
||||
offset_right = 102.0
|
||||
offset_bottom = 12.0
|
||||
theme_override_styles/background = SubResource("StyleBoxFlat_health_bg")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_health_fill")
|
||||
max_value = 100.0
|
||||
value = 100.0
|
||||
show_percentage = false
|
||||
|
||||
[node name="ShieldBar" type="ProgressBar" parent="Healthbar/SubViewport"]
|
||||
[node name="ShieldBar" type="ProgressBar" parent="Healthbar/SubViewport" unique_id=1891108036]
|
||||
offset_left = 2.0
|
||||
offset_top = 15.0
|
||||
offset_right = 102.0
|
||||
@@ -103,5 +95,5 @@ max_value = 50.0
|
||||
value = 50.0
|
||||
show_percentage = false
|
||||
|
||||
[connection signal="body_entered" from="DetectionArea" to="." method="_on_detection_area_body_entered"]
|
||||
[connection signal="body_exited" from="DetectionArea" to="." method="_on_detection_area_body_exited"]
|
||||
[connection signal="body_entered" from="DetectionArea" to="Detection" method="_on_detection_area_body_entered"]
|
||||
[connection signal="body_exited" from="DetectionArea" to="Detection" method="_on_detection_area_body_exited"]
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
extends Node
|
||||
|
||||
const SPEED := 3.0
|
||||
const ATTACK_RANGE := 2.0
|
||||
const REGEN_FAST := 0.10
|
||||
const REGEN_SLOW := 0.01
|
||||
|
||||
@onready var enemy: CharacterBody3D = get_parent()
|
||||
@onready var nav_agent: NavigationAgent3D = get_parent().get_node("NavigationAgent3D")
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
match enemy.state:
|
||||
enemy.State.IDLE:
|
||||
enemy.velocity.x = 0
|
||||
enemy.velocity.z = 0
|
||||
enemy.State.CHASE:
|
||||
_chase()
|
||||
enemy.State.RETURN:
|
||||
_return_to_spawn(delta)
|
||||
|
||||
func _chase() -> void:
|
||||
if not is_instance_valid(enemy.target):
|
||||
enemy.state = enemy.State.RETURN
|
||||
return
|
||||
var dist_to_target := enemy.global_position.distance_to(enemy.target.global_position)
|
||||
if dist_to_target <= ATTACK_RANGE:
|
||||
enemy.state = enemy.State.ATTACK
|
||||
return
|
||||
nav_agent.target_position = enemy.target.global_position
|
||||
var next_pos := nav_agent.get_next_path_position()
|
||||
var direction := (next_pos - enemy.global_position).normalized()
|
||||
direction.y = 0
|
||||
enemy.velocity.x = direction.x * SPEED
|
||||
enemy.velocity.z = direction.z * SPEED
|
||||
|
||||
func _return_to_spawn(delta: float) -> void:
|
||||
var dist := enemy.global_position.distance_to(enemy.spawn_position)
|
||||
if dist < 1.0:
|
||||
enemy.state = enemy.State.IDLE
|
||||
enemy.velocity.x = 0
|
||||
enemy.velocity.z = 0
|
||||
return
|
||||
nav_agent.target_position = enemy.spawn_position
|
||||
var next_pos := nav_agent.get_next_path_position()
|
||||
var direction := (next_pos - enemy.global_position).normalized()
|
||||
direction.y = 0
|
||||
enemy.velocity.x = direction.x * SPEED
|
||||
enemy.velocity.z = direction.z * SPEED
|
||||
_regenerate(delta)
|
||||
|
||||
func _regenerate(delta: float) -> void:
|
||||
var health: float = Stats.get_stat(enemy, "health")
|
||||
var max_health: float = Stats.get_stat(enemy, "max_health")
|
||||
if health == null or max_health == null:
|
||||
return
|
||||
if health < max_health:
|
||||
var rate: float = REGEN_FAST
|
||||
if health >= max_health * 0.99:
|
||||
rate = REGEN_SLOW
|
||||
health = min(health + max_health * rate * delta, max_health)
|
||||
Stats.set_stat(enemy, "health", health)
|
||||
EventBus.health_changed.emit(enemy, health, max_health)
|
||||
@@ -1 +0,0 @@
|
||||
uid://tnx6rbnnngn
|
||||
30
scenes/enemy/init.gd
Normal file
30
scenes/enemy/init.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
@export var stats: EnemyStats
|
||||
|
||||
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("enemies")
|
||||
if is_in_group("boss"):
|
||||
BossData.register(self, stats)
|
||||
BossData.set_stat(self, "spawn_position", global_position)
|
||||
else:
|
||||
EnemyData.register(self, stats)
|
||||
EnemyData.set_stat(self, "spawn_position", global_position)
|
||||
EventBus.entity_died.connect(_on_entity_died)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if is_in_group("boss"):
|
||||
BossData.deregister(self)
|
||||
else:
|
||||
EnemyData.deregister(self)
|
||||
|
||||
func _on_entity_died(entity: Node) -> void:
|
||||
if entity == self:
|
||||
queue_free()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if not is_on_floor():
|
||||
velocity.y -= gravity * delta
|
||||
move_and_slide()
|
||||
1
scenes/enemy/init.gd.uid
Normal file
1
scenes/enemy/init.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://vy6hyqok0p8b
|
||||
@@ -1,159 +0,0 @@
|
||||
extends Sprite3D
|
||||
|
||||
const ICON_SIZE := 10
|
||||
const ICON_MARGIN := 1
|
||||
const BORDER_W := 1
|
||||
|
||||
@onready var viewport: SubViewport = $SubViewport
|
||||
@onready var health_bar: ProgressBar = $SubViewport/HealthBar
|
||||
@onready var border: ColorRect = $SubViewport/Border
|
||||
@onready var parent_node: Node = get_parent()
|
||||
|
||||
var shield_bar: ProgressBar = null
|
||||
var style_normal: StyleBoxFlat
|
||||
var style_aggro: StyleBoxFlat
|
||||
var effect_container: HBoxContainer = null
|
||||
var base_viewport_height: int = 0
|
||||
|
||||
func _ready() -> void:
|
||||
shield_bar = $SubViewport.get_node_or_null("ShieldBar")
|
||||
border.visible = false
|
||||
style_normal = health_bar.get_theme_stylebox("fill").duplicate()
|
||||
style_aggro = style_normal.duplicate()
|
||||
style_aggro.bg_color = Color(0.2, 0.4, 0.9, 1)
|
||||
base_viewport_height = viewport.size.y
|
||||
_create_effect_container()
|
||||
texture = viewport.get_texture()
|
||||
EventBus.target_changed.connect(_on_target_changed)
|
||||
EventBus.health_changed.connect(_on_health_changed)
|
||||
EventBus.shield_changed.connect(_on_shield_changed)
|
||||
EventBus.effect_applied.connect(_on_effect_applied)
|
||||
EventBus.effect_expired.connect(_on_effect_expired)
|
||||
_init_bars()
|
||||
|
||||
func _create_effect_container() -> void:
|
||||
effect_container = HBoxContainer.new()
|
||||
effect_container.name = "EffectContainer"
|
||||
var y_pos: float = 0.0
|
||||
if shield_bar and shield_bar.visible:
|
||||
y_pos = shield_bar.offset_bottom + 2
|
||||
else:
|
||||
y_pos = health_bar.offset_bottom + 2
|
||||
effect_container.position = Vector2(2, y_pos)
|
||||
effect_container.add_theme_constant_override("separation", ICON_MARGIN)
|
||||
viewport.add_child(effect_container)
|
||||
|
||||
func _init_bars() -> void:
|
||||
var max_health: Variant = Stats.get_stat(parent_node, "max_health")
|
||||
if max_health != null:
|
||||
health_bar.max_value = max_health
|
||||
health_bar.value = Stats.get_stat(parent_node, "health")
|
||||
var max_shield: Variant = Stats.get_stat(parent_node, "max_shield")
|
||||
if shield_bar:
|
||||
if max_shield != null and max_shield > 0:
|
||||
shield_bar.max_value = max_shield
|
||||
shield_bar.value = Stats.get_stat(parent_node, "shield")
|
||||
else:
|
||||
shield_bar.visible = false
|
||||
effect_container.position.y = health_bar.offset_bottom + 2
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
var player: Node = get_tree().get_first_node_in_group("player")
|
||||
if player and "target" in parent_node and parent_node.target == player:
|
||||
health_bar.add_theme_stylebox_override("fill", style_aggro)
|
||||
else:
|
||||
health_bar.add_theme_stylebox_override("fill", style_normal)
|
||||
|
||||
func _on_health_changed(entity: Node, current: float, max_val: float) -> void:
|
||||
if entity != parent_node:
|
||||
return
|
||||
health_bar.max_value = max_val
|
||||
health_bar.value = current
|
||||
|
||||
func _on_shield_changed(entity: Node, current: float, max_val: float) -> void:
|
||||
if entity != parent_node or shield_bar == null:
|
||||
return
|
||||
shield_bar.max_value = max_val
|
||||
shield_bar.value = current
|
||||
|
||||
func _on_target_changed(_player: Node, target: Node) -> void:
|
||||
border.visible = (target == get_parent())
|
||||
|
||||
func _on_effect_applied(target: Node, effect: Effect) -> void:
|
||||
if target != parent_node:
|
||||
return
|
||||
_add_effect_icon(effect)
|
||||
|
||||
func _on_effect_expired(target: Node, effect: Effect) -> void:
|
||||
if target != parent_node:
|
||||
return
|
||||
_remove_effect_icon(effect)
|
||||
|
||||
func _add_effect_icon(effect: Effect) -> void:
|
||||
var panel := _create_icon_panel(effect)
|
||||
var insert_idx: int = _get_sorted_index(effect.type)
|
||||
effect_container.add_child(panel)
|
||||
effect_container.move_child(panel, insert_idx)
|
||||
_resize_viewport()
|
||||
|
||||
func _remove_effect_icon(effect: Effect) -> void:
|
||||
for child in effect_container.get_children():
|
||||
if child.has_meta("effect_type") and child.has_meta("effect_name"):
|
||||
if child.get_meta("effect_type") == effect.type and child.get_meta("effect_name") == effect.effect_name:
|
||||
child.queue_free()
|
||||
_resize_viewport.call_deferred()
|
||||
return
|
||||
|
||||
func _get_sorted_index(type: int) -> int:
|
||||
var idx := 0
|
||||
for child in effect_container.get_children():
|
||||
if not child.has_meta("effect_type"):
|
||||
continue
|
||||
var child_type: int = child.get_meta("effect_type")
|
||||
if child_type <= type:
|
||||
idx += 1
|
||||
else:
|
||||
break
|
||||
return idx
|
||||
|
||||
func _create_icon_panel(effect: Effect) -> PanelContainer:
|
||||
var panel := PanelContainer.new()
|
||||
var style := StyleBoxFlat.new()
|
||||
match effect.type:
|
||||
Effect.Type.AURA:
|
||||
style.bg_color = Color(0.15, 0.15, 0.3, 1)
|
||||
style.border_color = Color(0.3, 0.5, 1.0, 1)
|
||||
Effect.Type.BUFF:
|
||||
style.bg_color = Color(0.15, 0.3, 0.15, 1)
|
||||
style.border_color = Color(0.3, 1.0, 0.3, 1)
|
||||
Effect.Type.DEBUFF:
|
||||
style.bg_color = Color(0.3, 0.15, 0.15, 1)
|
||||
style.border_color = Color(1.0, 0.3, 0.3, 1)
|
||||
style.set_border_width_all(BORDER_W)
|
||||
style.set_content_margin_all(0)
|
||||
panel.add_theme_stylebox_override("panel", style)
|
||||
var label := Label.new()
|
||||
label.text = effect.effect_name.left(1)
|
||||
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
label.add_theme_font_size_override("font_size", 7)
|
||||
label.add_theme_color_override("font_color", Color.WHITE)
|
||||
label.custom_minimum_size = Vector2(ICON_SIZE, ICON_SIZE)
|
||||
panel.add_child(label)
|
||||
panel.custom_minimum_size = Vector2(ICON_SIZE + 2, ICON_SIZE + 2)
|
||||
panel.set_meta("effect_type", effect.type)
|
||||
panel.set_meta("effect_name", effect.effect_name)
|
||||
return panel
|
||||
|
||||
func _resize_viewport() -> void:
|
||||
var icon_count := 0
|
||||
for child in effect_container.get_children():
|
||||
if not child.is_queued_for_deletion():
|
||||
icon_count += 1
|
||||
if icon_count > 0:
|
||||
var needed: int = int(effect_container.position.y) + ICON_SIZE + 4
|
||||
viewport.size.y = max(base_viewport_height, needed)
|
||||
border.offset_bottom = viewport.size.y
|
||||
else:
|
||||
viewport.size.y = base_viewport_height
|
||||
border.offset_bottom = base_viewport_height
|
||||
@@ -1 +0,0 @@
|
||||
uid://d1w7vm7t3k3ts
|
||||
@@ -1,145 +0,0 @@
|
||||
extends CanvasLayer
|
||||
|
||||
const GCD_TIME := 0.5
|
||||
|
||||
@onready var health_bar: ProgressBar = $HealthBar
|
||||
@onready var health_label: Label = $HealthBar/HealthLabel
|
||||
@onready var shield_bar: ProgressBar = $ShieldBar
|
||||
@onready var shield_label: Label = $ShieldBar/ShieldLabel
|
||||
@onready var respawn_label: Label = $RespawnTimer
|
||||
@onready var class_icon: Label = $AbilityBar/ClassIcon/Label
|
||||
@onready var ability_panels: Array = [
|
||||
$AbilityBar/Ability1,
|
||||
$AbilityBar/Ability2,
|
||||
$AbilityBar/Ability3,
|
||||
$AbilityBar/Ability4,
|
||||
$AbilityBar/Ability5,
|
||||
]
|
||||
|
||||
var ability_labels: Array[String] = ["1", "2", "3", "4", "P"]
|
||||
var effect_container: HBoxContainer = null
|
||||
|
||||
func _ready() -> void:
|
||||
respawn_label.visible = false
|
||||
_create_effect_container()
|
||||
EventBus.health_changed.connect(_on_health_changed)
|
||||
EventBus.shield_changed.connect(_on_shield_changed)
|
||||
EventBus.entity_died.connect(_on_entity_died)
|
||||
EventBus.player_respawned.connect(_on_player_respawned)
|
||||
EventBus.role_changed.connect(_on_role_changed)
|
||||
EventBus.respawn_tick.connect(_on_respawn_tick)
|
||||
EventBus.cooldown_tick.connect(_on_cooldown_tick)
|
||||
EventBus.effect_applied.connect(_on_effect_applied)
|
||||
EventBus.effect_expired.connect(_on_effect_expired)
|
||||
|
||||
func _on_health_changed(entity: Node, current: float, max_val: float) -> void:
|
||||
if entity.name == "Player":
|
||||
health_bar.max_value = max_val
|
||||
health_bar.value = current
|
||||
health_label.text = "%d/%d" % [current, max_val]
|
||||
|
||||
func _on_shield_changed(entity: Node, current: float, max_val: float) -> void:
|
||||
if entity.name == "Player":
|
||||
shield_bar.max_value = max_val
|
||||
shield_bar.value = current
|
||||
shield_label.text = "%d/%d" % [current, max_val]
|
||||
|
||||
func _on_entity_died(entity: Node) -> void:
|
||||
if entity.name == "Player":
|
||||
respawn_label.visible = true
|
||||
|
||||
func _on_player_respawned(_player: Node) -> void:
|
||||
respawn_label.visible = false
|
||||
|
||||
func _on_respawn_tick(timer: float) -> void:
|
||||
respawn_label.text = str(ceil(timer))
|
||||
|
||||
func _on_role_changed(_player: Node, role_type: int) -> void:
|
||||
match role_type:
|
||||
0: class_icon.text = "T"
|
||||
1: class_icon.text = "D"
|
||||
2: class_icon.text = "H"
|
||||
|
||||
func _on_cooldown_tick(cooldowns: Array, max_cooldowns: Array, gcd_timer: float) -> void:
|
||||
for i in range(min(ability_panels.size(), cooldowns.size())):
|
||||
var panel: Panel = ability_panels[i]
|
||||
var label: Label = panel.get_node("Label")
|
||||
var overlay: ColorRect = panel.get_node("CooldownOverlay")
|
||||
var cd: float = cooldowns[i]
|
||||
var gcd: float = gcd_timer if i != 2 and i != 4 else 0.0
|
||||
var active_cd: float = max(cd, gcd)
|
||||
var max_cd: float = max_cooldowns[i] if max_cooldowns[i] > 0 else GCD_TIME
|
||||
|
||||
if active_cd > 0:
|
||||
var ratio: float = clamp(active_cd / max_cd, 0.0, 1.0)
|
||||
overlay.visible = true
|
||||
overlay.anchor_bottom = ratio
|
||||
label.text = str(ceil(active_cd))
|
||||
else:
|
||||
overlay.visible = false
|
||||
label.text = ability_labels[i]
|
||||
|
||||
func _create_effect_container() -> void:
|
||||
effect_container = HBoxContainer.new()
|
||||
effect_container.name = "EffectContainer"
|
||||
effect_container.position = Vector2(10, 60)
|
||||
effect_container.add_theme_constant_override("separation", 3)
|
||||
add_child(effect_container)
|
||||
|
||||
func _on_effect_applied(target: Node, effect: Effect) -> void:
|
||||
if target.name != "Player":
|
||||
return
|
||||
var panel := _create_icon_panel(effect)
|
||||
var insert_idx: int = _get_sorted_index(effect.type)
|
||||
effect_container.add_child(panel)
|
||||
effect_container.move_child(panel, insert_idx)
|
||||
|
||||
func _on_effect_expired(target: Node, effect: Effect) -> void:
|
||||
if target.name != "Player":
|
||||
return
|
||||
for child in effect_container.get_children():
|
||||
if child.has_meta("effect_type") and child.has_meta("effect_name"):
|
||||
if child.get_meta("effect_type") == effect.type and child.get_meta("effect_name") == effect.effect_name:
|
||||
child.queue_free()
|
||||
return
|
||||
|
||||
func _get_sorted_index(type: int) -> int:
|
||||
var idx := 0
|
||||
for child in effect_container.get_children():
|
||||
if not child.has_meta("effect_type"):
|
||||
continue
|
||||
var child_type: int = child.get_meta("effect_type")
|
||||
if child_type <= type:
|
||||
idx += 1
|
||||
else:
|
||||
break
|
||||
return idx
|
||||
|
||||
func _create_icon_panel(effect: Effect) -> PanelContainer:
|
||||
var panel := PanelContainer.new()
|
||||
var style := StyleBoxFlat.new()
|
||||
match effect.type:
|
||||
Effect.Type.AURA:
|
||||
style.bg_color = Color(0.15, 0.15, 0.3, 1)
|
||||
style.border_color = Color(0.3, 0.5, 1.0, 1)
|
||||
Effect.Type.BUFF:
|
||||
style.bg_color = Color(0.15, 0.3, 0.15, 1)
|
||||
style.border_color = Color(0.3, 1.0, 0.3, 1)
|
||||
Effect.Type.DEBUFF:
|
||||
style.bg_color = Color(0.3, 0.15, 0.15, 1)
|
||||
style.border_color = Color(1.0, 0.3, 0.3, 1)
|
||||
style.set_border_width_all(2)
|
||||
style.set_content_margin_all(2)
|
||||
panel.add_theme_stylebox_override("panel", style)
|
||||
var label := Label.new()
|
||||
label.text = effect.effect_name.left(1)
|
||||
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
label.add_theme_font_size_override("font_size", 14)
|
||||
label.add_theme_color_override("font_color", Color.WHITE)
|
||||
label.custom_minimum_size = Vector2(20, 20)
|
||||
panel.add_child(label)
|
||||
panel.custom_minimum_size = Vector2(24, 24)
|
||||
panel.set_meta("effect_type", effect.type)
|
||||
panel.set_meta("effect_name", effect.effect_name)
|
||||
return panel
|
||||
@@ -1 +0,0 @@
|
||||
uid://c4jhr8k4uwoy7
|
||||
@@ -1,7 +1,5 @@
|
||||
[gd_scene format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/hud/hud.gd" id="1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ability_active"]
|
||||
bg_color = Color(0.2, 0.2, 0.2, 0.8)
|
||||
border_width_bottom = 2
|
||||
@@ -34,8 +32,7 @@ bg_color = Color(0.1, 0.1, 0.3, 1)
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_shield_fill"]
|
||||
bg_color = Color(0.2, 0.5, 0.9, 1)
|
||||
|
||||
[node name="HUD" type="CanvasLayer"]
|
||||
script = ExtResource("1")
|
||||
[node name="HUD" type="CanvasLayer" groups=["hud"]]
|
||||
|
||||
[node name="HealthBar" type="ProgressBar" parent="."]
|
||||
offset_left = 10.0
|
||||
|
||||
@@ -5,5 +5,5 @@ extends Node
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
for i in range(5):
|
||||
if event.is_action_pressed("ability_%s" % (i + 1)):
|
||||
EventBus.ability_use_requested.emit(player, i)
|
||||
EventBus.ability_use.emit(player, i)
|
||||
return
|
||||
1
scenes/player/ability.gd.uid
Normal file
1
scenes/player/ability.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://hh5yw7vcjdqr
|
||||
@@ -1 +0,0 @@
|
||||
uid://d15til6fsxw5b
|
||||
12
scenes/player/init.gd
Normal file
12
scenes/player/init.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
@export var stats: PlayerStats
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("player")
|
||||
PlayerData.init_from_resource(stats)
|
||||
if PlayerData.returning_from_dungeon:
|
||||
global_position = PlayerData.portal_position + Vector3(0, 1, -5)
|
||||
PlayerData.returning_from_dungeon = false
|
||||
elif PlayerData.dungeon_cleared:
|
||||
PlayerData.clear_cache()
|
||||
1
scenes/player/init.gd.uid
Normal file
1
scenes/player/init.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cx6k5473yxno
|
||||
@@ -8,12 +8,8 @@ func _physics_process(delta: float) -> void:
|
||||
if not player.is_on_floor():
|
||||
player.velocity.y -= gravity * delta
|
||||
|
||||
var base: BaseStats = Stats.get_base(player)
|
||||
var speed: float = base.speed if base is PlayerStats else 5.0
|
||||
var jump_velocity: float = base.jump_velocity if base is PlayerStats else 4.5
|
||||
|
||||
if Input.is_action_just_pressed("ui_accept") and player.is_on_floor():
|
||||
player.velocity.y = jump_velocity
|
||||
player.velocity.y = PlayerData.jump_velocity
|
||||
|
||||
var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_back")
|
||||
var camera_pivot := player.get_node("CameraPivot") as Node3D
|
||||
@@ -27,10 +23,10 @@ func _physics_process(delta: float) -> void:
|
||||
var direction := (forward * -input_dir.y + right * input_dir.x).normalized()
|
||||
|
||||
if direction:
|
||||
player.velocity.x = direction.x * speed
|
||||
player.velocity.z = direction.z * speed
|
||||
player.velocity.x = direction.x * PlayerData.speed
|
||||
player.velocity.z = direction.z * PlayerData.speed
|
||||
else:
|
||||
player.velocity.x = move_toward(player.velocity.x, 0, speed)
|
||||
player.velocity.z = move_toward(player.velocity.z, 0, speed)
|
||||
player.velocity.x = move_toward(player.velocity.x, 0, PlayerData.speed)
|
||||
player.velocity.z = move_toward(player.velocity.z, 0, PlayerData.speed)
|
||||
|
||||
player.move_and_slide()
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
@export var stats: BaseStats
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("player")
|
||||
Stats.register(self, stats)
|
||||
var cooldown_system: Node = get_tree().get_first_node_in_group("cooldown_system")
|
||||
if cooldown_system:
|
||||
cooldown_system.register(self, 5)
|
||||
if GameState.returning_from_dungeon:
|
||||
GameState.restore_player(self)
|
||||
global_position = GameState.portal_position + Vector3(0, 1, -5)
|
||||
GameState.returning_from_dungeon = false
|
||||
elif GameState.dungeon_cleared:
|
||||
GameState.clear()
|
||||
var health: float = Stats.get_stat(self, "health")
|
||||
var max_health: float = Stats.get_stat(self, "max_health")
|
||||
var shield: float = Stats.get_stat(self, "shield")
|
||||
var max_shield: float = Stats.get_stat(self, "max_shield")
|
||||
EventBus.health_changed.emit(self, health, max_health)
|
||||
EventBus.shield_changed.emit(self, shield, max_shield)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
Stats.deregister(self)
|
||||
var cooldown_system: Node = get_tree().get_first_node_in_group("cooldown_system")
|
||||
if cooldown_system:
|
||||
cooldown_system.deregister(self)
|
||||
@@ -1 +0,0 @@
|
||||
uid://bfpt2p7uucfyb
|
||||
@@ -1,15 +1,12 @@
|
||||
[gd_scene format=3 uid="uid://cdnkbt1f0db7e"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bfpt2p7uucfyb" path="res://scenes/player/player.gd" id="1"]
|
||||
[ext_resource type="Script" uid="uid://cx6k5473yxno" path="res://scenes/player/init.gd" id="1"]
|
||||
[ext_resource type="Script" uid="uid://cohjyjge1kqxb" path="res://scenes/player/camera.gd" id="2"]
|
||||
[ext_resource type="Script" uid="uid://fg87dh8fbc8" path="res://scenes/player/movement.gd" id="3"]
|
||||
[ext_resource type="Script" uid="uid://d15til6fsxw5b" path="res://scenes/player/combat.gd" id="4"]
|
||||
[ext_resource type="Script" uid="uid://hh5yw7vcjdqr" path="res://scenes/player/ability.gd" id="4"]
|
||||
[ext_resource type="Script" uid="uid://b05nkuryipwny" path="res://scenes/player/targeting.gd" id="8"]
|
||||
[ext_resource type="Script" path="res://scenes/player/role/role.gd" id="10"]
|
||||
[ext_resource type="Resource" uid="uid://cgxtn7dfs40bh" path="res://scenes/player/role/tank/set.tres" id="11"]
|
||||
[ext_resource type="Resource" uid="uid://beodknb6i1pm4" path="res://scenes/player/role/damage/set.tres" id="12"]
|
||||
[ext_resource type="Resource" uid="uid://kcwuhnqy34mj" path="res://scenes/player/role/healer/set.tres" id="13"]
|
||||
[ext_resource type="Resource" path="res://scenes/player/player_stats.tres" id="14"]
|
||||
[ext_resource type="Script" uid="uid://dhomrampxola4" path="res://scenes/player/role/role.gd" id="10"]
|
||||
[ext_resource type="Resource" uid="uid://btd0g0oiulssq" path="res://scenes/player/player_stats.tres" id="14"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1"]
|
||||
radius = 0.3
|
||||
@@ -19,34 +16,31 @@ height = 1.8
|
||||
radius = 0.3
|
||||
height = 1.8
|
||||
|
||||
[node name="Player" type="CharacterBody3D" unique_id=1350215040]
|
||||
[node name="Player" type="CharacterBody3D" unique_id=197716516]
|
||||
script = ExtResource("1")
|
||||
stats = ExtResource("14")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=33887999]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=311205642]
|
||||
shape = SubResource("CapsuleShape3D_1")
|
||||
|
||||
[node name="Mesh" type="MeshInstance3D" parent="." unique_id=1346931672]
|
||||
[node name="Mesh" type="MeshInstance3D" parent="." unique_id=1514179122]
|
||||
mesh = SubResource("CapsuleMesh_1")
|
||||
|
||||
[node name="CameraPivot" type="Node3D" parent="." unique_id=1292689540]
|
||||
[node name="CameraPivot" type="Node3D" parent="." unique_id=1881685457]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="CameraPivot" unique_id=1225820651]
|
||||
[node name="Camera3D" type="Camera3D" parent="CameraPivot" unique_id=2062990383]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.966, 0.259, 0, -0.259, 0.966, 0, 2, 5)
|
||||
|
||||
[node name="Movement" type="Node" parent="." unique_id=654979387]
|
||||
[node name="Movement" type="Node" parent="." unique_id=811179177]
|
||||
script = ExtResource("3")
|
||||
|
||||
[node name="Combat" type="Node" parent="." unique_id=1754235583]
|
||||
[node name="Ability" type="Node" parent="." unique_id=1184596245]
|
||||
script = ExtResource("4")
|
||||
|
||||
[node name="Targeting" type="Node" parent="." unique_id=592540710]
|
||||
[node name="Targeting" type="Node" parent="." unique_id=1974574662]
|
||||
script = ExtResource("8")
|
||||
|
||||
[node name="Role" type="Node" parent="." unique_id=134158295]
|
||||
[node name="Role" type="Node" parent="." unique_id=1637643687]
|
||||
script = ExtResource("10")
|
||||
tank_set = ExtResource("11")
|
||||
damage_set = ExtResource("12")
|
||||
healer_set = ExtResource("13")
|
||||
|
||||
@@ -1,40 +1,14 @@
|
||||
extends Node
|
||||
|
||||
enum Role { TANK, DAMAGE, HEALER }
|
||||
|
||||
var current_role: int = Role.DAMAGE
|
||||
|
||||
@export var tank_set: AbilitySet
|
||||
@export var damage_set: AbilitySet
|
||||
@export var healer_set: AbilitySet
|
||||
|
||||
@onready var player: CharacterBody3D = get_parent()
|
||||
|
||||
func _ready() -> void:
|
||||
set_role.call_deferred(current_role)
|
||||
EventBus.role_change_requested.emit(player, PlayerData.current_role)
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("class_tank"):
|
||||
set_role(Role.TANK)
|
||||
EventBus.role_change_requested.emit(player, PlayerData.Role.TANK)
|
||||
elif event.is_action_pressed("class_damage"):
|
||||
set_role(Role.DAMAGE)
|
||||
EventBus.role_change_requested.emit(player, PlayerData.Role.DAMAGE)
|
||||
elif event.is_action_pressed("class_healer"):
|
||||
set_role(Role.HEALER)
|
||||
|
||||
func set_role(new_role: int) -> void:
|
||||
current_role = new_role
|
||||
EventBus.role_changed.emit(player, current_role)
|
||||
|
||||
func get_role_icon() -> String:
|
||||
match current_role:
|
||||
Role.TANK: return "T"
|
||||
Role.DAMAGE: return "D"
|
||||
Role.HEALER: return "H"
|
||||
return ""
|
||||
|
||||
func get_ability_set() -> AbilitySet:
|
||||
match current_role:
|
||||
Role.TANK: return tank_set
|
||||
Role.DAMAGE: return damage_set
|
||||
Role.HEALER: return healer_set
|
||||
return damage_set
|
||||
EventBus.role_change_requested.emit(player, PlayerData.Role.HEALER)
|
||||
|
||||
@@ -1,27 +1,12 @@
|
||||
extends Node
|
||||
|
||||
const TARGET_RANGE := 20.0
|
||||
const COMBAT_TIMEOUT := 3.0
|
||||
|
||||
var current_target: Node3D = null
|
||||
var mouse_press_pos: Vector2 = Vector2.ZERO
|
||||
var in_combat := false
|
||||
var combat_timer := 0.0
|
||||
|
||||
@onready var player: CharacterBody3D = get_parent()
|
||||
@onready var camera: Camera3D = get_parent().get_node("CameraPivot/Camera3D")
|
||||
|
||||
func _ready() -> void:
|
||||
EventBus.damage_dealt.connect(_on_damage_dealt)
|
||||
EventBus.entity_died.connect(_on_entity_died)
|
||||
EventBus.enemy_engaged.connect(_on_enemy_engaged)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if in_combat:
|
||||
combat_timer -= delta
|
||||
if combat_timer <= 0:
|
||||
in_combat = false
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT:
|
||||
if event.pressed:
|
||||
@@ -44,71 +29,19 @@ func _try_target_under_mouse(mouse_pos: Vector2) -> void:
|
||||
var result := space.intersect_ray(query)
|
||||
if result:
|
||||
var hit_target := result.collider.get_parent() as Node3D
|
||||
set_target(hit_target)
|
||||
EventBus.target_requested.emit(player, hit_target)
|
||||
else:
|
||||
set_target(null)
|
||||
EventBus.target_requested.emit(player, null)
|
||||
|
||||
func _cycle_target() -> void:
|
||||
var targets := get_tree().get_nodes_in_group("enemies") + get_tree().get_nodes_in_group("portals")
|
||||
if targets.is_empty():
|
||||
set_target(null)
|
||||
EventBus.target_requested.emit(player, null)
|
||||
return
|
||||
if current_target == null or current_target not in targets:
|
||||
set_target(targets[0])
|
||||
var current: Node3D = PlayerData.target
|
||||
if current == null or current not in targets:
|
||||
EventBus.target_requested.emit(player, targets[0])
|
||||
return
|
||||
var idx := targets.find(current_target)
|
||||
var idx := targets.find(current)
|
||||
var next_idx := (idx + 1) % targets.size()
|
||||
set_target(targets[next_idx])
|
||||
|
||||
func set_target(target: Node3D) -> void:
|
||||
current_target = target
|
||||
EventBus.target_changed.emit(player, target)
|
||||
|
||||
func _on_enemy_engaged(_enemy: Node, target: Node) -> void:
|
||||
if target == player:
|
||||
combat_timer = COMBAT_TIMEOUT
|
||||
if not in_combat:
|
||||
in_combat = true
|
||||
if current_target == null:
|
||||
_auto_target()
|
||||
|
||||
func _on_damage_dealt(attacker: Node, target: Node, _amount: float) -> void:
|
||||
if target == player:
|
||||
combat_timer = COMBAT_TIMEOUT
|
||||
if not in_combat:
|
||||
in_combat = true
|
||||
if current_target == null:
|
||||
_auto_target()
|
||||
elif attacker == player and in_combat:
|
||||
combat_timer = COMBAT_TIMEOUT
|
||||
|
||||
func _on_entity_died(entity: Node) -> void:
|
||||
if entity == current_target:
|
||||
set_target(null)
|
||||
if in_combat:
|
||||
_auto_target(entity)
|
||||
|
||||
func _auto_target(exclude: Node = null) -> void:
|
||||
# Priorität 1: Nächster Gegner
|
||||
var enemies := get_tree().get_nodes_in_group("enemies")
|
||||
var nearest: Node3D = null
|
||||
var nearest_dist: float = INF
|
||||
for enemy in enemies:
|
||||
if is_instance_valid(enemy) and enemy != exclude:
|
||||
var dist: float = player.global_position.distance_to(enemy.global_position)
|
||||
if dist < nearest_dist:
|
||||
nearest_dist = dist
|
||||
nearest = enemy
|
||||
if nearest:
|
||||
set_target(nearest)
|
||||
return
|
||||
# Priorität 2: Nächstes Portal
|
||||
var portals := get_tree().get_nodes_in_group("portals")
|
||||
for p in portals:
|
||||
if is_instance_valid(p) and p != exclude:
|
||||
var dist: float = player.global_position.distance_to(p.global_position)
|
||||
if dist < nearest_dist:
|
||||
nearest_dist = dist
|
||||
nearest = p
|
||||
if nearest:
|
||||
set_target(nearest)
|
||||
EventBus.target_requested.emit(player, targets[next_idx])
|
||||
|
||||
@@ -7,7 +7,7 @@ var active := false
|
||||
|
||||
func _ready() -> void:
|
||||
if not is_exit:
|
||||
if GameState.dungeon_cleared:
|
||||
if PlayerData.dungeon_cleared:
|
||||
queue_free()
|
||||
return
|
||||
get_tree().create_timer(0.5).timeout.connect(_check_overlapping)
|
||||
@@ -23,11 +23,11 @@ func _on_gate_area_body_entered(body: Node3D) -> void:
|
||||
if not active:
|
||||
return
|
||||
if body is CharacterBody3D and body.name == "Player":
|
||||
GameState.save_player(body)
|
||||
PlayerData.save_cache()
|
||||
if is_exit:
|
||||
GameState.returning_from_dungeon = true
|
||||
PlayerData.returning_from_dungeon = true
|
||||
else:
|
||||
GameState.portal_position = global_position
|
||||
PlayerData.portal_position = global_position
|
||||
call_deferred("_change_scene")
|
||||
|
||||
func _change_scene() -> void:
|
||||
|
||||
14
scenes/portal/init.gd
Normal file
14
scenes/portal/init.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends StaticBody3D
|
||||
|
||||
@export var stats: PortalStats
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("portals")
|
||||
PortalData.register(self, stats)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
PortalData.deregister(self)
|
||||
|
||||
func _on_detection_area_body_entered(body: Node3D) -> void:
|
||||
if body is CharacterBody3D and body.name == "Player":
|
||||
EventBus.portal_entered.emit(self, body)
|
||||
1
scenes/portal/init.gd.uid
Normal file
1
scenes/portal/init.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dlexijybbqxop
|
||||
@@ -1,33 +0,0 @@
|
||||
extends StaticBody3D
|
||||
|
||||
@export var stats: BaseStats
|
||||
|
||||
const GATE_SCENE: PackedScene = preload("res://scenes/portal/gate.tscn")
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("portals")
|
||||
Stats.register(self, stats)
|
||||
EventBus.entity_died.connect(_on_entity_died)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
Stats.deregister(self)
|
||||
|
||||
func _on_entity_died(entity: Node) -> void:
|
||||
if entity != self:
|
||||
return
|
||||
if not is_inside_tree():
|
||||
return
|
||||
var pos: Vector3 = global_position
|
||||
var gate: Node3D = GATE_SCENE.instantiate()
|
||||
get_parent().add_child(gate)
|
||||
gate.global_position = pos
|
||||
var enemies := get_tree().get_nodes_in_group("enemies")
|
||||
for enemy in enemies:
|
||||
if is_instance_valid(enemy):
|
||||
enemy.queue_free()
|
||||
EventBus.portal_defeated.emit(self)
|
||||
queue_free()
|
||||
|
||||
func _on_detection_area_body_entered(body: Node3D) -> void:
|
||||
if body is CharacterBody3D and body.name == "Player":
|
||||
EventBus.enemy_engaged.emit(self, body)
|
||||
@@ -1 +0,0 @@
|
||||
uid://byjxj4mq84gki
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/portal/portal.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://scenes/healthbar.gd" id="3"]
|
||||
[ext_resource type="Script" path="res://scenes/portal/init.gd" id="1"]
|
||||
[ext_resource type="Resource" path="res://scenes/portal/portal_stats.tres" id="6"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_1"]
|
||||
@@ -59,7 +58,6 @@ shape = SubResource("SphereShape3D_1")
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 0)
|
||||
billboard = 1
|
||||
pixel_size = 0.01
|
||||
script = ExtResource("3")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="Healthbar"]
|
||||
transparent_bg = true
|
||||
|
||||
@@ -11,17 +11,17 @@ var portals: Array[Node] = []
|
||||
var timer := 0.0
|
||||
|
||||
func _ready() -> void:
|
||||
if GameState.portal_position != Vector3.ZERO and not GameState.dungeon_cleared:
|
||||
if PlayerData.portal_position != Vector3.ZERO and not PlayerData.dungeon_cleared:
|
||||
call_deferred("_restore_gate")
|
||||
else:
|
||||
if GameState.dungeon_cleared:
|
||||
GameState.clear()
|
||||
if PlayerData.dungeon_cleared:
|
||||
PlayerData.clear_cache()
|
||||
call_deferred("_spawn_portal")
|
||||
|
||||
func _restore_gate() -> void:
|
||||
var gate: Node3D = GATE_SCENE.instantiate()
|
||||
get_parent().add_child(gate)
|
||||
gate.global_position = GameState.portal_position
|
||||
gate.global_position = PlayerData.portal_position
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
timer += delta
|
||||
|
||||
@@ -1,22 +1,34 @@
|
||||
[gd_scene format=3 uid="uid://dy1icabu2ssbw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://h0hts425epc6" path="res://systems/ability_system.gd" id="ability_system"]
|
||||
[ext_resource type="Script" uid="uid://cysg30lud2ta2" path="res://systems/aggro/aggro_decay.gd" id="aggro_decay"]
|
||||
[ext_resource type="Script" uid="uid://cyffo1g4uhmwh" path="res://systems/aggro/aggro_events.gd" id="aggro_events"]
|
||||
[ext_resource type="Script" uid="uid://cm7ehl2pexcst" path="res://systems/aggro/aggro_system.gd" id="aggro_system"]
|
||||
[ext_resource type="Script" uid="uid://c7gsu2qddsor6" path="res://systems/aggro/aggro_tracker.gd" id="aggro_tracker"]
|
||||
[ext_resource type="Script" uid="uid://ddos7mo8rahou" path="res://systems/cooldown_system.gd" id="cooldown_system"]
|
||||
[ext_resource type="Script" uid="uid://cbd1bryh0e2dw" path="res://systems/damage_system.gd" id="damage_system"]
|
||||
[ext_resource type="Script" uid="uid://drdlh6tq0dfwo" path="res://systems/effect_system.gd" id="effect_system"]
|
||||
[ext_resource type="Script" uid="uid://bqebxfvticxto" path="res://systems/element_system.gd" id="element_system"]
|
||||
[ext_resource type="Script" uid="uid://bwhxu5586lc1l" path="res://systems/enemy_ai_system.gd" id="enemy_ai_system"]
|
||||
[ext_resource type="Script" uid="uid://b3wkn5118dimy" path="res://systems/health_system.gd" id="health_system"]
|
||||
[ext_resource type="Script" path="res://systems/ability_system.gd" id="ability_system"]
|
||||
[ext_resource type="Script" path="res://systems/aggro/aggro_decay.gd" id="aggro_decay"]
|
||||
[ext_resource type="Script" path="res://systems/aggro/aggro_events.gd" id="aggro_events"]
|
||||
[ext_resource type="Script" path="res://systems/aggro/aggro_system.gd" id="aggro_system"]
|
||||
[ext_resource type="Script" path="res://systems/aggro/aggro_tracker.gd" id="aggro_tracker"]
|
||||
[ext_resource type="Script" path="res://systems/attack_system.gd" id="attack_system"]
|
||||
[ext_resource type="Script" path="res://systems/cooldown_system.gd" id="cooldown_system"]
|
||||
[ext_resource type="Script" path="res://systems/damage_system.gd" id="damage_system"]
|
||||
[ext_resource type="Script" path="res://systems/health_system.gd" id="health_system"]
|
||||
[ext_resource type="Script" path="res://systems/heal_system.gd" id="heal_system"]
|
||||
[ext_resource type="Script" path="res://systems/role_system.gd" id="role_system"]
|
||||
[ext_resource type="Script" path="res://systems/targeting_system.gd" id="targeting_system"]
|
||||
[ext_resource type="Script" path="res://systems/portal_system.gd" id="portal_system"]
|
||||
[ext_resource type="Script" path="res://systems/aura_system.gd" id="aura_system"]
|
||||
[ext_resource type="Script" path="res://systems/buff_system.gd" id="buff_system"]
|
||||
[ext_resource type="Script" path="res://systems/debuff_system.gd" id="debuff_system"]
|
||||
[ext_resource type="Script" path="res://systems/element_system.gd" id="element_system"]
|
||||
[ext_resource type="Script" path="res://systems/hud_system.gd" id="hud_system"]
|
||||
[ext_resource type="Script" path="res://systems/nameplate_system.gd" id="nameplate_system"]
|
||||
[ext_resource type="Script" path="res://systems/ai_system.gd" id="ai_system"]
|
||||
[ext_resource type="Script" path="res://systems/respawn_system.gd" id="respawn_system"]
|
||||
[ext_resource type="Script" path="res://systems/shield_system.gd" id="shield_system"]
|
||||
[ext_resource type="Script" path="res://systems/spawn_system.gd" id="spawn_system"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/hud/hud.tscn" id="hud"]
|
||||
[ext_resource type="PackedScene" uid="uid://cdnkbt1f0db7e" path="res://scenes/player/player.tscn" id="player"]
|
||||
[ext_resource type="Script" uid="uid://cskx6o07iukwh" path="res://scenes/world/portal_spawner.gd" id="portal_spawner"]
|
||||
[ext_resource type="Script" uid="uid://b1qkvoqvmd21h" path="res://systems/respawn_system.gd" id="respawn_system"]
|
||||
[ext_resource type="Script" uid="uid://rsnpuf77o0sn" path="res://systems/shield_system.gd" id="shield_system"]
|
||||
[ext_resource type="Script" uid="uid://c84voxmnaifyt" path="res://systems/spawn_system.gd" id="spawn_system"]
|
||||
[ext_resource type="Script" path="res://scenes/world/portal_spawner.gd" id="portal_spawner"]
|
||||
[ext_resource type="Resource" uid="uid://cgxtn7dfs40bh" path="res://scenes/player/role/tank/set.tres" id="tank_set"]
|
||||
[ext_resource type="Resource" uid="uid://beodknb6i1pm4" path="res://scenes/player/role/damage/set.tres" id="damage_set"]
|
||||
[ext_resource type="Resource" uid="uid://kcwuhnqy34mj" path="res://scenes/player/role/healer/set.tres" id="healer_set"]
|
||||
|
||||
[sub_resource type="NavigationMesh" id="NavigationMesh_1"]
|
||||
vertices = PackedVector3Array(-49.5, 0.5, -49.5, -49.5, 0.5, 49.5, 49.5, 0.5, 49.5, 49.5, 0.5, -49.5)
|
||||
@@ -53,81 +65,111 @@ size = Vector3(5, 3, 5)
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_tavern"]
|
||||
size = Vector3(5, 3, 5)
|
||||
|
||||
[node name="World" type="Node3D" unique_id=1865233338]
|
||||
[node name="World" type="Node3D"]
|
||||
|
||||
[node name="Systems" type="Node" parent="." unique_id=1813416478]
|
||||
[node name="Systems" type="Node" parent="."]
|
||||
|
||||
[node name="HealthSystem" type="Node" parent="Systems" unique_id=221270411]
|
||||
[node name="HealthSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("health_system")
|
||||
|
||||
[node name="ShieldSystem" type="Node" parent="Systems" unique_id=1790230220]
|
||||
script = ExtResource("shield_system")
|
||||
|
||||
[node name="DamageSystem" type="Node" parent="Systems" unique_id=2146323526]
|
||||
[node name="DamageSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("damage_system")
|
||||
|
||||
[node name="AbilitySystem" type="Node" parent="Systems" unique_id=391120092]
|
||||
[node name="HealSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("heal_system")
|
||||
|
||||
[node name="ShieldSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("shield_system")
|
||||
|
||||
[node name="RoleSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("role_system")
|
||||
tank_set = ExtResource("tank_set")
|
||||
damage_set = ExtResource("damage_set")
|
||||
healer_set = ExtResource("healer_set")
|
||||
|
||||
[node name="AbilitySystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("ability_system")
|
||||
|
||||
[node name="CooldownSystem" type="Node" parent="Systems" unique_id=99457358]
|
||||
[node name="AttackSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("attack_system")
|
||||
|
||||
[node name="CooldownSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("cooldown_system")
|
||||
|
||||
[node name="AggroSystem" type="Node" parent="Systems" unique_id=1539448343]
|
||||
[node name="TargetingSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("targeting_system")
|
||||
|
||||
[node name="AggroSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("aggro_system")
|
||||
|
||||
[node name="AggroTracker" type="Node" parent="Systems/AggroSystem" unique_id=1597893665]
|
||||
[node name="AggroTracker" type="Node" parent="Systems/AggroSystem"]
|
||||
script = ExtResource("aggro_tracker")
|
||||
|
||||
[node name="AggroDecay" type="Node" parent="Systems/AggroSystem" unique_id=1571705506]
|
||||
[node name="AggroDecay" type="Node" parent="Systems/AggroSystem"]
|
||||
script = ExtResource("aggro_decay")
|
||||
|
||||
[node name="AggroEvents" type="Node" parent="Systems/AggroSystem" unique_id=1936723580]
|
||||
[node name="AggroEvents" type="Node" parent="Systems/AggroSystem"]
|
||||
script = ExtResource("aggro_events")
|
||||
|
||||
[node name="EnemyAISystem" type="Node" parent="Systems" unique_id=2089718042]
|
||||
script = ExtResource("enemy_ai_system")
|
||||
[node name="AISystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("ai_system")
|
||||
|
||||
[node name="RespawnSystem" type="Node" parent="Systems" unique_id=1586865573]
|
||||
[node name="RespawnSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("respawn_system")
|
||||
|
||||
[node name="SpawnSystem" type="Node" parent="Systems" unique_id=1099032666]
|
||||
[node name="SpawnSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("spawn_system")
|
||||
|
||||
[node name="EffectSystem" type="Node" parent="Systems" unique_id=1219368182]
|
||||
script = ExtResource("effect_system")
|
||||
[node name="PortalSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("portal_system")
|
||||
|
||||
[node name="ElementSystem" type="Node" parent="Systems" unique_id=1401212832]
|
||||
[node name="AuraSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("aura_system")
|
||||
|
||||
[node name="BuffSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("buff_system")
|
||||
|
||||
[node name="DebuffSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("debuff_system")
|
||||
|
||||
[node name="ElementSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("element_system")
|
||||
|
||||
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="." unique_id=1265843679]
|
||||
[node name="HudSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("hud_system")
|
||||
|
||||
[node name="NameplateSystem" type="Node" parent="Systems"]
|
||||
script = ExtResource("nameplate_system")
|
||||
|
||||
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0027503967, 0.014227867, 0.023231506)
|
||||
navigation_mesh = SubResource("NavigationMesh_1")
|
||||
|
||||
[node name="Boden" type="MeshInstance3D" parent="NavigationRegion3D" unique_id=593226019]
|
||||
[node name="Boden" type="MeshInstance3D" parent="NavigationRegion3D"]
|
||||
mesh = SubResource("PlaneMesh_1")
|
||||
|
||||
[node name="BodenCollision" type="StaticBody3D" parent="." unique_id=1112667638]
|
||||
[node name="BodenCollision" type="StaticBody3D" parent="."]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="BodenCollision" unique_id=621554623]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="BodenCollision"]
|
||||
shape = SubResource("WorldBoundaryShape3D_1")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1797472817]
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.707, 0.707, 0, -0.707, 0.707, 0, 10, 0)
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="Taverne" type="StaticBody3D" parent="." unique_id=1978646562]
|
||||
[node name="Taverne" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||
|
||||
[node name="Mesh" type="MeshInstance3D" parent="Taverne" unique_id=2043279810]
|
||||
[node name="Mesh" type="MeshInstance3D" parent="Taverne"]
|
||||
mesh = SubResource("BoxMesh_tavern")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Taverne" unique_id=2108564286]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Taverne"]
|
||||
shape = SubResource("BoxShape3D_tavern")
|
||||
|
||||
[node name="Player" parent="." unique_id=585018813 instance=ExtResource("player")]
|
||||
[node name="Player" parent="." instance=ExtResource("player")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -5)
|
||||
|
||||
[node name="HUD" parent="." unique_id=763693646 instance=ExtResource("hud")]
|
||||
[node name="HUD" parent="." instance=ExtResource("hud")]
|
||||
|
||||
[node name="PortalSpawner" type="Node" parent="." unique_id=2100621428]
|
||||
[node name="PortalSpawner" type="Node" parent="."]
|
||||
script = ExtResource("portal_spawner")
|
||||
|
||||
Reference in New Issue
Block a user