* Evolution de l'histoire avec de nouveaux dialogues, une plus grande durée de vie du jeu, des nouvelles zones d'histoire... * Suppression du mode infini * Ajout d'un écran des mutations découvertes * Ajout d'un nouveau mécanisme de respawn situé dans le vaissau * Ajout de 2 nouveaux modificateurs de région * Quatre nouveaux artefacts * Visuel de la décontamination de la planète 3D en cours de la partie * Ajout d'une annonce visuelle des scène du jeu * Fix sur la mutation Généreux pour être en accord avec sa description * Amélioration de l'effet de la mutation Purification * Fix de la mutation sociale aux niveau supérieurs * Ajout d'un effet visuel de réacteur sur le joueur 3D * Fix sur l'annonce de nouveaux objets qui se déclenchaient à une nouvelle run * Amélioration des animation et des informations données dans le vaisseau * Correction mineure des traductions
96 lines
2.7 KiB
GDScript
96 lines
2.7 KiB
GDScript
@tool
|
|
extends CanvasLayer
|
|
class_name Announce
|
|
|
|
const DEFAULT_OBJECT_ACCELERATION = Vector2(3,0)
|
|
|
|
@export var announce_object : AnnouceObject = null : set = set_announce_object
|
|
|
|
@export_tool_button("Update", "Callable") var update_action = set_announce_object
|
|
|
|
var announce_objects : Array[AnnouceObject] = []
|
|
|
|
var object_acceleration := Vector2(0,0)
|
|
|
|
var rotating := false
|
|
|
|
var prev_mouse_pos : Vector2
|
|
var next_mouse_pos : Vector2
|
|
|
|
const YELLOW_COLOR = Color("e29f32")
|
|
const RED_COLOR = Color("f20058")
|
|
|
|
func _ready():
|
|
set_announce_object()
|
|
%OkButton.button_down.connect(_on_ok_button_down)
|
|
hide()
|
|
|
|
|
|
GameInfo.game_data.player_data.inventory.tool_added.connect(
|
|
func (i : Item):
|
|
if not i.name in GameInfo.game_data.item_announced:
|
|
announce_objects.append(AnnounceTool.new(i))
|
|
GameInfo.game_data.item_announced.append(i.name)
|
|
)
|
|
|
|
func _process(delta):
|
|
if announce_object == null and not visible and len(announce_objects) > 0:
|
|
announce_object = announce_objects.pop_front()
|
|
update_rotation(delta)
|
|
|
|
func update_rotation(delta):
|
|
if visible:
|
|
next_mouse_pos = get_viewport().get_mouse_position()
|
|
if Input.is_action_just_pressed("action"):
|
|
rotating = true
|
|
prev_mouse_pos = get_viewport().get_mouse_position()
|
|
if Input.is_action_just_released("action"):
|
|
rotating = false
|
|
object_acceleration = Vector2(
|
|
float(next_mouse_pos.x - prev_mouse_pos.x),
|
|
float(next_mouse_pos.y - prev_mouse_pos.y)
|
|
)
|
|
|
|
var object_rotation = object_acceleration
|
|
|
|
if rotating:
|
|
object_rotation = Vector2(
|
|
float(next_mouse_pos.x - prev_mouse_pos.x),
|
|
float(next_mouse_pos.y - prev_mouse_pos.y)
|
|
)
|
|
prev_mouse_pos = next_mouse_pos
|
|
else :
|
|
object_acceleration = object_acceleration.lerp(DEFAULT_OBJECT_ACCELERATION, 0.1)
|
|
|
|
%AnnouceObject.rotate(Vector3.UP, object_rotation.x * delta)
|
|
%AnnouceObject.rotate(Vector3.RIGHT, object_rotation.y * delta)
|
|
|
|
|
|
func set_announce_object(object := announce_object):
|
|
if is_node_ready() and object:
|
|
for children in %AnnouceObject.get_children():
|
|
children.queue_free()
|
|
|
|
%AnnouceObject.add_child(object.get_3d_object())
|
|
%AnnouceObject.rotation = Vector3.ZERO
|
|
%AnnounceTitle.text = object.get_title()
|
|
%AnnounceText.text = object.get_text()
|
|
%ObjectVisualiser.info = object.get_card_info()
|
|
|
|
if not visible:
|
|
%AnimationPlayer.play("appear")
|
|
Pointer.action_disabled = true
|
|
AudioManager.play_sfx("Reveal")
|
|
elif object == null and visible:
|
|
%AnimationPlayer.play_backwards("appear")
|
|
get_tree().create_timer(0.2).timeout.connect( # Put a delay to not interfere with the ok button click
|
|
func():
|
|
Pointer.action_disabled = false
|
|
)
|
|
announce_object = object
|
|
|
|
func _on_ok_button_down():
|
|
if announce_object:
|
|
announce_object._on_dismiss()
|
|
announce_object = null
|