enabled enforced static typing
This commit is contained in:
@ -1,11 +1,10 @@
|
||||
extends Projectile
|
||||
class_name ExplosiveProjectile
|
||||
class_name ExplosiveProjectile extends Projectile
|
||||
|
||||
@export var explosion_range := 3.0
|
||||
@export var explosion_range: float = 3.0
|
||||
|
||||
var exploded := false
|
||||
var sound_done := false
|
||||
var particles_done := false
|
||||
var exploded: bool = false
|
||||
var sound_done: bool = false
|
||||
var particles_done: bool = false
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
@ -18,12 +17,12 @@ func _on_body_entered(_body: Node) -> void:
|
||||
explode()
|
||||
|
||||
|
||||
func explode():
|
||||
func explode() -> void:
|
||||
if is_multiplayer_authority() and !exploded:
|
||||
freeze = true
|
||||
exploded = true
|
||||
$CollisionShape3D.call_deferred("set_disabled", true)
|
||||
for enemy in get_tree().get_nodes_in_group("Enemies"):
|
||||
for enemy: EnemyController in get_tree().get_nodes_in_group("Enemies"):
|
||||
if global_position.distance_to(enemy.global_position) <= explosion_range:
|
||||
hit(enemy)
|
||||
networked_hit.rpc(get_tree().root.get_path_to(enemy))
|
||||
@ -33,7 +32,7 @@ func explode():
|
||||
$AudioStreamPlayer.play()
|
||||
|
||||
|
||||
func hit(target):
|
||||
func hit(target: CharacterBody3D) -> void:
|
||||
target.damage(damage)
|
||||
if owner_id == 0:
|
||||
if Data.preferences.display_tower_damage_indicators:
|
||||
@ -47,13 +46,13 @@ func hit(target):
|
||||
|
||||
|
||||
@rpc("reliable")
|
||||
func networked_hit(target_node_path):
|
||||
var target = get_tree().root.get_node(target_node_path)
|
||||
func networked_hit(target_node_path: String) -> void:
|
||||
var target: CharacterBody3D = get_tree().root.get_node(target_node_path)
|
||||
hit(target)
|
||||
|
||||
|
||||
@rpc("reliable")
|
||||
func networked_kill():
|
||||
func networked_kill() -> void:
|
||||
$Sprite3D.set_visible(false)
|
||||
$GPUParticles3D.emitting = true
|
||||
$AudioStreamPlayer.play()
|
||||
|
Reference in New Issue
Block a user