2 Commits

Author SHA1 Message Date
fcf8bfaa45 Ajout de l'intégration twitch 2026-06-23 23:38:20 +02:00
4f93f7acaf Ajout de l'addon twitch 2026-06-23 23:28:12 +02:00
21 changed files with 36 additions and 234 deletions

View File

@@ -9,18 +9,18 @@ class_name DialogicNode_NameLabel
@export var use_character_color := true
func _ready() -> void:
add_to_group('dialogic_name_label')
if hide_when_empty:
name_label_root.visible = false
text = ""
add_to_group('dialogic_name_label')
if hide_when_empty:
name_label_root.visible = false
text = ""
func _set(property, what):
if property == 'text' and typeof(what) == TYPE_STRING:
text = what
if hide_when_empty:
name_label_root.visible = !what.is_empty()
else:
name_label_root.show()
return true
return false
if property == 'text' and typeof(what) == TYPE_STRING:
text = what
if hide_when_empty:
name_label_root.visible = !what.is_empty()
else:
name_label_root.show()
return true
return false

View File

@@ -1,9 +1,10 @@
extends Node
const SAVE_GAME_LOCATION = "user://stw_playtest_2_save.tres"
const SAVE_GAME_LOCATION = "user://stw_demo_save.tres"
const SAVE_SETTINGS_LOCATION = "user://stw_settings.tres"
signal game_loaded
var game_loaded = false
signal game_data_updated(g : GameData)
var game_data : GameData :
@@ -19,7 +20,6 @@ func load_game_data() -> GameData:
game_data = null
if ResourceLoader.exists(SAVE_GAME_LOCATION) and ResourceLoader.load(SAVE_GAME_LOCATION):
game_data = ResourceLoader.load(SAVE_GAME_LOCATION).duplicate_deep()
game_loaded.emit()
return game_data

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 MiB

After

Width:  |  Height:  |  Size: 8.4 MiB

View File

@@ -4,12 +4,12 @@
[ext_resource type="Script" uid="uid://c360ic1aost1n" path="res://entities/plants/scripts/texture_builder/plant_part_builder.gd" id="2_a5yje"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_attach_builder.gd" id="3_yh7e0"]
[sub_resource type="AtlasTexture" id="AtlasTexture_khbsd"]
[sub_resource type="AtlasTexture" id="AtlasTexture_yh7e0"]
atlas = ExtResource("1_yh7e0")
region = Rect2(1914, 1843, 213, 199)
[node name="Sprite" type="Sprite2D" unique_id=1642167049 node_paths=PackedStringArray("root", "attaches")]
texture = SubResource("AtlasTexture_khbsd")
texture = SubResource("AtlasTexture_yh7e0")
script = ExtResource("2_a5yje")
part_name = "LeafE9"
type = 2

View File

@@ -123,13 +123,8 @@ func calculate_plant_score(
return data.get_score(with_state)
func harvest():
var do_produce_seeds := true
for m in data.mutations:
do_produce_seeds = do_produce_seeds && m.produce_seeds()
if do_produce_seeds:
for i in range(data.get_seed_number()):
await produce_seed()
for i in range(data.get_seed_number()):
await produce_seed()
if data.get_state() == PlantData.State.MATURE:
for m in data.mutations:
@@ -156,15 +151,8 @@ func mature():
func die():
for m in data.mutations:
m._start_dead_effect(self)
var do_produce_seeds := true
for m in data.mutations:
do_produce_seeds = do_produce_seeds && m.produce_seeds_on_maturation()
if do_produce_seeds:
for i in range(data.get_seed_number()):
await produce_seed()
for i in range(data.get_seed_number()):
await produce_seed()
AudioManager.play_sfx("Harvest")
disappear()

View File

@@ -28,9 +28,6 @@ func get_mutation_name() -> String:
func mutate_plant_data(_plant_data: PlantData):
pass
func has_score(_plant_data: PlantData) -> bool:
return true
func mutate_score(_plant_data: PlantData, score: int) -> int:
return score
@@ -43,9 +40,6 @@ func mutate_lifetime(_plant_data: PlantData, lifetime: int) -> int:
func mutate_growing_time(_plant_data: PlantData, growing_time: int) -> int:
return growing_time
func produce_seeds() -> bool:
return true
func mutate_seed_number(_plant_data: PlantData, seed_number: int) -> int:
return seed_number

View File

@@ -1,25 +0,0 @@
extends PlantMutation
class_name CleaningMutation
func get_icon() -> Texture:
return preload("res://common/icons/alert-triangle.svg")
func get_mutation_id() -> String:
return "CLEANING"
func get_mutation_name() -> String:
return tr("CLEANING")
func get_mutation_description() -> String:
return tr("CLEANING_EFFECT_TEXT").format({
"purification_radius": get_purification_radius()
})
func _start_dead_effect(plant: Plant):
plant.region.decontaminate(Math.get_tiles_in_circle(
plant.global_position,
get_purification_radius() * (Region.TILE_SIZE + Region.TILE_SIZE / 2.)
))
func get_purification_radius() -> int:
return level + 1 # one more than purification

View File

@@ -1 +0,0 @@
uid://coh8clft5bs1j

View File

@@ -1,29 +0,0 @@
extends PlantMutation
class_name CuttingMutation
func get_icon() -> Texture:
return preload("res://common/icons/alert-triangle.svg")
func get_base_rarity() -> int:
return 1
func get_mutation_id() -> String:
return "CUTTING"
func get_mutation_name() -> String:
return tr("CUTTING")
func get_mutation_description() -> String:
return tr("CUTTING_EFFECT_TEXT").format({
"cutable_per_day": get_cutable_per_day()
})
func _start_day_effect(plant: Plant):
var cut_left := get_cutable_per_day()
for p in plant.data.nearby_plants:
if cut_left > 0 && p.is_mature():
p.harvest()
cut_left -= 1
func get_cutable_per_day() -> int:
return level

View File

@@ -1 +0,0 @@
uid://j2f1ogpead8d

View File

@@ -1,25 +0,0 @@
extends PlantMutation
class_name EnergizingMutation
func get_icon() -> Texture:
return preload("res://common/icons/alert-triangle.svg")
func get_base_rarity() -> int:
return 1
func get_mutation_id() -> String:
return "ENERGIZING"
func get_mutation_name() -> String:
return tr("ENERGIZING")
func get_mutation_description() -> String:
return tr("ENERGIZING_EFFECT_TEXT").format({
"bonus_energy": get_bonus_energy()
})
func _start_dead_effect(plant: Plant):
plant.region.player.data.energy += get_bonus_energy()
func get_bonus_energy() -> int:
return level

View File

@@ -1 +0,0 @@
uid://byj1hq1w42i7

View File

@@ -1,27 +0,0 @@
extends PlantMutation
class_name ErmitMutation
func get_icon() -> Texture:
return preload("res://common/icons/alert-triangle.svg")
func get_mutation_id() -> String:
return "ERMIT"
func get_mutation_name() -> String:
return tr("ERMIT")
func get_mutation_description() -> String:
return tr("ERMIT_EFFECT_TEXT").format(
{
"score_increase": get_score_increase(),
}
)
func has_score(plant_data: PlantData) -> bool:
return false if plant_data.nearby_plants.size() > 0 else true
func mutate_score(plant_data: PlantData, score: int) -> int:
return score + get_score_increase() if plant_data.nearby_plants.size() == 0 else 0
func get_score_increase():
return 2 * level

View File

@@ -1 +0,0 @@
uid://5pfa2y03wvlt

View File

@@ -1,31 +0,0 @@
extends PlantMutation
class_name SolarMutation
func get_icon() -> Texture:
return preload("res://common/icons/alert-triangle.svg")
func get_base_rarity() -> int:
return 1
func get_mutation_id() -> String:
return "SOLAR"
func get_mutation_name() -> String:
return tr("SOLAR")
func get_mutation_description() -> String:
return tr("SOLAR_EFFECT_TEXT").format({
"bonus_chance": get_bonus_chance(),
"bonus_energy": get_bonus_energy()
})
func _start_day_effect(plant: Plant):
var rng := RandomNumberGenerator.new()
if rng.randf() < get_bonus_chance():
plant.region.player.data.energy += get_bonus_energy()
func get_bonus_chance() -> float:
return 1 / (6 - min(level, 5))
func get_bonus_energy() -> int:
return 1

View File

@@ -1 +0,0 @@
uid://bhmlq1ke803rc

View File

@@ -1,32 +0,0 @@
extends PlantMutation
class_name SpontaneousMutation
func get_icon() -> Texture:
return preload("res://common/icons/droplet.svg")
func get_base_rarity() -> int:
return 1
func get_mutation_id() -> String:
return "SPONTANEOUS"
func get_mutation_name() -> String:
return tr("SPONTANEOUS")
func get_mutation_description() -> String:
return tr("SPONTANEOUS_EFFECT_TEXT").format({
"bonus_seed": get_bonus_seed()
})
func produce_seeds() -> bool:
return false
func mutate_seed_number(_plant_data: PlantData, seed_number: int) -> int:
return seed_number + get_bonus_seed()
func _start_maturation_effect(plant: Plant):
for i in range(plant.data.get_seed_number()):
await plant.produce_seed()
func get_bonus_seed() -> int:
return level - 1

View File

@@ -1 +0,0 @@
uid://cvrw2rf8p82rd

View File

@@ -16,7 +16,7 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true
config/name="Seeding The Wasteland"
config/description="Seeding planets is a survival, managment and cosy game in which you play a little gardener robot."
config/version="beta-2.0"
config/version="demo-2.0"
run/main_scene="uid://c5bruelvqbm1k"
config/features=PackedStringArray("4.7", "Forward Plus")
config/icon="uid://df0y0s666ui4h"
@@ -259,7 +259,7 @@ environment/defaults/default_clear_color=Color(0.0617213, 0.0605653, 0.169189, 1
[steam]
initialization/app_id=4452760
initialization/app_id=4690960
initialization/initialize_on_startup=true
initialization/embed_callbacks=true
multiplayer_peer/max_channels=4

View File

@@ -16,15 +16,15 @@ func _ready():
%Version.text = ProjectSettings.get_setting("application/config/version")
%Start.text = tr("CONTINUE") if GameInfo.game_data else tr("START")
%Restart.visible = GameInfo.game_data != null
if GameInfo.game_data:
%Planet3d.fertility_factor = (
max(0,float(GameInfo.game_data.progression_data.story_step_i - 1))
/ len(
GameInfo.game_data.progression_data.get_all_story_steps()
) - 1
)
%Settings.close_settings()
%Controls.close_controls()
if not GameInfo.game_data:
GameInfo.game_loaded.connect(
func ():
decontaminate_3D_planet(GameInfo.game_data)
)
else :
decontaminate_3D_planet(GameInfo.game_data)
func _on_start_pressed():
if GameInfo.game_data :
@@ -36,14 +36,6 @@ func _on_start_pressed():
GameInfo.start_game_data()
SceneManager.change_to_scene(IntroScene.new())
func decontaminate_3D_planet(game_data):
%Planet3d.fertility_factor = (
max(0,float(GameInfo.game_data.progression_data.story_step_i))
/ len(
GameInfo.game_data.progression_data.get_all_story_steps()
)
)
func _process(delta):
next_mouse_pos = get_viewport().get_mouse_position()
if Input.is_action_just_pressed("action"):

View File

@@ -3,8 +3,8 @@
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_4ph5l"]
[ext_resource type="Script" uid="uid://cwmp2une7hobe" path="res://stages/title_screen/scripts/title_screen.gd" id="1_6yuhi"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_6yuhi"]
[ext_resource type="Texture2D" uid="uid://cdpqg3pkjcw2h" path="res://stages/title_screen/assets/textures/title.png" id="3_lwj2x"]
[ext_resource type="Texture2D" uid="uid://cvvnrj8wi3f3r" path="res://common/icons/brand-twitch.svg" id="3_gn4uv"]
[ext_resource type="Texture2D" uid="uid://3813d8ld7vt2" path="res://stages/title_screen/assets/textures/Logo-demo.png" id="3_lwj2x"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_ofiho"]
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://common/icons/rotate.svg" id="5_6yuhi"]
[ext_resource type="PackedScene" uid="uid://cm5b7w7j6527f" path="res://stages/title_screen/planet_3d.tscn" id="5_7a1qq"]
@@ -107,7 +107,7 @@ shader = ExtResource("8_pjo5j")
shader_parameter/strength = 5.00000023424012
shader_parameter/mix_percentage = 0.3
[sub_resource type="FastNoiseLite" id="FastNoiseLite_rf16a"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_0e8rs"]
frequency = 1.0
[sub_resource type="Animation" id="Animation_gn4uv"]
@@ -406,6 +406,9 @@ size_flags_horizontal = 4
size_flags_vertical = 4
theme = ExtResource("1_4ph5l")
theme_override_font_sizes/font_size = 33
theme_override_styles/normal = SubResource("StyleBoxFlat_rf16a")
theme_override_styles/pressed = SubResource("StyleBoxFlat_gn4uv")
theme_override_styles/hover = SubResource("StyleBoxFlat_ofiho")
text = "START"
icon = ExtResource("3_6yuhi")
@@ -523,7 +526,7 @@ size = Vector2i(1980, 1080)
[node name="Planet3d" parent="SubViewport" unique_id=926789923 instance=ExtResource("5_7a1qq")]
unique_name_in_owner = true
noise = SubResource("FastNoiseLite_rf16a")
noise = SubResource("FastNoiseLite_0e8rs")
[node name="Camera3D" type="Camera3D" parent="SubViewport" unique_id=806252928]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.369979, 0, 64.323425)