Made Extra Jump unique

Fixed Boss getting stuck during slam
This commit is contained in:
Melvin Weiß 2025-10-02 19:37:56 +02:00
parent 7687844ea6
commit 8e9f7723d9
4 changed files with 18 additions and 15 deletions

View file

@ -14,6 +14,7 @@ var target_pos = Vector2.ZERO
var damage = 1
var dead = false
signal grounded
signal slam_step_finished
func choose_next_move() -> String:
if $EnemyHurtbox.hp <= 3 * $EnemyHurtbox.max_hp / 4 and risen == 0:
@ -59,32 +60,32 @@ func slam():
idle_move = false
velocity = up_direction * 500
await get_tree().create_timer(0.6).timeout
damage = 2
velocity = up_direction * -1500
await grounded
$SoundSlam.play()
destroy_below()
await slam_step()
damage = 1
velocity = up_direction * 500
await get_tree().create_timer(0.3).timeout
damage = 2
velocity = up_direction * -1500
await grounded
$SoundSlam.play()
destroy_below()
damage = 1
await slam_step()
velocity = up_direction * 35
await get_tree().create_timer(3).timeout
idle_move = true
attack_ready = true
func slam_step():
damage = 2
velocity = up_direction * -1500
grounded.connect(func(): slam_step_finished.emit())
get_tree().create_timer(1.5).timeout.connect(func(): slam_step_finished.emit())
await slam_step_finished
$SoundSlam.play()
destroy_below()
damage = 1
func destroy_below():
if dead: return
for body in $DestructionChecker.get_overlapping_bodies():
if(body.has_method("destroy")): body.destroy()
func wave():
var angle = atan2(player.position.y, player.position.x)
var dir = randi_range(0, 1) * 2 - 1
var speed = 3000/water.radius_base

View file

@ -14,5 +14,5 @@
[resource]
script = ExtResource("6_rli0f")
common = Array[PackedScene]([ExtResource("1_2l6sh"), ExtResource("1_2l6sh"), ExtResource("1_2l6sh"), ExtResource("9_esvgx"), ExtResource("5_jwi73"), ExtResource("4_vpswe")])
rare = Array[PackedScene]([ExtResource("3_g002j"), ExtResource("2_rli0f")])
unique = Array[PackedScene]([ExtResource("6_73uum"), ExtResource("7_k6eth"), ExtResource("8_8cxou")])
rare = Array[PackedScene]([ExtResource("3_g002j")])
unique = Array[PackedScene]([ExtResource("6_73uum"), ExtResource("7_k6eth"), ExtResource("8_8cxou"), ExtResource("2_rli0f")])

View file

@ -22,7 +22,7 @@ position = Vector2(1.90735e-06, 0.999999)
shape = SubResource("RectangleShape2D_hw3fr")
[node name="Sprite2D2" type="Sprite2D" parent="."]
modulate = Color(0.583047, 0.321422, 0.988413, 1)
modulate = Color(0.7254902, 0.52156866, 0, 1)
position = Vector2(0, 2)
scale = Vector2(1.5, 1.5)
texture = ExtResource("3_hw3fr")

View file

@ -103,6 +103,8 @@ colors = Array[Color]([Color(0, 0.6441987, 0.6693053, 1), Color(0.90588236, 0.15
script = ExtResource("10_efxa6")
boss = ExtResource("11_efxa6")
[node name="Boss" parent="." instance=ExtResource("11_efxa6")]
[connection signal="active_item_changed" from="Player" to="UIOverlay/ItemUI" method="_on_player_active_item_changed"]
[connection signal="health_changed" from="Player" to="UIOverlay/Healthbar" method="_on_player_health_changed"]
[connection signal="max_hp_changed" from="Player" to="UIOverlay/Healthbar" method="_on_player_max_hp_changed"]