feat: implement weapon system, loadout manager, and specialized projectile behaviors with associated assets
This commit is contained in:
@@ -139,6 +139,17 @@ func spawn_damage_number(amount: float, hit_pos: Vector3) -> void:
|
||||
_hit_marker_tween = create_tween()
|
||||
_hit_marker_tween.tween_property(hit_marker, "modulate:a", 0.0, 0.4)
|
||||
|
||||
func apply_impulse(force: Vector3) -> void:
|
||||
velocity += force
|
||||
# Force an upward launch to break ground contact
|
||||
if force.y > 0.1:
|
||||
# Tiny upward bump helps move_and_slide detach from the floor
|
||||
global_position.y += 0.1
|
||||
|
||||
func take_damage(amount: float, hit_pos: Vector3, source: Node = null) -> void:
|
||||
# Show damage number for self-damage
|
||||
spawn_damage_number(amount, hit_pos)
|
||||
|
||||
func _ensure_machine() -> MovementStateMachine:
|
||||
if is_instance_valid(_machine):
|
||||
return _machine
|
||||
|
||||
Reference in New Issue
Block a user