prototype vibe

This commit is contained in:
Marek Lenczewski
2026-04-16 17:20:57 +02:00
parent cf5979803e
commit f21e30eb55
72 changed files with 1330 additions and 70 deletions

View File

@@ -4,6 +4,7 @@ extends StaticBody3D
@export var is_exit: bool = false
var active := false
var dungeon_variant: int = 0
func _ready() -> void:
if not is_exit:
@@ -28,6 +29,7 @@ func _on_gate_area_body_entered(body: Node3D) -> void:
PlayerData.returning_from_dungeon = true
else:
PlayerData.portal_position = global_position
GameState.last_dungeon_variant = dungeon_variant
call_deferred("_change_scene")
func _change_scene() -> void:

View File

@@ -4,11 +4,34 @@ extends StaticBody3D
func _ready() -> void:
add_to_group("portals")
if stats.variant == PortalStats.Kind.RED:
add_to_group("red_portal")
_apply_appearance()
PortalData.register(self, stats)
func _exit_tree() -> void:
PortalData.deregister(self)
func _process(delta: float) -> void:
var mesh: Node3D = get_node_or_null("Mesh")
if mesh:
mesh.rotate_y(delta * 1.5)
func _apply_appearance() -> void:
var mesh: MeshInstance3D = get_node_or_null("Mesh")
if not mesh:
return
var mat := StandardMaterial3D.new()
mat.emission_enabled = true
mat.emission_energy_multiplier = 0.8
if stats.variant == PortalStats.Kind.RED:
mat.albedo_color = Color(0.9, 0.1, 0.1, 1)
mat.emission = Color(1.0, 0.25, 0.25, 1)
else:
mat.albedo_color = Color(0.4, 0.2, 0.85, 1)
mat.emission = Color(0.6, 0.35, 1.0, 1)
mesh.material_override = mat
func _on_detection_area_body_entered(body: Node3D) -> void:
if body is CharacterBody3D and body.name == "Player":
EventBus.portal_entered.emit(self, body)

View File

@@ -1,5 +1,8 @@
extends BaseStats
class_name PortalStats
enum Kind { NORMAL, RED }
@export var variant: Kind = Kind.NORMAL
@export var spawn_count := 3
@export var thresholds: Array[float] = [0.85, 0.70, 0.55, 0.40, 0.25, 0.10]

View File

@@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="PortalStats" format=3]
[ext_resource type="Script" path="res://scenes/portal/portal_stats.gd" id="1"]
[resource]
script = ExtResource("1")
variant = 1
max_health = 5000.0
spawn_count = 5