Dev 0.2.0
* Ajout de la déblocage des mutation du mode infini dans le mode histoire * Ajout de plus de caverne * Rework de l'emplacement des distributeurs/cavernes * Rework de l'influence, plus de clarté sur les plantes influencées * 4 d'inventaire dans le mode infini * Fix du tuto de mouvement en 3D * Déblocage de toutes le mutations à la fin du jeu * Fix de bug de chargelent de scène multiple
This commit is contained in:
@@ -12,35 +12,6 @@ height = 52.0
|
||||
atlas = ExtResource("3_j6jm5")
|
||||
region = Rect2(76, 75, 124, 135)
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_rbgiq"]
|
||||
viewport_path = NodePath("LifeTimeSprite/SubViewport")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_rbgiq"]
|
||||
interpolation_mode = 1
|
||||
offsets = PackedFloat32Array(0, 0.800905, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_rbgiq"]
|
||||
gradient = SubResource("Gradient_rbgiq")
|
||||
width = 100
|
||||
height = 100
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
fill_to = Vector2(1, 0.5)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_j6jm5"]
|
||||
interpolation_mode = 1
|
||||
offsets = PackedFloat32Array(0, 0.5248869)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_wyuub"]
|
||||
gradient = SubResource("Gradient_j6jm5")
|
||||
width = 100
|
||||
height = 100
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
fill_to = Vector2(1, 0.5)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_wyuub"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
@@ -184,30 +155,6 @@ position = Vector2(4.444448, 31.11118)
|
||||
scale = Vector2(3.1777775, 3.1777775)
|
||||
texture = ExtResource("3_rbgiq")
|
||||
|
||||
[node name="LifeTimeSprite" type="Sprite2D" parent="." unique_id=799762981]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
scale = Vector2(0.26000002, 0.26000005)
|
||||
texture = SubResource("ViewportTexture_rbgiq")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="LifeTimeSprite" unique_id=1809354262]
|
||||
disable_3d = true
|
||||
transparent_bg = true
|
||||
size = Vector2i(100, 100)
|
||||
|
||||
[node name="LifetimeProgressBar" type="TextureProgressBar" parent="LifeTimeSprite/SubViewport" unique_id=967185775]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
fill_mode = 4
|
||||
texture_over = SubResource("GradientTexture2D_rbgiq")
|
||||
texture_progress = SubResource("GradientTexture2D_wyuub")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1793068152]
|
||||
unique_name_in_owner = true
|
||||
libraries/ = SubResource("AnimationLibrary_8eofq")
|
||||
|
||||
@@ -47,22 +47,27 @@ func _ready():
|
||||
await get_tree().create_timer(0.05).timeout
|
||||
update_nearby_plant()
|
||||
update_decontamination_area_factor()
|
||||
if data.day == data.get_lifetime() - 1:
|
||||
plant_sprite.apply_about_to_dye_effect()
|
||||
plant_sprite.is_about_to_die = data.day == data.get_lifetime() - 1
|
||||
|
||||
func pointer_text() -> String:
|
||||
return data.plant_name
|
||||
|
||||
func inspect(is_inspected: bool = true):
|
||||
plant_sprite.set_modulate_color(MODULATE_INSPECTED_COLOR if is_inspected else default_modulate, false)
|
||||
plant_sprite.display_lifetime_sprite = is_inspected
|
||||
plant_sprite.is_inspected = is_inspected
|
||||
influence_zone.show_influence = is_inspected
|
||||
|
||||
for area in influence_zone.get_overlapping_areas():
|
||||
if area is Plant and area != self:
|
||||
area.show_influence(is_inspected)
|
||||
|
||||
|
||||
func show_influence(influenced := true):
|
||||
plant_sprite.is_plant_influenced = influenced
|
||||
|
||||
func generate_sprite() -> PlantSprite:
|
||||
var sprite_object: PlantSprite = SPRITE_SCENE.instantiate()
|
||||
|
||||
add_child(sprite_object)
|
||||
# sprite_object.generate_mutation_effects(self)
|
||||
|
||||
return sprite_object
|
||||
|
||||
@@ -107,8 +112,7 @@ func _pass_day():
|
||||
for m in data.mutations:
|
||||
m._start_day_effect(self)
|
||||
|
||||
if data.day == data.get_lifetime() - 1:
|
||||
plant_sprite.apply_about_to_dye_effect()
|
||||
plant_sprite.is_about_to_die = data.day == data.get_lifetime() - 1
|
||||
|
||||
func _end_pass_day():
|
||||
match data.get_state():
|
||||
|
||||
@@ -16,10 +16,10 @@ func _init(_radius = 100):
|
||||
func _ready():
|
||||
sprite = Circle.new()
|
||||
# sprite.z_index = 100
|
||||
sprite.radius = radius
|
||||
sprite.radius = radius + roundi(Plant.PLANT_AREA_RADIUS / 2.)
|
||||
sprite.fill = false
|
||||
sprite.width = 1
|
||||
sprite.opacity = 0.5
|
||||
sprite.width = 3
|
||||
sprite.opacity = 0.3
|
||||
sprite.visible = show_influence
|
||||
add_child(sprite)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ class_name PlantSprite
|
||||
const PLANTED_SEED_CROP_WIDTH = 50
|
||||
const PLANTED_SEED_POS_Y = 0
|
||||
|
||||
const PARTICLES_SCENE: PackedScene = preload("res://common/vfx/particles/effect_particles.tscn")
|
||||
const MODULATE_PLANT_INFLUENCED_COLOR = Color("c599ffff")
|
||||
|
||||
const ABOUT_TO_DYE_COLOR := Color("#fca67e")
|
||||
const ABOUT_TO_DYE_PERIOD := 1.0
|
||||
@@ -14,14 +14,17 @@ signal harvest_animation_finished
|
||||
var last_updated_on_state: PlantData.State = PlantData.State.MATURE
|
||||
var stored_seed_image: Texture = null
|
||||
|
||||
var display_lifetime_sprite: bool = false: set = set_display_lifetime_sprite
|
||||
var sprite_modulate: Color = Color.WHITE: set = set_sprite_modulate
|
||||
var is_action_affected : bool = false
|
||||
var is_inspected : bool = false
|
||||
var is_plant_influenced : bool = false
|
||||
var is_about_to_die : bool = false
|
||||
|
||||
var about_to_dye_tween: Tween
|
||||
var target_modulate_color := Color.WHITE
|
||||
|
||||
var elapsed_time := 0.
|
||||
|
||||
func setup_plant_sprite(plant_data: PlantData):
|
||||
set_display_lifetime_sprite()
|
||||
%PlantedSeed.texture = PlantTextureBuilder.build_seed_texture(plant_data.plant_name.hash())
|
||||
update_plant_sprite(plant_data, true)
|
||||
|
||||
@@ -35,43 +38,13 @@ func update_plant_sprite(plant_data: PlantData, with_animation = false):
|
||||
|
||||
%PlantedSeed.visible = plant_data.get_state() == PlantData.State.PLANTED
|
||||
|
||||
%LifetimeProgressBar.value = 100 * (float(plant_data.day) / plant_data.get_lifetime())
|
||||
|
||||
# %PlantedSeed.region_rect = Rect2(
|
||||
# 0,
|
||||
# PLANTED_SEED_POS_Y,
|
||||
# %PlantedSeed.texture.get_width(),
|
||||
# %PlantedSeed.texture.texture.get_height() - PLANTED_SEED_CROP_WIDTH + -1 * PLANTED_SEED_POS_Y,
|
||||
# )
|
||||
|
||||
func generate_mutation_effects(plant: Plant):
|
||||
for m in plant.data.mutations:
|
||||
var particles_emitter: EffectParticles = PARTICLES_SCENE.instantiate() as EffectParticles
|
||||
particles_emitter.setup_particles(
|
||||
EffectParticles.Parameters.new(
|
||||
m.get_icon(),
|
||||
PlantMutation.get_rarity_color(m.get_rarity())
|
||||
)
|
||||
)
|
||||
add_child(particles_emitter)
|
||||
|
||||
func start_harvest_animation():
|
||||
$AnimationPlayer.play("harvest")
|
||||
await $AnimationPlayer.animation_finished
|
||||
harvest_animation_finished.emit()
|
||||
|
||||
func set_display_lifetime_sprite(d := display_lifetime_sprite):
|
||||
display_lifetime_sprite = d
|
||||
# if is_node_ready():
|
||||
# %LifeTimeSprite.visible = d
|
||||
|
||||
func set_sprite_modulate(c := sprite_modulate):
|
||||
sprite_modulate = c
|
||||
if is_node_ready():
|
||||
%Sprite.modulate = c
|
||||
|
||||
func affect_preview(is_affected: bool = true):
|
||||
set_modulate_color(InspectableEntity.MODULATE_AFFECTED_COLOR if is_affected else Color.WHITE, true)
|
||||
is_action_affected = is_affected
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is Player && $AnimationPlayer.current_animation != "player_move":
|
||||
@@ -81,25 +54,20 @@ func play_bump_animation():
|
||||
%AnimationPlayer.play("bump")
|
||||
await %AnimationPlayer.animation_finished
|
||||
|
||||
func set_modulate_color(color: Color, pause_about_to_dye: bool):
|
||||
target_modulate_color = color
|
||||
if about_to_dye_tween:
|
||||
if pause_about_to_dye and about_to_dye_tween.is_running():
|
||||
about_to_dye_tween.pause()
|
||||
modulate = target_modulate_color
|
||||
elif not pause_about_to_dye and not about_to_dye_tween.is_running():
|
||||
about_to_dye_tween.play()
|
||||
elif is_node_ready():
|
||||
%Sprite.modulate = target_modulate_color
|
||||
func _process(delta):
|
||||
elapsed_time += delta
|
||||
|
||||
func apply_about_to_dye_effect():
|
||||
if not about_to_dye_tween:
|
||||
about_to_dye_tween = create_tween()
|
||||
about_to_dye_tween.tween_property(%Sprite, "modulate:r", ABOUT_TO_DYE_COLOR.r, ABOUT_TO_DYE_PERIOD).from(target_modulate_color.r)
|
||||
about_to_dye_tween.parallel().tween_property(%Sprite, "modulate:g", ABOUT_TO_DYE_COLOR.g, ABOUT_TO_DYE_PERIOD).from(target_modulate_color.g)
|
||||
about_to_dye_tween.parallel().tween_property(%Sprite, "modulate:b", ABOUT_TO_DYE_COLOR.b, ABOUT_TO_DYE_PERIOD).from(target_modulate_color.b)
|
||||
var target_modulate = Color.WHITE
|
||||
|
||||
if is_action_affected:
|
||||
target_modulate = InspectableEntity.MODULATE_AFFECTED_COLOR
|
||||
elif is_inspected:
|
||||
target_modulate = InspectableEntity.MODULATE_INSPECTED_COLOR
|
||||
elif is_plant_influenced:
|
||||
target_modulate = MODULATE_PLANT_INFLUENCED_COLOR
|
||||
elif is_about_to_die:
|
||||
var blink_value = (cos((elapsed_time * (2 * PI)) * ABOUT_TO_DYE_PERIOD) + 1)/2
|
||||
target_modulate = target_modulate.lerp(ABOUT_TO_DYE_COLOR, blink_value)
|
||||
|
||||
modulate = modulate.lerp(target_modulate, 0.8)
|
||||
|
||||
about_to_dye_tween.tween_property(%Sprite, "modulate:r", target_modulate_color.r, ABOUT_TO_DYE_PERIOD).from(ABOUT_TO_DYE_COLOR.r)
|
||||
about_to_dye_tween.parallel().tween_property(%Sprite, "modulate:g", target_modulate_color.g, ABOUT_TO_DYE_PERIOD).from(ABOUT_TO_DYE_COLOR.g)
|
||||
about_to_dye_tween.parallel().tween_property(%Sprite, "modulate:b", target_modulate_color.b, ABOUT_TO_DYE_PERIOD).from(ABOUT_TO_DYE_COLOR.b)
|
||||
about_to_dye_tween.set_loops()
|
||||
|
||||
@@ -106,7 +106,6 @@ theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="MoveTutorial" type="Label" parent="CanvasLayer/3dTutorial" unique_id=1165378520]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
text = "MOVE_WITH_RIGHT_CLICK_OR_WASD"
|
||||
@@ -116,6 +115,7 @@ vertical_alignment = 1
|
||||
|
||||
[node name="InteractTutorial" type="Label" parent="CanvasLayer/3dTutorial" unique_id=1117243867]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
text = "INTERACT_WITH_LEFT_CLICK"
|
||||
|
||||
@@ -33,6 +33,12 @@ func _ready():
|
||||
|
||||
%MoveTutorial.visible = not "3d_move" in GameInfo.game_data.tutorials_done
|
||||
%InteractTutorial.visible = false
|
||||
%MoveTutorial.text = tr("MOVE_WITH_RIGHT_CLICK_OR_WASD").format({
|
||||
"W": GameInfo.get_action_key_name("move_up"),
|
||||
"A": GameInfo.get_action_key_name("move_left"),
|
||||
"S": GameInfo.get_action_key_name("move_down"),
|
||||
"D": GameInfo.get_action_key_name("move_right")
|
||||
})
|
||||
%Camera3D.fov = GameInfo.settings_data.fov
|
||||
GameInfo.settings_data.fov_changed.connect(
|
||||
func(fov : float):
|
||||
|
||||
Reference in New Issue
Block a user