création du squelette des region modifier, amélioration du tutoriel et mise en place de la run complète avec cinématique d'outro

This commit is contained in:
2026-02-21 20:44:41 +01:00
parent eb48a095de
commit e767e776f2
80 changed files with 415 additions and 201 deletions

View File

@@ -4,8 +4,10 @@
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_nq5i2"]
[ext_resource type="PackedScene" uid="uid://brfsapvj2quxm" path="res://gui/game/energy_info/energy_info.tscn" id="4_2wykm"]
[ext_resource type="PackedScene" uid="uid://fnv0qhkh40mv" path="res://gui/game/announce/announce.tscn" id="4_h6540"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="6_2wykm"]
[ext_resource type="PackedScene" uid="uid://df0eop555wfj5" path="res://gui/game/objective_progress_bar/objective_progress_bar.tscn" id="6_dr1y2"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="6_h6540"]
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="6_id0t5"]
[ext_resource type="Texture2D" uid="uid://b43thuq8piv18" path="res://common/icons/skull.svg" id="7_dr1y2"]
[ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="9_id0t5"]
@@ -19,6 +21,10 @@ gradient = SubResource("Gradient_id0t5")
fill_to = Vector2(1, 1)
repeat = 1
[sub_resource type="LabelSettings" id="LabelSettings_id0t5"]
font = ExtResource("6_2wykm")
font_size = 40
[sub_resource type="Animation" id="Animation_2wykm"]
resource_name = "NoRechargeAppear"
length = 0.5
@@ -155,7 +161,24 @@ layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
[node name="RechargesLeftLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=1961035876]
[node name="SimplePlantPointScore" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=973032799]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 0
alignment = 1
[node name="TextureRect" type="TextureRect" parent="MarginContainer/VBoxContainer/SimplePlantPointScore" unique_id=534916675]
layout_mode = 2
texture = ExtResource("6_id0t5")
[node name="SimplePlantPointScoreLabel" type="Label" parent="MarginContainer/VBoxContainer/SimplePlantPointScore" unique_id=1961035876]
unique_name_in_owner = true
layout_mode = 2
text = "0 Plant Point"
label_settings = SubResource("LabelSettings_id0t5")
horizontal_alignment = 1
[node name="RechargesLeftLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=1254074923]
unique_name_in_owner = true
layout_mode = 2
text = "9 charges left"

View File

@@ -15,6 +15,9 @@ func _ready():
GameInfo.game_data.player_data.updated.connect(_on_player_updated)
GameInfo.game_data.current_region_data.pass_day_ended.connect(_on_region_pass_day_ended)
%ObjectiveProgressBar.visible = not "tutorial" in GameInfo.game_data.current_region_data.flags
%SimplePlantPointScore.visible = "tutorial" in GameInfo.game_data.current_region_data.flags
charge_update(GameInfo.game_data.current_region_data)
player_update(GameInfo.game_data.player_data, false)
@@ -22,7 +25,6 @@ func _ready():
%GiveUpButton.pressed.connect(_on_give_up_pressed)
score_mirror = GameInfo.game_data.current_region_data.get_score()
print(score_mirror)
for p : PlantData in GameInfo.game_data.current_region_data.plants:
score_by_plant[str(p.random_seed)] = p.get_score()
@@ -44,10 +46,8 @@ func _on_region_updated(region_data : RegionData):
if not str(p.random_seed) in score_by_plant:
score_by_plant[str(p.random_seed)] = 0
if score > score_by_plant[str(p.random_seed)]:
print("emit particles for %s" % p.plant_name)
plant_changing_score(p, score - score_by_plant[str(p.random_seed)])
elif score < score_by_plant[str(p.random_seed)]:
print("reduce score for %s" % p.plant_name)
score_mirror -= score_by_plant[str(p.random_seed)] - score
score_by_plant[str(p.random_seed)] = score
# Check for removed plants
@@ -55,7 +55,6 @@ func _on_region_updated(region_data : RegionData):
if region_data.plants.find_custom(
func (p): return str(p.random_seed) == key
) == -1:
print("remove plant")
score_mirror -= score_by_plant[key]
score_by_plant.erase(key)
@@ -93,6 +92,11 @@ func score_update(with_animation = true):
)
else:
%ObjectiveProgressBar.set_progress(objective_progression)
if score_mirror > 1:
%SimplePlantPointScoreLabel.text = tr("%d_PLANT_POINTS") % score_mirror
else :
%SimplePlantPointScoreLabel.text = tr("%d_PLANT_POINT") % score_mirror
func plant_changing_score(plant_data: PlantData, amount : int):
if GameInfo.game_data.current_region_data.in_passing_day_animation:
@@ -136,6 +140,7 @@ func spawn_score_particle(
await tween.finished
score_mirror += 1
AudioManager.play_sfx("PlantPoint")
sprite_particle.queue_free()

View File

@@ -3,6 +3,7 @@ class_name Tutorial
const STEP_SCENE = preload("res://gui/game/tutorial/step_gui/step_gui.tscn")
signal succeded
var indicators : Array[InGameIndicator]
@export var player : Player
@@ -48,13 +49,29 @@ var indicators : Array[InGameIndicator]
return region.data.get_score() != 0)
),
Step.new(
"HARVEST_MATURE_PLANTS_WITH_SHOVEL",
"DISCOVER_A_SEED_WITH_A_MUTATION",
(func ():
for e in region.entity_container.get_children():
if e is Plant and e.harvested:
if e is ItemObject and e.item is Seed and len(e.item.plant_mutations):
return true
return false)
)
),
Step.new(
"PLANT_A_SEED_WITH_A_MUTATION",
(func ():
for e in region.entity_container.get_children():
if e is Plant and len(e.data.mutations):
return true
return false)
),
Step.new(
"HARVEST_A_MATURE_PLANT_WITH_A_MUTATION",
(func ():
for e in region.entity_container.get_children():
if e is Plant and e.harvested and len(e.data.mutations):
return true
return false)
),
]
func _ready():
@@ -76,13 +93,23 @@ func setup_gui():
func _process(_d):
if region and region.data and "tutorial" in region.data.flags:
if region and region.data and "tutorial" in region.data.flags and not GameInfo.game_data.tutorial_done:
var success = true
for i in len(steps):
var step := steps[i]
var step_gui := %Steps.get_children()[i] as TutorialStepGui
step.update_succeeded()
step_gui.suceeded = step.succeeded
if not step.succeeded:
success = false
if success:
finish_tutorial()
func finish_tutorial():
GameInfo.game_data.tutorial_done = true
succeded.emit()
class Step:
var text : String : get = get_text

View File

@@ -2,6 +2,8 @@
[ext_resource type="Script" uid="uid://c2w7h0x2blimk" path="res://gui/game/tutorial/step_gui/scripts/step_gui.gd" id="1_8qp12"]
[ext_resource type="Texture2D" uid="uid://dk7j4cmn2avor" path="res://common/icons/circle-check.svg" id="2_8qp12"]
[ext_resource type="FontFile" uid="uid://cc4xli25271fd" path="res://addons/dialogic/Example Assets/Fonts/Roboto-Bold.ttf" id="3_kbfp3"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_i138t"]
[node name="Step" type="HBoxContainer" unique_id=595946430]
modulate = Color(1, 1, 1, 0.5)
@@ -30,11 +32,13 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 0
theme_override_fonts/normal_font = ExtResource("3_kbfp3")
theme_override_fonts/bold_font = ExtResource("4_i138t")
theme_override_font_sizes/normal_font_size = 15
theme_override_font_sizes/bold_font_size = 15
theme_override_font_sizes/bold_italics_font_size = 15
theme_override_font_sizes/italics_font_size = 15
theme_override_font_sizes/mono_font_size = 15
bbcode_enabled = true
text = "Lorem Ipsum dolor sit amet and again and again and again and again"
text = "Hello"
fit_content = true

View File

@@ -1,4 +1,4 @@
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://dqwayi8yjwau2"]
[gd_resource type="LabelSettings" format=3 uid="uid://dqwayi8yjwau2"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="1_lsdoq"]