ajouts d'objectifs sur la carte, déplacements des icônes et divers changements

This commit is contained in:
2025-09-13 12:48:52 +02:00
parent e56ec31069
commit 85cd832864
81 changed files with 983 additions and 307 deletions

View File

@@ -0,0 +1,37 @@
extends InspectableEntity
class_name Objective
const RANDOM_MAX_OBJECTIVE_INTERVAL = 1.
var completed : bool = false
var planet : Planet
@export var reward : ObjectiveReward = null :
set(r):
reward = r
update_reward_info(r)
func _ready():
update_reward_info(reward)
func pointer_text():
return "Contamination Objective"
func inspector_info() -> Inspector.Info:
return Inspector.Info.new(
pointer_text(),
"If the zone around is decontaminated, give the following reward.\n\n" + reward.get_description(),
)
func _end_pass_day():
if planet and not completed:
if not planet.is_there_contamination(global_position):
reward.reward(self)
%AnimationPlayer.play("activate")
%RewardInfo.visible = false
completed = true
func update_reward_info(r : ObjectiveReward):
if r:
%RewardText.text = r.get_text()
%RewardIcon.texture = r.get_icon()
%RewardInfo.visible = r != null