diff --git a/behaviours/rewards.json b/behaviours/rewards.json index d3f7aac..8b73f48 100644 --- a/behaviours/rewards.json +++ b/behaviours/rewards.json @@ -23,6 +23,14 @@ "description": "强化枪机是一项专为追求更强大战术控制的射手设计的武器升级服务。通过对武器的枪机系统进行增强,这项服务赋予了射击出的子弹更为强大的击退能力。每一发子弹都带有更大的冲击力,能够有效地推动目标并改变战场动态。", "weight": 0.2 }, + { + "id": "PLAYER_SPEED", + "value": 200, + "title": "外骨骼强化", + "subtitle": "让你跑得比波尔特还快", + "description": "外骨骼强化是一项引人注目的技术,专为那些寻求超越人类极限的玩家而设计。通过这项强化,你的角色将获得令人瞠目结舌的移动速度提升,使你在战场上成为一名极具机动性的玩家。", + "weight": 0.2 + }, { "id": "TOWER_HEALTH", "value": 50, diff --git a/scenes/main.tscn b/scenes/main.tscn index 0adc516..1c489db 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -56,5 +56,6 @@ stats = NodePath("../Statistics") [connection signal="enemy_defeat" from="EnemyFarm" to="Statistics" method="_on_enemy_defeated"] [connection signal="tower_broken" from="Tower" to="FinishScreen" method="_show"] [connection signal="wave_finished" from="Statistics" to="EnemyFarm" method="_on_wave_finished"] +[connection signal="wave_finished" from="Statistics" to="Player" method="_on_wave_finished"] [connection signal="wave_finished" from="Statistics" to="RewardClaimScreen" method="_show"] [connection signal="wave_started" from="Statistics" to="EnemyFarm" method="_on_wave_started"] diff --git a/scripts/player.gd b/scripts/player.gd index 35f9eb5..2b815d9 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -47,6 +47,10 @@ func deal_weapon_shoot(): statistics.bullet_shoot += 1 fire_cooldown_timer.start(fire_cooldown_duration) +func move_to_center(): + var screen_size = get_viewport_rect().size + position = Vector2(screen_size.x / 2, screen_size.y / 2) + func _on_dash_cooled_down(): dash_cooldown_timer.stop() @@ -54,10 +58,12 @@ func _on_fire_cooled_down(): fire_cooldown_timer.stop() func _ready(): - var screen_size = get_viewport_rect().size - position = Vector2(screen_size.x / 2, screen_size.y / 2) + move_to_center() func _physics_process(delta): deal_move(delta) deal_weapon_shoot() move_and_slide() + +func _on_wave_finished(): + move_to_center() diff --git a/scripts/ui/reward_item.gd b/scripts/ui/reward_item.gd index 81bd91c..d17fbf4 100644 --- a/scripts/ui/reward_item.gd +++ b/scripts/ui/reward_item.gd @@ -26,6 +26,8 @@ func _on_claim(): player.weapon_bullet_damage += value "BULLET_KNOCKBACK": player.weapon_bullet_knockback += value + "PLAYER_SPEED": + player.speed += value "TOWER_HEALTH": tower.health += value claimed.emit()