diff --git a/scenes/projectiles/sword_slash.tscn b/scenes/projectiles/sword_slash.tscn index cc4e7ad2..1ab555fd 100644 --- a/scenes/projectiles/sword_slash.tscn +++ b/scenes/projectiles/sword_slash.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=19 format=3 uid="uid://c6ys2qs8aeu8n"] +[gd_scene load_steps=18 format=3 uid="uid://c6ys2qs8aeu8n"] [ext_resource type="PackedScene" uid="uid://beifde6xst23w" path="res://scenes/projectiles/projectile.tscn" id="1_lwexf"] [ext_resource type="Texture2D" uid="uid://b3kerfdfiley3" path="res://assets/images/shadow.png" id="2_pfam2"] [ext_resource type="PackedScene" uid="uid://djobi3eqlcjvo" path="res://scenes/vfx/trail_particle.tscn" id="3_gx0bp"] [ext_resource type="Texture2D" uid="uid://d155og1uw717" path="res://assets/images/vfx/slash_3_strip4.png" id="4_u6vsr"] -[ext_resource type="PackedScene" uid="uid://bmmyvowwwwyu1" path="res://scenes/vfx/explosion_0.tscn" id="5_yh6pw"] [ext_resource type="Script" path="res://scripts/weapon_system/projectile/ProjectileSpawner.gd" id="6_whjok"] [ext_resource type="Resource" uid="uid://d1ck1axrd4kd4" path="res://resources/ReferenceNodeResources/ysort_reference.tres" id="7_d1e47"] [ext_resource type="Script" path="res://scripts/weapon_system/projectile/SubProjectileManager.gd" id="7_n74ie"] @@ -130,9 +129,6 @@ libraries = { } autoplay = "slash" -[node name="ProjectileImpact" parent="." index="4"] -impact_scene = ExtResource("5_yh6pw") - [node name="ProjectileSpawner" type="Node" parent="." index="5"] script = ExtResource("6_whjok") initial_distance = 10.0 diff --git a/scripts/actor/MoverTopDown2D.gd b/scripts/actor/MoverTopDown2D.gd index 18f78f70..dd216fd0 100644 --- a/scripts/actor/MoverTopDown2D.gd +++ b/scripts/actor/MoverTopDown2D.gd @@ -35,7 +35,7 @@ func _physics_process(delta:float)->void: if distance > 0.0: ratio = min(acceleration / distance, 1.0) character.velocity += (direction * ratio) - var collided:bool = character.move_and_slide() + var _collided:bool = character.move_and_slide() ## Adds an impulse to velocity, like a kickback func add_impulse(impulse:Vector2)->void: diff --git a/scripts/weapon_system/projectile/HitLimit.gd b/scripts/weapon_system/projectile/HitLimit.gd index 4e2684ad..0b65fdb1 100644 --- a/scripts/weapon_system/projectile/HitLimit.gd +++ b/scripts/weapon_system/projectile/HitLimit.gd @@ -8,8 +8,13 @@ extends Node @export var hit_limit:int = 1 func _ready()->void: + if hit_limit < 1: + return damage_source.hit.connect(on_hit) - damage_source.hit_solid.connect(projectile.prepare_exit) + damage_source.hit_solid.connect(on_hit_solid) + +func on_hit_solid()->void: + projectile.prepare_exit() func on_hit()->void: if hit_limit < 1: