* Ajout des achievement Steam * Ajout d'une annonce à la récupération d'un artefact et ajout de textes axplicatifs sur les annonces d'artefacts et de mutation * Fix du léger glitch des tooltips * Ajout de clarté sur la machine de respawn dans le vaisseau
59 lines
1.7 KiB
GDScript
59 lines
1.7 KiB
GDScript
extends Interactable3D
|
|
|
|
const MAX_BREAK_LEVEL = 2
|
|
|
|
signal broken
|
|
|
|
@export var break_level = 0
|
|
|
|
func _ready():
|
|
update_model()
|
|
|
|
func click():
|
|
if interactable:
|
|
clicked.emit()
|
|
%BreackAudioPlayer.playing = true
|
|
%BreakParticles.emitting = true
|
|
|
|
break_level += 1
|
|
if break_level == MAX_BREAK_LEVEL:
|
|
broken.emit()
|
|
interactable = false
|
|
unlock_mutation()
|
|
|
|
update_model()
|
|
|
|
|
|
func update_model():
|
|
if is_node_ready():
|
|
%CristalModel.visible = break_level == 0
|
|
%CristalModelCrack.visible = break_level > 0
|
|
|
|
if break_level > 1:
|
|
%CristalModelCrack.find_children("AnimationPlayer")[0].play("Break")
|
|
|
|
func unlock_mutation():
|
|
var progression = GameInfo.game_data.progression_data
|
|
|
|
if progression.mutations_unlocked < len(progression.get_all_mutations()):
|
|
var new_mutation : PlantMutation = progression.get_all_mutations()[progression.mutations_unlocked]
|
|
progression.mutations_unlocked += 1
|
|
|
|
get_tree().create_timer(1.).timeout.connect(
|
|
func (): %MutationAnnounce.announce_mutation = new_mutation
|
|
);
|
|
|
|
if progression.mutations_unlocked == len(progression.get_all_mutations()):
|
|
SteamConnection.unlock_achievement(SteamConnection.ACH_UNLOCK_ALL_MUTATION)
|
|
|
|
else:
|
|
var talion_relay = TalionRelayArtifact.new()
|
|
|
|
if GameInfo.game_data and GameInfo.game_data.current_region_data and GameInfo.game_data.current_run:
|
|
GameInfo.game_data.current_run.add_artefacts(talion_relay)
|
|
|
|
get_tree().create_timer(1.).timeout.connect(
|
|
func (): %ArtefactAnnounce.announce_artefact = talion_relay
|
|
);
|
|
|