Feat/5 adding settings fundamentals and ui improvements #9
@@ -146,7 +146,7 @@ func _shoot_hitscan() -> void:
|
||||
|
||||
if result.collider.has_method("take_damage"):
|
||||
result.collider.take_damage(damage, result.position, player)
|
||||
else:
|
||||
elif result.collider is StaticBody3D or result.collider is CSGShape3D:
|
||||
# Not a target, spawn a bullet hole
|
||||
ImpactSpawner.spawn(get_tree(), "bullet", result.position, result.normal, 0.1)
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ func _shoot_hitscan() -> void:
|
||||
|
||||
if result.collider.has_method("take_damage"):
|
||||
result.collider.take_damage(damage, result.position, player)
|
||||
else:
|
||||
elif result.collider is StaticBody3D or result.collider is CSGShape3D:
|
||||
ImpactSpawner.spawn(get_tree(), "bullet", result.position, result.normal, 0.08)
|
||||
|
||||
# Spawn cosmetic tracer
|
||||
|
||||
@@ -133,7 +133,8 @@ func _setup_effects() -> void:
|
||||
|
||||
func _on_hit(result: Dictionary) -> void:
|
||||
if not result.collider.has_method("take_damage"):
|
||||
ImpactSpawner.spawn(get_tree(), "crater", result.position, result.normal, explosion_radius * 1.5)
|
||||
if result.collider is StaticBody3D or result.collider is CSGShape3D:
|
||||
ImpactSpawner.spawn(get_tree(), "crater", result.position, result.normal, explosion_radius * 1.5)
|
||||
_explode(result.position)
|
||||
destroy()
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ func _on_hit(result: Dictionary) -> void:
|
||||
|
||||
if result.collider.has_method("take_damage"):
|
||||
result.collider.take_damage(final_damage, result.position, owner_player)
|
||||
else:
|
||||
elif result.collider is StaticBody3D or result.collider is CSGShape3D:
|
||||
var size = 0.4 if impact_type == "plasma" else 0.15
|
||||
ImpactSpawner.spawn(get_tree(), impact_type, result.position, result.normal, size)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user