Dev pour la beta 1.4
* Changements de la texture des cristaux de Talion dans tous les assets 3D pour correspondre aux assets 2D * Ajout d'un évenement en fin de région, une résurgence de Talion qui décontamine et fait looter les plantes mature aux alentours * Ajout d'un path finding sur le mouvement du robot * Modification du flow des actions à la souris : ajout d'un nouveau son, d'un icône à l'emplacement de l'action * Modification du nombre et de l'ordre de mutation débloquées * Augmentation de la valeur maximale de zoom * Modification des scores à atteindre dans les premières régions * Modification de l'interface du vaisseau, laissant apparaitre une roadmap plus claire, et laissant inspecter l'inventaire actuel * Modification de l'icône d'action dans les scènes 3D * Augmentation de la zone d'écart entre les plantes, et augmentation du taux de zone fertile en conséquence * La station de recharge devient inutilisable après la fin de la région * Ajout d'une transparence lors de la sélection d'objets derrières d'autres objets * Les plantes juvéniles donneront toujours une graine si coupées * Ajout d'un bouclage sur les couleurs des mutations * Fix des hitbox des plantes pour l'inspection à la souris * Fix de plusieurs bugs sur la manipulation de l'inventaire * Ajout de nombreux screenshots d'utilisation des outils lors du tutoriel * Amélioration mineure de la traduction/wording
14
common/assets/materials/cristal.tres
Normal file
@@ -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
|
||||
BIN
common/assets/textures/cristal.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
41
common/assets/textures/cristal.png.import
Normal file
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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]:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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. :
|
||||
|
||||
@@ -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 ""
|
||||
@@ -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 ""
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
23
common/icons/flag-2.svg
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="currentColor"
|
||||
class="icon icon-tabler icons-tabler-filled icon-tabler-flag-2"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<path
|
||||
stroke="none"
|
||||
d="M 0,0 H 24 V 24 H 0 Z"
|
||||
fill="none"
|
||||
id="path1" />
|
||||
<path
|
||||
d="m 19,4 a 1,1 0 0 1 0.993,0.883 L 20,5 v 9 a 1,1 0 0 1 -0.883,0.993 L 19,15 H 6 v 6 A 1,1 0 0 1 5.117,21.993 L 5,22 A 1,1 0 0 1 4.007,21.117 L 4,21 V 5 A 1,1 0 0 1 4.883,4.007 L 5,4 Z"
|
||||
id="path2"
|
||||
style="fill:#fefefe;fill-opacity:1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 701 B |
43
common/icons/flag-2.svg.import
Normal file
@@ -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
|
||||
39
common/icons/hand-finger
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="18.474695"
|
||||
height="20.999998"
|
||||
viewBox="0 0 18.474695 20.999998"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-hand-finger"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs5" />
|
||||
<path
|
||||
stroke="none"
|
||||
d="m -2.525305,-2.0000007 h 24 V 21.999999 h -24 z"
|
||||
fill="none"
|
||||
id="path1" />
|
||||
<path
|
||||
d="M 5.474695,10.999999 V 2.4999993 a 1.5,1.5 0 0 1 3,0 v 7.5"
|
||||
id="path2"
|
||||
style="stroke:#ffffff;stroke-opacity:1" />
|
||||
<path
|
||||
d="m 8.474695,9.4999993 v -2 a 1.5,1.5 0 1 1 3,0 v 2.5"
|
||||
id="path3"
|
||||
style="stroke:#ffffff;stroke-opacity:1" />
|
||||
<path
|
||||
d="m 11.474695,8.4999993 a 1.5,1.5 0 0 1 3,0 v 1.5"
|
||||
id="path4"
|
||||
style="stroke:#ffffff;stroke-opacity:1" />
|
||||
<path
|
||||
d="m 14.474695,9.4999993 a 1.5,1.5 0 0 1 3,0 v 4.4999997 a 6,6 0 0 1 -6,6 h -2 0.208 a 6,6 0 0 1 -5.012,-2.7 69.74,69.74 0 0 1 -0.196,-0.3 c -0.312,-0.479 -1.407,-2.388 -3.286,-5.728 a 1.5,1.5 0 0 1 0.536,-2.0219997 1.867,1.867 0 0 1 2.28,0.28 l 1.47,1.4699997"
|
||||
id="path5"
|
||||
style="stroke:#ffffff;stroke-opacity:1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
39
common/icons/hand-finger.svg
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="18.474695"
|
||||
height="20.999998"
|
||||
viewBox="0 0 18.474695 20.999998"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-hand-finger"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs5" />
|
||||
<path
|
||||
stroke="none"
|
||||
d="m -2.525305,-2.0000007 h 24 V 21.999999 h -24 z"
|
||||
fill="none"
|
||||
id="path1" />
|
||||
<path
|
||||
d="M 5.474695,10.999999 V 2.4999993 a 1.5,1.5 0 0 1 3,0 v 7.5"
|
||||
id="path2"
|
||||
style="stroke:#ffffff;stroke-opacity:1" />
|
||||
<path
|
||||
d="m 8.474695,9.4999993 v -2 a 1.5,1.5 0 1 1 3,0 v 2.5"
|
||||
id="path3"
|
||||
style="stroke:#ffffff;stroke-opacity:1" />
|
||||
<path
|
||||
d="m 11.474695,8.4999993 a 1.5,1.5 0 0 1 3,0 v 1.5"
|
||||
id="path4"
|
||||
style="stroke:#ffffff;stroke-opacity:1" />
|
||||
<path
|
||||
d="m 14.474695,9.4999993 a 1.5,1.5 0 0 1 3,0 v 4.4999997 a 6,6 0 0 1 -6,6 h -2 0.208 a 6,6 0 0 1 -5.012,-2.7 69.74,69.74 0 0 1 -0.196,-0.3 c -0.312,-0.479 -1.407,-2.388 -3.286,-5.728 a 1.5,1.5 0 0 1 0.536,-2.0219997 1.867,1.867 0 0 1 2.28,0.28 l 1.47,1.4699997"
|
||||
id="path5"
|
||||
style="stroke:#ffffff;stroke-opacity:1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
43
common/icons/hand-finger.svg.import
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
3
common/tools/scripts/test_tiles.gd
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
|
||||
1
common/tools/scripts/test_tiles.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bebwor5r5nnov
|
||||
9
common/tools/test_tiles.tscn
Normal file
@@ -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
|
||||
40
common/vfx/materials/shaders/topology_map.gdshader
Normal file
@@ -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);
|
||||
}
|
||||
1
common/vfx/materials/shaders/topology_map.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bklafn6ulmkij
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
entities/interactable_3d/cristal/assets/cristal.blend1
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
After Width: | Height: | Size: 478 KiB |
@@ -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
|
||||
31
entities/interactables/win_cristal/scripts/win_cristal.gd
Normal file
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
uid://cismap3cn5e36
|
||||
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
uid://cos0ennmyfvc2
|
||||
82
entities/interactables/win_cristal/win_cristal.tscn
Normal file
@@ -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"
|
||||
@@ -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]
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)]
|
||||
return rarity_colors[rarity%len(rarity_colors)]
|
||||
@@ -23,4 +23,4 @@ func _start_maturation_effect(plant : Plant):
|
||||
|
||||
|
||||
func get_purification_radius() -> int:
|
||||
return level * 2
|
||||
return level
|
||||
|
||||
@@ -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
|
||||
@@ -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:
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -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
|
||||
|
||||
BIN
gui/game/announce/screenshots/detector.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
40
gui/game/announce/screenshots/detector.png.import
Normal file
@@ -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
|
||||
BIN
gui/game/announce/screenshots/fork.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
40
gui/game/announce/screenshots/fork.png.import
Normal file
@@ -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
|
||||
BIN
gui/game/announce/screenshots/pickaxe.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
40
gui/game/announce/screenshots/pickaxe.png.import
Normal file
@@ -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
|
||||
@@ -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()
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"):
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
BIN
stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend
Normal file
@@ -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
|
||||
BIN
stages/3d_scenes/cockpit_scene/assets/3d/windshield.blend1
Normal file
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||