Feat/2 weapons foundation #6

Merged
Dotts merged 30 commits from feat/2-weapons-foundation into main 2026-06-04 22:22:16 -07:00
2 changed files with 42 additions and 15 deletions
Showing only changes of commit bd04135dba - Show all commits
+22
View File
@@ -68,3 +68,25 @@ func _explode(pos: Vector3) -> void:
pass
else:
col.take_damage(final_damage, target_pos, owner_player)
# Visual Effect
var visual = MeshInstance3D.new()
var s_mesh = SphereMesh.new()
s_mesh.radius = explosion_radius
s_mesh.height = explosion_radius * 2.0
visual.mesh = s_mesh
var mat = StandardMaterial3D.new()
mat.albedo_color = Color(1.0, 0.5, 0.0, 0.6) # Translucent orange
mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
mat.emission_enabled = true
mat.emission = Color(1.0, 0.3, 0.0)
visual.material_override = mat
visual.position = pos
get_tree().current_scene.add_child(visual)
var tween = visual.create_tween()
tween.tween_property(mat, "albedo_color:a", 0.0, 0.3)
tween.parallel().tween_property(visual, "scale", Vector3(1.1, 1.1, 1.1), 0.3)
tween.tween_callback(visual.queue_free)
+5
View File
@@ -6,6 +6,11 @@ var turn_speed: float = 5.0
func _physics_process(delta: float) -> void:
if is_instance_valid(weapon_source) and weapon_source.get("homing_target_pos") != null:
var is_painting = weapon_source.get("is_targeting")
if is_painting != null and not is_painting:
# Not painting target, just fly straight
pass
else:
var target: Vector3 = weapon_source.homing_target_pos
if target != Vector3.ZERO:
# Steer towards target