feat: Add Tekton NPC with roaming behavior, combat reactions, and interaction mechanics including carrying and throwing.
This commit is contained in:
+1
-1
@@ -1933,7 +1933,7 @@ func sync_throw_tekton(target_pos: Vector2i):
|
||||
|
||||
# 2. Tekton drops tiles (Spawn tiles around) AND shrinks
|
||||
if tekton.has_method("on_thrown_landing"):
|
||||
tekton.on_thrown_landing(self )
|
||||
tekton.on_thrown_landing(self, 2.0)
|
||||
else:
|
||||
# Fallback
|
||||
tekton.on_hit(self , 1.0)
|
||||
|
||||
+1
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://dyovwailce5tf" path="res://scripts/tekton.gd" id="1_tekton"]
|
||||
[ext_resource type="Script" uid="uid://c67yq846u8y68" path="res://scripts/tekton_controller.gd" id="2_controller"]
|
||||
[ext_resource type="PackedScene" uid="uid://bdaghaxkmi3w1" path="res://scenes/tekton_mesh.tscn" id="3_d2kpk"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6d6qu1ir13q1" path="res://scenes/tekton_mesh.scn" id="3_d2kpk"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_tekton"]
|
||||
size = Vector3(0.8, 1, 0.8)
|
||||
@@ -16,7 +16,6 @@ script = ExtResource("2_controller")
|
||||
[node name="Visuals" type="Node3D" parent="." unique_id=1698719440]
|
||||
|
||||
[node name="tekton" parent="Visuals" unique_id=2052742928 instance=ExtResource("3_d2kpk")]
|
||||
transform = Transform3D(0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0, 0)
|
||||
|
||||
[node name="HitArea" type="Area3D" parent="." unique_id=2139590311]
|
||||
collision_layer = 4
|
||||
|
||||
Binary file not shown.
+3
-4
@@ -194,7 +194,7 @@ func on_thrown_landing(attacker: Node = null, intensity: float = 1.0):
|
||||
|
||||
print("[Tekton] Landed/Knocked! Shrinking and waiting... (Intensity: %.1f)" % intensity)
|
||||
|
||||
_flash_damage() # Add visual flash too? Why not.
|
||||
# _flash_damage() # Disabled to prevent tween conflict with shrinking
|
||||
|
||||
# Disable movement/interaction logic temporarily
|
||||
var controller = get_node_or_null("TektonController")
|
||||
@@ -205,14 +205,13 @@ func on_thrown_landing(attacker: Node = null, intensity: float = 1.0):
|
||||
# Use cached meshes if available, else find them (but can't restore accurately if not cached)
|
||||
if mesh_cache.is_empty():
|
||||
# Fallback if _ready hasn't run or failed
|
||||
# We'll just define the user's specific vector as fallback target for the sphere
|
||||
# But better to rely on cache.
|
||||
pass
|
||||
|
||||
for i in range(mesh_cache.size()):
|
||||
var mesh = mesh_cache[i]
|
||||
if is_instance_valid(mesh):
|
||||
var base_scale = original_scales[i]
|
||||
# Kill any existing tweens on this mesh to stop flash_damage or previous effects
|
||||
var t = create_tween()
|
||||
t.tween_property(mesh, "scale", base_scale * 0.5, 0.2).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK)
|
||||
|
||||
@@ -223,7 +222,7 @@ func on_thrown_landing(attacker: Node = null, intensity: float = 1.0):
|
||||
# Floor Freeze (Visual/Instant - Run on all clients locally)
|
||||
temporarily_change_floor(current_position, 1, 6, 3.0)
|
||||
|
||||
# Wait 3 seconds
|
||||
# Wait 3.0 seconds
|
||||
await get_tree().create_timer(3.0).timeout
|
||||
|
||||
# Grow back
|
||||
|
||||
Reference in New Issue
Block a user