Dev Beta 1.3
* Ajout d'un déblocage des mutations, dans une scène 3D trouvable dans les runs, ainsi qu'un dialogue d'annonce de ces scènes * Augmentation des charges par map à 10 et augmentation des objectifs de points de plantes en conséquence * Modification du loot des graines : les plantes donnent désormais un nombre fixe de graine et les graines issues de veine de Talion n'obtiennent pas automatiquement de mutations * Les portes ne seront désormais plus sur de la pierre * Amélioration du tutoriel pour inclure une section d'explication des mutations * Ajout du modificateur de région Magnétique qui divise l'objectif et les recharges par 2 *
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
@tool
|
||||
extends CanvasLayer
|
||||
class_name MutationAnnounce
|
||||
|
||||
const DEFAULT_OBJECT_ACCELERATION = Vector2(3,0)
|
||||
|
||||
@export var announce_mutation : PlantMutation = null : set = set_announce_mutation
|
||||
|
||||
@export_tool_button("Update", "Callable") var update_action = set_announce_mutation
|
||||
|
||||
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_mutation()
|
||||
%OkButton.button_down.connect(_on_ok_button_down)
|
||||
hide()
|
||||
|
||||
func _process(delta):
|
||||
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_mutation(mutation := announce_mutation):
|
||||
|
||||
if is_node_ready() and mutation:
|
||||
|
||||
%AnnounceTitle.text = "NEW_MUTATION"
|
||||
%AnnounceText.text = mutation.get_mutation_name()
|
||||
%MutationIconTextureRect.texture = mutation.get_icon()
|
||||
%ObjectVisualiser.info = mutation.card_info()
|
||||
|
||||
if not visible:
|
||||
%AnimationPlayer.play("appear")
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
AudioManager.play_sfx("Reveal")
|
||||
elif mutation == null and visible:
|
||||
%AnimationPlayer.play_backwards("appear")
|
||||
|
||||
if not Engine.is_editor_hint():
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
announce_mutation = mutation
|
||||
|
||||
func _on_ok_button_down():
|
||||
announce_mutation = null
|
||||
Reference in New Issue
Block a user