équilibrage des quota et du jeu, changement du GUI pour rendre les objectifs de quotas plus visibles #72

This commit is contained in:
2025-09-19 10:25:15 +02:00
parent 43bdbc3581
commit 42edc97401
24 changed files with 316 additions and 102 deletions

View File

@@ -13,16 +13,17 @@ func _on_player_updated(player:Player):
update_no_energy_left_info(player.energy)
func _on_planet_updated(planet:Planet):
%DayCount.text = "Day " + str(planet.day) + "/" + str(planet.day_limit)
%DayCount.text = str(planet.get_quota_remaining_days()) + " days left"
var quota_progression_percent : float = (planet.decontamination_surface - planet.surface_on_last_quota) / (planet.next_quota - planet.surface_on_last_quota) * 100
%QuotaProgressText.text = str(roundi(quota_progression_percent)) + " %"
get_tree().create_tween().tween_property(
%QuotaProgressBar,
"value",
quota_progression_percent,
0.5,
)
if planet.next_quota:
var quota_progression_percent : float = (planet.decontamination_surface - planet.last_quota) / (planet.next_quota - planet.last_quota) * 100
%QuotaProgressText.text = str(roundi(planet.decontamination_surface)) + "/" + str(roundi(planet.next_quota))
get_tree().create_tween().tween_property(
%QuotaProgressBar,
"value",
quota_progression_percent,
0.5,
)
func _on_player_action_tried_without_energy():
$AnimationPlayer.play("no_energy_left")
@@ -52,3 +53,25 @@ func update_no_energy_left_info(energy):
$NoEnergyLeftAnimation.play("no_energy_left_appear")
elif energy != 0 and %NoEnergyLeft.visible:
%NoEnergyLeft.visible = false
func _on_planet_new_quota_started(planet:Planet):
%Announce.announce(
"New Quota",
"Reach " + str(roundi(planet.next_quota)) + " units before " + str(Planet.DEFAULT_DAY_LIMIT) + " days"
)
func _on_planet_pass_day_ended(planet:Planet):
var remaining_days = planet.get_quota_remaining_days()
if remaining_days == 1:
%Announce.announce(
"Last day for reaching quota",
str(roundi(planet.next_quota - planet.decontamination_surface)) + " units left to decontaminate",
Announce.RED_COLOR
)
if remaining_days == 2:
%Announce.announce(
"2 days left before quota's ending",
str(roundi(planet.next_quota - planet.decontamination_surface)) + " units left to decontaminate",
Announce.YELLOW_COLOR
)