diff --git a/common/assets/materials/cristal.tres b/common/assets/materials/cristal.tres
new file mode 100644
index 0000000..235dddb
--- /dev/null
+++ b/common/assets/materials/cristal.tres
@@ -0,0 +1,14 @@
+[gd_resource type="StandardMaterial3D" format=3 uid="uid://di0m3uqgi3l08"]
+
+[ext_resource type="Texture2D" uid="uid://dfd72vla6crn4" path="res://common/assets/textures/cristal.png" id="1_m4qy0"]
+
+[resource]
+diffuse_mode = 3
+specular_mode = 1
+disable_fog = true
+albedo_texture = ExtResource("1_m4qy0")
+metallic_specular = 1.0
+rim_tint = 0.48
+stencil_flags = 2
+stencil_reference = 5
+stencil_outline_thickness = 0.626
diff --git a/common/assets/textures/cristal.png b/common/assets/textures/cristal.png
new file mode 100644
index 0000000..5c12845
Binary files /dev/null and b/common/assets/textures/cristal.png differ
diff --git a/common/assets/textures/cristal.png.import b/common/assets/textures/cristal.png.import
new file mode 100644
index 0000000..a8809c8
--- /dev/null
+++ b/common/assets/textures/cristal.png.import
@@ -0,0 +1,41 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dfd72vla6crn4"
+path.s3tc="res://.godot/imported/cristal.png-542ce388785d47ebc69b0d8cd0728915.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://common/assets/textures/cristal.png"
+dest_files=["res://.godot/imported/cristal.png-542ce388785d47ebc69b0d8cd0728915.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=0
diff --git a/common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3 b/common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3
new file mode 100644
index 0000000..6439be8
Binary files /dev/null and b/common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3 differ
diff --git a/common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3.import b/common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3.import
new file mode 100644
index 0000000..d67b166
--- /dev/null
+++ b/common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3.import
@@ -0,0 +1,19 @@
+[remap]
+
+importer="mp3"
+type="AudioStreamMP3"
+uid="uid://dnqq2sy3dxrb2"
+path="res://.godot/imported/freesound_community-wine-glass-clink-36036.mp3-bc462b7f4a73f6e9bc3696ca5c63bc97.mp3str"
+
+[deps]
+
+source_file="res://common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3"
+dest_files=["res://.godot/imported/freesound_community-wine-glass-clink-36036.mp3-bc462b7f4a73f6e9bc3696ca5c63bc97.mp3str"]
+
+[params]
+
+loop=false
+loop_offset=0
+bpm=0
+beat_count=0
+bar_beats=4
diff --git a/common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3 b/common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3
new file mode 100644
index 0000000..178306e
Binary files /dev/null and b/common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3 differ
diff --git a/common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3.import b/common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3.import
new file mode 100644
index 0000000..f5b1886
--- /dev/null
+++ b/common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3.import
@@ -0,0 +1,19 @@
+[remap]
+
+importer="mp3"
+type="AudioStreamMP3"
+uid="uid://di6id2kyfy2e1"
+path="res://.godot/imported/sslc2022-earth-rumble-128880.mp3-cbdb82e7630ba8aed62692404d0e45e0.mp3str"
+
+[deps]
+
+source_file="res://common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3"
+dest_files=["res://.godot/imported/sslc2022-earth-rumble-128880.mp3-cbdb82e7630ba8aed62692404d0e45e0.mp3str"]
+
+[params]
+
+loop=false
+loop_offset=0
+bpm=0
+beat_count=0
+bar_beats=4
diff --git a/common/audio_manager/assets/sfx/signal/universfield-bubble-pop-07-487896.mp3 b/common/audio_manager/assets/sfx/signal/universfield-bubble-pop-07-487896.mp3
new file mode 100644
index 0000000..2b92796
Binary files /dev/null and b/common/audio_manager/assets/sfx/signal/universfield-bubble-pop-07-487896.mp3 differ
diff --git a/common/audio_manager/assets/sfx/signal/universfield-bubble-pop-07-487896.mp3.import b/common/audio_manager/assets/sfx/signal/universfield-bubble-pop-07-487896.mp3.import
new file mode 100644
index 0000000..a241f63
--- /dev/null
+++ b/common/audio_manager/assets/sfx/signal/universfield-bubble-pop-07-487896.mp3.import
@@ -0,0 +1,19 @@
+[remap]
+
+importer="mp3"
+type="AudioStreamMP3"
+uid="uid://rf7hachl3042"
+path="res://.godot/imported/universfield-bubble-pop-07-487896.mp3-9674fcc5b43af938e0c8845e16ca6bfd.mp3str"
+
+[deps]
+
+source_file="res://common/audio_manager/assets/sfx/signal/universfield-bubble-pop-07-487896.mp3"
+dest_files=["res://.godot/imported/universfield-bubble-pop-07-487896.mp3-9674fcc5b43af938e0c8845e16ca6bfd.mp3str"]
+
+[params]
+
+loop=false
+loop_offset=0
+bpm=0
+beat_count=0
+bar_beats=4
diff --git a/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend b/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend
index 7d8d0f1..eb41fd5 100644
Binary files a/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend and b/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend differ
diff --git a/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend.import b/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend.import
index 487b7da..5d4bf82 100644
--- a/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend.import
+++ b/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend.import
@@ -39,6 +39,11 @@ materials/extract_format=0
materials/extract_path=""
_subresources={
"materials": {
+"Cristal": {
+"use_external/enabled": true,
+"use_external/fallback_path": "res://common/assets/materials/cristal.tres",
+"use_external/path": "uid://di0m3uqgi3l08"
+},
"Material": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
diff --git a/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend1 b/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend1
index d7c2439..ab1ad9b 100644
Binary files a/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend1 and b/common/game_data/scripts/artefacts/talion_overloader/talion_overloader.blend1 differ
diff --git a/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend b/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend
index 01fe511..7f77912 100644
Binary files a/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend and b/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend differ
diff --git a/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend.import b/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend.import
index 019b175..66ad1ae 100644
--- a/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend.import
+++ b/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend.import
@@ -39,6 +39,11 @@ materials/extract_format=0
materials/extract_path=""
_subresources={
"materials": {
+"Cristal": {
+"use_external/enabled": true,
+"use_external/fallback_path": "res://common/assets/materials/cristal.tres",
+"use_external/path": "uid://di0m3uqgi3l08"
+},
"Material": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
diff --git a/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend1 b/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend1
index 130550a..eb4c060 100644
Binary files a/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend1 and b/common/game_data/scripts/artefacts/talion_relay/talion_relay.blend1 differ
diff --git a/common/game_data/scripts/progression_data.gd b/common/game_data/scripts/progression_data.gd
index 54536e9..46c6782 100644
--- a/common/game_data/scripts/progression_data.gd
+++ b/common/game_data/scripts/progression_data.gd
@@ -3,7 +3,7 @@ class_name ProgressionData
@export var planted_mutation_ids: Array[String] = []
@export var story_step_i := 0
-@export var mutations_unlocked = 5
+@export var mutations_unlocked = 8
var all_mutations: Array[PlantMutation] : get = get_all_mutations
var available_mutations: Array[PlantMutation] : get = get_available_mutations
@@ -28,16 +28,16 @@ func get_all_mutations() -> Array[PlantMutation]:
ProlificMutation.new(),
PrecociousMutation.new(),
PurificationMutation.new(),
+ VivaciousMutation.new(),
+ QuickMutation.new(),
+ RobustMutation.new(),
SocialMutation.new(),
FertileMutation.new(),
- QuickMutation.new(),
HurriedMutation.new(),
GenerousMutation.new(),
ProtectiveMutation.new(),
PureMutation.new(),
- RobustMutation.new(),
ToughMutation.new(),
- VivaciousMutation.new(),
]
func get_all_artifacts() -> Array[Artefact]:
diff --git a/common/game_data/scripts/run/run_data.gd b/common/game_data/scripts/run/run_data.gd
index b82b8ac..d5a80b2 100644
--- a/common/game_data/scripts/run/run_data.gd
+++ b/common/game_data/scripts/run/run_data.gd
@@ -70,17 +70,9 @@ func generate_next_run_point(last_modifiers : Array[String] = []) -> RunPoint:
] as Array[RegionModifier]
- var first_vending = story_step.get_first_vending_machine_occurence(next_level)
- var vending_occurence = story_step.get_vending_machine_occurence(next_level)
- if vending_occurence > 0 and level >= first_vending:
- if (level - first_vending)%vending_occurence == 0:
- region_parameter.modifiers.append(VendingMachineModifier.new())
-
- var first_cave = story_step.get_first_cave_occurence(next_level)
- var cave_occurence = story_step.get_cave_occurence(next_level)
- if cave_occurence > 0 and level >= first_cave:
- if (level - first_cave)%cave_occurence == 0:
- region_parameter.modifiers.append(CaveModifier.new())
+ region_parameter.modifiers.append_array(
+ story_step.get_gameplay_modifiers_for_region(next_level)
+ )
region_parameter.modifiers.append_array(
story_step.get_story_modifiers_for_region(next_level)
diff --git a/common/game_data/scripts/settings_data.gd b/common/game_data/scripts/settings_data.gd
index 93c607d..dd8763a 100644
--- a/common/game_data/scripts/settings_data.gd
+++ b/common/game_data/scripts/settings_data.gd
@@ -57,8 +57,8 @@ const AVAILABLE_LANGUAGES_LABEL = [
#region ------------------ Game ------------------
-const MAX_ZOOM = 1.8
-const MIN_ZOOM = 0.8
+const MAX_ZOOM = 2.
+const MIN_ZOOM = 0.5
# Not in settings pannel
@export var zoom : float = 1. :
diff --git a/common/game_data/scripts/story/astra_story_step.gd b/common/game_data/scripts/story/astra_story_step.gd
index 4efb589..854f65b 100644
--- a/common/game_data/scripts/story/astra_story_step.gd
+++ b/common/game_data/scripts/story/astra_story_step.gd
@@ -16,8 +16,20 @@ func get_destination_scene() -> Scene:
"001"
)
+func get_cave_occurence(_level : int) -> int:
+ return 2
+
func get_region_sequence_length() -> int:
- return 5
+ return 4
+
+func get_objective_for_region(level : int) -> int:
+ match level:
+ 1: return 6
+ 2: return 10
+ 3: return 16
+ 4: return 24
+ 5: return 34
+ _: return get_objective_for_region(level-1) + (level-2) * 5
func get_first_vending_machine_occurence(_level : int) -> int:
return 0
@@ -29,8 +41,8 @@ func get_challenge_chance(_level : int) -> float:
return 0.
func get_ship_dialog_path(level : int, ship_in_space := true) -> String:
- if ship_in_space and level == get_cave_occurence(level):
+ if ship_in_space and level == get_cave_occurence(level) - 1:
return CAVE_DIALOG_PATH
- if ship_in_space and level == get_region_sequence_length() - 1:
+ if ship_in_space and is_run_finished(level + 1):
return MERCURY_ARRIVAL_DIALOG_PATH
return ""
\ No newline at end of file
diff --git a/common/game_data/scripts/story/mercury_story_step.gd b/common/game_data/scripts/story/mercury_story_step.gd
index cb4f95c..0d242a7 100644
--- a/common/game_data/scripts/story/mercury_story_step.gd
+++ b/common/game_data/scripts/story/mercury_story_step.gd
@@ -22,11 +22,11 @@ func get_destination_scene() -> Scene:
)
func get_first_vending_machine_occurence(_level : int) -> int:
- return 0
+ return 1
func get_ship_dialog_path(level : int, ship_in_space := true) -> String:
if level == 0:
return MERCURY_DEPARTURE_DIALOG_PATH
- if ship_in_space and level == get_region_sequence_length() - 1:
+ if ship_in_space and is_run_finished(level + 1):
return VENUS_ARRIVAL_DIALOG_PATH
return ""
\ No newline at end of file
diff --git a/common/game_data/scripts/story/story_step.gd b/common/game_data/scripts/story/story_step.gd
index 9b1ecdb..6354391 100644
--- a/common/game_data/scripts/story/story_step.gd
+++ b/common/game_data/scripts/story/story_step.gd
@@ -19,7 +19,7 @@ func get_ship_dialog_path(_level : int, _ship_in_space := true) -> String:
#region ------------------ Run ------------------
func is_run_finished(level : int) -> bool:
- return level == get_region_sequence_length()
+ return level == get_region_sequence_length() - 1
func get_region_sequence_length() -> int:
return 6
@@ -28,7 +28,7 @@ func get_first_vending_machine_occurence(_level : int) -> int:
return 2
func get_vending_machine_occurence(_level : int) -> int:
- return 4
+ return 3
func get_first_cave_occurence(level : int) -> int:
return get_cave_occurence(level)
@@ -62,6 +62,25 @@ func get_story_modifiers_for_region(level : int) -> Array[RegionModifier]:
var dest_mod = DestinationModifier.new()
dest_mod.destination_scene = get_destination_scene()
modifiers.append(dest_mod)
+
+ var first_cave = get_first_cave_occurence(level)
+ var cave_occurence = get_cave_occurence(level)
+ if cave_occurence > 0 and level >= first_cave:
+ if (level - first_cave)%cave_occurence == 0:
+ modifiers.append(CaveModifier.new())
+
+ return modifiers
+
+func get_gameplay_modifiers_for_region(level : int) -> Array[RegionModifier]:
+ var modifiers : Array[RegionModifier] = []
+
+ if need_gameplay_modifier(level):
+ var first_vending = get_first_vending_machine_occurence(level)
+ var vending_occurence = get_vending_machine_occurence(level)
+ if vending_occurence > 0 and level >= first_vending:
+ if (level - first_vending)%vending_occurence == 0:
+ modifiers.append(VendingMachineModifier.new())
+
return modifiers
func need_gameplay_modifier(level : int):
diff --git a/common/icons/cristal.svg.import b/common/icons/cristal.svg.import
index 2811e9b..d190803 100644
--- a/common/icons/cristal.svg.import
+++ b/common/icons/cristal.svg.import
@@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cqdyykjx6hdrr"
-path="res://.godot/imported/cristal.svg-7e9a919e9dbc36092f14a8401b5f4888.ctex"
+path.s3tc="res://.godot/imported/cristal.svg-7e9a919e9dbc36092f14a8401b5f4888.s3tc.ctex"
metadata={
-"vram_texture": false
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
}
[deps]
source_file="res://common/icons/cristal.svg"
-dest_files=["res://.godot/imported/cristal.svg-7e9a919e9dbc36092f14a8401b5f4888.ctex"]
+dest_files=["res://.godot/imported/cristal.svg-7e9a919e9dbc36092f14a8401b5f4888.s3tc.ctex"]
[params]
-compress/mode=0
+compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
-mipmaps/generate=false
+mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,7 +38,7 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
-detect_3d/compress_to=1
+detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
diff --git a/common/icons/flag-2.svg b/common/icons/flag-2.svg
new file mode 100644
index 0000000..9186aca
--- /dev/null
+++ b/common/icons/flag-2.svg
@@ -0,0 +1,23 @@
+
+
diff --git a/common/icons/flag-2.svg.import b/common/icons/flag-2.svg.import
new file mode 100644
index 0000000..58f270f
--- /dev/null
+++ b/common/icons/flag-2.svg.import
@@ -0,0 +1,43 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://uckrw5fan88k"
+path="res://.godot/imported/flag-2.svg-b4658bfe95b153ec543e0e6f4d1176cb.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://common/icons/flag-2.svg"
+dest_files=["res://.godot/imported/flag-2.svg-b4658bfe95b153ec543e0e6f4d1176cb.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=2.0
+editor/scale_with_editor_scale=false
+editor/convert_colors_with_editor_theme=false
diff --git a/common/icons/hand-finger b/common/icons/hand-finger
new file mode 100644
index 0000000..20f78a1
--- /dev/null
+++ b/common/icons/hand-finger
@@ -0,0 +1,39 @@
+
+
diff --git a/common/icons/hand-finger.svg b/common/icons/hand-finger.svg
new file mode 100644
index 0000000..20f78a1
--- /dev/null
+++ b/common/icons/hand-finger.svg
@@ -0,0 +1,39 @@
+
+
diff --git a/common/icons/hand-finger.svg.import b/common/icons/hand-finger.svg.import
new file mode 100644
index 0000000..c73dd11
--- /dev/null
+++ b/common/icons/hand-finger.svg.import
@@ -0,0 +1,43 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://b3vg3tipd4boh"
+path="res://.godot/imported/hand-finger.svg-4b9fa57a07066292554e8fd7f7ad9dac.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://common/icons/hand-finger.svg"
+dest_files=["res://.godot/imported/hand-finger.svg-4b9fa57a07066292554e8fd7f7ad9dac.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=2.0
+editor/scale_with_editor_scale=false
+editor/convert_colors_with_editor_theme=false
diff --git a/common/tools/scripts/math.gd b/common/tools/scripts/math.gd
index 47d1ff7..44a96f0 100644
--- a/common/tools/scripts/math.gd
+++ b/common/tools/scripts/math.gd
@@ -12,16 +12,18 @@ static func get_tile_from_pos(coord) -> Vector2i:
floori(coord.y / (Region.TILE_SIZE)),
)
-static func get_tiles_in_circle(center: Vector2, radius : float) -> Array[Vector2i]:
+static func get_tiles_in_circle(center: Vector2,radius : float) -> Array[Vector2i]:
var tiles : Array[Vector2i] = []
+ var margin = ceili(radius * 0.5)
+
for x in range(
- floori((center.x - radius/2.) / Region.TILE_SIZE),
- ceili((center.x + radius/2.) / Region.TILE_SIZE),
+ floori((center.x - radius/2.) / Region.TILE_SIZE) - margin,
+ ceili((center.x + radius/2.) / Region.TILE_SIZE) + margin,
):
for y in range(
- floori((center.y - radius/2.) / Region.TILE_SIZE),
- ceili((center.y + radius/2.) / Region.TILE_SIZE),
+ floori((center.y - radius/2.) / Region.TILE_SIZE) - margin,
+ ceili((center.y + radius/2.) / Region.TILE_SIZE) + margin,
):
if is_tile_on_circle(Vector2i(x,y), center, radius):
tiles.append(Vector2i(x,y))
@@ -30,24 +32,29 @@ static func get_tiles_in_circle(center: Vector2, radius : float) -> Array[Vector
static func is_tile_on_circle(tile_coord : Vector2i, circle_center: Vector2, circle_radius : float) -> bool:
var absolute_tile_pos : Vector2 = tile_coord * Region.TILE_SIZE
- # Loop over tile corners to know if the area collide
- var corners : Array[Vector2] = []
- for x in [0,1]:
- for y in [0,1]:
- corners.append(
- absolute_tile_pos
- + Vector2.RIGHT * x * Region.TILE_SIZE
- + Vector2.DOWN * y * Region.TILE_SIZE
- )
-
- # Check if segment touch area
- for i in range(4):
- var a = corners[i%4]
- var b = corners[(i+1)%4]
- if segment_intersect_circle(a,b,circle_center,circle_radius):
- return true
+ var tile_center = absolute_tile_pos + Vector2.ONE * Region.TILE_SIZE / 2
+ var tile_radius = roundf(Region.TILE_SIZE/2.)
- return false
+ return pow(tile_center.x - circle_center.x, 2) + pow(tile_center.y - circle_center.y, 2) <= pow(tile_radius + circle_radius, 2)
+
+ # Loop over tile corners to know if the area collide
+ # var corners : Array[Vector2] = []
+ # for x in [0,1]:
+ # for y in [0,1]:
+ # corners.append(
+ # absolute_tile_pos
+ # + Vector2.RIGHT * x * Region.TILE_SIZE
+ # + Vector2.DOWN * y * Region.TILE_SIZE
+ # )
+
+ # # Check if segment touch area
+ # for i in range(4):
+ # var a = corners[i%4]
+ # var b = corners[(i+1)%4]
+ # if segment_intersect_circle(a,b,circle_center,circle_radius):
+ # return true
+
+ # return false
# Stolen here https://stackoverflow.com/questions/1073336/circle-line-segment-collision-detection-algorithm
diff --git a/common/tools/scripts/test_tiles.gd b/common/tools/scripts/test_tiles.gd
new file mode 100644
index 0000000..b28b04f
--- /dev/null
+++ b/common/tools/scripts/test_tiles.gd
@@ -0,0 +1,3 @@
+
+
+
diff --git a/common/tools/scripts/test_tiles.gd.uid b/common/tools/scripts/test_tiles.gd.uid
new file mode 100644
index 0000000..17bca07
--- /dev/null
+++ b/common/tools/scripts/test_tiles.gd.uid
@@ -0,0 +1 @@
+uid://bebwor5r5nnov
diff --git a/common/tools/test_tiles.tscn b/common/tools/test_tiles.tscn
new file mode 100644
index 0000000..7586060
--- /dev/null
+++ b/common/tools/test_tiles.tscn
@@ -0,0 +1,9 @@
+[gd_scene format=3 uid="uid://6or2rnjt5ixv"]
+
+[ext_resource type="Script" uid="uid://bebwor5r5nnov" path="res://common/tools/scripts/test_tiles.gd" id="1_44t07"]
+
+[node name="TestTiles" type="Node2D" unique_id=949540000]
+script = ExtResource("1_44t07")
+
+[node name="Grid" type="Node2D" parent="." unique_id=2109744474]
+unique_name_in_owner = true
diff --git a/common/vfx/materials/shaders/topology_map.gdshader b/common/vfx/materials/shaders/topology_map.gdshader
new file mode 100644
index 0000000..053a8f8
--- /dev/null
+++ b/common/vfx/materials/shaders/topology_map.gdshader
@@ -0,0 +1,40 @@
+shader_type canvas_item;
+
+uniform float line_number = 6;
+uniform vec4 line_color : source_color = vec4(1.);
+uniform float line_thickness : hint_range(0.0, 0.01) = 0.001;
+
+const mat3 sobel_x = mat3(
+ vec3( 1.0, 2.0, 1.0),
+ vec3( 0.0, 0.0, 0.0),
+ vec3(-1.0, -2.0, -1.0)
+);
+
+const mat3 sobel_y = mat3(
+ vec3(1.0, 0.0, -1.0),
+ vec3(2.0, 0.0, -2.0),
+ vec3(1.0, 0.0, -1.0)
+);
+
+float sample_quantized(sampler2D text, vec2 uv) {
+ return ceil(texture(text, uv).r * line_number) / line_number;
+}
+
+void fragment() {
+ float gx = 0.0;
+ float gy = 0.0;
+
+ for (int x = 0; x < 3; x++) {
+ for (int y = 0; y < 3; y++) {
+ vec2 offset = vec2(float(x) - 1.0, float(y) - 1.0) * line_thickness;
+ float s = sample_quantized(TEXTURE, UV + offset);
+ gx += s * sobel_x[x][y];
+ gy += s * sobel_y[x][y];
+ }
+ }
+
+ float edge = length(vec2(gx, gy));
+ float line = step(0.0001, edge);
+
+ COLOR = vec4(line_color.rgb, line * line_color.a * COLOR.r);
+}
\ No newline at end of file
diff --git a/common/vfx/materials/shaders/topology_map.gdshader.uid b/common/vfx/materials/shaders/topology_map.gdshader.uid
new file mode 100644
index 0000000..0de5c61
--- /dev/null
+++ b/common/vfx/materials/shaders/topology_map.gdshader.uid
@@ -0,0 +1 @@
+uid://bklafn6ulmkij
diff --git a/entities/camera/scripts/camera.gd b/entities/camera/scripts/camera.gd
index fc9e717..df10916 100644
--- a/entities/camera/scripts/camera.gd
+++ b/entities/camera/scripts/camera.gd
@@ -1,29 +1,52 @@
extends Camera2D
-class_name Camera
+class_name RegionCamera
const MOVE_LERP_WEIGHT = 0.9
const ZOOM_LERP_WEIGHT = 0.05
+const SHAKE_INTENSITY = 10.0
+const SHAKE_SPEED = 500.0
+
const ZOOM_STEP = 0.1
@export var following : Node2D
+@export var should_follow : bool = true
@onready var settings = GameInfo.settings_data
+@export var shake_active_time = -1
+var shake_noise := FastNoiseLite.new()
+
func _input(_e):
- if Input.is_action_just_pressed("zoom_in"):
- settings.zoom = settings.zoom + ZOOM_STEP
- GameInfo.save_settings()
- if Input.is_action_just_pressed("zoom_out"):
- settings.zoom = settings.zoom - ZOOM_STEP
- GameInfo.save_settings()
+ if Input.is_action_just_pressed("zoom_in"):
+ settings.zoom = settings.zoom + ZOOM_STEP
+ GameInfo.save_settings()
+ if Input.is_action_just_pressed("zoom_out"):
+ settings.zoom = settings.zoom - ZOOM_STEP
+ GameInfo.save_settings()
func _ready():
- if following:
- zoom = Vector2.ONE * settings.zoom
- global_position = following.global_position
+ if following and should_follow:
+ zoom = Vector2.ONE * settings.zoom
+ global_position = following.global_position
-func _process(_delta):
- if following:
- global_position = following.global_position.lerp(global_position, MOVE_LERP_WEIGHT)
-
- zoom = zoom.lerp(Vector2.ONE * settings.zoom, MOVE_LERP_WEIGHT)
+func _process(delta):
+ if following and should_follow:
+ global_position = following.global_position.lerp(global_position, MOVE_LERP_WEIGHT)
+
+ zoom = zoom.lerp(Vector2.ONE * settings.zoom, MOVE_LERP_WEIGHT)
+
+ if shake_active_time > 0.:
+ print(shake_noise.get_noise_2d(shake_active_time * SHAKE_SPEED, 0) * SHAKE_INTENSITY)
+ shake_active_time -= delta
+
+ offset = Vector2(
+ shake_noise.get_noise_2d(shake_active_time * SHAKE_SPEED, 0) * SHAKE_INTENSITY,
+ shake_noise.get_noise_2d(0, shake_active_time * SHAKE_SPEED) * SHAKE_INTENSITY,
+ )
+ else :
+ offset = lerp(offset, Vector2.ZERO, 10.5 * delta)
+
+func shake(time := 5):
+ shake_noise.seed = randi()
+
+ shake_active_time = time
diff --git a/entities/interactable_3d/cristal/assets/cristal.blend b/entities/interactable_3d/cristal/assets/cristal.blend
index 8a0adeb..28d1e2e 100644
Binary files a/entities/interactable_3d/cristal/assets/cristal.blend and b/entities/interactable_3d/cristal/assets/cristal.blend differ
diff --git a/entities/interactable_3d/cristal/assets/cristal.blend.import b/entities/interactable_3d/cristal/assets/cristal.blend.import
index 8d2f033..6be05fb 100644
--- a/entities/interactable_3d/cristal/assets/cristal.blend.import
+++ b/entities/interactable_3d/cristal/assets/cristal.blend.import
@@ -39,10 +39,10 @@ materials/extract_format=0
materials/extract_path=""
_subresources={
"materials": {
-"Default3D": {
+"Cristal": {
"use_external/enabled": true,
-"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
-"use_external/path": "uid://dvvi1k5c5iowc"
+"use_external/fallback_path": "res://common/assets/materials/cristal.tres",
+"use_external/path": "uid://di0m3uqgi3l08"
}
}
}
diff --git a/entities/interactable_3d/cristal/assets/cristal.blend1 b/entities/interactable_3d/cristal/assets/cristal.blend1
new file mode 100644
index 0000000..32d0855
Binary files /dev/null and b/entities/interactable_3d/cristal/assets/cristal.blend1 differ
diff --git a/entities/interactable_3d/cristal/assets/cristal_crack_3.blend b/entities/interactable_3d/cristal/assets/cristal_crack.blend
similarity index 51%
rename from entities/interactable_3d/cristal/assets/cristal_crack_3.blend
rename to entities/interactable_3d/cristal/assets/cristal_crack.blend
index 15d217d..85c32ee 100644
Binary files a/entities/interactable_3d/cristal/assets/cristal_crack_3.blend and b/entities/interactable_3d/cristal/assets/cristal_crack.blend differ
diff --git a/entities/interactable_3d/cristal/assets/cristal_crack_3.blend.import b/entities/interactable_3d/cristal/assets/cristal_crack.blend.import
similarity index 82%
rename from entities/interactable_3d/cristal/assets/cristal_crack_3.blend.import
rename to entities/interactable_3d/cristal/assets/cristal_crack.blend.import
index d8a51c8..9838c78 100644
--- a/entities/interactable_3d/cristal/assets/cristal_crack_3.blend.import
+++ b/entities/interactable_3d/cristal/assets/cristal_crack.blend.import
@@ -4,12 +4,12 @@ importer="scene"
importer_version=1
type="PackedScene"
uid="uid://c7p114rvk26xw"
-path="res://.godot/imported/cristal_crack_3.blend-513c4ee47a074edd5c96e86c23a0716a.scn"
+path="res://.godot/imported/cristal_crack.blend-127c21c2b9bb4a6237729dd3a817aaf1.scn"
[deps]
-source_file="res://entities/interactable_3d/cristal/assets/cristal_crack_3.blend"
-dest_files=["res://.godot/imported/cristal_crack_3.blend-513c4ee47a074edd5c96e86c23a0716a.scn"]
+source_file="res://entities/interactable_3d/cristal/assets/cristal_crack.blend"
+dest_files=["res://.godot/imported/cristal_crack.blend-127c21c2b9bb4a6237729dd3a817aaf1.scn"]
[params]
@@ -39,10 +39,10 @@ materials/extract_format=0
materials/extract_path=""
_subresources={
"materials": {
-"Default3D": {
+"Cristal": {
"use_external/enabled": true,
-"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
-"use_external/path": "uid://dvvi1k5c5iowc"
+"use_external/fallback_path": "res://common/assets/materials/cristal.tres",
+"use_external/path": "uid://di0m3uqgi3l08"
}
}
}
diff --git a/entities/interactable_3d/cristal/assets/cristal_crack_1.blend b/entities/interactable_3d/cristal/assets/cristal_crack_1.blend
deleted file mode 100644
index 30d99b9..0000000
Binary files a/entities/interactable_3d/cristal/assets/cristal_crack_1.blend and /dev/null differ
diff --git a/entities/interactable_3d/cristal/assets/cristal_crack_2.blend b/entities/interactable_3d/cristal/assets/cristal_crack_2.blend
deleted file mode 100644
index f8d0ef2..0000000
Binary files a/entities/interactable_3d/cristal/assets/cristal_crack_2.blend and /dev/null differ
diff --git a/entities/interactable_3d/cristal/assets/cristal_crack_2.blend.import b/entities/interactable_3d/cristal/assets/cristal_crack_2.blend.import
deleted file mode 100644
index fe47c86..0000000
--- a/entities/interactable_3d/cristal/assets/cristal_crack_2.blend.import
+++ /dev/null
@@ -1,68 +0,0 @@
-[remap]
-
-importer="scene"
-importer_version=1
-type="PackedScene"
-uid="uid://b8cqw348lx15s"
-path="res://.godot/imported/cristal_crack_2.blend-e5cf949346bc85a9c664c66dde3ab25a.scn"
-
-[deps]
-
-source_file="res://entities/interactable_3d/cristal/assets/cristal_crack_2.blend"
-dest_files=["res://.godot/imported/cristal_crack_2.blend-e5cf949346bc85a9c664c66dde3ab25a.scn"]
-
-[params]
-
-nodes/root_type=""
-nodes/root_name=""
-nodes/root_script=null
-nodes/apply_root_scale=true
-nodes/root_scale=1.0
-nodes/import_as_skeleton_bones=false
-nodes/use_name_suffixes=true
-nodes/use_node_type_suffixes=true
-meshes/ensure_tangents=true
-meshes/generate_lods=true
-meshes/create_shadow_meshes=true
-meshes/light_baking=1
-meshes/lightmap_texel_size=0.2
-meshes/force_disable_compression=false
-skins/use_named_skins=true
-animation/import=true
-animation/fps=30
-animation/trimming=false
-animation/remove_immutable_tracks=true
-animation/import_rest_as_RESET=false
-import_script/path=""
-materials/extract=0
-materials/extract_format=0
-materials/extract_path=""
-_subresources={
-"materials": {
-"Default3D": {
-"use_external/enabled": true,
-"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
-"use_external/path": "uid://dvvi1k5c5iowc"
-}
-}
-}
-blender/nodes/visible=0
-blender/nodes/active_collection_only=false
-blender/nodes/punctual_lights=true
-blender/nodes/cameras=true
-blender/nodes/custom_properties=true
-blender/nodes/modifiers=1
-blender/meshes/colors=false
-blender/meshes/uvs=true
-blender/meshes/normals=true
-blender/meshes/export_geometry_nodes_instances=false
-blender/meshes/gpu_instances=false
-blender/meshes/tangents=true
-blender/meshes/skins=2
-blender/meshes/export_bones_deforming_mesh_only=false
-blender/materials/unpack_enabled=true
-blender/materials/export_materials=1
-blender/animation/limit_playback=true
-blender/animation/always_sample=true
-blender/animation/group_tracks=true
-gltf/naming_version=2
diff --git a/entities/interactable_3d/cristal/assets/cristal_crack_3.blend1 b/entities/interactable_3d/cristal/assets/cristal_crack_3.blend1
index 25aa5d2..e24f8b8 100644
Binary files a/entities/interactable_3d/cristal/assets/cristal_crack_3.blend1 and b/entities/interactable_3d/cristal/assets/cristal_crack_3.blend1 differ
diff --git a/entities/interactable_3d/cristal/cristal.tscn b/entities/interactable_3d/cristal/cristal.tscn
index 006d233..9f73374 100644
--- a/entities/interactable_3d/cristal/cristal.tscn
+++ b/entities/interactable_3d/cristal/cristal.tscn
@@ -3,9 +3,8 @@
[ext_resource type="Script" uid="uid://dwn3g8c5sa0a2" path="res://entities/interactable_3d/cristal/scripts/cristal.gd" id="1_ci2hw"]
[ext_resource type="AudioStream" uid="uid://3c4nxjasebyk" path="res://common/audio_manager/assets/sfx/pickaxe/pickaxe_1_reverb.wav" id="2_3rrt0"]
[ext_resource type="PackedScene" uid="uid://mwk845fx5ye2" path="res://entities/interactable_3d/cristal/assets/cristal.blend" id="2_ci2hw"]
-[ext_resource type="PackedScene" uid="uid://c7p114rvk26xw" path="res://entities/interactable_3d/cristal/assets/cristal_crack_3.blend" id="2_vejte"]
+[ext_resource type="PackedScene" uid="uid://c7p114rvk26xw" path="res://entities/interactable_3d/cristal/assets/cristal_crack.blend" id="2_vejte"]
[ext_resource type="AudioStream" uid="uid://bs5ldhabymm5p" path="res://common/audio_manager/assets/sfx/pickaxe/pickaxe_2_reverb.wav" id="3_247i2"]
-[ext_resource type="PackedScene" uid="uid://d0sdfjneo8rjj" path="res://entities/interactable_3d/cristal/assets/cristal_crack_1.blend" id="3_nvfy2"]
[ext_resource type="AudioStream" uid="uid://bu278eqn8krnb" path="res://common/audio_manager/assets/sfx/pickaxe/pickaxe_3_reverb.wav" id="4_k7wsc"]
[ext_resource type="PackedScene" uid="uid://brp1fpvasaims" path="res://entities/interactable_3d/cristal/mutation_announce.tscn" id="9_247i2"]
@@ -63,14 +62,10 @@ scale_amount_min = 0.5
color = Color(1, 0.6509804, 0.09019608, 1)
color_ramp = SubResource("Gradient_ci2hw")
-[node name="CristalModel" parent="." unique_id=1362490576 instance=ExtResource("2_ci2hw")]
+[node name="CristalModel" parent="." unique_id=886555966 instance=ExtResource("2_ci2hw")]
unique_name_in_owner = true
-[node name="CristalModelCrack1" parent="." unique_id=2936580 instance=ExtResource("3_nvfy2")]
-unique_name_in_owner = true
-visible = false
-
-[node name="CristalModelCrack2" parent="." unique_id=1202531828 instance=ExtResource("2_vejte")]
+[node name="CristalModelCrack" parent="." unique_id=26298259 instance=ExtResource("2_vejte")]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0051152706, 0.006559938, -0.011411905)
visible = false
@@ -82,4 +77,4 @@ shape = SubResource("BoxShape3D_nvfy2")
[node name="MutationAnnounce" parent="." unique_id=1447182082 instance=ExtResource("9_247i2")]
unique_name_in_owner = true
-[editable path="CristalModelCrack2"]
+[editable path="CristalModelCrack"]
diff --git a/entities/interactable_3d/cristal/scripts/cristal.gd b/entities/interactable_3d/cristal/scripts/cristal.gd
index 3c7deec..55a2671 100644
--- a/entities/interactable_3d/cristal/scripts/cristal.gd
+++ b/entities/interactable_3d/cristal/scripts/cristal.gd
@@ -27,11 +27,10 @@ func click():
func update_model():
if is_node_ready():
%CristalModel.visible = break_level == 0
- %CristalModelCrack1.visible = break_level == 1
- %CristalModelCrack2.visible = break_level > 1
+ %CristalModelCrack.visible = break_level > 0
if break_level > 1:
- %CristalModelCrack2.find_children("AnimationPlayer")[0].play("Break")
+ %CristalModelCrack.find_children("AnimationPlayer")[0].play("Break")
func unlock_mutation():
var progression = GameInfo.game_data.progression_data
diff --git a/entities/interactables/truck/recharge/scripts/truck_recharge.gd b/entities/interactables/truck/recharge/scripts/truck_recharge.gd
index aaeb1f2..4480d35 100644
--- a/entities/interactables/truck/recharge/scripts/truck_recharge.gd
+++ b/entities/interactables/truck/recharge/scripts/truck_recharge.gd
@@ -14,6 +14,7 @@ func can_interact(_p : Player) -> bool:
region != null
and region.data
and region.data.charges > 0
+ and region.data.state == RegionData.State.IN_PROGRESS
)
func interact(_p: Player) -> bool:
diff --git a/entities/interactables/truck/recharge/truck_recharge.tscn b/entities/interactables/truck/recharge/truck_recharge.tscn
index 9167dba..d726b3e 100644
--- a/entities/interactables/truck/recharge/truck_recharge.tscn
+++ b/entities/interactables/truck/recharge/truck_recharge.tscn
@@ -7,14 +7,18 @@
[ext_resource type="Texture2D" uid="uid://bhi3mwl23flwp" path="res://entities/interactables/truck/recharge/STW_Props_Batterie_Glass_V2.png" id="5_2okh4"]
[ext_resource type="Texture2D" uid="uid://c01f6ja6btsep" path="res://entities/interactables/truck/recharge/STW_Props_Batterie_TERRE.png" id="6_2okh4"]
-[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
-radius = 38.45475
-height = 76.9095
-
[sub_resource type="LabelSettings" id="LabelSettings_1vpbi"]
font = ExtResource("4_ot7vv")
font_size = 30
+[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ot7vv"]
+radius = 43.0
+height = 116.0
+
+[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
+radius = 38.45475
+height = 76.9095
+
[node name="TruckRecharge" type="Area2D" unique_id=1099196706]
script = ExtResource("1_ipgcv")
default_interact_text = "RECHARGE"
@@ -22,10 +26,6 @@ default_info_title = "RECHARGE_STATION"
default_info_desc = "RECHARGE_STATION_DESC_TEXT"
metadata/_custom_type_script = "uid://dyprcd68fjstf"
-[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2014886648]
-position = Vector2(9, -53)
-shape = SubResource("CapsuleShape2D_bjhct")
-
[node name="RechargeStation" type="Sprite2D" parent="." unique_id=1801951226]
scale = Vector2(0.5, 0.5)
texture = ExtResource("2_ot7vv")
@@ -67,6 +67,10 @@ scale = Vector2(0.5, 0.5)
texture = ExtResource("6_2okh4")
offset = Vector2(0, -120)
+[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2014886648]
+position = Vector2(12, -54)
+shape = SubResource("CapsuleShape2D_ot7vv")
+
[node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=1324035615]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=842130596]
diff --git a/entities/interactables/win_cristal/assets/sprites/asset_cristals.png b/entities/interactables/win_cristal/assets/sprites/asset_cristals.png
new file mode 100644
index 0000000..c431251
Binary files /dev/null and b/entities/interactables/win_cristal/assets/sprites/asset_cristals.png differ
diff --git a/entities/interactables/win_cristal/assets/sprites/asset_cristals.png.import b/entities/interactables/win_cristal/assets/sprites/asset_cristals.png.import
new file mode 100644
index 0000000..c949b97
--- /dev/null
+++ b/entities/interactables/win_cristal/assets/sprites/asset_cristals.png.import
@@ -0,0 +1,40 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dslagvhodlepi"
+path="res://.godot/imported/asset_cristals.png-fbcde6581d88986094aa97c2145c31c2.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://entities/interactables/win_cristal/assets/sprites/asset_cristals.png"
+dest_files=["res://.godot/imported/asset_cristals.png-fbcde6581d88986094aa97c2145c31c2.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/entities/interactables/win_cristal/scripts/win_cristal.gd b/entities/interactables/win_cristal/scripts/win_cristal.gd
new file mode 100644
index 0000000..db42711
--- /dev/null
+++ b/entities/interactables/win_cristal/scripts/win_cristal.gd
@@ -0,0 +1,31 @@
+@tool
+extends InspectableEntity
+class_name WinCristal
+
+@export_tool_button("Update", "Callable") var update_action = update
+@export_tool_button("Spawn Anim", "Callable") var spawn_action = spawn_animation
+@export var data : WinCristalData = WinCristalData.random() :
+ set(v):
+ data = v
+ update()
+
+func _ready():
+ update()
+
+func update():
+ if is_node_ready() and data:
+ for i in range(len(%Sprites.get_children())):
+ %Sprites.get_children()[i].visible = data.cristal_type == i
+ %Sprites.get_children()[i].flip_h = data.cristal_flip
+
+func spawn_animation():
+ scale = Vector2.ZERO
+ %CristalPlayer.play()
+ get_tree().create_tween().tween_property(self, "scale", Vector2.ONE, 0.3).set_trans(Tween.TRANS_BOUNCE)
+
+func get_card_up_padding() -> float:
+ return Pointer.CARD_UP_PADDING * 2
+
+func save() -> EntityData:
+ data.position = global_position
+ return data
\ No newline at end of file
diff --git a/entities/interactables/win_cristal/scripts/win_cristal.gd.uid b/entities/interactables/win_cristal/scripts/win_cristal.gd.uid
new file mode 100644
index 0000000..c4e1353
--- /dev/null
+++ b/entities/interactables/win_cristal/scripts/win_cristal.gd.uid
@@ -0,0 +1 @@
+uid://cismap3cn5e36
diff --git a/entities/interactables/win_cristal/scripts/win_cristal_data.gd b/entities/interactables/win_cristal/scripts/win_cristal_data.gd
new file mode 100644
index 0000000..37a0c83
--- /dev/null
+++ b/entities/interactables/win_cristal/scripts/win_cristal_data.gd
@@ -0,0 +1,22 @@
+extends EntityData
+class_name WinCristalData
+
+const WIN_CRISTAL_SCENE = preload("res://entities/interactables/win_cristal/win_cristal.tscn")
+
+@export var cristal_type : int
+@export var cristal_flip : bool
+
+func load_entity() -> Entity:
+ var win_cristal := WIN_CRISTAL_SCENE.instantiate() as WinCristal
+
+ win_cristal.data = self
+
+ return win_cristal
+
+static func random() -> WinCristalData:
+ var data = WinCristalData.new()
+
+ data.cristal_type = randi_range(0,3)
+ data.cristal_flip = randi() % 2 == 0
+
+ return data
\ No newline at end of file
diff --git a/entities/interactables/win_cristal/scripts/win_cristal_data.gd.uid b/entities/interactables/win_cristal/scripts/win_cristal_data.gd.uid
new file mode 100644
index 0000000..55b094a
--- /dev/null
+++ b/entities/interactables/win_cristal/scripts/win_cristal_data.gd.uid
@@ -0,0 +1 @@
+uid://cos0ennmyfvc2
diff --git a/entities/interactables/win_cristal/win_cristal.tscn b/entities/interactables/win_cristal/win_cristal.tscn
new file mode 100644
index 0000000..eacf25a
--- /dev/null
+++ b/entities/interactables/win_cristal/win_cristal.tscn
@@ -0,0 +1,82 @@
+[gd_scene format=3 uid="uid://de5pt5vyu23fb"]
+
+[ext_resource type="Script" uid="uid://cismap3cn5e36" path="res://entities/interactables/win_cristal/scripts/win_cristal.gd" id="1_yb2ta"]
+[ext_resource type="Script" uid="uid://cos0ennmyfvc2" path="res://entities/interactables/win_cristal/scripts/win_cristal_data.gd" id="2_vkbio"]
+[ext_resource type="Texture2D" uid="uid://dslagvhodlepi" path="res://entities/interactables/win_cristal/assets/sprites/asset_cristals.png" id="2_yb2ta"]
+[ext_resource type="AudioStream" uid="uid://dnqq2sy3dxrb2" path="res://common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3" id="3_vkbio"]
+
+[sub_resource type="Resource" id="Resource_5lni1"]
+script = ExtResource("2_vkbio")
+cristal_type = 2
+cristal_flip = true
+
+[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_vkbio"]
+radius = 40.0
+height = 116.0
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_5lni1"]
+atlas = ExtResource("2_yb2ta")
+region = Rect2(52, 55, 305, 347)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_bcx38"]
+atlas = ExtResource("2_yb2ta")
+region = Rect2(378, 21, 199, 385)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_t34j2"]
+atlas = ExtResource("2_yb2ta")
+region = Rect2(75, 527, 316, 399)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_55qjo"]
+atlas = ExtResource("2_yb2ta")
+region = Rect2(462, 542, 286, 387)
+
+[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_tfnwb"]
+random_pitch = 1.4142135
+streams_count = 1
+stream_0/stream = ExtResource("3_vkbio")
+
+[node name="WinCristal" type="Area2D" unique_id=247353676]
+script = ExtResource("1_yb2ta")
+data = SubResource("Resource_5lni1")
+default_info_title = "TALION_CRISTAL"
+default_info_desc = "TALION_CRISTAL_DESC_TEXT"
+metadata/_custom_type_script = "uid://d3bk52402ylvl"
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=187731103]
+position = Vector2(1, -42)
+shape = SubResource("CapsuleShape2D_vkbio")
+
+[node name="Sprites" type="Node2D" parent="." unique_id=940993390]
+unique_name_in_owner = true
+
+[node name="AssetCristals" type="Sprite2D" parent="Sprites" unique_id=2111863528]
+scale = Vector2(0.4, 0.4)
+texture = SubResource("AtlasTexture_5lni1")
+offset = Vector2(0, -139.255)
+flip_h = true
+
+[node name="AssetCristals2" type="Sprite2D" parent="Sprites" unique_id=1380362341]
+visible = false
+scale = Vector2(0.3, 0.3)
+texture = SubResource("AtlasTexture_bcx38")
+offset = Vector2(0, -149)
+flip_h = true
+
+[node name="AssetCristals3" type="Sprite2D" parent="Sprites" unique_id=2082980627]
+visible = false
+scale = Vector2(0.3, 0.3)
+texture = SubResource("AtlasTexture_t34j2")
+offset = Vector2(0, -150)
+flip_h = true
+
+[node name="AssetCristals4" type="Sprite2D" parent="Sprites" unique_id=495215885]
+visible = false
+scale = Vector2(0.3, 0.3)
+texture = SubResource("AtlasTexture_55qjo")
+offset = Vector2(0, -150)
+flip_h = true
+
+[node name="CristalPlayer" type="AudioStreamPlayer2D" parent="." unique_id=1879646229]
+unique_name_in_owner = true
+stream = SubResource("AudioStreamRandomizer_tfnwb")
+bus = &"Sfx"
diff --git a/entities/plants/plant_sprite.tscn b/entities/plants/plant_sprite.tscn
index ef515f5..55a3450 100644
--- a/entities/plants/plant_sprite.tscn
+++ b/entities/plants/plant_sprite.tscn
@@ -13,6 +13,7 @@ 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
@@ -185,8 +186,7 @@ texture = ExtResource("3_rbgiq")
[node name="LifeTimeSprite" type="Sprite2D" parent="." unique_id=799762981]
unique_name_in_owner = true
-position = Vector2(-1, -9.999985)
-scale = Vector2(0.34, 0.34)
+scale = Vector2(0.26000002, 0.26000005)
texture = SubResource("ViewportTexture_rbgiq")
[node name="SubViewport" type="SubViewport" parent="LifeTimeSprite" unique_id=1809354262]
diff --git a/entities/plants/scripts/plant.gd b/entities/plants/scripts/plant.gd
index dea4794..da79e44 100644
--- a/entities/plants/scripts/plant.gd
+++ b/entities/plants/scripts/plant.gd
@@ -1,7 +1,9 @@
extends InspectableEntity
class_name Plant
-const PLANT_AREA_RADIUS = 20
+const PLANT_AREA_RADIUS = 40
+const PLANT_GROWING_AREA_HEIGHT = 70
+const PLANT_MATURE_AREA_HEIGHT = 150
const HARVESTED_SEED_DISPLACEMENT_FACTOR = 100
const RANDOM_MAX_GROW_INTERVAL = Region.MIN_PASS_DAY_ANIMATION_TIME/2. - 0.1
@@ -22,6 +24,7 @@ const SPRITE_SCENE : PackedScene = preload("res://entities/plants/plant_sprite.t
@onready var influence_zone : PlantInfluenceZone
var harvested = false
+var last_state : PlantData.State
func _init(
_data : PlantData
@@ -30,7 +33,7 @@ func _init(
func _ready():
plant_sprite = generate_sprite()
- collision_shape = generate_collision_shape()
+ generate_collision_shape()
influence_zone = generate_influence_zone()
plant_sprite.setup_plant_sprite(data)
@@ -53,9 +56,6 @@ func inspect(is_inspected : bool = true):
plant_sprite.display_lifetime_sprite = is_inspected
influence_zone.show_influence = is_inspected
-func affect_preview(is_affected : bool = true):
- plant_sprite.sprite_modulate = MODULATE_AFFECTED_COLOR if is_affected else default_modulate
-
func generate_sprite() -> PlantSprite:
var sprite_object : PlantSprite = SPRITE_SCENE.instantiate()
@@ -64,15 +64,28 @@ func generate_sprite() -> PlantSprite:
return sprite_object
-func generate_collision_shape() -> CollisionShape2D:
- var collision = CollisionShape2D.new()
- var shape = CircleShape2D.new()
+func generate_collision_shape():
+ if collision_shape:
+ collision_shape.queue_free()
+
+ collision_shape = CollisionShape2D.new()
+ var shape = CapsuleShape2D.new()
shape.radius = PLANT_AREA_RADIUS
- collision.shape = shape
- add_child(collision)
+ var height = PLANT_AREA_RADIUS
- return collision
+ match data.get_state():
+ PlantData.State.GROWING:
+ height = PLANT_GROWING_AREA_HEIGHT
+ PlantData.State.MATURE:
+ height = PLANT_MATURE_AREA_HEIGHT
+
+ shape.height = height
+
+ collision_shape.shape = shape
+
+ collision_shape.position.y -= height / 5.
+ add_child(collision_shape)
func generate_influence_zone() -> PlantInfluenceZone:
var zone = PlantInfluenceZone.new(data.get_influence_radius())
@@ -85,13 +98,14 @@ func generate_influence_zone() -> PlantInfluenceZone:
func _pass_day():
await get_tree().create_timer(randf_range(0., RANDOM_MAX_GROW_INTERVAL)).timeout
- var last_state = data.get_state()
+ last_state = data.get_state()
data.day += 1
for m in data.mutations:
m._start_day_effect(self)
+func _end_pass_day():
match data.get_state():
PlantData.State.MATURE:
if last_state != PlantData.State.MATURE:
@@ -99,7 +113,7 @@ func _pass_day():
PlantData.State.DEAD:
die()
-
+ generate_collision_shape()
plant_sprite.update_plant_sprite(data, last_state != data.get_state())
@@ -110,7 +124,7 @@ func calculate_plant_score(
func harvest():
for i in range(data.get_seed_number()):
- produce_seed()
+ await produce_seed()
if data.get_state() == PlantData.State.MATURE:
for m in data.mutations:
@@ -128,6 +142,7 @@ func produce_seed():
global_position,
HARVESTED_SEED_DISPLACEMENT_FACTOR,
)
+ await plant_sprite.play_bump_animation()
func mature():
for m in data.mutations:
@@ -137,7 +152,8 @@ func die():
for m in data.mutations:
m._start_dead_effect(self)
for i in range(data.get_seed_number()):
- produce_seed()
+ await produce_seed()
+ AudioManager.play_sfx("Harvest")
disappear()
func disappear():
diff --git a/entities/plants/scripts/plant_data.gd b/entities/plants/scripts/plant_data.gd
index 621bc74..0e5c9c1 100644
--- a/entities/plants/scripts/plant_data.gd
+++ b/entities/plants/scripts/plant_data.gd
@@ -96,7 +96,7 @@ func is_mature() -> bool:
return get_state() == State.MATURE
func get_seed_number(state = get_state()):
- var seed_number = get_plant_info().get_seed_number() if (state == State.MATURE or state == State.DEAD) else 0
+ var seed_number = get_plant_info().get_seed_number() if (state == State.MATURE or state == State.DEAD) else 1
for m in mutations:
seed_number = m.mutate_seed_number(self , seed_number)
diff --git a/entities/plants/scripts/plant_mutation.gd b/entities/plants/scripts/plant_mutation.gd
index 9137ad9..6d7eadc 100644
--- a/entities/plants/scripts/plant_mutation.gd
+++ b/entities/plants/scripts/plant_mutation.gd
@@ -124,4 +124,4 @@ static func get_rarity_color(rarity: int) -> Color:
Color("FFA617"),
]
- return rarity_colors[min(rarity, len(rarity_colors) - 1)%len(rarity_colors)]
\ No newline at end of file
+ return rarity_colors[rarity%len(rarity_colors)]
\ No newline at end of file
diff --git a/entities/plants/scripts/plant_mutation/purification_mutation.gd b/entities/plants/scripts/plant_mutation/purification_mutation.gd
index 49de17d..7845359 100644
--- a/entities/plants/scripts/plant_mutation/purification_mutation.gd
+++ b/entities/plants/scripts/plant_mutation/purification_mutation.gd
@@ -23,4 +23,4 @@ func _start_maturation_effect(plant : Plant):
func get_purification_radius() -> int:
- return level * 2
+ return level
diff --git a/entities/plants/scripts/plant_sprite.gd b/entities/plants/scripts/plant_sprite.gd
index 0cb5f02..83e8bb1 100644
--- a/entities/plants/scripts/plant_sprite.gd
+++ b/entities/plants/scripts/plant_sprite.gd
@@ -1,4 +1,4 @@
-extends Node2D
+extends Area2D
class_name PlantSprite
const PLANTED_SEED_CROP_WIDTH = 50
@@ -64,6 +64,13 @@ func set_sprite_modulate(c := sprite_modulate):
if is_node_ready():
%Sprite.modulate = c
+func affect_preview(is_affected : bool = true):
+ sprite_modulate = InspectableEntity.MODULATE_AFFECTED_COLOR if is_affected else Color.WHITE
+
func _on_body_entered(body: Node2D) -> void:
if body is Player && $AnimationPlayer.current_animation != "player_move":
$AnimationPlayer.play("player_move");
+
+func play_bump_animation():
+ %AnimationPlayer.play("bump")
+ await %AnimationPlayer.animation_finished
\ No newline at end of file
diff --git a/entities/player/inventory/scripts/inventory.gd b/entities/player/inventory/scripts/inventory.gd
index 67a0848..796d082 100644
--- a/entities/player/inventory/scripts/inventory.gd
+++ b/entities/player/inventory/scripts/inventory.gd
@@ -17,7 +17,7 @@ func _init(size : int = 1):
seeds_size = size
func current_is_tool() -> bool:
- return current_item_ind <= len(tools)
+ return current_item_ind < len(tools)
func set_current_item(new_ind: int):
if new_ind < 0:
diff --git a/entities/player/inventory/scripts/item.gd b/entities/player/inventory/scripts/item.gd
index 6f8e5e3..7b44170 100644
--- a/entities/player/inventory/scripts/item.gd
+++ b/entities/player/inventory/scripts/item.gd
@@ -44,7 +44,7 @@ func is_action_need_press_time() -> bool:
func get_action_press_time() -> float:
return DEFAULT_PRESS_TIME
-func get_usage_object_affected(_i : InspectableEntity) -> bool:
+func get_usage_object_affected(_i : Area2D) -> bool:
return false
func is_one_time_use():
diff --git a/entities/player/inventory/scripts/items/fork.gd b/entities/player/inventory/scripts/items/fork.gd
index f092ecf..00c074f 100644
--- a/entities/player/inventory/scripts/items/fork.gd
+++ b/entities/player/inventory/scripts/items/fork.gd
@@ -21,7 +21,7 @@ func get_energy_used() -> int:
func get_usage_zone_radius() -> int:
return 10
-func get_usage_object_affected(i : InspectableEntity) -> bool:
+func get_usage_object_affected(i : Area2D) -> bool:
return i is Plant
func use_text() -> String:
diff --git a/entities/player/inventory/scripts/items/seed.gd b/entities/player/inventory/scripts/items/seed.gd
index a0888a8..aef54dd 100644
--- a/entities/player/inventory/scripts/items/seed.gd
+++ b/entities/player/inventory/scripts/items/seed.gd
@@ -63,10 +63,10 @@ func get_energy_used() -> int:
return 1
func get_usage_zone_radius() -> int:
- return 35
+ return 50
-func get_usage_object_affected(i : InspectableEntity) -> bool:
- return i is Plant
+func get_usage_object_affected(i : Area2D) -> bool:
+ return i is PlantSprite
func use_text() -> String:
return tr("PLANT_%s") % plant_name
@@ -82,10 +82,19 @@ func can_use(player : Player, zone : Player.ActionZone) -> bool:
var is_there_a_plant_here = false
for area in zone.get_affected_areas():
- if area is Plant:
+ if area is PlantSprite:
is_there_a_plant_here = true
- return not is_there_a_plant_here and player.region.is_coords_decontaminated(zone.get_tiles())
+ var plant_tiles = Math.get_tiles_in_circle(
+ zone.get_global_position(),
+ 20
+ )
+
+ return (
+ not is_there_a_plant_here
+ and player.region.is_coords_decontaminated(plant_tiles)
+ and not player.region.is_coords_rocky(plant_tiles)
+ )
func use(player : Player, zone : Player.ActionZone) -> bool:
if player.region == null:
diff --git a/entities/player/inventory/scripts/items/shovel.gd b/entities/player/inventory/scripts/items/shovel.gd
index 4417400..7e5a209 100644
--- a/entities/player/inventory/scripts/items/shovel.gd
+++ b/entities/player/inventory/scripts/items/shovel.gd
@@ -17,7 +17,7 @@ func get_icon() -> Texture2D:
func get_usage_zone_radius() -> int:
return SHOVEL_ZONE_RADIUS
-func get_usage_object_affected(i : InspectableEntity) -> bool:
+func get_usage_object_affected(i : Area2D) -> bool:
return i is Plant
func use_text() -> String:
diff --git a/entities/player/player.tscn b/entities/player/player.tscn
index 1b7fe36..22e3e5e 100644
--- a/entities/player/player.tscn
+++ b/entities/player/player.tscn
@@ -9,11 +9,23 @@
[ext_resource type="AudioStream" uid="uid://cv5avkd3qekt7" path="res://common/audio_manager/assets/sfx/movement/movement.wav" id="7_qiwj3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_sglur"]
-radius = 27.0
+radius = 13.0
[sub_resource type="CircleShape2D" id="CircleShape2D_abrql"]
radius = 40.0
+[sub_resource type="Gradient" id="Gradient_qiwj3"]
+offsets = PackedFloat32Array(0.37339056, 0.49785408)
+colors = PackedColorArray(0.043137256, 0.050980393, 0.15686275, 0, 0.043137256, 0.050980393, 0.15686275, 1)
+
+[sub_resource type="GradientTexture2D" id="GradientTexture2D_26q78"]
+gradient = SubResource("Gradient_qiwj3")
+width = 600
+height = 600
+fill = 1
+fill_from = Vector2(0.5, 0.5)
+fill_to = Vector2(0.5, 0)
+
[sub_resource type="AtlasTexture" id="AtlasTexture_fkugw"]
atlas = ExtResource("4_bls4j")
region = Rect2(3048, 0, 762, 1080)
@@ -113,6 +125,9 @@ animations = [{
"speed": 5.0
}]
+[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_bectd"]
+blend_mode = 1
+
[sub_resource type="Curve" id="Curve_fkugw"]
_data = [Vector2(0, 0.14473677), 0.0, 0.0, 0, 0, Vector2(0.972549, 0.2654798), 0.0, 0.0, 0, 0]
point_count = 2
@@ -253,6 +268,12 @@ position = Vector2(-2.3841858e-07, -7.999996)
scale = Vector2(0.29154927, 0.29154924)
texture = ExtResource("2_fkugw")
+[node name="Fog" type="Sprite2D" parent="." unique_id=1590893330]
+z_index = 10
+position = Vector2(0.99999994, -17)
+scale = Vector2(8, 8)
+texture = SubResource("GradientTexture2D_26q78")
+
[node name="PlayerSprite" type="AnimatedSprite2D" parent="." unique_id=638545037]
unique_name_in_owner = true
position = Vector2(0.99999994, -17)
@@ -267,6 +288,7 @@ wanted_orientation = 2
[node name="Light" type="Sprite2D" parent="PlayerSprite" unique_id=1768327734]
modulate = Color(0.70603025, 0.5959886, 0.33971557, 0.09019608)
z_index = -1
+material = SubResource("CanvasItemMaterial_bectd")
scale = Vector2(16.093441, 16.093441)
texture = ExtResource("5_8fjmc")
@@ -290,3 +312,15 @@ bus = &"Sfx"
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=793749564]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_qiwj3")
+
+[node name="NavigationAgent2D" type="NavigationAgent2D" parent="." unique_id=1282043308]
+unique_name_in_owner = true
+simplify_path = true
+simplify_epsilon = 4.223
+path_search_max_polygons = 1000
+avoidance_enabled = true
+radius = 500.0
+debug_use_custom = true
+debug_path_custom_color = Color(0.5882353, 0.7019608, 0.85882354, 0.3019608)
+debug_path_custom_point_size = 0.0
+debug_path_custom_line_width = 1.0
diff --git a/entities/player/scripts/player.gd b/entities/player/scripts/player.gd
index 3aff6a7..90b0818 100644
--- a/entities/player/scripts/player.gd
+++ b/entities/player/scripts/player.gd
@@ -5,6 +5,7 @@ const ACTION_AREA_UPDATE_TIME=0.05 # When creating an action_zone, we make sure
const MAX_REACH = 100
const HOLDING_ITEM_SPRITE_SIZE = 20.
const TURN_ANIMATION_MINIMUM_THRESHOLD = 0.2
+const SPEED = 350
signal player_updated(player: Player)
signal upgraded
@@ -12,7 +13,6 @@ signal upgraded
var terrain : Terrain
var region : Region :
get(): return terrain if terrain is Region else null
-@export var speed = 350
var data : PlayerData
var last_action_area_movement_timer : float = 100.
@@ -22,7 +22,13 @@ var controlling_player : bool = false :
controlling_player = v
velocity = Vector2.ZERO
-var instruction : Instruction = null
+var instruction : Instruction = null :
+ set(i):
+ if instruction and is_node_ready():
+ instruction.abort(self)
+ instruction = i
+ if instruction and is_node_ready():
+ instruction.spawn_indicator(self)
@onready var preview_zone : ActionZone = await setup_action_zone(Vector2.ZERO, null)
@onready var action_zone : ActionZone = await setup_action_zone(Vector2.ZERO, null)
@@ -81,7 +87,7 @@ func _process(delta):
instruction = null
input_direction = calculate_direction_instruction_direction()
- velocity = input_direction * speed
+ velocity = input_direction * SPEED
turn_animate(input_direction)
move_preview_zone(get_global_mouse_position())
@@ -106,8 +112,11 @@ func calculate_direction_instruction_direction() -> Vector2:
instruction.position.distance_to(global_position) > (MAX_REACH - 1.)
or instruction is MoveInstruction
)
- ):
- return self.global_position.direction_to(instruction.position)
+ ):
+ if %NavigationAgent2D.target_position != instruction.position:
+ %NavigationAgent2D.target_position = instruction.position
+ return to_local(%NavigationAgent2D.get_next_path_position()).normalized()
+ # return self.global_position.direction_to(instruction.position)
return Vector2.ZERO
func calculate_direction_input_direction() -> Vector2:
@@ -147,8 +156,8 @@ func try_interact(interactable : Interactable):
func try_move(move_to : Vector2):
instruction = MoveInstruction.new(move_to)
-func can_pick_item(item: Item):
- return item.type == Item.ItemType.TOOL_ITEM || !data.inventory.is_full() || !data.inventory.current_is_tool()
+func can_pick_item(_item: Item):
+ return true
func pick_item(item : Item):
if item.type != Item.ItemType.TOOL_ITEM && data.inventory.is_full():
@@ -163,13 +172,23 @@ func pick_item(item : Item):
func drop_item():
var ind_to_drop := data.inventory.current_item_ind
- while (
- (data.inventory.get_item(ind_to_drop) == null or ind_to_drop < len(data.inventory.tools))
- and ind_to_drop < len(data.inventory.get_all_items()) - 1
+
+ if (
+ data.inventory.get_item(ind_to_drop) == null or ind_to_drop < len(data.inventory.tools)
):
- ind_to_drop += 1
- var item_to_drop = data.inventory.pop_item(ind_to_drop)
- if item_to_drop:
+ var possible_ind : Array = range(
+ len(data.inventory.tools),
+ len(data.inventory.tools) + data.inventory.seeds_size
+ ).filter(
+ func (i): return data.inventory.get_item(i) != null
+ )
+ if len(possible_ind):
+ ind_to_drop = possible_ind.pop_back()
+ else:
+ return
+
+ var item_to_drop : Item = data.inventory.pop_item(ind_to_drop)
+ if item_to_drop and item_to_drop.type != Item.ItemType.TOOL_ITEM:
terrain.drop_item(item_to_drop, global_position)
AudioManager.play_sfx("Drop")
region.save()
@@ -239,11 +258,10 @@ func setup_preview_zone(item : Item):
return preview_zone
elif preview_zone:
preview_zone.destroy()
+ preview_zone = null
if item:
preview_zone = await generate_action_zone(item)
- else:
- preview_zone = null
func setup_action_zone(zone_position : Vector2, item: Item) -> ActionZone:
if action_zone:
@@ -259,8 +277,11 @@ func move_preview_zone(zone_position : Vector2):
class Instruction:
+ const INDICATOR_COLOR := Color("#96B3DB")
+
var position : Vector2
var need_movement : bool = true
+ var indicator := Sprite2D.new()
func _init(_pos : Vector2):
position = _pos
@@ -270,8 +291,46 @@ class Instruction:
func do(_player : Player):
pass
+
+ func indicator_texture():
+ return preload("res://common/icons/map-pin.svg")
+
+ func indicator_size():
+ return 40
+
+ func indicator_shift():
+ return Vector2.ZERO
+
+ func spawn_indicator(player : Player):
+ indicator.texture = indicator_texture()
+
+ indicator.texture = indicator_texture()
+ indicator.scale = Vector2(
+ 1./(float(indicator_texture().get_width())/indicator_size()),
+ 1./(float(indicator_texture().get_height())/indicator_size())
+ )
+
+ indicator.modulate = Color(
+ INDICATOR_COLOR.r,
+ INDICATOR_COLOR.g,
+ INDICATOR_COLOR.b,
+ 0.
+ )
+
+ player.get_parent().add_child(indicator)
+
+ indicator.global_position = position + indicator_shift()
+
+ player.get_tree().create_tween().tween_property(indicator, "modulate:a", 0.8, 0.2)
+
+ func abort(player : Player):
+ indicator.queue_free()
class MoveInstruction extends Instruction:
+
+ func indicator_shift():
+ return Vector2.UP * 50
+
func can_be_done(player : Player):
return player.global_position.distance_to(position) < 10.
@@ -289,7 +348,10 @@ class ItemActionInstruction extends Instruction:
not item.is_usage_need_proximity() or
player.global_position.distance_to(position) < player.MAX_REACH
)
-
+
+ func indicator_texture():
+ return item.icon
+
func do(player : Player):
player.use_item(item)
@@ -303,13 +365,16 @@ class InteractableInstruction extends Instruction:
func can_be_done(player : Player):
return player.global_position.distance_to(position) < player.MAX_REACH
+ func indicator_texture():
+ return preload("res://common/icons/hand-grab.svg")
+
func do(player : Player):
interactable.interact(player)
class ActionZone:
var item : Item = null
var area : Area2D = Area2D.new()
- var affected_areas : Array[InspectableEntity]= []
+ var affected_areas : Array[Area2D]= []
func _init(_i : Item):
item = _i
@@ -330,9 +395,9 @@ class ActionZone:
func update_preview_on_affected_area():
var detected_areas = get_affected_areas()
clear_preview_on_affected_area()
- var new_affected_areas : Array[InspectableEntity] = []
+ var new_affected_areas : Array[Area2D] = []
for a in detected_areas:
- if a is InspectableEntity and item.get_usage_object_affected(a):
+ if a is Area2D and item.get_usage_object_affected(a) and a.has_method("affect_preview"):
a.affect_preview(true)
new_affected_areas.append(a)
affected_areas = new_affected_areas
diff --git a/entities/player_3d/scripts/player_3d.gd b/entities/player_3d/scripts/player_3d.gd
index ef25f51..ab8cfdf 100644
--- a/entities/player_3d/scripts/player_3d.gd
+++ b/entities/player_3d/scripts/player_3d.gd
@@ -2,7 +2,7 @@ extends CharacterBody3D
class_name Player3D
const POINTER_TEXTURE = preload("res://common/icons/focus.svg")
-const POINTER_ACTION_TEXTURE = preload("res://common/icons/hand-stop.svg")
+const POINTER_ACTION_TEXTURE = preload("res://common/icons/hand-finger.svg")
@export var pointer_texture_rect : TextureRect
diff --git a/entities/scripts/entity_data.gd b/entities/scripts/entity_data.gd
index 53f0205..7c7f7a2 100644
--- a/entities/scripts/entity_data.gd
+++ b/entities/scripts/entity_data.gd
@@ -4,9 +4,6 @@ class_name EntityData
@export var position : Vector2
-func _init(e : Entity):
- position = e.global_position
-
func get_position() -> Vector2:
return position
diff --git a/entities/scripts/inspectable_entity.gd b/entities/scripts/inspectable_entity.gd
index 30bd63d..212cadd 100644
--- a/entities/scripts/inspectable_entity.gd
+++ b/entities/scripts/inspectable_entity.gd
@@ -1,8 +1,8 @@
extends Entity
class_name InspectableEntity
-const MODULATE_INSPECTED_COLOR = Color.GRAY
-const MODULATE_AFFECTED_COLOR = Color.RED
+const MODULATE_INSPECTED_COLOR = Color("#96B3DB")
+const MODULATE_AFFECTED_COLOR = Color("#FF006E")
const DESC_ICON = preload("res://common/icons/align-right.svg")
@export var default_info_title = ""
@@ -11,6 +11,8 @@ const DESC_ICON = preload("res://common/icons/align-right.svg")
@onready var default_modulate : Color = modulate
@onready var inspectable_signals_setuped : bool = setup_inspectable_signals()
+var mouse_over := false
+
func inspect(is_inspected : bool = true):
modulate = MODULATE_INSPECTED_COLOR if is_inspected else default_modulate
@@ -23,9 +25,11 @@ func setup_inspectable_signals() -> bool:
return true
func _on_mouse_entered():
+ mouse_over = true
Pointer.inspect(self)
func _on_mouse_excited():
+ mouse_over = false
Pointer.stop_inspect(self)
func pointer_text() -> String:
@@ -54,3 +58,7 @@ func _notification(what):
func get_card_up_padding() -> float:
return Pointer.CARD_UP_PADDING
+
+
+func _process(_delta):
+ modulate.a = 0.3 if mouse_over and Pointer.inspected != self else 1.
\ No newline at end of file
diff --git a/gui/game/announce/announce.tscn b/gui/game/announce/announce.tscn
index 9305ca2..4c7ce5b 100644
--- a/gui/game/announce/announce.tscn
+++ b/gui/game/announce/announce.tscn
@@ -7,6 +7,7 @@
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_aao0q"]
[ext_resource type="Environment" uid="uid://bxyp24f85p0xf" path="res://gui/game/assets/gui_3d_environment.tres" id="4_yjj5u"]
[ext_resource type="Script" uid="uid://bqisp5hjs06rj" path="res://gui/game/announce/scripts/announce_inspectable.gd" id="6_aao0q"]
+[ext_resource type="Texture2D" uid="uid://df0y0s666ui4h" path="res://icon.png" id="7_aao0q"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="9_b6hac"]
[sub_resource type="ViewportTexture" id="ViewportTexture_huxc5"]
@@ -27,7 +28,7 @@ font_size = 50
font_color = Color(1, 0.6509804, 0.09019608, 1)
[sub_resource type="ViewportTexture" id="ViewportTexture_aao0q"]
-viewport_path = NodePath("AnnounceContainer/ObjectVisualiser/SubViewport")
+viewport_path = NodePath("AnnounceContainer/HBoxContainer/ObjectVisualiser/SubViewport")
[sub_resource type="Animation" id="Animation_aao0q"]
length = 0.001
@@ -178,6 +179,7 @@ layout_mode = 2
color = Color(0.0352941, 0.0196078, 0.12549, 0.705882)
[node name="Particles" type="TextureRect" parent="." unique_id=691167186]
+z_index = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
@@ -232,33 +234,76 @@ text = "Pelle"
label_settings = SubResource("LabelSettings_6qyp1")
horizontal_alignment = 1
-[node name="ObjectVisualiser" type="TextureRect" parent="AnnounceContainer" unique_id=1529068201]
+[node name="HBoxContainer" type="GridContainer" parent="AnnounceContainer" unique_id=802355154]
+layout_mode = 2
+size_flags_horizontal = 4
+theme_override_constants/h_separation = 87
+columns = 3
+
+[node name="Control" type="VBoxContainer" parent="AnnounceContainer/HBoxContainer" unique_id=316081338]
+custom_minimum_size = Vector2(300, 0)
+layout_mode = 2
+alignment = 1
+
+[node name="AnnounceDesc" type="RichTextLabel" parent="AnnounceContainer/HBoxContainer/Control" unique_id=1675704602]
unique_name_in_owner = true
layout_mode = 2
+theme_override_fonts/normal_font = ExtResource("4_aao0q")
+theme_override_fonts/bold_font = ExtResource("4_aao0q")
+theme_override_fonts/bold_italics_font = ExtResource("4_aao0q")
+theme_override_fonts/italics_font = ExtResource("4_aao0q")
+theme_override_fonts/mono_font = ExtResource("4_aao0q")
+theme_override_font_sizes/normal_font_size = 20
+theme_override_font_sizes/bold_font_size = 20
+theme_override_font_sizes/bold_italics_font_size = 20
+theme_override_font_sizes/italics_font_size = 20
+theme_override_font_sizes/mono_font_size = 20
+bbcode_enabled = true
+text = "This tool is used to blablablabla"
+fit_content = true
+autowrap_mode = 2
+horizontal_alignment = 1
+
+[node name="ObjectVisualiser" type="TextureRect" parent="AnnounceContainer/HBoxContainer" unique_id=1529068201]
+unique_name_in_owner = true
+z_index = 2
+layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 0
texture = SubResource("ViewportTexture_aao0q")
stretch_mode = 5
script = ExtResource("6_aao0q")
-[node name="SubViewport" type="SubViewport" parent="AnnounceContainer/ObjectVisualiser" unique_id=403959884]
+[node name="SubViewport" type="SubViewport" parent="AnnounceContainer/HBoxContainer/ObjectVisualiser" unique_id=403959884]
own_world_3d = true
transparent_bg = true
size = Vector2i(300, 300)
-[node name="AnnouceObject" type="Node3D" parent="AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=986671004]
+[node name="AnnouceObject" type="Node3D" parent="AnnounceContainer/HBoxContainer/ObjectVisualiser/SubViewport" unique_id=986671004]
unique_name_in_owner = true
-transform = Transform3D(0.5251642, 0.51167643, -0.6798119, -0.8508927, 0.32199714, -0.4149924, 0.0065870024, 0.7963845, 0.6045711, 0, 0, 0)
+transform = Transform3D(-0.054461285, 0.73170173, 0.6795513, -0.8508927, 0.32199714, -0.4149924, -0.52245957, -0.6008157, 0.60510355, 0, 0, 0)
-[node name="Camera3D" type="Camera3D" parent="AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=1788331074]
+[node name="Camera3D" type="Camera3D" parent="AnnounceContainer/HBoxContainer/ObjectVisualiser/SubViewport" unique_id=1788331074]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1)
keep_aspect = 0
current = true
fov = 20.0
-[node name="WorldEnvironment" type="WorldEnvironment" parent="AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=296795988]
+[node name="WorldEnvironment" type="WorldEnvironment" parent="AnnounceContainer/HBoxContainer/ObjectVisualiser/SubViewport" unique_id=296795988]
environment = ExtResource("4_yjj5u")
+[node name="Control3" type="VBoxContainer" parent="AnnounceContainer/HBoxContainer" unique_id=1699222883]
+custom_minimum_size = Vector2(300, 0)
+layout_mode = 2
+alignment = 1
+
+[node name="AnnounceImage" type="TextureRect" parent="AnnounceContainer/HBoxContainer/Control3" unique_id=291872035]
+unique_name_in_owner = true
+layout_mode = 2
+texture = ExtResource("7_aao0q")
+expand_mode = 4
+stretch_mode = 5
+
[node name="OkButton" type="Button" parent="AnnounceContainer" unique_id=56162930]
unique_name_in_owner = true
layout_mode = 2
diff --git a/gui/game/announce/screenshots/detector.png b/gui/game/announce/screenshots/detector.png
new file mode 100644
index 0000000..178ec17
Binary files /dev/null and b/gui/game/announce/screenshots/detector.png differ
diff --git a/gui/game/announce/screenshots/detector.png.import b/gui/game/announce/screenshots/detector.png.import
new file mode 100644
index 0000000..d7b6a25
--- /dev/null
+++ b/gui/game/announce/screenshots/detector.png.import
@@ -0,0 +1,40 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://ctthl6arolwgv"
+path="res://.godot/imported/detector.png-5b74af2127c132dd4b571fa880e19088.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://gui/game/announce/screenshots/detector.png"
+dest_files=["res://.godot/imported/detector.png-5b74af2127c132dd4b571fa880e19088.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/gui/game/announce/screenshots/fork.png b/gui/game/announce/screenshots/fork.png
new file mode 100644
index 0000000..1b62ae8
Binary files /dev/null and b/gui/game/announce/screenshots/fork.png differ
diff --git a/gui/game/announce/screenshots/fork.png.import b/gui/game/announce/screenshots/fork.png.import
new file mode 100644
index 0000000..656a60f
--- /dev/null
+++ b/gui/game/announce/screenshots/fork.png.import
@@ -0,0 +1,40 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dprd77l2y7c3u"
+path="res://.godot/imported/fork.png-d60826a524b93f90b3c53fad53cb4507.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://gui/game/announce/screenshots/fork.png"
+dest_files=["res://.godot/imported/fork.png-d60826a524b93f90b3c53fad53cb4507.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/gui/game/announce/screenshots/pickaxe.png b/gui/game/announce/screenshots/pickaxe.png
new file mode 100644
index 0000000..c67d165
Binary files /dev/null and b/gui/game/announce/screenshots/pickaxe.png differ
diff --git a/gui/game/announce/screenshots/pickaxe.png.import b/gui/game/announce/screenshots/pickaxe.png.import
new file mode 100644
index 0000000..4aeefe0
--- /dev/null
+++ b/gui/game/announce/screenshots/pickaxe.png.import
@@ -0,0 +1,40 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://idqv6f2w46h4"
+path="res://.godot/imported/pickaxe.png-581e6e1ec785ec3f6ccdd57812a72d40.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://gui/game/announce/screenshots/pickaxe.png"
+dest_files=["res://.godot/imported/pickaxe.png-581e6e1ec785ec3f6ccdd57812a72d40.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/gui/game/announce/scripts/annouce_object.gd b/gui/game/announce/scripts/annouce_object.gd
index 69549e2..1f9e96d 100644
--- a/gui/game/announce/scripts/annouce_object.gd
+++ b/gui/game/announce/scripts/annouce_object.gd
@@ -2,12 +2,21 @@
extends Resource
class_name AnnouceObject
+var desc := ""
+var image : Texture = null
+
@abstract func get_3d_object() -> Node3D
@abstract func get_title() -> String
@abstract func get_text() -> String
+func get_desc() -> String:
+ return desc
+
+func get_image() -> Texture:
+ return image
+
@abstract func get_card_info() -> CardInfo
@abstract func _on_dismiss()
\ No newline at end of file
diff --git a/gui/game/announce/scripts/annouce_tool.gd b/gui/game/announce/scripts/annouce_tool.gd
index 5383f94..917f7a7 100644
--- a/gui/game/announce/scripts/annouce_tool.gd
+++ b/gui/game/announce/scripts/annouce_tool.gd
@@ -6,8 +6,14 @@ const ITEM_3D_SCENE = preload("res://gui/game/inventory_gui/inventory_item/inven
@export var tool_item : Item
-func _init(_tool_item : Item):
+func _init(
+ _tool_item : Item,
+ _image : Texture = null,
+ _desc := _tool_item.get_description(),
+):
tool_item = _tool_item
+ desc = _desc
+ image = _image
func get_3d_object() -> Node3D:
var new_object = ITEM_3D_SCENE.instantiate() as InventoryItem3D
diff --git a/gui/game/announce/scripts/announce.gd b/gui/game/announce/scripts/announce.gd
index 2d2da47..05a3417 100644
--- a/gui/game/announce/scripts/announce.gd
+++ b/gui/game/announce/scripts/announce.gd
@@ -21,75 +21,86 @@ const YELLOW_COLOR = Color("e29f32")
const RED_COLOR = Color("f20058")
func _ready():
- set_announce_object()
- %OkButton.button_down.connect(_on_ok_button_down)
- hide()
-
+ 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)
- )
+ 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, get_screenshots_for_item(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)
+ if announce_object == null and not visible and len(announce_objects) > 0:
+ announce_object = announce_objects.pop_front()
+ update_rotation(delta)
+
+func get_screenshots_for_item(i : Item) -> Texture:
+ if i is Pickaxe:
+ return preload("res://gui/game/announce/screenshots/pickaxe.png")
+ if i is Detector:
+ return preload("res://gui/game/announce/screenshots/detector.png")
+ if i is Fork:
+ return preload("res://gui/game/announce/screenshots/fork.png")
+ return null
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)
- )
+ 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
+ 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)
+ 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)
+ %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()
+ 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()
+ %AnnouceObject.add_child(object.get_3d_object())
+ %AnnouceObject.rotation = Vector3.ZERO
+ %AnnounceTitle.text = object.get_title()
+ %AnnounceText.text = object.get_text()
+ %AnnounceDesc.text = object.get_desc()
+ %AnnounceImage.texture = object.get_image()
+ %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
+ 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
+ if announce_object:
+ announce_object._on_dismiss()
+ announce_object = null
diff --git a/gui/game/inventory_gui/inventory_item/inventory_item_3d.tscn b/gui/game/inventory_gui/inventory_item/inventory_item_3d.tscn
index dde4cf2..9ab9515 100644
--- a/gui/game/inventory_gui/inventory_item/inventory_item_3d.tscn
+++ b/gui/game/inventory_gui/inventory_item/inventory_item_3d.tscn
@@ -10,6 +10,9 @@
script = ExtResource("3_ixa47")
metadata/_custom_type_script = "uid://bq7admu4ahs5r"
+[sub_resource type="BoxShape3D" id="BoxShape3D_1uxm0"]
+size = Vector3(0.21289063, 0.22167969, 0.2841797)
+
[sub_resource type="Gradient" id="Gradient_ixa47"]
offsets = PackedFloat32Array(0, 0.84549356)
colors = PackedColorArray(0.002722778, 0.0025074463, 0.012722934, 1, 0.0627451, 0.05882353, 0.16862746, 1)
@@ -41,12 +44,14 @@ height = 14
fill_from = Vector2(0, 1)
fill_to = Vector2(0, 0)
-[sub_resource type="BoxShape3D" id="BoxShape3D_1uxm0"]
-size = Vector3(0.21289063, 0.22167969, 0.2841797)
-
-[node name="InventoryItem3d" type="Node3D" unique_id=797856392]
+[node name="InventoryItem3d" type="Area3D" unique_id=1974785723]
script = ExtResource("1_nsad1")
item = SubResource("Resource_g1uf8")
+interactable = null
+inspectable = true
+
+[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=2020875183]
+shape = SubResource("BoxShape3D_1uxm0")
[node name="Model" parent="." unique_id=1055300734 instance=ExtResource("2_1uxm0")]
@@ -59,12 +64,14 @@ texture = SubResource("GradientTexture2D_g1uf8")
[node name="ItemScreen" type="Sprite3D" parent="." unique_id=1128109703]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.08962244)
+visible = false
transparent = false
texture = SubResource("GradientTexture2D_jdjjl")
[node name="ToolScreen" type="Sprite3D" parent="." unique_id=1384339729]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.08962244)
+visible = false
transparent = false
texture = SubResource("GradientTexture2D_gj8fm")
@@ -79,35 +86,36 @@ unique_name_in_owner = true
[node name="ParticleSprite1" type="Sprite3D" parent="ParticleSprites" unique_id=811884632]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.04235574, -0.03381054, -0.105405755)
+visible = false
pixel_size = 0.001
texture = ExtResource("5_g1uf8")
[node name="ParticleSprite2" type="Sprite3D" parent="ParticleSprites" unique_id=1076243108]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.042, -0.034, -0.105)
+visible = false
pixel_size = 0.001
texture = ExtResource("6_jdjjl")
[node name="ParticleSprite3" type="Sprite3D" parent="ParticleSprites" unique_id=490761808]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0029564463, -0.034, -0.105)
+visible = false
pixel_size = 0.001
texture = ExtResource("6_jdjjl")
[node name="ParticleSprite4" type="Sprite3D" parent="ParticleSprites" unique_id=1224179780]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.04235574, 0.04323736, -0.105405755)
+visible = false
pixel_size = 0.001
texture = ExtResource("5_g1uf8")
[node name="ParticleSprite5" type="Sprite3D" parent="ParticleSprites" unique_id=241043116]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.042, 0.043047898, -0.105)
+visible = false
pixel_size = 0.001
texture = ExtResource("6_jdjjl")
[node name="ParticleSprite6" type="Sprite3D" parent="ParticleSprites" unique_id=1794865960]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0029564463, 0.043047898, -0.105)
+visible = false
pixel_size = 0.001
texture = ExtResource("6_jdjjl")
-
-[node name="Area3D" type="Area3D" parent="." unique_id=426596211]
-
-[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D" unique_id=2020875183]
-shape = SubResource("BoxShape3D_1uxm0")
diff --git a/gui/game/inventory_gui/inventory_item/scripts/inventory_item_3d.gd b/gui/game/inventory_gui/inventory_item/scripts/inventory_item_3d.gd
index 3945517..61b42d6 100644
--- a/gui/game/inventory_gui/inventory_item/scripts/inventory_item_3d.gd
+++ b/gui/game/inventory_gui/inventory_item/scripts/inventory_item_3d.gd
@@ -1,5 +1,5 @@
@tool
-extends Node3D
+extends Interactable3D
class_name InventoryItem3D
enum State { BLACK,ITEM,TOOL }
@@ -43,3 +43,8 @@ func set_state(s := state):
%BlackScreen.visible = state == State.BLACK
%ItemScreen.visible = state == State.ITEM
%ToolScreen.visible = state == State.TOOL
+
+func card_info() -> CardInfo:
+ if item :
+ return item.card_info()
+ return null
diff --git a/gui/game/scripts/game_gui.gd b/gui/game/scripts/game_gui.gd
index 3fcd3ac..1bd6f1e 100644
--- a/gui/game/scripts/game_gui.gd
+++ b/gui/game/scripts/game_gui.gd
@@ -99,7 +99,7 @@ func score_update(with_animation = true):
func state_update(region_data : RegionData):
if region_data.state == RegionData.State.SUCCEEDED:
- objective_text = "SHIP_IS_READY_TO_TAKE_OFF"
+ objective_text = "COLLECT_YOUR_SEEDS_AND_TAKE_OFF"
if GameInfo.game_data.current_run.story_step is TutorialStoryStep:
objective_text = "PASS_THE_MYSTERIOUS_DOOR"
elif region_data.state == RegionData.State.FAILED:
diff --git a/gui/pause/scripts/pause.gd b/gui/pause/scripts/pause.gd
index 17b7720..a1cc77d 100644
--- a/gui/pause/scripts/pause.gd
+++ b/gui/pause/scripts/pause.gd
@@ -54,6 +54,5 @@ func _on_controls_pressed():
func _on_give_up_pressed():
if GameInfo.game_data:
- SceneManager.change_to_scene(AstraScene.new())
GameInfo.game_data.give_up()
pause = false
diff --git a/gui/pointer/pointer.tscn b/gui/pointer/pointer.tscn
index b7431c0..a9c296b 100644
--- a/gui/pointer/pointer.tscn
+++ b/gui/pointer/pointer.tscn
@@ -3,9 +3,9 @@
[ext_resource type="Script" uid="uid://vhumsfntpqcl" path="res://gui/pointer/scripts/pointer.gd" id="1_1pe2k"]
[ext_resource type="Texture2D" uid="uid://bspffyprdywgc" path="res://gui/pointer/assets/cursors/pointer.svg" id="2_q4bvb"]
[ext_resource type="AudioStream" uid="uid://bym03qp4n6vep" path="res://gui/pointer/assets/sounds/click.wav" id="3_kj0cm"]
-[ext_resource type="Texture2D" uid="uid://djb52fosgmv4j" path="res://common/icons/left_click.svg" id="3_pshoq"]
[ext_resource type="AudioStream" uid="uid://bhsew2amu3ydx" path="res://gui/pointer/assets/sounds/action_press_time.wav" id="3_tof6i"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="4_b4uwv"]
+[ext_resource type="AudioStream" uid="uid://cs4y6sinpth8e" path="res://common/audio_manager/assets/sfx/recharge/recharge_capsule_1.wav" id="4_mw4ws"]
[ext_resource type="Script" uid="uid://c60a1bjcuj4hd" path="res://common/vfx/circle/scripts/circle.gd" id="5_b4uwv"]
[ext_resource type="PackedScene" uid="uid://3ss8pvhsackj" path="res://gui/game/card/card_visualiser.tscn" id="6_7j4mj"]
[ext_resource type="Shader" uid="uid://bqjwmomh851lc" path="res://common/vfx/materials/shaders/skew.gdshader" id="7_wgcdp"]
@@ -90,6 +90,13 @@ volume_db = -5.0
pitch_scale = 4.0
bus = &"Sfx"
+[node name="ActionPlayer" type="AudioStreamPlayer" parent="InspectorCanvasLayer/Inspector" unique_id=659884130]
+unique_name_in_owner = true
+stream = ExtResource("4_mw4ws")
+volume_db = -2.0
+pitch_scale = 2.0
+bus = &"Sfx"
+
[node name="ActionProgressBar" type="TextureProgressBar" parent="InspectorCanvasLayer/Inspector" unique_id=55992280]
unique_name_in_owner = true
layout_mode = 1
@@ -111,8 +118,8 @@ texture_progress = SubResource("GradientTexture2D_tof6i")
[node name="Container" type="VBoxContainer" parent="InspectorCanvasLayer/Inspector" unique_id=319962477]
layout_mode = 0
-offset_left = 28.0
-offset_right = 134.0
+offset_left = 32.0
+offset_right = 138.0
offset_bottom = 79.0
size_flags_horizontal = 0
size_flags_vertical = 0
@@ -123,12 +130,6 @@ unique_name_in_owner = true
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
-[node name="MouseImage" type="TextureRect" parent="InspectorCanvasLayer/Inspector/Container/Action" unique_id=530309967]
-layout_mode = 2
-texture = ExtResource("3_pshoq")
-expand_mode = 2
-stretch_mode = 5
-
[node name="ActionEnergyImage" type="TextureRect" parent="InspectorCanvasLayer/Inspector/Container/Action" unique_id=1684096069]
unique_name_in_owner = true
layout_mode = 2
diff --git a/gui/pointer/scripts/pointer.gd b/gui/pointer/scripts/pointer.gd
index 06a405a..28f8a47 100644
--- a/gui/pointer/scripts/pointer.gd
+++ b/gui/pointer/scripts/pointer.gd
@@ -4,8 +4,10 @@ const DEFAULT_ACTION_COLOR = Color.WHITE
const ENERGY_ACTION_COLOR = Color("ffff2b")
const NO_ENERGY_ACTION_COLOR = Color.RED
const ZONE_OPACITY = 0.4
-const ZONE_ACTIVATED_COLOR = Color.TURQUOISE
-const ZONE_DEACTIVATED_COLOR = Color.REBECCA_PURPLE
+const ZONE_ACTIVATED_COLOR = Color("#96B3DB")
+const ZONE_DEACTIVATED_COLOR = Color("#FF006E")
+
+const SEED_CURSOR = preload("res://common/icons/shovel.svg")
const CARD_VISUALISATION_TIME = 0.3
const CARD_UP_PADDING = 50
@@ -99,6 +101,7 @@ func process_player_actions(delta : float):
%ActionProgressPlayer.pitch_scale = 1. / (current_selected_item.get_action_press_time() / %ActionProgressPlayer.stream.get_length())
if press_time > current_selected_item.get_action_press_time():
+ %ActionPlayer.play()
player.try_use_item(
current_selected_item,
player.get_global_mouse_position()
@@ -117,10 +120,10 @@ func process_player_actions(delta : float):
var interactable = current_inspect as Interactable
player.try_interact(interactable)
elif can_use_item and not current_selected_item.is_action_need_press_time():
- player.try_use_item(
- current_selected_item,
- player.get_global_mouse_position()
- )
+ player.try_use_item(
+ current_selected_item,
+ player.get_global_mouse_position()
+ )
func inspect(node: Node):
if current_inspect and current_inspect != node and current_inspect.has_method("inspect"):
diff --git a/project.godot b/project.godot
index ae74d01..c9f06ca 100644
--- a/project.godot
+++ b/project.godot
@@ -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-1.3"
+config/version="beta-1.4"
run/main_scene="uid://c5bruelvqbm1k"
config/features=PackedStringArray("4.6", "Forward Plus")
config/icon="uid://df0y0s666ui4h"
diff --git a/stages/3d_scenes/cave/3d/cave.blend b/stages/3d_scenes/cave/3d/cave.blend
index c13a3ec..416a3b2 100644
Binary files a/stages/3d_scenes/cave/3d/cave.blend and b/stages/3d_scenes/cave/3d/cave.blend differ
diff --git a/stages/3d_scenes/cave/3d/cave.blend.import b/stages/3d_scenes/cave/3d/cave.blend.import
index 3e7ec8f..54417e8 100644
--- a/stages/3d_scenes/cave/3d/cave.blend.import
+++ b/stages/3d_scenes/cave/3d/cave.blend.import
@@ -39,6 +39,11 @@ materials/extract_format=0
materials/extract_path=""
_subresources={
"materials": {
+"Cristal": {
+"use_external/enabled": true,
+"use_external/fallback_path": "res://common/assets/materials/cristal.tres",
+"use_external/path": "uid://di0m3uqgi3l08"
+},
"Default3D": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
diff --git a/stages/3d_scenes/cave/3d/cave.blend1 b/stages/3d_scenes/cave/3d/cave.blend1
index 2ece548..b261ada 100644
Binary files a/stages/3d_scenes/cave/3d/cave.blend1 and b/stages/3d_scenes/cave/3d/cave.blend1 differ
diff --git a/stages/3d_scenes/cave/cave.tscn b/stages/3d_scenes/cave/cave.tscn
index a5d3daf..d1cb49c 100644
--- a/stages/3d_scenes/cave/cave.tscn
+++ b/stages/3d_scenes/cave/cave.tscn
@@ -86,7 +86,7 @@ environment = SubResource("Environment_x7awc")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.124447, 2.974639, 1.201046)
omni_range = 16.327286
-[node name="CaveModel" parent="." unique_id=741350561 instance=ExtResource("2_xlbt6")]
+[node name="CaveModel" parent="." unique_id=532031355 instance=ExtResource("2_xlbt6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.573945, 0, 1.5022337)
[node name="OmniLight3D" type="OmniLight3D" parent="CaveModel" unique_id=2145888223]
diff --git a/stages/3d_scenes/cave/scripts/cave.gd b/stages/3d_scenes/cave/scripts/cave.gd
index 965a070..3ebf20d 100644
--- a/stages/3d_scenes/cave/scripts/cave.gd
+++ b/stages/3d_scenes/cave/scripts/cave.gd
@@ -4,12 +4,13 @@ class_name Cave
func _ready():
if not Engine.is_editor_hint():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
- setup_room(10)
func setup_room(door_id : int):
var rng := RandomNumberGenerator.new()
rng.seed = door_id
+ %Cristal.rotate_y(rng.randf_range(-PI,PI))
+
%Cristal.broken.connect(
func ():
GameInfo.game_data.current_region_data.completed_doors.append(door_id)
diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend b/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend
index 28b56b9..b727fbf 100644
Binary files a/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend and b/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend differ
diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend1 b/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend1
index 5c250b3..269cd8d 100644
Binary files a/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend1 and b/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend1 differ
diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend b/stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend
new file mode 100644
index 0000000..f441c7d
Binary files /dev/null and b/stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend differ
diff --git a/entities/interactable_3d/cristal/assets/cristal_crack_1.blend.import b/stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend.import
similarity index 73%
rename from entities/interactable_3d/cristal/assets/cristal_crack_1.blend.import
rename to stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend.import
index d8da56d..9ef9dc9 100644
--- a/entities/interactable_3d/cristal/assets/cristal_crack_1.blend.import
+++ b/stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend.import
@@ -3,13 +3,13 @@
importer="scene"
importer_version=1
type="PackedScene"
-uid="uid://d0sdfjneo8rjj"
-path="res://.godot/imported/cristal_crack_1.blend-01f6238e5ee6ec34d1d8a421f878430c.scn"
+uid="uid://jj7k5r4b1xme"
+path="res://.godot/imported/windshield.blend-40cb486363267d9c774e89c6eeb0dbdf.scn"
[deps]
-source_file="res://entities/interactable_3d/cristal/assets/cristal_crack_1.blend"
-dest_files=["res://.godot/imported/cristal_crack_1.blend-01f6238e5ee6ec34d1d8a421f878430c.scn"]
+source_file="res://stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend"
+dest_files=["res://.godot/imported/windshield.blend-40cb486363267d9c774e89c6eeb0dbdf.scn"]
[params]
@@ -37,15 +37,7 @@ import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
-_subresources={
-"materials": {
-"Default3D": {
-"use_external/enabled": true,
-"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
-"use_external/path": "uid://dvvi1k5c5iowc"
-}
-}
-}
+_subresources={}
blender/nodes/visible=0
blender/nodes/active_collection_only=false
blender/nodes/punctual_lights=true
diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend1 b/stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend1
new file mode 100644
index 0000000..df4dbf7
Binary files /dev/null and b/stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend1 differ
diff --git a/stages/3d_scenes/cockpit_scene/cockpit.tscn b/stages/3d_scenes/cockpit_scene/cockpit.tscn
index fc17c5a..cdbe31d 100644
--- a/stages/3d_scenes/cockpit_scene/cockpit.tscn
+++ b/stages/3d_scenes/cockpit_scene/cockpit.tscn
@@ -5,7 +5,6 @@
[ext_resource type="PackedScene" uid="uid://csx7d5khjd6y5" path="res://entities/interactable_3d/phone/phone.tscn" id="3_3b5pk"]
[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://common/icons/logout.svg" id="3_w4l7d"]
[ext_resource type="PackedScene" uid="uid://by45bbbnf0k13" path="res://gui/game/objective_progress_bar/gauge_3d.tscn" id="4_ers7b"]
-[ext_resource type="PackedScene" uid="uid://d01cp8xl0rme4" path="res://gui/game/energy_info/energy_info_3d.tscn" id="6_ogqwl"]
[ext_resource type="PackedScene" uid="uid://jjkw4edrewsk" path="res://stages/3d_scenes/cockpit_scene/assets/3d/furnitures/closet.blend" id="7_lnpag"]
[ext_resource type="PackedScene" uid="uid://cv0ehgy3d1kmj" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn" id="8_seqvk"]
[ext_resource type="PackedScene" uid="uid://cgw2ct7smispo" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/shelf.tscn" id="11_w4l7d"]
@@ -122,9 +121,9 @@ shape = SubResource("BoxShape3D_ctvhk")
[node name="Player3D" parent="." unique_id=549819967 instance=ExtResource("13_a2cx2")]
unique_name_in_owner = true
-transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 3.2830403)
+transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, -0.00043085217, 0, 3.283195)
-[node name="CockpitModel" parent="." unique_id=825141342 instance=ExtResource("17_omtjc")]
+[node name="CockpitModel" parent="." unique_id=1122480479 instance=ExtResource("17_omtjc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.04904175e-05, 0.0026242882, 4.4822693e-05)
[node name="Phone" parent="." unique_id=429299908 instance=ExtResource("3_3b5pk")]
@@ -134,14 +133,9 @@ interactable = false
[node name="Gauge3D" parent="." unique_id=232507348 instance=ExtResource("4_ers7b")]
unique_name_in_owner = true
-transform = Transform3D(-0.070710674, 0.07071066, -4.864633e-09, 8.7422745e-09, 2.199196e-30, -0.09999998, -0.070710674, -0.07071066, -7.4988105e-09, 0.9122916, -0.51005816, 5.5039926)
+transform = Transform3D(-0.070710674, 0.07071066, -4.864633e-09, 8.7422745e-09, 2.199196e-30, -0.09999998, -0.070710674, -0.07071066, -7.4988105e-09, 1.1546884, -0.51005816, 5.135547)
progress = 1.085
-[node name="EnergyInfo3d" parent="." unique_id=1798644168 instance=ExtResource("6_ogqwl")]
-unique_name_in_owner = true
-transform = Transform3D(0.23, 0, 0, 0, 0.23, 0, 0, 0, 0.23, -1.2449384, -0.8972735, 5.2538967)
-max_energy = 3
-
[node name="Furnitures" type="Node3D" parent="." unique_id=1095424400]
[node name="ClosetR" parent="Furnitures" unique_id=1358386607 instance=ExtResource("7_lnpag")]
@@ -152,7 +146,7 @@ transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 1.13
[node name="Dashboard" parent="." unique_id=1374334508 instance=ExtResource("8_seqvk")]
unique_name_in_owner = true
-transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.035136223, -0.7094687, 6.45286)
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.035136223, -0.7094687, 6.1824927)
[node name="Shelf" parent="." unique_id=1769159984 instance=ExtResource("11_w4l7d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.1218804, -1.0799314, 2.6211417)
diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn b/stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn
index 71950da..4ba31fe 100644
--- a/stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn
+++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn
@@ -1,8 +1,8 @@
[gd_scene format=3 uid="uid://cv0ehgy3d1kmj"]
[ext_resource type="Script" uid="uid://fet6urfgiiwr" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd" id="1_vks67"]
+[ext_resource type="PackedScene" uid="uid://cnx1xwc4uupmc" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/topology_content.tscn" id="2_lskho"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="3_g7q16"]
-[ext_resource type="PackedScene" uid="uid://cs5gir1u8jbrg" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/holo_content.tscn" id="3_go2gd"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_7u0n5"]
[ext_resource type="Script" uid="uid://biqgucg78cx44" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard_main_screen.gd" id="4_vks67"]
[ext_resource type="Script" uid="uid://ccb06rayqowp3" path="res://stages/terrain/region/scripts/modifiers/region_modifier.gd" id="5_7u0n5"]
@@ -16,9 +16,29 @@
[ext_resource type="PackedScene" uid="uid://crbjmwumboelw" path="res://gui/game/inventory_gui/inventory_3d.tscn" id="10_y1ysr"]
[ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://entities/player/inventory/scripts/item.gd" id="11_3cel1"]
[ext_resource type="Script" uid="uid://fnu2d6wna4yc" path="res://entities/player/inventory/scripts/inventory.gd" id="12_oix5e"]
+[ext_resource type="PackedScene" uid="uid://dj4u5grx00ky1" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/travel_screen_content.tscn" id="17_emtfq"]
+[ext_resource type="PackedScene" uid="uid://d01cp8xl0rme4" path="res://gui/game/energy_info/energy_info_3d.tscn" id="17_lskho"]
-[sub_resource type="ViewportTexture" id="ViewportTexture_cvt2p"]
-viewport_path = NodePath("Holo/SubViewport")
+[sub_resource type="ViewportTexture" id="ViewportTexture_v1m0r"]
+viewport_path = NodePath("Background/SubViewport")
+
+[sub_resource type="Gradient" id="Gradient_psxhb"]
+interpolation_mode = 1
+colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
+
+[sub_resource type="GradientTexture2D" id="GradientTexture2D_y1ysr"]
+gradient = SubResource("Gradient_psxhb")
+width = 400
+height = 400
+fill = 1
+fill_from = Vector2(0.5, 0.5)
+fill_to = Vector2(1, 0.5)
+
+[sub_resource type="ViewportTexture" id="ViewportTexture_psxhb"]
+viewport_path = NodePath("Topology/SubViewport")
+
+[sub_resource type="ViewportTexture" id="ViewportTexture_lskho"]
+viewport_path = NodePath("TravelScreen/SubViewport")
[sub_resource type="ViewportTexture" id="ViewportTexture_5d7hc"]
viewport_path = NodePath("StatusScreen/SubViewport")
@@ -179,33 +199,48 @@ metadata/_custom_type_script = "uid://fnu2d6wna4yc"
[node name="Dashboard" type="Node3D" unique_id=1374334508]
script = ExtResource("1_vks67")
-destination_title = "TO_BOREA_BASE"
-[node name="Holo" type="Sprite3D" parent="." unique_id=1067303692]
-unique_name_in_owner = true
-transform = Transform3D(-1, 0, -8.742278e-08, 0, 1.0000002, 0, 8.742278e-08, 0, -1, 0, 0.91157264, 0.33655214)
+[node name="Background" type="Sprite3D" parent="." unique_id=747271324]
+transform = Transform3D(-1, 0, 8.742278e-08, 5.2901907e-08, 0.79612875, 0.6051273, -6.9599785e-08, 0.6051273, -0.79612875, 0, 0.85765254, 1.1502768)
pixel_size = 0.004
-texture = SubResource("ViewportTexture_cvt2p")
+texture = SubResource("ViewportTexture_v1m0r")
-[node name="SubViewport" type="SubViewport" parent="Holo" unique_id=471832787]
+[node name="SubViewport" type="SubViewport" parent="Background" unique_id=1285367140]
disable_3d = true
transparent_bg = true
-size = Vector2i(365, 68)
+size = Vector2i(500, 500)
-[node name="HoloContent" parent="Holo/SubViewport" unique_id=668915500 instance=ExtResource("3_go2gd")]
+[node name="Circle" type="Sprite2D" parent="Background/SubViewport" unique_id=204541212]
+modulate = Color(0.0627451, 0.05882353, 0.16862746, 1)
+position = Vector2(250, 250)
+texture = SubResource("GradientTexture2D_y1ysr")
+
+[node name="Topology" type="Sprite3D" parent="." unique_id=555628624]
+transform = Transform3D(-1, 0, 8.742278e-08, 5.2901907e-08, 0.79612875, 0.6051273, -6.9599785e-08, 0.6051273, -0.79612875, 0, 0.8662406, 1.012941)
+pixel_size = 0.004
+texture = SubResource("ViewportTexture_psxhb")
+
+[node name="SubViewport" type="SubViewport" parent="Topology" unique_id=610507336]
+disable_3d = true
+transparent_bg = true
+size = Vector2i(500, 500)
+
+[node name="TopologyContent" parent="Topology/SubViewport" unique_id=1478734478 instance=ExtResource("2_lskho")]
unique_name_in_owner = true
-anchors_preset = 8
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-offset_left = -162.0
-offset_top = -28.0
-offset_right = 162.0
-offset_bottom = 28.0
-grow_horizontal = 2
-grow_vertical = 2
-stop_name = ""
+
+[node name="TravelScreen" type="Sprite3D" parent="." unique_id=1605384571]
+transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0.7866177, 0.5924386)
+pixel_size = 0.002
+texture = SubResource("ViewportTexture_lskho")
+
+[node name="SubViewport" type="SubViewport" parent="TravelScreen" unique_id=1413693044]
+disable_3d = true
+transparent_bg = true
+size = Vector2i(1000, 512)
+
+[node name="TravelScreenContent" parent="TravelScreen/SubViewport" unique_id=1386845472 instance=ExtResource("17_emtfq")]
+unique_name_in_owner = true
+current_position = 4.0
[node name="StatusScreen" type="Sprite3D" parent="." unique_id=1257606535]
unique_name_in_owner = true
@@ -246,7 +281,6 @@ icon = NodePath("MainScreenSprite/SubViewport/VBoxContainer/MainScreenIcon")
label = NodePath("MainScreenSprite/SubViewport/VBoxContainer/MainScreenLabel")
run_point = SubResource("Resource_psxhb")
interactable = false
-inspectable = true
hover_animation_player = NodePath("HoverAnimationPlayer")
metadata/_custom_type_script = "uid://bj4d1x8n8ina"
@@ -410,6 +444,13 @@ libraries/ = SubResource("AnimationLibrary_cvt2p")
[node name="Inventory3D" parent="." unique_id=810532522 instance=ExtResource("10_y1ysr")]
unique_name_in_owner = true
-transform = Transform3D(1, 0, 8.940697e-08, 0, 1, 0, -8.940697e-08, 0, 1, 0, 0.5876103, 0.89364576)
+transform = Transform3D(0.42250758, 0, -0.90635943, 0, 1, 0, 0.90635943, 0, 0.42250758, -1.1253021, 0.4732105, -0.4411707)
no_tools = true
test_inventory = SubResource("Resource_ne0dp")
+
+[node name="EnergyInfo3d" parent="." unique_id=1798644168 instance=ExtResource("17_lskho")]
+unique_name_in_owner = true
+transform = Transform3D(-0.12115031, 0, 0.047144443, 0, 0.12999998, 0, -0.047144443, 0, -0.12115031, 1.1126381, 0.41387832, -0.35765195)
+max_energy = 3
+
+[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=316569967]
diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd
index 0dc57cb..c94136f 100644
--- a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd
+++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd
@@ -2,25 +2,18 @@
extends Node3D
class_name Dashboard
-const PLANET_3D_HOLO_RADIUS = 1.3
-const PLANET_3D_HOLO_ARROW_SIZE = 0.3
-const LAND_ICON = preload("res://common/icons/arrow-narrow-down.svg")
-const GROWTH_ICON = preload("res://common/icons/growth.svg")
-const CHARGE_ICON = preload("res://common/icons/bolt.svg")
+const TOPOLOGY_SPEED = 5000.
signal main_screen_activated
signal right_screen_activated
signal left_screen_activated
+@export var run_data : RunData
+@export var in_space : bool
+
@export var main_screen_state : DashboardMainScreen.State : set = set_main_screen_state
@export var main_screen_run_point : RunPoint : set = set_main_screen_run_point
-
-@export var stop_name : String : set = set_stop_label
-@export var stop_title : String : set = set_stop_title_label
-@export var destination_distance : int
-@export var destination_title : String : set = set_destination_title
-
@export var status_text : String : set = set_status_text
@export var left_stop : RunPoint = null : set = set_left_stop
@@ -31,25 +24,35 @@ func _ready():
%RightScreen.clicked.connect(func(): right_screen_activated.emit())
%LeftScreen.clicked.connect(func(): left_screen_activated.emit())
-
set_main_screen_state()
set_main_screen_run_point()
- set_stop_label()
- set_stop_title_label()
- set_destination_title()
set_status_text()
set_left_stop()
set_right_stop()
- %HoloContent.distance = destination_distance
if not Engine.is_editor_hint() and GameInfo.game_data.player_data:
%Inventory3D.update(GameInfo.game_data.player_data.inventory)
+ %EnergyInfo3d.energy = GameInfo.game_data.player_data.energy
+ %EnergyInfo3d.max_energy = GameInfo.game_data.player_data.max_energy
+
+func update_travel_screen(with_animation = true):
+ if is_node_ready():
+ var current_position = run_data.level + (0.5 if in_space else 0.)
+
+ %TravelScreenContent.story_step = run_data.story_step
+ %TravelScreenContent.current_position = current_position
+
+ %TravelScreenContent.update(with_animation)
+
+ %TopologyContent.texture.noise.seed = run_data.run_seed
+
+ if with_animation:
+ var topology_tween = create_tween()
+ topology_tween.set_trans(Tween.TRANS_EXPO)
+ topology_tween.tween_property(%TopologyContent.texture.noise,"offset:y",-current_position*TOPOLOGY_SPEED, 5.)
+ else:
+ %TopologyContent.texture.noise.offset.y = -current_position*TOPOLOGY_SPEED
-func _process(_d):
- if %HoloContent.distance < destination_distance:
- %HoloContent.distance = ceili(lerp(float(%HoloContent.distance), float(destination_distance), 0.05))
- else:
- %HoloContent.distance = floori(lerp(float(%HoloContent.distance), float(destination_distance), 0.05))
func set_main_screen_state(s := main_screen_state):
main_screen_state = s
@@ -61,22 +64,6 @@ func set_main_screen_run_point(rp := main_screen_run_point):
if is_node_ready():
%MainScreen.run_point = rp
-
-func set_stop_label(v := stop_name):
- stop_name = v
- if is_node_ready():
- %HoloContent.stop_name = v
-
-func set_stop_title_label(v := stop_title):
- stop_title = v
- if is_node_ready():
- %HoloContent.stop_title = v
-
-func set_destination_title(v := destination_title):
- destination_title = v
- if is_node_ready():
- %HoloContent.destination = v
-
func set_status_text(v := status_text):
status_text = v
if is_node_ready():
@@ -91,4 +78,4 @@ func set_right_stop(v := right_stop):
right_stop = v
if is_node_ready():
%RightScreen.run_point = right_stop
-
\ No newline at end of file
+
diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/scripts/travel_screen_content.gd b/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/scripts/travel_screen_content.gd
new file mode 100644
index 0000000..94b3441
--- /dev/null
+++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/scripts/travel_screen_content.gd
@@ -0,0 +1,87 @@
+@tool
+extends Node2D
+class_name TravelScreenContent
+
+const SHIP_ICON = preload("res://common/icons/rocket.svg")
+const START_ICON = preload("res://common/icons/device-floppy.svg")
+const REGION_ICON = preload("res://common/icons/globe.svg")
+const DESTINATION_ICON = preload("res://common/icons/flag-2.svg")
+
+const PREVIOUS_COLOR = Color("2364AAAA")
+const CURRENT_COLOR = Color("e29f32")
+const NEXT_COLOR = Color("96B3DB")
+
+const WIDTH = 800
+const V_DIST = 50
+
+@export_tool_button("Update", "Callable") var update_action = update
+
+@export var current_position : float = 0
+@export var story_step : StoryStep
+
+func _ready():
+ update()
+
+var ship_icon : Sprite2D
+
+func update(with_animation := true):
+ if is_node_ready() and story_step:
+ if ship_icon and with_animation:
+ var tween = create_tween()
+ tween.set_trans(Tween.TRANS_SPRING)
+ tween.tween_property(ship_icon,"position",coord_to_pos(Vector2(current_position, 1)),5.)
+
+ await tween.finished
+
+ for c in %Icons.get_children():
+ c.queue_free()
+
+ for i in range(get_step_number()):
+ print("showing %d" % i)
+ var icon = REGION_ICON
+ if i == 0:
+ icon = START_ICON
+ elif i == get_step_number() - 1:
+ icon = DESTINATION_ICON
+
+ var color = NEXT_COLOR
+ if i < current_position:
+ color = PREVIOUS_COLOR
+ elif i == current_position:
+ color = CURRENT_COLOR
+
+ var modifiers := story_step.get_story_modifiers_for_region(i)
+ modifiers.append_array(story_step.get_gameplay_modifiers_for_region(i))
+ for m_i in range(len(modifiers)):
+ spawn_icon(modifiers[m_i].get_icon(), Vector2(i,-m_i - 1),color, 0.7)
+
+ print(modifiers)
+
+ spawn_icon(icon, Vector2(i,0),color)
+
+ ship_icon = spawn_icon(SHIP_ICON, Vector2(current_position, 1), CURRENT_COLOR, 1)
+
+func spawn_icon(texture : Texture, coord := Vector2.ZERO, color := Color.WHITE, scaling := 1.) -> Sprite2D:
+ var new_icon = Sprite2D.new()
+ new_icon.texture = texture
+ new_icon.modulate = color
+ new_icon.scale = Vector2.ONE * scaling
+
+ %Icons.add_child(new_icon)
+
+ new_icon.position = coord_to_pos(coord)
+
+ return new_icon
+
+func get_step_number() -> int:
+ if story_step:
+ return story_step.get_region_sequence_length()
+ return 0
+
+func coord_to_pos(coord : Vector2) -> Vector2:
+ var h_dist = WIDTH / (get_step_number() + 2.)
+
+ return Vector2(
+ coord.x * h_dist - float(get_step_number())/2 * h_dist + h_dist/2.,
+ coord.y * V_DIST,
+ )
diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/scripts/travel_screen_content.gd.uid b/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/scripts/travel_screen_content.gd.uid
new file mode 100644
index 0000000..31d3d6b
--- /dev/null
+++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/scripts/travel_screen_content.gd.uid
@@ -0,0 +1 @@
+uid://r1gn83h8re8m
diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/topology_content.tscn b/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/topology_content.tscn
new file mode 100644
index 0000000..03bf369
--- /dev/null
+++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/topology_content.tscn
@@ -0,0 +1,41 @@
+[gd_scene format=3 uid="uid://cnx1xwc4uupmc"]
+
+[ext_resource type="Shader" uid="uid://bklafn6ulmkij" path="res://common/vfx/materials/shaders/topology_map.gdshader" id="1_5gx2n"]
+
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_y1ysr"]
+shader = ExtResource("1_5gx2n")
+shader_parameter/line_number = 6.0
+shader_parameter/line_color = Color(0.13725491, 0.39215687, 0.6666667, 1)
+shader_parameter/line_thickness = 0.002000000095
+
+[sub_resource type="FastNoiseLite" id="FastNoiseLite_psxhb"]
+noise_type = 2
+fractal_octaves = 3
+
+[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_3cel1"]
+width = 500
+height = 500
+noise = SubResource("FastNoiseLite_psxhb")
+
+[sub_resource type="Gradient" id="Gradient_v1m0r"]
+interpolation_mode = 1
+colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
+
+[sub_resource type="GradientTexture2D" id="GradientTexture2D_5gx2n"]
+gradient = SubResource("Gradient_v1m0r")
+width = 400
+height = 400
+fill = 1
+fill_from = Vector2(0.5, 0.5)
+fill_to = Vector2(1, 0.5)
+
+[node name="TopologyContent" type="Polygon2D" unique_id=1478734478]
+material = SubResource("ShaderMaterial_y1ysr")
+texture = SubResource("NoiseTexture2D_3cel1")
+polygon = PackedVector2Array(283, 51, 242, 50, 190, 58, 137, 83, 107, 110, 81, 142, 59, 189, 50, 233, 53, 284, 69, 334, 92, 373, 129, 410, 168, 432, 219, 449, 268, 449, 303, 445, 351, 423, 383, 400, 414, 365, 437, 323, 451, 266, 449, 229, 444, 200, 422, 147, 394, 109, 350, 75, 316, 59)
+
+[node name="Circle" type="Sprite2D" parent="." unique_id=1114259574]
+visible = false
+z_index = -1
+position = Vector2(250, 250)
+texture = SubResource("GradientTexture2D_5gx2n")
diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/travel_screen_content.tscn b/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/travel_screen_content.tscn
new file mode 100644
index 0000000..954a28b
--- /dev/null
+++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/travel_screen_content.tscn
@@ -0,0 +1,11 @@
+[gd_scene format=3 uid="uid://dj4u5grx00ky1"]
+
+[ext_resource type="Script" uid="uid://r1gn83h8re8m" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/travel_screen/scripts/travel_screen_content.gd" id="1_u6tks"]
+
+[node name="TravelScreenContent" type="Node2D" unique_id=1386845472]
+position = Vector2(500, 256)
+script = ExtResource("1_u6tks")
+current_position = 2.0
+
+[node name="Icons" type="Node2D" parent="." unique_id=1787603855]
+unique_name_in_owner = true
diff --git a/stages/3d_scenes/cockpit_scene/scripts/cockpit.gd b/stages/3d_scenes/cockpit_scene/scripts/cockpit.gd
index 158680a..4805c73 100644
--- a/stages/3d_scenes/cockpit_scene/scripts/cockpit.gd
+++ b/stages/3d_scenes/cockpit_scene/scripts/cockpit.gd
@@ -23,10 +23,7 @@ func _ready():
else (float(region_data.get_score()) / max(float(region_data.objective), 1))
)
- %EnergyInfo3d.energy = GameInfo.game_data.player_data.energy
- %EnergyInfo3d.max_energy = GameInfo.game_data.player_data.max_energy
-
- update_dashboard()
+ update_dashboard(false)
dashboard.main_screen_activated.connect(_on_main_screen_activated)
dashboard.left_screen_activated.connect(_on_left_screen_activated)
@@ -140,18 +137,14 @@ func _on_exit_clicked():
exiting = true
SceneManager.change_to_scene(RegionScene.new(GameInfo.game_data.current_region_data))
-func update_dashboard():
+func update_dashboard(with_animation := true):
var current_region_data = GameInfo.game_data.current_region_data
var current_run = GameInfo.game_data.current_run
-
- if current_run.is_finished():
- dashboard.destination_distance = 0
- else:
- dashboard.destination_distance = (
- current_run.get_progress() * 1000
- )
- dashboard.destination_title = current_run.story_step.get_destination_text()
+
+ dashboard.run_data = current_run
+ dashboard.in_space = GameInfo.game_data.ship_in_space
+ dashboard.update_travel_screen(with_animation)
var can_take_off : bool = (
not current_run.is_finished()
@@ -165,15 +158,10 @@ func update_dashboard():
if GameInfo.game_data.ship_in_space:
if choosen_run_point:
dashboard.main_screen_state = DashboardMainScreen.State.READY_TO_LAND
- dashboard.stop_title = tr("NEXT_STOP")
- dashboard.stop_name = choosen_run_point.region_parameter.region_name
dashboard.status_text = ""
else:
dashboard.main_screen_state = DashboardMainScreen.State.WAITING_CHOICE
- dashboard.stop_title = ""
- dashboard.stop_name = tr("ORBIT")
dashboard.status_text = tr("CHOOSE_NEXT_STOP")
- dashboard.stop_name = ""
if GameInfo.game_data.current_run:
var next_run_points = GameInfo.game_data.current_run.next_run_points
@@ -198,11 +186,5 @@ func update_dashboard():
dashboard.left_stop = null
dashboard.right_stop = null
- if current_region_data:
- dashboard.stop_title = tr("LOCATION")
- dashboard.stop_name = current_region_data.region_name
-
-
-
func _on_orchid_saver_clicked():
GameInfo.game_data.give_up()
diff --git a/stages/terrain/region/assets/empty.png b/stages/terrain/region/assets/empty.png
new file mode 100644
index 0000000..c8135f5
Binary files /dev/null and b/stages/terrain/region/assets/empty.png differ
diff --git a/stages/terrain/region/assets/empty.png.import b/stages/terrain/region/assets/empty.png.import
new file mode 100644
index 0000000..1503069
--- /dev/null
+++ b/stages/terrain/region/assets/empty.png.import
@@ -0,0 +1,40 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://djd5ing64rqk0"
+path="res://.godot/imported/empty.png-ff8d2278ab956d3d787ab07e7096aec1.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://stages/terrain/region/assets/empty.png"
+dest_files=["res://.godot/imported/empty.png-ff8d2278ab956d3d787ab07e7096aec1.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/stages/terrain/region/assets/textures/moss_biome/moss_particle.png b/stages/terrain/region/assets/textures/moss_biome/moss_particle.png
new file mode 100644
index 0000000..3a4d818
Binary files /dev/null and b/stages/terrain/region/assets/textures/moss_biome/moss_particle.png differ
diff --git a/stages/terrain/region/assets/textures/moss_biome/moss_particle.png.import b/stages/terrain/region/assets/textures/moss_biome/moss_particle.png.import
new file mode 100644
index 0000000..3e993e7
--- /dev/null
+++ b/stages/terrain/region/assets/textures/moss_biome/moss_particle.png.import
@@ -0,0 +1,40 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://k2smk66py4uq"
+path="res://.godot/imported/moss_particle.png-5ac5ac284abd73e64071d175c4b8d609.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_particle.png"
+dest_files=["res://.godot/imported/moss_particle.png-5ac5ac284abd73e64071d175c4b8d609.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/stages/terrain/region/region.tscn b/stages/terrain/region/region.tscn
index ae39b68..52ddff1 100644
--- a/stages/terrain/region/region.tscn
+++ b/stages/terrain/region/region.tscn
@@ -17,12 +17,16 @@
[ext_resource type="Texture2D" uid="uid://rdrhi3r11ey6" path="res://common/icons/square-rounded.svg" id="10_ktnx3"]
[ext_resource type="Texture2D" uid="uid://lftiiulpc8kl" path="res://stages/terrain/region/assets/textures/rain.png" id="12_6d8m3"]
[ext_resource type="Script" uid="uid://dple0sunrpauc" path="res://stages/terrain/region/scripts/post_process/rain.gd" id="13_fwgig"]
+[ext_resource type="Shader" uid="uid://8qwmgc4ry3ro" path="res://common/vfx/materials/shaders/see_behind.gdshader" id="16_3lxsc"]
+[ext_resource type="Script" uid="uid://wd7n5xbgl82c" path="res://stages/terrain/region/scripts/see_behind.gd" id="16_al6gf"]
[sub_resource type="Resource" id="Resource_r4e5h"]
script = ExtResource("3_r4e5h")
-cloud_value = 0.93
-wind_direction = Vector2(-0.9519732, -0.30618128)
-wind_force = 0.039
+cloud_value = 0.23939586
+wind_direction = Vector2(0.6897295, 0.72406715)
+wind_force = 0.87287587
+fog_value = 0.5362279
+ambiance_name = "ExteriorFoggy"
type = 3
[sub_resource type="FastNoiseLite" id="FastNoiseLite_2w03p"]
@@ -38,7 +42,7 @@ shader_parameter/camera_position = Vector2(0, 0)
shader_parameter/camera_zoom = Vector2(1, 1)
shader_parameter/viewport_size = Vector2(1920, 1080)
shader_parameter/noise_texture = SubResource("NoiseTexture2D_6d8m3")
-shader_parameter/cloud_speed = 0.11699999999999999
+shader_parameter/cloud_speed = 0.117
shader_parameter/cloud_delay = 1.0
shader_parameter/cloud_dir = Vector2(-0.9519732, -0.30618128)
shader_parameter/cloud_color = Color(0.59428054, 0.8206175, 0.899937, 1)
@@ -98,6 +102,19 @@ gravity = Vector3(0, 0, 0)
anim_speed_min = 1.0
anim_speed_max = 1.0
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_al6gf"]
+shader = ExtResource("16_3lxsc")
+
+[sub_resource type="Gradient" id="Gradient_q7iyx"]
+offsets = PackedFloat32Array(0, 0.7040359, 1)
+colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0.94170403, 1, 1, 1, 0)
+
+[sub_resource type="GradientTexture2D" id="GradientTexture2D_0e2h6"]
+gradient = SubResource("Gradient_q7iyx")
+fill = 1
+fill_from = Vector2(0.5, 0.5)
+fill_to = Vector2(0.5, 0)
+
[sub_resource type="Curve" id="Curve_qdnee"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.4883721, 1), 0.037164874, 0.037164874, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
@@ -208,7 +225,14 @@ process_material = SubResource("ParticleProcessMaterial_r4e5h")
script = ExtResource("13_fwgig")
camera = NodePath("../../Camera")
+[node name="SeeBehindSprite" type="Sprite2D" parent="Entities" unique_id=471327108]
+material = SubResource("ShaderMaterial_al6gf")
+scale = Vector2(2.4375, 2.4375)
+texture = SubResource("GradientTexture2D_0e2h6")
+script = ExtResource("16_al6gf")
+
[node name="Camera" parent="." unique_id=1399042986 node_paths=PackedStringArray("following") instance=ExtResource("8_fwgig")]
+unique_name_in_owner = true
following = NodePath("../Entities/Player")
[node name="WindParticles" type="GPUParticles2D" parent="Camera" unique_id=1897174931]
diff --git a/stages/terrain/region/resources/materials/default_chunk_material.tres b/stages/terrain/region/resources/materials/default_chunk_material.tres
index 67a0faf..03b2d9c 100644
--- a/stages/terrain/region/resources/materials/default_chunk_material.tres
+++ b/stages/terrain/region/resources/materials/default_chunk_material.tres
@@ -13,7 +13,6 @@ height = 20
noise = SubResource("FastNoiseLite_kujx0")
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_cmstg"]
-load_path = "res://.godot/imported/rock_background_texture.png-79a8569ff49f7d85f8b64d55ac1ce62d.ctex"
[resource]
shader = ExtResource("1_kujx0")
diff --git a/stages/terrain/region/resources/materials/ground_contamination.tres b/stages/terrain/region/resources/materials/ground_contamination.tres
index ea77bcf..ce9217c 100644
--- a/stages/terrain/region/resources/materials/ground_contamination.tres
+++ b/stages/terrain/region/resources/materials/ground_contamination.tres
@@ -10,7 +10,6 @@ frequency = 0.0109
noise = SubResource("FastNoiseLite_6hswu")
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_nntr3"]
-load_path = "res://.godot/imported/garden_decontamined_background_texture_old.png-951b3e125e8b7083a60c2b7435bce68a.ctex"
[resource]
shader = ExtResource("1_ye8oh")
diff --git a/stages/terrain/region/resources/moss_biome.tres b/stages/terrain/region/resources/moss_biome.tres
index ef46795..d334efd 100644
--- a/stages/terrain/region/resources/moss_biome.tres
+++ b/stages/terrain/region/resources/moss_biome.tres
@@ -4,6 +4,179 @@
[ext_resource type="Texture2D" uid="uid://dr72xhc07i56e" path="res://stages/terrain/region/assets/textures/moss_biome/moss_contamination_atlas_texture.png" id="1_uqnql"]
[ext_resource type="Texture2D" uid="uid://dlbdjyqj03gvo" path="res://stages/terrain/region/assets/textures/moss_biome/moss_talion_atlas_texture.png" id="2_fywqu"]
[ext_resource type="Texture2D" uid="uid://bi08trir23od2" path="res://stages/terrain/region/assets/textures/red_rect.png" id="4_spfgy"]
+[ext_resource type="Texture2D" uid="uid://djd5ing64rqk0" path="res://stages/terrain/region/assets/empty.png" id="5_wwlp4"]
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_d5hne"]
+vertices = PackedVector2Array(-24.273438, -24, -24, 32, -32, 32, -32, -32, 32, -32, 24, -24, 32, 32, 24, 32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(0, 3, 4, 5), PackedInt32Array(5, 4, 6, 7)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, 24, 32, 24, -24, -24.272377, -24, -24, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_lfyrs"]
+vertices = PackedVector2Array(-24, 32, -32, 32, -32, -32, -24, -32, 32, 32, 24, 32, 24, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 5, 6, 7)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, 24, 32, 24, -32, -24, -32, -24, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_hl8m2"]
+vertices = PackedVector2Array(24, 24, 24, -32, 32, -32, 32, 32, -32, 32, -24, 24, -32, -32, -24, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(0, 3, 4, 5), PackedInt32Array(5, 4, 6, 7)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, -32, 32, 32, 32, 32, -32, 24, -32, 24, 24, -24, 24, -24, -32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_1ka8d"]
+vertices = PackedVector2Array(24, 24, 32, -32, 32, 32, 24, 32, 24, -24, 24, -32, -24, -24, -32, -32, -32, 32, -24, 24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(1, 0, 4), PackedInt32Array(5, 1, 4, 6), PackedInt32Array(7, 5, 6), PackedInt32Array(8, 7, 6, 9), PackedInt32Array(3, 8, 9, 0)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(32, 32, 32, -32, 24, -32, -32, -32, -32, 32, 24, 32, 24, 24, -24, 24, -24, -24, 24, -24, 24, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_kd3mn"]
+vertices = PackedVector2Array(32, -24, -32, -24, -32, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, -24, -32, -24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_dt08x"]
+vertices = PackedVector2Array(32, -32, 32, 32, 24, 32, 24, -24, -32, -32, -32, -24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 0, 3, 5)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, 24, 32, 24, -24, -32, -24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_ai561"]
+vertices = PackedVector2Array(32, 32, 24, 32, 24, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(32, 32, 32, -32, 24, -32, 24, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_0g2d2"]
+vertices = PackedVector2Array(32, 32, -32, 32, -32, 24, 24, 24, 32, -32, 24, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 0, 3, 5)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, 32, 32, 32, 32, -32, 24, -32, 24, 24, -32, 24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_s7hek"]
+vertices = PackedVector2Array(-24.273438, -24, -24, 32, -32, 32, -32, -32, 32, -32, 32, -24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(0, 3, 4, 5)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, -24, -24.272377, -24, -24, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_rsjga"]
+vertices = PackedVector2Array(-24, 32, -32, 32, -32, -32, -24, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, -24, -32, -24, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_fdxnc"]
+vertices = PackedVector2Array(-24, 24, 32, 24, 32, 32, -32, 32, -32, -32, -24, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(0, 3, 4, 5)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, -24, -32, -24, 24, 32, 24, 32, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_wfpa5"]
+vertices = PackedVector2Array(32, -32, 32, -24, -24.273438, -24, -32, -32, -32, 32, -24, 24, 32, 32, 32, 24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 3, 2, 5), PackedInt32Array(6, 4, 5, 7)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, -24, -24.272377, -24, -24, 24, 32, 24, 32, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_38nby"]
+vertices = PackedVector2Array(32, -24, -32, -24, -32, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, -24, -32, -24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_6nyek"]
+vertices = PackedVector2Array(32, 32, -32, 32, -32, 24, 32, 24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, 32, 32, 32, 32, 24, -32, 24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_0u8fn"]
+vertices = PackedVector2Array(32, 32, -32, 32, -32, 24, 32, 24, 32, -24, -32, -24, -32, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 5, 6, 7)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32, -32, 24, 32, 24, 32, -24, -32, -24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_53wg5"]
+vertices = PackedVector2Array(32, -32, 32, 32, 24, 32, 24, -24, -32, -32, -32, -24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 0, 3, 5)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, 24, 32, 24, -24, -32, -24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_w5wko"]
+vertices = PackedVector2Array(32, 32, 24, 32, 24, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(32, 32, 32, -32, 24, -32, 24, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_omx72"]
+vertices = PackedVector2Array(32, 32, -32, 32, -32, 24, 24, 24, 32, -32, 24, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 0, 3, 5)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, 32, 32, 32, 32, -32, 24, -32, 24, 24, -32, 24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_ei338"]
+vertices = PackedVector2Array(32, 32, -32, 32, -32, 24, 24, 24, 32, -32, 24, -24, -32, -32, -32, -24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 0, 3, 5), PackedInt32Array(6, 4, 5, 7)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32, -32, 24, 24, 24, 24, -24, -32, -24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_nr1fe"]
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_0g1o1"]
+vertices = PackedVector2Array(-24, 32, -32, 32, -32, -32, -24, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, -24, -32, -24, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_yh1lj"]
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_g61rk"]
+vertices = PackedVector2Array(32, -24, -32, -24, -32, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, -24, -32, -24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_i0yy6"]
+vertices = PackedVector2Array(32, 32, -32, 32, -32, 24, 32, 24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, 32, 32, 32, 32, 24, -32, 24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_5vo1o"]
+vertices = PackedVector2Array(32, -24, -32, -24, -32, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, -24, -32, -24)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_pykno"]
+vertices = PackedVector2Array(32, 32, 24, 32, 24, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(32, 32, 32, -32, 24, -32, 24, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_fv1hs"]
+vertices = PackedVector2Array(-24.273438, -24, -24, 32, -32, 32, -32, -32, 32, -32, 32, -24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(0, 3, 4, 5)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, -24, -24.272377, -24, -24, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_nj7v8"]
+vertices = PackedVector2Array(-24, 32, -32, 32, -32, -32, -24, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, -24, -32, -24, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_k1gnd"]
+vertices = PackedVector2Array(-24, 24, 32, 24, 32, 32, -32, 32, -32, -32, -24, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(0, 3, 4, 5)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, -24, -32, -24, 24, 32, 24, 32, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_3cip6"]
+vertices = PackedVector2Array(32, 32, -32, 32, -32, 24, 32, 24)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, 32, 32, 32, 32, 24, -32, 24)])
+agent_radius = 0.0
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_4i8c6"]
resource_name = "Rock"
@@ -12,14 +185,16 @@ texture_region_size = Vector2i(64, 64)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrain = 1
-0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 0, 0, -16, 16, 0, 16, 32, -16, 32)
+0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 16, 0, 0, 16, 16, 16, 32, -16, 32)
0:0/0/terrains_peering_bit/bottom_side = 1
+0:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_d5hne")
1:0/0 = 0
1:0/0/terrain_set = 0
1:0/0/terrain = 1
-1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(32, -16, 32, 16, 16, 32, -16, 32, -16, 0, 0, -16)
+1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(32, -16, 32, 16, 16, 32, -16, 32, -16, 16, 16, -16)
1:0/0/terrains_peering_bit/right_side = 1
1:0/0/terrains_peering_bit/bottom_side = 1
+1:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_s7hek")
2:0/0 = 0
2:0/0/terrain_set = 0
2:0/0/terrain = 1
@@ -27,12 +202,14 @@ texture_region_size = Vector2i(64, 64)
2:0/0/terrains_peering_bit/right_side = 1
2:0/0/terrains_peering_bit/bottom_side = 1
2:0/0/terrains_peering_bit/left_side = 1
+2:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_38nby")
3:0/0 = 0
3:0/0/terrain_set = 0
3:0/0/terrain = 1
-3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, 0, -16, 16, 0, 16, 32, -16, 32, -32, 16)
+3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, -16, -16, 16, 16, 16, 32, -16, 32, -32, 16)
3:0/0/terrains_peering_bit/bottom_side = 1
3:0/0/terrains_peering_bit/left_side = 1
+3:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_53wg5")
4:0/0 = 0
4:0/0/terrain_set = 0
4:0/0/terrain = 1
@@ -42,6 +219,7 @@ texture_region_size = Vector2i(64, 64)
4:0/0/terrains_peering_bit/left_side = 1
4:0/0/terrains_peering_bit/top_left_corner = 1
4:0/0/terrains_peering_bit/top_side = 1
+4:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_nr1fe")
5:0/0 = 0
5:0/0/terrain_set = 0
5:0/0/terrain = 1
@@ -50,6 +228,7 @@ texture_region_size = Vector2i(64, 64)
5:0/0/terrains_peering_bit/bottom_right_corner = 1
5:0/0/terrains_peering_bit/bottom_side = 1
5:0/0/terrains_peering_bit/left_side = 1
+5:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_g61rk")
6:0/0 = 0
6:0/0/terrain_set = 0
6:0/0/terrain = 1
@@ -58,6 +237,7 @@ texture_region_size = Vector2i(64, 64)
6:0/0/terrains_peering_bit/bottom_side = 1
6:0/0/terrains_peering_bit/bottom_left_corner = 1
6:0/0/terrains_peering_bit/left_side = 1
+6:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_5vo1o")
7:0/0 = 0
7:0/0/terrain_set = 0
7:0/0/terrain = 1
@@ -70,10 +250,11 @@ texture_region_size = Vector2i(64, 64)
8:0/0 = 0
8:0/0/terrain_set = 0
8:0/0/terrain = 1
-8:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 0, 0, -16, 32, -16, 32, 32, -16, 32)
+8:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 16, 16, -16, 32, -16, 32, 32, -16, 32)
8:0/0/terrains_peering_bit/right_side = 1
8:0/0/terrains_peering_bit/bottom_right_corner = 1
8:0/0/terrains_peering_bit/bottom_side = 1
+8:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_fv1hs")
9:0/0 = 0
9:0/0/terrain_set = 0
9:0/0/terrain = 1
@@ -93,19 +274,22 @@ texture_region_size = Vector2i(64, 64)
10:0/0/terrains_peering_bit/bottom_side = 1
10:0/0/terrains_peering_bit/bottom_left_corner = 1
10:0/0/terrains_peering_bit/left_side = 1
+10:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_kd3mn")
11:0/0 = 0
11:0/0/terrain_set = 0
11:0/0/terrain = 1
-11:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, 0, -16, 16, 0, 16, 32, -32, 32)
+11:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, -16, -16, 16, 16, 16, 32, -32, 32)
11:0/0/terrains_peering_bit/bottom_side = 1
11:0/0/terrains_peering_bit/bottom_left_corner = 1
11:0/0/terrains_peering_bit/left_side = 1
+11:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_dt08x")
0:1/0 = 0
0:1/0/terrain_set = 0
0:1/0/terrain = 1
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -32, 16, -32, 16, 32, -16, 32)
0:1/0/terrains_peering_bit/bottom_side = 1
0:1/0/terrains_peering_bit/top_side = 1
+0:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_lfyrs")
1:1/0 = 0
1:1/0/terrain_set = 0
1:1/0/terrain = 1
@@ -113,6 +297,7 @@ texture_region_size = Vector2i(64, 64)
1:1/0/terrains_peering_bit/right_side = 1
1:1/0/terrains_peering_bit/bottom_side = 1
1:1/0/terrains_peering_bit/top_side = 1
+1:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_rsjga")
2:1/0 = 0
2:1/0/terrain_set = 0
2:1/0/terrain = 1
@@ -128,6 +313,7 @@ texture_region_size = Vector2i(64, 64)
3:1/0/terrains_peering_bit/bottom_side = 1
3:1/0/terrains_peering_bit/left_side = 1
3:1/0/terrains_peering_bit/top_side = 1
+3:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_w5wko")
4:1/0 = 0
4:1/0/terrain_set = 0
4:1/0/terrain = 1
@@ -136,6 +322,7 @@ texture_region_size = Vector2i(64, 64)
4:1/0/terrains_peering_bit/bottom_right_corner = 1
4:1/0/terrains_peering_bit/bottom_side = 1
4:1/0/terrains_peering_bit/top_side = 1
+4:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_0g1o1")
5:1/0 = 0
5:1/0/terrain_set = 0
5:1/0/terrain = 1
@@ -166,6 +353,7 @@ texture_region_size = Vector2i(64, 64)
7:1/0/terrains_peering_bit/bottom_left_corner = 1
7:1/0/terrains_peering_bit/left_side = 1
7:1/0/terrains_peering_bit/top_side = 1
+7:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_pykno")
8:1/0 = 0
8:1/0/terrain_set = 0
8:1/0/terrain = 1
@@ -175,6 +363,7 @@ texture_region_size = Vector2i(64, 64)
8:1/0/terrains_peering_bit/bottom_side = 1
8:1/0/terrains_peering_bit/top_side = 1
8:1/0/terrains_peering_bit/top_right_corner = 1
+8:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_nj7v8")
9:1/0 = 0
9:1/0/terrain_set = 0
9:1/0/terrain = 1
@@ -198,14 +387,16 @@ texture_region_size = Vector2i(64, 64)
0:2/0 = 0
0:2/0/terrain_set = 0
0:2/0/terrain = 1
-0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -32, 16, -32, 16, 0, -0.564476, 16, -16, 0)
+0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -32, 16, -32, 16, -16, 0, 0, -16, -16)
0:2/0/terrains_peering_bit/top_side = 1
+0:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_hl8m2")
1:2/0 = 0
1:2/0/terrain_set = 0
1:2/0/terrain = 1
-1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -32, 16, -32, 32, -16, 32, 16, 0, 16, -16, 0)
+1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -32, 16, -32, 32, -16, 32, 16, 16, 16, -16, -16)
1:2/0/terrains_peering_bit/right_side = 1
1:2/0/terrains_peering_bit/top_side = 1
+1:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_fdxnc")
2:2/0 = 0
2:2/0/terrain_set = 0
2:2/0/terrain = 1
@@ -213,12 +404,14 @@ texture_region_size = Vector2i(64, 64)
2:2/0/terrains_peering_bit/right_side = 1
2:2/0/terrains_peering_bit/left_side = 1
2:2/0/terrains_peering_bit/top_side = 1
+2:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_6nyek")
3:2/0 = 0
3:2/0/terrain_set = 0
3:2/0/terrain = 1
-3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, -16, -32, 16, -32, 16, 0, 0, 16, -32, 16)
+3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, -16, -32, 16, -32, 16, -16, -16, 16, -32, 16)
3:2/0/terrains_peering_bit/left_side = 1
3:2/0/terrains_peering_bit/top_side = 1
+3:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_omx72")
4:2/0 = 0
4:2/0/terrain_set = 0
4:2/0/terrain = 1
@@ -227,6 +420,7 @@ texture_region_size = Vector2i(64, 64)
4:2/0/terrains_peering_bit/bottom_side = 1
4:2/0/terrains_peering_bit/top_side = 1
4:2/0/terrains_peering_bit/top_right_corner = 1
+4:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_0g1o1")
5:2/0 = 0
5:2/0/terrain_set = 0
5:2/0/terrain = 1
@@ -257,6 +451,7 @@ texture_region_size = Vector2i(64, 64)
7:2/0/terrains_peering_bit/left_side = 1
7:2/0/terrains_peering_bit/top_left_corner = 1
7:2/0/terrains_peering_bit/top_side = 1
+7:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_pykno")
8:2/0 = 0
8:2/0/terrain_set = 0
8:2/0/terrain = 1
@@ -298,26 +493,31 @@ texture_region_size = Vector2i(64, 64)
11:2/0/terrains_peering_bit/left_side = 1
11:2/0/terrains_peering_bit/top_left_corner = 1
11:2/0/terrains_peering_bit/top_side = 1
+11:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_ai561")
0:3/0 = 0
0:3/0/terrain_set = 0
0:3/0/terrain = 1
0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 0, 0, -16, 16, 0, 0, 16)
+0:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_1ka8d")
1:3/0 = 0
1:3/0/terrain_set = 0
1:3/0/terrain = 1
-1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(0, -16, 32, -16, 32, 16, 0, 16, -16, 0)
+1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -16, 32, -16, 32, 16, 16, 16, 0, 0)
1:3/0/terrains_peering_bit/right_side = 1
+1:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_wfpa5")
2:3/0 = 0
2:3/0/terrain_set = 0
2:3/0/terrain = 1
2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, 32, -16, 32, 16, -32, 16)
2:3/0/terrains_peering_bit/right_side = 1
2:3/0/terrains_peering_bit/left_side = 1
+2:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_0u8fn")
3:3/0 = 0
3:3/0/terrain_set = 0
3:3/0/terrain = 1
-3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, 0, -16, 16, 0, 0, 16, -32, 16)
+3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -16, -16, -16, 0, 0, -16, 16, -32, 16)
3:3/0/terrains_peering_bit/left_side = 1
+3:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_ei338")
4:3/0 = 0
4:3/0/terrain_set = 0
4:3/0/terrain = 1
@@ -327,6 +527,7 @@ texture_region_size = Vector2i(64, 64)
4:3/0/terrains_peering_bit/bottom_left_corner = 1
4:3/0/terrains_peering_bit/left_side = 1
4:3/0/terrains_peering_bit/top_side = 1
+4:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_yh1lj")
5:3/0 = 0
5:3/0/terrain_set = 0
5:3/0/terrain = 1
@@ -335,6 +536,7 @@ texture_region_size = Vector2i(64, 64)
5:3/0/terrains_peering_bit/left_side = 1
5:3/0/terrains_peering_bit/top_side = 1
5:3/0/terrains_peering_bit/top_right_corner = 1
+5:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_i0yy6")
6:3/0 = 0
6:3/0/terrain_set = 0
6:3/0/terrain = 1
@@ -343,6 +545,7 @@ texture_region_size = Vector2i(64, 64)
6:3/0/terrains_peering_bit/left_side = 1
6:3/0/terrains_peering_bit/top_left_corner = 1
6:3/0/terrains_peering_bit/top_side = 1
+6:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_i0yy6")
7:3/0 = 0
7:3/0/terrain_set = 0
7:3/0/terrain = 1
@@ -355,10 +558,11 @@ texture_region_size = Vector2i(64, 64)
8:3/0 = 0
8:3/0/terrain_set = 0
8:3/0/terrain = 1
-8:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -32, 32, -32, 32, 16, 0, 16, -16, 0)
+8:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -32, 32, -32, 32, 16, 16, 16, -16, -16)
8:3/0/terrains_peering_bit/right_side = 1
8:3/0/terrains_peering_bit/top_side = 1
8:3/0/terrains_peering_bit/top_right_corner = 1
+8:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_k1gnd")
9:3/0 = 0
9:3/0/terrain_set = 0
9:3/0/terrain = 1
@@ -368,6 +572,7 @@ texture_region_size = Vector2i(64, 64)
9:3/0/terrains_peering_bit/top_left_corner = 1
9:3/0/terrains_peering_bit/top_side = 1
9:3/0/terrains_peering_bit/top_right_corner = 1
+9:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_3cip6")
10:3/0 = 0
10:3/0/terrain_set = 0
10:3/0/terrain = 1
@@ -381,10 +586,11 @@ texture_region_size = Vector2i(64, 64)
11:3/0 = 0
11:3/0/terrain_set = 0
11:3/0/terrain = 1
-11:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 16, -32, 16, 0, 0, 16, -32, 16)
+11:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 16, -32, 16, -16, -16, 16, -32, 16)
11:3/0/terrains_peering_bit/left_side = 1
11:3/0/terrains_peering_bit/top_left_corner = 1
11:3/0/terrains_peering_bit/top_side = 1
+11:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_0g2d2")
10:1/0 = 0
10:1/0/terrain_set = 0
10:1/0/terrain = 1
@@ -1137,13 +1343,28 @@ texture_region_size = Vector2i(64, 64)
11:3/0/terrains_peering_bit/top_side = 0
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_3g8t4"]
-resource_name = "ground"
+resource_name = "Ground"
texture = ExtResource("4_spfgy")
texture_region_size = Vector2i(64, 64)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrain = 3
+[sub_resource type="NavigationPolygon" id="NavigationPolygon_wwlp4"]
+vertices = PackedVector2Array(32, 32, -32, 32, -32, -32, 32, -32)
+polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
+outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32), PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)])
+agent_radius = 0.0
+
+[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_yh1lj"]
+resource_name = "Empty"
+texture = ExtResource("5_wwlp4")
+texture_region_size = Vector2i(64, 64)
+0:0/0 = 0
+0:0/0/terrain_set = 0
+0:0/0/terrain = 4
+0:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_wwlp4")
+
[resource]
tile_size = Vector2i(64, 64)
physics_layer_0/collision_layer = 1
@@ -1156,7 +1377,11 @@ terrain_set_0/terrain_2/name = "Cristal"
terrain_set_0/terrain_2/color = Color(0.48793238, 0.38601816, 0.8285951, 1)
terrain_set_0/terrain_3/name = "Ground"
terrain_set_0/terrain_3/color = Color(0.375, 0.5, 0.25, 1)
+terrain_set_0/terrain_4/name = "Walkable"
+terrain_set_0/terrain_4/color = Color(0.28125, 0.5, 0.25, 1)
+navigation_layer_0/layers = 1
sources/2 = SubResource("TileSetAtlasSource_aw22q")
sources/0 = SubResource("TileSetAtlasSource_4i8c6")
sources/1 = SubResource("TileSetAtlasSource_spfgy")
sources/3 = SubResource("TileSetAtlasSource_3g8t4")
+sources/4 = SubResource("TileSetAtlasSource_yh1lj")
diff --git a/stages/terrain/region/scripts/chunk.gd b/stages/terrain/region/scripts/chunk.gd
index d16e73e..b76f16b 100644
--- a/stages/terrain/region/scripts/chunk.gd
+++ b/stages/terrain/region/scripts/chunk.gd
@@ -97,9 +97,12 @@ func generate():
add_child.call_deferred(ground_layer)
add_child.call_deferred(decontamination_layer)
- generated.emit()
+ call_deferred("emit_generated")
is_generated = true
+func emit_generated():
+ generated.emit()
+
func calculate_all_tiles() -> Array[Vector2i]:
var coords : Array[Vector2i] = []
@@ -200,15 +203,19 @@ func get_tile_value_from_noise(tile_position : Vector2i, noise : Noise) -> float
func generate_rocks(layer : RockLayer):
var cristals : Array[Vector2i] = []
var rocks : Array[Vector2i] = []
+ var emptys : Array[Vector2i] = []
for coord in all_tiles:
var tile_type := get_generated_rock_type(coord)
if tile_type == RockLayer.TileType.CRISTAL:
cristals.append(coord)
elif tile_type == RockLayer.TileType.ROCK:
rocks.append(coord)
+ else:
+ emptys.append(coord)
layer.place_rocks(cristals, RockLayer.TileType.CRISTAL)
layer.place_rocks(rocks, RockLayer.TileType.ROCK)
+ layer.place_empty(emptys)
func get_generated_rock_type(coord : Vector2i) -> RockLayer.TileType:
var rock_tile_value : float = (
diff --git a/stages/terrain/region/scripts/post_process/clouds.gd b/stages/terrain/region/scripts/post_process/clouds.gd
index 45c4c87..9da2373 100644
--- a/stages/terrain/region/scripts/post_process/clouds.gd
+++ b/stages/terrain/region/scripts/post_process/clouds.gd
@@ -1,6 +1,6 @@
extends ColorRect
-@export var camera : Camera
+@export var camera : RegionCamera
@export var region : Region
const PASSING_DAY_CLOUD_SPEED = 1
diff --git a/stages/terrain/region/scripts/post_process/rain.gd b/stages/terrain/region/scripts/post_process/rain.gd
index 284e71f..c8963f8 100644
--- a/stages/terrain/region/scripts/post_process/rain.gd
+++ b/stages/terrain/region/scripts/post_process/rain.gd
@@ -1,6 +1,6 @@
extends GPUParticles2D
-@export var camera : Camera
+@export var camera : RegionCamera
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_d):
diff --git a/stages/terrain/region/scripts/region.gd b/stages/terrain/region/scripts/region.gd
index 617d7d9..0e27589 100644
--- a/stages/terrain/region/scripts/region.gd
+++ b/stages/terrain/region/scripts/region.gd
@@ -3,7 +3,7 @@ class_name Region
const MIN_PASS_DAY_ANIMATION_TIME : float = PassDay.TIME_MARGIN * 2
-const TUTORIAL_SCENE : PackedScene = preload("res://gui/game/tutorial/tutorial.tscn")
+const WIN_WAVE_SCENE : PackedScene = preload("res://stages/terrain/region/win_wave.tscn")
const TILE_SET : TileSet = preload("res://stages/terrain/region/resources/moss_biome.tres")
const TILE_SCALE = 1
@@ -35,6 +35,7 @@ var generated_chunks : Array[Chunk] = []
var generation_semaphore : Semaphore
@onready var recharge_station : TruckRecharge = %RechargeStation
+@onready var camera : RegionCamera = %Camera
# Cheat Code
func _input(_e):
@@ -46,7 +47,7 @@ func _input(_e):
):
data.succeded.emit()
data.state = RegionData.State.SUCCEEDED
- data.update()
+ # data.update()
if (
Input.is_action_pressed("drop")
@@ -86,6 +87,8 @@ func _ready():
GameInfo.game_data.player_data.inventory.add_item(Pickaxe.new())
GameInfo.game_data.player_data.inventory.add_item(Fork.new())
GameInfo.game_data.player_data.inventory.add_item(ShipPortal.new())
+
+ data.succeded.connect(finishing_region_animation)
func _process(_d):
if player:
@@ -244,6 +247,16 @@ func is_coords_decontaminated(tiles_coords : Array[Vector2i]):
return false
return true
+func is_coords_rocky(tiles_coords : Array[Vector2i]):
+ for coord in tiles_coords:
+ var chunk : Chunk = get_chunk_for_coord(coord)
+ if chunk:
+ var local_coord := TilesDiffData.get_local_coord(coord, chunk.chunk_coord)
+ print(chunk.rock_layer.get_tile_type(local_coord))
+ if chunk.rock_layer.get_tile_type(local_coord) != RockLayer.TileType.EMPTY:
+ return false
+ return true
+
func dig_rocks(tiles_coords : Array[Vector2i], save_tiles_diff := true, loot := true):
if save_tiles_diff :
data.rock_tiles_data.update_tiles_diff(tiles_coords, TilesDiffData.TileDiff.ABSENT)
@@ -277,14 +290,27 @@ func decontaminate(tiles_coords : Array[Vector2i], save_tiles_diff := true):
if save_tiles_diff :
data.decontamination_tiles_data.update_tiles_diff(tiles_coords, TilesDiffData.TileDiff.PRESENT)
+ var coord_to_update : Dictionary = {}
+
for coord in tiles_coords:
var chunk : Chunk = get_chunk_for_coord(coord)
if chunk:
var local_coord := TilesDiffData.get_local_coord(coord, chunk.chunk_coord)
- chunk.decontamination_layer.place_decontamination(local_coord)
+ if not chunk in coord_to_update.keys():
+ coord_to_update[chunk] = [] as Array[Vector2i]
+
+ coord_to_update[chunk].append(local_coord)
+
+ for chunk in coord_to_update.keys():
+ var coords : Array[Vector2i] = coord_to_update[chunk] as Array[Vector2i]
+ chunk.decontamination_layer.place_decontaminations(coords)
func finishing_region_animation():
- pass #TODO
+ var win_wave := WIN_WAVE_SCENE.instantiate() as WinWave
+ add_entity(win_wave)
+ win_wave.started_time = 0.
+ win_wave.position = player.position
+ win_wave.region = self
#endregion
diff --git a/stages/terrain/region/scripts/region_parameter.gd b/stages/terrain/region/scripts/region_parameter.gd
index e97ac21..eb5acfe 100644
--- a/stages/terrain/region/scripts/region_parameter.gd
+++ b/stages/terrain/region/scripts/region_parameter.gd
@@ -2,7 +2,7 @@ extends Resource
class_name RegionParameter
const DEFAULT_ROCK_THRESHOLD = 0.3
-const DEFAULT_DECONTAMINATION_THRESHOLD = 0.4
+const DEFAULT_DECONTAMINATION_THRESHOLD = 0.5
const DEFAULT_CRISTAL_THRESHOLD = 0.1
const DEFAULT_CHARGE = 8
const DEFAULT_START_DECONTAMINATION_ZONE_RADIUS = 3
diff --git a/stages/terrain/region/scripts/screen_post_process.gd b/stages/terrain/region/scripts/screen_post_process.gd
index ea02c30..7867bf6 100644
--- a/stages/terrain/region/scripts/screen_post_process.gd
+++ b/stages/terrain/region/scripts/screen_post_process.gd
@@ -1,9 +1,6 @@
extends ColorRect
-@export var camera : Camera
-
-
-
+@export var camera : RegionCamera
func _process(_delta: float) -> void:
if is_node_ready():
diff --git a/stages/terrain/region/scripts/tile_map_layers/decontamination_layer.gd b/stages/terrain/region/scripts/tile_map_layers/decontamination_layer.gd
index cd2642b..89f3649 100644
--- a/stages/terrain/region/scripts/tile_map_layers/decontamination_layer.gd
+++ b/stages/terrain/region/scripts/tile_map_layers/decontamination_layer.gd
@@ -11,7 +11,7 @@ func setup():
func place_decontamination(coord : Vector2i, save = false):
place_decontaminations([coord], save)
-func place_decontaminations(coords : Array[Vector2i], _save := false):
+func place_decontaminations(coords : Array, _save := false):
place_terrain_cells(
coords,
DECONTAMINATION_TILE_TERRAIN_SET,
diff --git a/stages/terrain/region/scripts/tile_map_layers/region_layer.gd b/stages/terrain/region/scripts/tile_map_layers/region_layer.gd
index 6ed871b..7d216c4 100644
--- a/stages/terrain/region/scripts/tile_map_layers/region_layer.gd
+++ b/stages/terrain/region/scripts/tile_map_layers/region_layer.gd
@@ -12,7 +12,7 @@ func _init(
set_rendering_quadrant_size(Region.CHUNK_TILE_SIZE)
tile_set = Region.TILE_SET
scale = Vector2.ONE * Region.TILE_SCALE
- navigation_enabled = false
+ navigation_enabled = true
region_data = _region_data
# collision_visibility_mode = DebugVisibilityMode.DEBUG_VISIBILITY_MODE_FORCE_SHOW
diff --git a/stages/terrain/region/scripts/tile_map_layers/rock_layer.gd b/stages/terrain/region/scripts/tile_map_layers/rock_layer.gd
index 9dd7288..2fa6859 100644
--- a/stages/terrain/region/scripts/tile_map_layers/rock_layer.gd
+++ b/stages/terrain/region/scripts/tile_map_layers/rock_layer.gd
@@ -5,12 +5,21 @@ class_name RockLayer
const ROCK_TILE_TERRAIN_SET : int = 0
const ROCK_TILE_TERRAIN : int = 1
const CRISTAL_TILE_TERRAIN : int = 2
+const EMPTY_TILE_TERRAIN_SET : int = 0
+const EMPTY_TILE_TERRAIN : int = 4
enum TileType { EMPTY,ROCK,CRISTAL }
func setup():
z_index = -1
+func place_empty(coords : Array[Vector2i]):
+ place_terrain_cells(
+ coords,
+ EMPTY_TILE_TERRAIN_SET,
+ EMPTY_TILE_TERRAIN,
+ )
+
func place_rocks(coords : Array[Vector2i], type := TileType.ROCK):
if type != TileType.EMPTY:
place_terrain_cells(
@@ -18,12 +27,13 @@ func place_rocks(coords : Array[Vector2i], type := TileType.ROCK):
ROCK_TILE_TERRAIN_SET,
ROCK_TILE_TERRAIN if type == TileType.ROCK else CRISTAL_TILE_TERRAIN,
)
+
func remove_rocks(coords : Array[Vector2i], _save = false):
place_terrain_cells(
coords,
- ROCK_TILE_TERRAIN_SET,
- -1
+ EMPTY_TILE_TERRAIN_SET,
+ EMPTY_TILE_TERRAIN,
)
diff --git a/stages/terrain/region/scripts/win_wave.gd b/stages/terrain/region/scripts/win_wave.gd
new file mode 100644
index 0000000..61cc8a4
--- /dev/null
+++ b/stages/terrain/region/scripts/win_wave.gd
@@ -0,0 +1,75 @@
+@tool
+extends Node2D
+class_name WinWave
+
+var region : Region
+@export var started_time = 0.
+var shake_asked := false
+var last_updated = 0.
+
+const WAVE_DURATION := 10
+const WAVE_DISTANCE := 1000
+const WAVE_FERTILE_FACTOR = 0.5
+const WAVE_COLOR := Color("e29f32")
+const UPDATE_INTERVAL := 1.5
+
+const WIN_CRISTAL_SCENE = preload("res://entities/interactables/win_cristal/win_cristal.tscn")
+
+var plant_looted : Array[Plant] = []
+
+func _process(delta):
+ %CPUParticles2D.emitting = started_time < WAVE_DURATION
+ if not %EarthQuakePlayer.playing and started_time < 1.:
+ %EarthQuakePlayer.play()
+
+
+ if started_time < WAVE_DURATION:
+ if region and not shake_asked:
+ region.camera.shake(WAVE_DURATION)
+ shake_asked = true
+ %CPUParticles2D.emission_sphere_radius = get_radius()
+ started_time += delta
+ queue_redraw()
+ if started_time - last_updated > UPDATE_INTERVAL:
+ update()
+
+func get_radius():
+ return started_time/WAVE_DURATION * WAVE_DISTANCE
+
+func update():
+ last_updated = started_time
+
+ if region:
+ region.decontaminate(
+ Math.get_tiles_in_circle(
+ global_position,
+ get_radius() * WAVE_FERTILE_FACTOR
+ ),
+ true
+ )
+
+ for p in region.entity_container.get_children():
+ if (
+ p is Plant
+ and p.data.get_state() == PlantData.State.MATURE
+ and not p in plant_looted
+ and p.position.distance_to(self.position) < get_radius()
+ ):
+ AudioManager.play_sfx("Harvest")
+ p.produce_seed()
+ plant_looted.append(p)
+
+ spawn_cristal()
+
+
+func spawn_cristal():
+ var new_cristal := WIN_CRISTAL_SCENE.instantiate() as WinCristal
+ new_cristal.data = WinCristalData.random()
+
+ var random_angle = randf_range(-PI,PI)
+
+ region.add_entity(new_cristal)
+
+ new_cristal.global_position = global_position + Vector2.UP.rotated(random_angle) * get_radius() * WAVE_FERTILE_FACTOR
+
+ new_cristal.spawn_animation()
diff --git a/stages/terrain/region/scripts/win_wave.gd.uid b/stages/terrain/region/scripts/win_wave.gd.uid
new file mode 100644
index 0000000..b018c75
--- /dev/null
+++ b/stages/terrain/region/scripts/win_wave.gd.uid
@@ -0,0 +1 @@
+uid://cq1g6e4ifp0nl
diff --git a/stages/terrain/region/win_wave.tscn b/stages/terrain/region/win_wave.tscn
new file mode 100644
index 0000000..d5ce46a
--- /dev/null
+++ b/stages/terrain/region/win_wave.tscn
@@ -0,0 +1,35 @@
+[gd_scene format=3 uid="uid://cy6e7rf263qyn"]
+
+[ext_resource type="Script" uid="uid://cq1g6e4ifp0nl" path="res://stages/terrain/region/scripts/win_wave.gd" id="1_1nw4v"]
+[ext_resource type="Texture2D" uid="uid://k2smk66py4uq" path="res://stages/terrain/region/assets/textures/moss_biome/moss_particle.png" id="2_qsj5l"]
+[ext_resource type="AudioStream" uid="uid://di6id2kyfy2e1" path="res://common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3" id="3_qsj5l"]
+
+[node name="WinWave" type="Node2D" unique_id=1731344761]
+position = Vector2(-2, 0)
+script = ExtResource("1_1nw4v")
+started_time = 10.00204700000008
+
+[node name="CPUParticles2D" type="CPUParticles2D" parent="." unique_id=474468021]
+unique_name_in_owner = true
+z_index = -1
+emitting = false
+amount = 16
+texture = ExtResource("2_qsj5l")
+lifetime = 0.3
+emission_shape = 1
+emission_sphere_radius = 90.3
+direction = Vector2(0, -1)
+initial_velocity_min = 47.81
+initial_velocity_max = 103.59
+angular_velocity_min = -10.0
+angular_velocity_max = 10.0
+angle_min = -720.0
+angle_max = 720.0
+scale_amount_min = 0.5
+scale_amount_max = 0.8
+
+[node name="EarthQuakePlayer" type="AudioStreamPlayer2D" parent="." unique_id=11609177]
+unique_name_in_owner = true
+stream = ExtResource("3_qsj5l")
+volume_db = 7.0
+bus = &"Sfx"
diff --git a/translation/game/gui.csv b/translation/game/gui.csv
index e93a135..9e5d6d3 100644
--- a/translation/game/gui.csv
+++ b/translation/game/gui.csv
@@ -93,7 +93,7 @@ BUILD_%s,Build %s,Construit %s
FORK,Fork,Fourche
FORK_DESC_TEXT,"Use it to [b]harvest mature plants[/b].","Utilise-la pour [b]récolter les plantes mature[/b]."
DETECTOR,Detector,Détecteur
-DETECTOR_DESC_TEXT,"Indicate [b]near signals[/b].","Indique les [b]signaux proches[/b]"
+DETECTOR_DESC_TEXT,"Indicate [b]near signals[/b]","Indique les [b]signaux proches[/b]"
DETECT_USE_TEXT,"Search near signals","Rechercher les signaux proches"
SHIP_TELEPORT,Ship Portal,Portail vers le vaisseau
SHIP_TELEPORT_DESC_TEXT,"A mysterious technology that get you to the [b]Internode[/b].","Une mystèrieuse technologie qui t'amène sur l'[b]Internode[/b]"
@@ -106,7 +106,7 @@ SHOVEL_DESC_TEXT,"Use it to [b]dig up seeds[/b] and [b]harvest mature plants[/b]
TROWEL,Trowel,Truelle
TROWEL_DESC_TEXT,"Use it to [b]harvest mature plants[/b]. Can grant a [b]bonus seed[/b].","Utilise-la pour [b]récolter les plantes mature[/b]. Peut donner une [b]graine supplémentaire[/b]."
PICKAXE,Pickaxe,Pioche
-PICKAXE_DESC_TEXT,Can dig rock and precious materials,Peut creuser la roche et des matériaux précieux
+PICKAXE_DESC_TEXT,Can dig [b]Talion Veins[/b] and rock,Peut creuser les [b]Veine de Talion[/b] et la roche
DIG,Dig,Creuser
OPEN,Open,Ouvrir
%s_SEED,%s Seed,Graine de %s
@@ -144,6 +144,8 @@ LADDER_DESC_TEXT,A good old ladder,Une bonne vieille échelle
RECHARGE_STATION,Recharge station,Station de recharge
RECHARGE,Recharge,Recharger
RECHARGE_STATION_DESC_TEXT,"[b]You can recharge yourself here.[/b] When recharging, time pass and plants grow.","[b]Tu peux te recharger ici.[/b] Pendant la recharge, le temps passe et les plantes grandissent."
+TALION_CRISTAL,Talion Crystal,Cristal de Talion
+TALION_CRISTAL_DESC_TEXT,"A pure form of Talion, cannot be break or used","Une forme pure de Talion, ne peut être cassé ou utilisé"
COMPOST,Compost,Compost
START,Start,Commencer
HELP,Help,Aide
@@ -178,6 +180,8 @@ ITEM_6,Item 6,Item 6
ITEM_7,Item 7,Item 7
ITEM_8,Item 8,Item 8
ITEM_9,Item 9,Item 9
+ZOOM_IN,Zoom in,Zoomer
+ZOOM_OUT,Zoom ou,Dézoomer
PRESS_KEY,Press a key...,Appuyer sur une touche...
LOADING,Loading...,Chargement...
LOADING_SCENE,Loading Scene,Chargement de la scène
@@ -214,7 +218,7 @@ OUT_OF_ENERGY,Out of energy,À court d'énergie
USE_THE_BACKUP_DEVICE_TO_RESPAWN_TO_LAST_BASE,Use the backup device to respawn to last base,Utilisez l'appareil de sauvegarde pour réapparaitre à la dernière base
STEP_ON_THE_DATA_SAVER_TEXT,[b]Step on the backup device to use it[/b] You can use it at any time.,[b]Déplacez-vous sur l'appareil de sauvegarde pour l'utiliser[/b] Vous pouvez l'utiliser à tout moment
RESTART_FROM_LAST_BASE_WITHOUT_SEEDS_TEXT,[b]Restart from last base without any seeds[/b] You will also lose all artefacts found.,[b]Recommencer à partir de la dernière base sans aucune graine[/b] Vous perdrez également tous les artefacts trouvés.
-SHIP_IS_READY_TO_TAKE_OFF,Ship is ready to take off,Le vaisseau est prêt à partir
+COLLECT_YOUR_SEEDS_AND_TAKE_OFF,Collect your seeds and take off with the ship,Collectez vos graines et décollez avec le vaisseau
SAVE_ORCHID_MEMORY_AND_RESPAWN,Save Orchid Memory and respawn,Sauvegarder la mémoire d'Orchid et recommencer
DOWNLOAD_ORCHID_DATA_TO_LOCAL_SERVERS,Download Orchid data to local servers,Télécharger les données d'Orchid sur les serveurs locaux
TUTORIAL_FINISHED,Tutorial finished,Tutoriel terminé