* changements des objectifs, donnent juste des graines, sprite moins gros et objectifs plus nombreux * changement de la probabilité de mutation * refactor du code terrain et planet
36 lines
825 B
GDScript
36 lines
825 B
GDScript
extends InspectableEntity
|
|
class_name Objective
|
|
|
|
const RANDOM_MAX_OBJECTIVE_INTERVAL = 1.
|
|
const DECONTAMINATION_ICON = preload("res://common/icons/skull.svg")
|
|
|
|
var completed : bool = false
|
|
@export var reward : ObjectiveReward = null
|
|
|
|
func pointer_text():
|
|
return "Contamination Objective"
|
|
|
|
func inspector_info() -> Inspector.Info:
|
|
var info : Inspector.Info = Inspector.Info.new(
|
|
pointer_text(),
|
|
"This dead branch can hide a treasure of life."
|
|
)
|
|
|
|
info.framed_infos.append(
|
|
Inspector.FramedInfo.new(
|
|
"When decontamined",
|
|
reward.get_description(),
|
|
DECONTAMINATION_ICON
|
|
)
|
|
)
|
|
|
|
return info
|
|
|
|
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
|