Merge branch 'demo'

This commit is contained in:
2026-06-22 20:19:48 +02:00
427 changed files with 12288 additions and 2329 deletions
-1
View File
@@ -36,7 +36,6 @@ func _process(delta):
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(
@@ -0,0 +1,9 @@
[gd_scene format=3 uid="uid://cthjy6sifcogo"]
[ext_resource type="PackedScene" uid="uid://bql646jknccr0" path="res://entities/interactable_3d/3d_printer/assets/3d/3d_printer.blend" id="1_w8y4a"]
[node name="3dPrinter" type="Node3D" unique_id=1603073620]
[node name="3d_printer" parent="." unique_id=2066223847 instance=ExtResource("1_w8y4a")]
[editable path="3d_printer"]
@@ -0,0 +1,71 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bql646jknccr0"
path="res://.godot/imported/3d_printer.blend-764f02f73d7ba9dc897cfc0819ee7cc5.scn"
[deps]
source_file="res://entities/interactable_3d/3d_printer/assets/3d/3d_printer.blend"
dest_files=["res://.godot/imported/3d_printer.blend-764f02f73d7ba9dc897cfc0819ee7cc5.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
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/vertex_colors=1
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
gltf/texture_map_mode=1
@@ -0,0 +1,89 @@
[gd_scene format=3 uid="uid://c2unmkf4ec4gf"]
[ext_resource type="Script" uid="uid://ds8qj6h3nerkt" path="res://entities/interactable_3d/ai_receptacle/scripts/ai_receptacle.gd" id="1_f5pxu"]
[ext_resource type="Texture2D" uid="uid://dg00xnpp6ixls" path="res://common/icons/server-2.svg" id="2_f5pxu"]
[ext_resource type="PackedScene" uid="uid://b50g4ufp0ul5x" path="res://entities/interactable_3d/ai_receptacle/assets/3d/ai_receptacle.blend" id="2_hstrx"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="3_ocu3y"]
[ext_resource type="PackedScene" uid="uid://dssuk68nfqq1y" path="res://entities/interactable_3d/ai_receptacle/assets/3d/ai_receptacle_broken.blend" id="4_drapv"]
[sub_resource type="BoxShape3D" id="BoxShape3D_f5pxu"]
size = Vector3(1.4648438, 1.5727539, 1.1850586)
[sub_resource type="ViewportTexture" id="ViewportTexture_drapv"]
viewport_path = NodePath("Screen/SubViewport")
[sub_resource type="LabelSettings" id="LabelSettings_s7ckp"]
font = ExtResource("3_ocu3y")
font_size = 30
[node name="AiReceptacle" type="Area3D" unique_id=1082354698]
script = ExtResource("1_f5pxu")
screen_icon = ExtResource("2_f5pxu")
screen_text = "Hello"
screen_turned_on = true
metadata/_custom_type_script = "uid://bj4d1x8n8ina"
[node name="Model" parent="." unique_id=154868613 instance=ExtResource("2_hstrx")]
unique_name_in_owner = true
[node name="ModelBroken" parent="." unique_id=1633938801 instance=ExtResource("4_drapv")]
unique_name_in_owner = true
visible = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=447695736]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0038106, 3.0576665)
shape = SubResource("BoxShape3D_f5pxu")
[node name="Screen" type="Sprite3D" parent="." unique_id=1396407912]
transform = Transform3D(1, 0, 0, 0, 0.8021926, 0.5970652, 0, -0.5970652, 0.8021926, 0, 0.8748945, 3.3313272)
pixel_size = 0.0018
texture = SubResource("ViewportTexture_drapv")
[node name="SubViewport" type="SubViewport" parent="Screen" unique_id=709453654]
disable_3d = true
transparent_bg = true
size = Vector2i(595, 367)
[node name="TurnedOffBackground" type="ColorRect" parent="Screen/SubViewport" unique_id=65019012]
unique_name_in_owner = true
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.0627451, 0.05882353, 0.16862746, 1)
[node name="ScreenContent" type="MarginContainer" parent="Screen/SubViewport" unique_id=380698147]
unique_name_in_owner = true
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_top = 16
theme_override_constants/margin_right = 16
theme_override_constants/margin_bottom = 16
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/SubViewport/ScreenContent" unique_id=1893636910]
layout_mode = 2
size_flags_vertical = 4
alignment = 1
[node name="ScreenIcon" type="TextureRect" parent="Screen/SubViewport/ScreenContent/VBoxContainer" unique_id=697782774]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
texture = ExtResource("2_f5pxu")
expand_mode = 1
stretch_mode = 5
[node name="ScreenTitle" type="Label" parent="Screen/SubViewport/ScreenContent/VBoxContainer" unique_id=443526476]
unique_name_in_owner = true
layout_mode = 2
text = "Hello"
label_settings = SubResource("LabelSettings_s7ckp")
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 3
@@ -0,0 +1,73 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b50g4ufp0ul5x"
path="res://.godot/imported/ai_receptacle.blend-b318d06849ebd1a83015daf5e59aedc4.scn"
[deps]
source_file="res://entities/interactable_3d/ai_receptacle/assets/3d/ai_receptacle.blend"
dest_files=["res://.godot/imported/ai_receptacle.blend-b318d06849ebd1a83015daf5e59aedc4.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"
},
"Glass": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/glass_3d.tres",
"use_external/path": "uid://b5vlcdry8vtgi"
}
}
}
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
@@ -0,0 +1,73 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dssuk68nfqq1y"
path="res://.godot/imported/ai_receptacle_broken.blend-ab45bb89545c07a9942287d0298bb2da.scn"
[deps]
source_file="res://entities/interactable_3d/ai_receptacle/assets/3d/ai_receptacle_broken.blend"
dest_files=["res://.godot/imported/ai_receptacle_broken.blend-ab45bb89545c07a9942287d0298bb2da.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"
},
"Glass": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/glass_3d.tres",
"use_external/path": "uid://b5vlcdry8vtgi"
}
}
}
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
@@ -0,0 +1,35 @@
@tool
extends Interactable3D
class_name AiReceptacle
@export var screen_icon : Texture :
set(v):
screen_icon = v
update()
@export var screen_text : String :
set(v):
screen_text = v
update()
@export var screen_turned_on : bool = false :
set(v):
screen_turned_on = v
update()
@export var broken : bool = false :
set(v):
broken = v
update()
func _ready():
update()
func update():
if is_node_ready():
%TurnedOffBackground.visible = not screen_turned_on
%ScreenContent.visible = screen_turned_on
%ScreenIcon.texture = screen_icon
%ScreenTitle.text = screen_text
%Model.visible = not broken
%ModelBroken.visible = broken
@@ -0,0 +1 @@
uid://ds8qj6h3nerkt
@@ -1,6 +1,7 @@
[gd_scene format=3 uid="uid://bhbc1monbgumh"]
[ext_resource type="Script" uid="uid://xamd5y6tig71" path="res://entities/interactable_3d/cristal/scripts/artefact_announce.gd" id="1_2sroa"]
[ext_resource type="Script" uid="uid://c6lr0fucklsto" path="res://common/game_data/scripts/artefacts/pile/pile.gd" id="2_2sroa"]
[ext_resource type="Texture2D" uid="uid://bi5jo6pf0acjb" path="res://common/icons/carambola.svg" id="2_3vg7r"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_doutq"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_bw55c"]
@@ -10,12 +11,17 @@
[ext_resource type="Texture2D" uid="uid://dth2mj0nh2q70" path="res://common/icons/align-right.svg" id="9_qlk3h"]
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="10_d5x7w"]
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="11_mb83y"]
[ext_resource type="Texture2D" uid="uid://cwewx7cdy085h" path="res://common/icons/help-hexagon.svg" id="12_041ff"]
[ext_resource type="Environment" uid="uid://bxyp24f85p0xf" path="res://gui/game/assets/gui_3d_environment.tres" id="13_uyc6b"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="14_kb1t6"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="15_ijwr2"]
[sub_resource type="Resource" id="Resource_3vg7r"]
script = ExtResource("2_2sroa")
metadata/_custom_type_script = "uid://c6lr0fucklsto"
[sub_resource type="ViewportTexture" id="ViewportTexture_6hxtc"]
viewport_path = NodePath("Particles/SubViewport")
viewport_path = NodePath("Container/Particles/SubViewport")
[sub_resource type="Curve" id="Curve_brrmr"]
_limits = [-200.0, 200.0, 0.0, 1.0]
@@ -32,27 +38,30 @@ font_size = 50
font_color = Color(1, 0.6509804, 0.09019608, 1)
[sub_resource type="ViewportTexture" id="ViewportTexture_smt8b"]
viewport_path = NodePath("AnnounceContainer/ObjectVisualiser/SubViewport")
viewport_path = NodePath("Container/AnnounceContainer/ObjectVisualiser/SubViewport")
[sub_resource type="Resource" id="Resource_xdybx"]
[sub_resource type="Resource" id="Resource_doutq"]
script = ExtResource("8_duftv")
title_text = "DESCRIPTION"
title_text = "Description"
title_icon = ExtResource("9_qlk3h")
text = "TALION_OVERLOADER_DESC_TEXT"
text = "PILE_DESC_TEXT"
[sub_resource type="Resource" id="Resource_041ff"]
[sub_resource type="Resource" id="Resource_bw55c"]
script = ExtResource("7_tryv5")
title = "TALION_OVERLOADER"
subtitle = "ARTEFACT"
title = "PILE"
subtitle = "Artefact"
important_stat_icon = ExtResource("11_mb83y")
sections = Array[ExtResource("8_duftv")]([SubResource("Resource_xdybx")])
sections = Array[ExtResource("8_duftv")]([SubResource("Resource_doutq")])
[sub_resource type="LabelSettings" id="LabelSettings_2sroa"]
font_size = 23
[sub_resource type="Animation" id="Animation_aao0q"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ArtefactAnnounce/AnnounceContainer:theme_override_constants/separation")
tracks/0/path = NodePath("ArtefactAnnounce/Container/AnnounceContainer:theme_override_constants/separation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
@@ -64,7 +73,7 @@ tracks/0/keys = {
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ArtefactAnnounce/Particles:modulate")
tracks/1/path = NodePath("ArtefactAnnounce/Container/Particles:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
@@ -76,19 +85,19 @@ tracks/1/keys = {
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("ArtefactAnnounce/AnnounceContainer:modulate")
tracks/2/path = NodePath("ArtefactAnnounce:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"times": PackedFloat32Array(0.03333333),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
"update": 1,
"values": [false]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("ArtefactAnnounce/MarginContainer/BackgroundRect:modulate:a")
tracks/3/path = NodePath("ArtefactAnnounce/Container:modulate:a")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
@@ -97,18 +106,6 @@ tracks/3/keys = {
"update": 1,
"values": [1.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("ArtefactAnnounce:visible")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.03333333),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_b6hac"]
resource_name = "appear"
@@ -116,7 +113,7 @@ length = 0.8
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ArtefactAnnounce/AnnounceContainer:theme_override_constants/separation")
tracks/0/path = NodePath("ArtefactAnnounce/Container/AnnounceContainer:theme_override_constants/separation")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
@@ -128,7 +125,7 @@ tracks/0/keys = {
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ArtefactAnnounce/Particles:modulate")
tracks/1/path = NodePath("ArtefactAnnounce/Container/Particles:modulate")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
@@ -140,39 +137,27 @@ tracks/1/keys = {
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("ArtefactAnnounce/AnnounceContainer:modulate")
tracks/2/interp = 2
tracks/2/path = NodePath("ArtefactAnnounce:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.2, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("ArtefactAnnounce/MarginContainer/BackgroundRect:modulate:a")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.03333333, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 0.8]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("ArtefactAnnounce:visible")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.16666667),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("ArtefactAnnounce/Container:modulate:a")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.13333334, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_1aa3a"]
_data = {
@@ -181,21 +166,29 @@ _data = {
}
[node name="ArtefactAnnounce" type="CanvasLayer" unique_id=1447182082]
visible = false
layer = 2
script = ExtResource("1_2sroa")
announce_artefact = SubResource("Resource_3vg7r")
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1853133518]
[node name="Container" type="Control" parent="." unique_id=686450138]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="BackgroundRect" type="ColorRect" parent="MarginContainer" unique_id=1594037653]
layout_mode = 2
color = Color(0.0352941, 0.0196078, 0.12549, 0.705882)
[node name="BackgroundRect" type="ColorRect" parent="Container" unique_id=1594037653]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.036075003, 0.019499997, 0.13, 0.78431374)
[node name="Particles" type="TextureRect" parent="." unique_id=1748571879]
[node name="Particles" type="TextureRect" parent="Container" unique_id=1748571879]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
@@ -207,13 +200,14 @@ offset_right = 500.0
offset_bottom = 500.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
texture = SubResource("ViewportTexture_6hxtc")
[node name="SubViewport" type="SubViewport" parent="Particles" unique_id=1123249182]
[node name="SubViewport" type="SubViewport" parent="Container/Particles" unique_id=1123249182]
transparent_bg = true
size = Vector2i(1000, 1000)
[node name="GPUParticles2D" type="CPUParticles2D" parent="Particles/SubViewport" unique_id=220592083]
[node name="GPUParticles2D" type="CPUParticles2D" parent="Container/Particles/SubViewport" unique_id=220592083]
position = Vector2(500, 500)
amount = 20
texture = ExtResource("2_3vg7r")
@@ -227,32 +221,32 @@ linear_accel_max = 5.0
linear_accel_curve = SubResource("Curve_brrmr")
color_ramp = SubResource("Gradient_0u75y")
[node name="AnnounceContainer" type="VBoxContainer" parent="." unique_id=645433045]
[node name="AnnounceContainer" type="VBoxContainer" parent="Container" unique_id=645433045]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -627.0
offset_bottom = 627.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_constants/separation = 4
alignment = 1
[node name="AnnounceTitle" type="Label" parent="AnnounceContainer" unique_id=1768593559]
[node name="AnnounceTitle" type="Label" parent="Container/AnnounceContainer" unique_id=1768593559]
unique_name_in_owner = true
layout_mode = 2
text = "NEW_ARTEFACT"
label_settings = ExtResource("3_doutq")
horizontal_alignment = 1
[node name="AnnounceText" type="Label" parent="AnnounceContainer" unique_id=768724763]
[node name="AnnounceText" type="Label" parent="Container/AnnounceContainer" unique_id=768724763]
unique_name_in_owner = true
layout_mode = 2
text = "TALION_OVERLOADER"
text = "PILE"
label_settings = SubResource("LabelSettings_u8fe7")
horizontal_alignment = 1
[node name="ObjectVisualiser" type="TextureRect" parent="AnnounceContainer" unique_id=1180983374]
[node name="ObjectVisualiser" type="TextureRect" parent="Container/AnnounceContainer" unique_id=1180983374]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
@@ -260,27 +254,46 @@ mouse_filter = 0
texture = SubResource("ViewportTexture_smt8b")
stretch_mode = 5
script = ExtResource("5_5vr2f")
info = SubResource("Resource_041ff")
info = SubResource("Resource_bw55c")
[node name="SubViewport" type="SubViewport" parent="AnnounceContainer/ObjectVisualiser" unique_id=1795775056]
[node name="SubViewport" type="SubViewport" parent="Container/AnnounceContainer/ObjectVisualiser" unique_id=1795775056]
own_world_3d = true
transparent_bg = true
size = Vector2i(300, 300)
[node name="AnnouceObject" type="Node3D" parent="AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=1527573801]
[node name="AnnouceObject" type="Node3D" parent="Container/AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=1527573801]
unique_name_in_owner = true
transform = Transform3D(-0.47699222, 0, 0.878631, 0, 0.9995686, 0, -0.8787731, 0, -0.47690943, 0, 0, 0)
transform = Transform3D(0.49246997, -0.037707455, 0.8692438, 0.6477846, -0.65092874, -0.39512447, 0.5810579, 0.75763476, -0.2962104, 0, 0, 0)
[node name="Camera3D" type="Camera3D" parent="AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=173755338]
[node name="Camera3D" type="Camera3D" parent="Container/AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=173755338]
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=1135825303]
[node name="WorldEnvironment" type="WorldEnvironment" parent="Container/AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=1135825303]
environment = ExtResource("13_uyc6b")
[node name="OkButton" type="Button" parent="AnnounceContainer" unique_id=249785792]
[node name="HBoxContainer" type="HBoxContainer" parent="Container/AnnounceContainer" unique_id=1714739118]
custom_minimum_size = Vector2(0, 71.475)
layout_mode = 2
theme_override_constants/separation = 8
alignment = 1
[node name="TextureRect" type="TextureRect" parent="Container/AnnounceContainer/HBoxContainer" unique_id=1247508373]
custom_minimum_size = Vector2(30, 30)
layout_mode = 2
texture = ExtResource("12_041ff")
expand_mode = 1
stretch_mode = 5
[node name="Label" type="Label" parent="Container/AnnounceContainer/HBoxContainer" unique_id=812537515]
layout_mode = 2
text = "ADD_A_PASSIVE_EFFECT_FOR_THIS_TRAVEL"
label_settings = SubResource("LabelSettings_2sroa")
horizontal_alignment = 1
[node name="OkButton" type="Button" parent="Container/AnnounceContainer" unique_id=249785792]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
@@ -16,6 +16,8 @@ dest_files=["res://.godot/imported/cristal_crack.blend-127c21c2b9bb4a6237729dd3a
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
@@ -52,7 +54,7 @@ blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/vertex_colors=2
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/export_geometry_nodes_instances=false
@@ -66,3 +68,4 @@ blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true
gltf/naming_version=2
gltf/texture_map_mode=0
+13 -11
View File
@@ -1,19 +1,18 @@
[gd_scene format=3 uid="uid://8rorj31s3irn"]
[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="AudioStream" uid="uid://x36rvb4eso8q" path="res://common/audio_manager/assets/sfx/pickaxe/pickaxe_cave_1.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.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="AudioStream" uid="uid://bu278eqn8krnb" path="res://common/audio_manager/assets/sfx/pickaxe/pickaxe_3_reverb.wav" id="4_k7wsc"]
[ext_resource type="AudioStream" uid="uid://c6jdmdjncamcu" path="res://common/audio_manager/assets/sfx/pickaxe/pickaxe_cave_finalblow.wav" id="4_k7wsc"]
[ext_resource type="PackedScene" uid="uid://bhbc1monbgumh" path="res://entities/interactable_3d/cristal/artefact_announce.tscn" id="8_3rrt0"]
[ext_resource type="PackedScene" uid="uid://brp1fpvasaims" path="res://entities/interactable_3d/cristal/mutation_announce.tscn" id="9_247i2"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_ojmpp"]
streams_count = 3
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_amehi"]
playback_mode = 2
streams_count = 2
stream_0/stream = ExtResource("2_3rrt0")
stream_1/stream = ExtResource("3_247i2")
stream_2/stream = ExtResource("4_k7wsc")
stream_1/stream = ExtResource("4_k7wsc")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ci2hw"]
transparency = 1
@@ -39,7 +38,7 @@ metadata/_custom_type_script = "uid://bj4d1x8n8ina"
[node name="BreackAudioPlayer" type="AudioStreamPlayer3D" parent="." unique_id=1190729820]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0430325, 0)
stream = SubResource("AudioStreamRandomizer_ojmpp")
stream = SubResource("AudioStreamRandomizer_amehi")
[node name="BreakParticles" type="CPUParticles3D" parent="." unique_id=1968257379]
unique_name_in_owner = true
@@ -75,10 +74,13 @@ visible = false
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9791151, 0)
shape = SubResource("BoxShape3D_nvfy2")
[node name="MutationAnnounce" parent="." unique_id=1447182082 instance=ExtResource("9_247i2")]
unique_name_in_owner = true
[node name="ArtefactAnnounce" parent="." unique_id=114641656 instance=ExtResource("8_3rrt0")]
unique_name_in_owner = true
visible = true
announce_artefact = null
[node name="MutationAnnounce" parent="." unique_id=1447182082 instance=ExtResource("9_247i2")]
unique_name_in_owner = true
visible = false
[editable path="CristalModelCrack"]
@@ -14,10 +14,11 @@
[ext_resource type="PackedScene" uid="uid://mwk845fx5ye2" path="res://entities/interactable_3d/cristal/assets/cristal.blend" id="12_wy2oe"]
[ext_resource type="Environment" uid="uid://bxyp24f85p0xf" path="res://gui/game/assets/gui_3d_environment.tres" id="13_kyl1n"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="14_d2gpy"]
[ext_resource type="Texture2D" uid="uid://cwewx7cdy085h" path="res://common/icons/help-hexagon.svg" id="14_vlom2"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="15_hu5cq"]
[sub_resource type="ViewportTexture" id="ViewportTexture_6hxtc"]
viewport_path = NodePath("Particles/SubViewport")
viewport_path = NodePath("Container/Particles/SubViewport")
[sub_resource type="Curve" id="Curve_brrmr"]
_limits = [-200.0, 200.0, 0.0, 1.0]
@@ -34,7 +35,7 @@ font_size = 50
font_color = Color(1, 0.6509804, 0.09019608, 1)
[sub_resource type="ViewportTexture" id="ViewportTexture_smt8b"]
viewport_path = NodePath("AnnounceContainer/ObjectVisualiser/SubViewport")
viewport_path = NodePath("Container/AnnounceContainer/ObjectVisualiser/SubViewport")
[sub_resource type="Resource" id="Resource_rjaqi"]
script = ExtResource("8_0osya")
@@ -49,12 +50,15 @@ subtitle = "Mutation"
important_stat_icon = ExtResource("6_n403s")
sections = Array[ExtResource("8_0osya")]([SubResource("Resource_rjaqi")])
[sub_resource type="LabelSettings" id="LabelSettings_02o74"]
font_size = 23
[sub_resource type="Animation" id="Animation_aao0q"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MutationAnnounce/AnnounceContainer:theme_override_constants/separation")
tracks/0/path = NodePath("MutationAnnounce/Container/AnnounceContainer:theme_override_constants/separation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
@@ -66,7 +70,7 @@ tracks/0/keys = {
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MutationAnnounce/Particles:modulate")
tracks/1/path = NodePath("MutationAnnounce/Container/Particles:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
@@ -78,19 +82,19 @@ tracks/1/keys = {
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("MutationAnnounce/AnnounceContainer:modulate")
tracks/2/path = NodePath("MutationAnnounce:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"times": PackedFloat32Array(0.03333333),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
"update": 1,
"values": [false]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("MutationAnnounce/MarginContainer/BackgroundRect:modulate:a")
tracks/3/path = NodePath("MutationAnnounce/Container:modulate:a")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
@@ -99,18 +103,6 @@ tracks/3/keys = {
"update": 1,
"values": [1.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("MutationAnnounce:visible")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.03333333),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_b6hac"]
resource_name = "appear"
@@ -118,7 +110,7 @@ length = 0.8
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MutationAnnounce/AnnounceContainer:theme_override_constants/separation")
tracks/0/path = NodePath("MutationAnnounce/Container/AnnounceContainer:theme_override_constants/separation")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
@@ -130,7 +122,7 @@ tracks/0/keys = {
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MutationAnnounce/Particles:modulate")
tracks/1/path = NodePath("MutationAnnounce/Container/Particles:modulate")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
@@ -142,39 +134,27 @@ tracks/1/keys = {
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("MutationAnnounce/AnnounceContainer:modulate")
tracks/2/interp = 2
tracks/2/path = NodePath("MutationAnnounce:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.2, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("MutationAnnounce/MarginContainer/BackgroundRect:modulate:a")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.03333333, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 0.8]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("MutationAnnounce:visible")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.16666667),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("MutationAnnounce/Container:modulate:a")
tracks/3/interp = 2
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.13333334, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_1aa3a"]
_data = {
@@ -183,21 +163,29 @@ _data = {
}
[node name="MutationAnnounce" type="CanvasLayer" unique_id=1447182082]
visible = false
layer = 2
script = ExtResource("1_02o74")
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1853133518]
[node name="Container" type="Control" parent="." unique_id=250759747]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="BackgroundRect" type="ColorRect" parent="MarginContainer" unique_id=1594037653]
layout_mode = 2
color = Color(0.0352941, 0.0196078, 0.12549, 0.705882)
[node name="BackgroundRect" type="ColorRect" parent="Container" unique_id=1594037653]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0.03529412, 0.019607844, 0.12941177, 0.78431374)
[node name="Particles" type="TextureRect" parent="." unique_id=1748571879]
[node name="Particles" type="TextureRect" parent="Container" unique_id=1748571879]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
@@ -209,13 +197,14 @@ offset_right = 500.0
offset_bottom = 500.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
texture = SubResource("ViewportTexture_6hxtc")
[node name="SubViewport" type="SubViewport" parent="Particles" unique_id=1123249182]
[node name="SubViewport" type="SubViewport" parent="Container/Particles" unique_id=1123249182]
transparent_bg = true
size = Vector2i(1000, 1000)
[node name="GPUParticles2D" type="CPUParticles2D" parent="Particles/SubViewport" unique_id=220592083]
[node name="GPUParticles2D" type="CPUParticles2D" parent="Container/Particles/SubViewport" unique_id=220592083]
position = Vector2(500, 500)
amount = 20
texture = ExtResource("2_vlom2")
@@ -229,42 +218,40 @@ linear_accel_max = 5.0
linear_accel_curve = SubResource("Curve_brrmr")
color_ramp = SubResource("Gradient_0u75y")
[node name="AnnounceContainer" type="VBoxContainer" parent="." unique_id=645433045]
[node name="AnnounceContainer" type="VBoxContainer" parent="Container" unique_id=645433045]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -627.0
offset_bottom = 627.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 4
alignment = 1
[node name="AnnounceTitle" type="Label" parent="AnnounceContainer" unique_id=1768593559]
[node name="AnnounceTitle" type="Label" parent="Container/AnnounceContainer" unique_id=1768593559]
unique_name_in_owner = true
layout_mode = 2
text = "NEW_MUTATION"
label_settings = ExtResource("3_5hs4t")
horizontal_alignment = 1
[node name="AnnounceText" type="Label" parent="AnnounceContainer" unique_id=768724763]
[node name="AnnounceText" type="Label" parent="Container/AnnounceContainer" unique_id=768724763]
unique_name_in_owner = true
layout_mode = 2
text = "Ancien"
label_settings = SubResource("LabelSettings_u8fe7")
horizontal_alignment = 1
[node name="ObjectVisualiser" type="TextureRect" parent="AnnounceContainer" unique_id=1180983374]
[node name="ObjectVisualiser" type="TextureRect" parent="Container/AnnounceContainer" unique_id=1180983374]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 0
texture = SubResource("ViewportTexture_smt8b")
stretch_mode = 5
script = ExtResource("5_qu1xy")
info = SubResource("Resource_kgj7d")
[node name="MutationIconTextureRect" type="TextureRect" parent="AnnounceContainer/ObjectVisualiser" unique_id=312214951]
[node name="MutationIconTextureRect" type="TextureRect" parent="Container/AnnounceContainer/ObjectVisualiser" unique_id=312214951]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 8
@@ -280,28 +267,47 @@ grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("6_n403s")
[node name="SubViewport" type="SubViewport" parent="AnnounceContainer/ObjectVisualiser" unique_id=1795775056]
[node name="SubViewport" type="SubViewport" parent="Container/AnnounceContainer/ObjectVisualiser" unique_id=1795775056]
own_world_3d = true
transparent_bg = true
size = Vector2i(300, 300)
[node name="AnnouceObject" type="Node3D" parent="AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=1527573801]
[node name="AnnouceObject" type="Node3D" parent="Container/AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=1527573801]
unique_name_in_owner = true
transform = Transform3D(0.9998366, 0, 0, 0, 0.9995686, 0, 0, 0, 0.9996744, 0, 0, 0)
transform = Transform3D(-0.66996473, 0.079749085, -0.73779225, -0.56796145, 0.58463466, 0.5788058, 0.47777697, 0.80682886, -0.34651512, 0, 0, 0)
[node name="cristal" parent="AnnounceContainer/ObjectVisualiser/SubViewport/AnnouceObject" unique_id=1362490576 instance=ExtResource("12_wy2oe")]
[node name="cristal" parent="Container/AnnounceContainer/ObjectVisualiser/SubViewport/AnnouceObject" unique_id=1362490576 instance=ExtResource("12_wy2oe")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
[node name="Camera3D" type="Camera3D" parent="AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=173755338]
[node name="Camera3D" type="Camera3D" parent="Container/AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=173755338]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10)
keep_aspect = 0
current = true
fov = 20.0
[node name="WorldEnvironment" type="WorldEnvironment" parent="AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=1135825303]
[node name="WorldEnvironment" type="WorldEnvironment" parent="Container/AnnounceContainer/ObjectVisualiser/SubViewport" unique_id=1135825303]
environment = ExtResource("13_kyl1n")
[node name="OkButton" type="Button" parent="AnnounceContainer" unique_id=249785792]
[node name="HBoxContainer" type="HBoxContainer" parent="Container/AnnounceContainer" unique_id=1306240981]
custom_minimum_size = Vector2(0, 71.475)
layout_mode = 2
theme_override_constants/separation = 8
alignment = 1
[node name="TextureRect" type="TextureRect" parent="Container/AnnounceContainer/HBoxContainer" unique_id=1018668980]
custom_minimum_size = Vector2(30, 30)
layout_mode = 2
texture = ExtResource("14_vlom2")
expand_mode = 1
stretch_mode = 5
[node name="Label" type="Label" parent="Container/AnnounceContainer/HBoxContainer" unique_id=1496120454]
layout_mode = 2
text = "THIS_MUTATION_CAN_NOW_APPEAR_ON_SEEDS"
label_settings = SubResource("LabelSettings_02o74")
horizontal_alignment = 1
[node name="OkButton" type="Button" parent="Container/AnnounceContainer" unique_id=249785792]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
@@ -55,29 +55,29 @@ func update_rotation(delta):
func set_announce_artefact(artefact := announce_artefact):
for c in %AnnouceObject.get_children():
c.queue_free()
if is_node_ready():
for c in %AnnouceObject.get_children():
c.queue_free()
if is_node_ready() and artefact:
if is_node_ready() and artefact:
%AnnounceTitle.text = "NEW_ARTEFACT"
%AnnounceText.text = artefact.get_artefact_name()
%ObjectVisualiser.info = artefact.card_info()
%AnnounceTitle.text = "NEW_ARTEFACT"
%AnnounceText.text = artefact.get_artefact_name()
%ObjectVisualiser.info = artefact.card_info()
%AnnouceObject.add_child(
artefact.get_3d_scene().instantiate()
)
%AnnouceObject.add_child(
artefact.get_3d_scene().instantiate()
)
if not visible:
%AnimationPlayer.play("appear")
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
AudioManager.play_sfx("Unlock_tool")
elif artefact == null and visible:
%AnimationPlayer.play_backwards("appear")
if not Engine.is_editor_hint():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
if not visible:
%AnimationPlayer.play("appear")
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
AudioManager.play_sfx("Unlock_tool")
elif artefact == null and visible:
%AnimationPlayer.play_backwards("appear")
if not Engine.is_editor_hint():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
announce_artefact = artefact
@@ -42,6 +42,10 @@ func unlock_mutation():
get_tree().create_timer(1.).timeout.connect(
func (): %MutationAnnounce.announce_mutation = new_mutation
);
if progression.mutations_unlocked == len(progression.get_all_mutations()):
SteamConnection.unlock_achievement(SteamConnection.ACH_UNLOCK_ALL_MUTATION)
else:
var talion_relay = TalionRelayArtifact.new()
+16 -3
View File
@@ -1,14 +1,18 @@
extends Area3D
class_name Interactable3D
@export var interactable = true
@export var inspectable = false
@export var interactable := true : set = set_interactable
@export var inspectable := false
signal clicked
@export var hover_animation_player : AnimationPlayer
@export var audio_player : AudioStreamPlayer3D
func _ready():
set_interactable()
func click():
if interactable:
clicked.emit()
@@ -22,7 +26,7 @@ func stop_audio():
audio_player.stop()
func _on_mouse_entered():
if hover_animation_player and interactable:
if hover_animation_player and interactable and hover_animation_player.has_animation("hover"):
hover_animation_player.play("hover")
if inspectable:
Pointer.inspect(self)
@@ -35,3 +39,12 @@ func _on_mouse_exited():
func card_info() -> CardInfo:
return null
func set_interactable(i := interactable):
interactable = i
if is_node_ready() and hover_animation_player:
if i and hover_animation_player.has_animation("activated"):
hover_animation_player.play("activated")
if not i and hover_animation_player.has_animation("deactivated"):
hover_animation_player.play("deactivated")
Binary file not shown.
Binary file not shown.
@@ -16,7 +16,7 @@ viewport_path = NodePath("Screen/SubViewport")
[sub_resource type="LabelSettings" id="LabelSettings_cqerb"]
font = ExtResource("3_h5gyd")
font_size = 30
font_size = 20
[node name="OrchidSaver" type="Area3D" unique_id=381308711]
script = ExtResource("1_tiit5")
Binary file not shown.
File diff suppressed because it is too large Load Diff
+160 -12
View File
@@ -1,13 +1,22 @@
[gd_scene format=3 uid="uid://csx7d5khjd6y5"]
[ext_resource type="Script" uid="uid://bj4d1x8n8ina" path="res://entities/interactable_3d/interactable_3d.gd" id="1_2si4a"]
[ext_resource type="Script" uid="uid://chedhuxpxro4k" path="res://entities/interactable_3d/phone/scripts/phone.gd" id="1_2si4a"]
[ext_resource type="AudioStream" uid="uid://ocm1dkkhv7ls" path="res://common/audio_manager/assets/sfx/phone/phone_ringing.wav" id="2_w00q2"]
[ext_resource type="PackedScene" uid="uid://5dytwh4wydcg" path="res://entities/interactable_3d/phone/assets/3d/phone.blend" id="3_lp5jo"]
[ext_resource type="Texture2D" uid="uid://dks6cugwif2em" path="res://common/icons/phone.svg" id="4_gtuax"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_mwti2"]
radius = 0.9633789
height = 2.4316406
radius = 0.87646484
height = 2.0859375
[sub_resource type="Gradient" id="Gradient_w00q2"]
offsets = PackedFloat32Array(0.020833334, 1)
colors = PackedColorArray(0.0627451, 0.05882353, 0.16862746, 1, 0.0627451, 0.05882353, 0.16862746, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_lp5jo"]
gradient = SubResource("Gradient_w00q2")
width = 139
height = 96
[sub_resource type="Animation" id="Animation_v4tdl"]
length = 0.001
@@ -23,6 +32,86 @@ tracks/0/keys = {
"update": 0,
"values": [Vector3(1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Model/Sprite3D:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Model/OffScreenBackground:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_gtuax"]
resource_name = "activated"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Model/Sprite3D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Model/OffScreenBackground:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_euiu0"]
resource_name = "deactivated"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Model/Sprite3D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.033333335),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Model/OffScreenBackground:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_lkqnn"]
resource_name = "hover"
@@ -43,36 +132,95 @@ tracks/0/keys = {
[sub_resource type="AnimationLibrary" id="AnimationLibrary_xa016"]
_data = {
&"RESET": SubResource("Animation_v4tdl"),
&"activated": SubResource("Animation_gtuax"),
&"deactivated": SubResource("Animation_euiu0"),
&"hover": SubResource("Animation_lkqnn")
}
[sub_resource type="Animation" id="Animation_1kswv"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Model:rotation:z")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_ckx3x"]
resource_name = "ring"
length = 1.95
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Model:rotation:z")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2, 0.3, 0.4, 0.5, 0.6, 0.70000005, 0.8000001, 1, 1.1, 1.2, 1.3, 1.4, 1.5000001, 1.6),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0.0, -0.03, 0.03, -0.03, 0.03, -0.03, 0.03, 0.0, -0.03, 0.03, -0.03, 0.03, -0.03, 0.03, 0.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_bc3p2"]
_data = {
&"RESET": SubResource("Animation_1kswv"),
&"ring": SubResource("Animation_ckx3x")
}
[node name="Phone" type="Area3D" unique_id=429299908 node_paths=PackedStringArray("hover_animation_player", "audio_player")]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 0)
transform = Transform3D(-1, 0, -1.509958e-07, 0, 1, 0, 1.509958e-07, 0, -1, 0, 0, 0)
script = ExtResource("1_2si4a")
hover_animation_player = NodePath("HoverAnimationPlayer")
audio_player = NodePath("AudioStreamPlayer3D")
metadata/_custom_type_script = "uid://bj4d1x8n8ina"
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=660671507]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.21582031, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5439453, 0)
shape = SubResource("CapsuleShape3D_mwti2")
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="." unique_id=73991663]
stream = ExtResource("2_w00q2")
bus = &"Sfx"
[node name="Model" parent="." unique_id=178278867 instance=ExtResource("3_lp5jo")]
[node name="Model" parent="." unique_id=1951271790 instance=ExtResource("3_lp5jo")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.000101934645, 0)
[node name="PhoneSignal" parent="Model" index="1" unique_id=2035875887]
transform = Transform3D(0.99678284, 0, -0.080149435, 0, 1, 0, 0.080149435, 0, 0.99678284, -0.27000237, 1.5518044, -0.16334502)
[node name="Sprite3D" type="Sprite3D" parent="Model" unique_id=2025147118]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1913681, 0.3055997, -0.095009446)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.023056125, 0.6826539, -0.33169416)
visible = false
pixel_size = 0.005
texture = ExtResource("4_gtuax")
[node name="OffScreenBackground" type="Sprite3D" parent="Model" unique_id=802126508]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.023056127, 0.6826539, -0.34936276)
pixel_size = 0.005
texture = SubResource("GradientTexture2D_lp5jo")
[node name="OmniLight3D" type="OmniLight3D" parent="Model" unique_id=1684592543]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 0.9238404, -0.47173643)
light_color = Color(0.87551093, 0.72609586, 0.8473426, 1)
shadow_enabled = true
omni_range = 1.8928293
[node name="AnimationPlayer" parent="Model" index="6" unique_id=636985304]
autoplay = &"Turning"
[node name="HoverAnimationPlayer" type="AnimationPlayer" parent="." unique_id=1414304456]
libraries/ = SubResource("AnimationLibrary_xa016")
[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=1684592543]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.9604645e-08, 1.0397238, -0.47173643)
light_color = Color(0.87551093, 0.72609586, 0.8473426, 1)
shadow_enabled = true
omni_range = 1.8928293
[node name="RingingAnimationPlayer" type="AnimationPlayer" parent="." unique_id=1401157488]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_bc3p2")
[editable path="Model"]
@@ -0,0 +1,21 @@
extends Interactable3D
class_name Phone
func click():
if interactable:
clicked.emit()
interactable = false
func set_interactable(i := interactable):
interactable = i
if is_node_ready() and hover_animation_player:
if i and hover_animation_player.has_animation("activated"):
hover_animation_player.play("activated")
if not i and hover_animation_player.has_animation("deactivated"):
hover_animation_player.play("deactivated")
if i :
%RingingAnimationPlayer.play("ring")
else:
%RingingAnimationPlayer.stop()
@@ -0,0 +1 @@
uid://chedhuxpxro4k
+3 -4
View File
@@ -112,9 +112,8 @@ fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(1, 0.5)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_6w4e0"]
radius = 25.393593
height = 50.787186
[sub_resource type="CircleShape2D" id="CircleShape2D_6w4e0"]
radius = 16.583923
[node name="Door" type="Area2D" unique_id=2053096538]
process_mode = 4
@@ -155,4 +154,4 @@ scale = Vector2(1.3906125, 1.3906125)
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=676936346]
position = Vector2(0, 12)
shape = SubResource("CapsuleShape2D_6w4e0")
shape = SubResource("CircleShape2D_6w4e0")
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dh6jdqoy2xu65"
path="res://.godot/imported/energy_cell_off.png-d0f76768f0abf3252fb82e90132330e5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/energy_cell/assets/sprites/energy_cell_off.png"
dest_files=["res://.godot/imported/energy_cell_off.png-d0f76768f0abf3252fb82e90132330e5.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ds65vxsiitxit"
path="res://.godot/imported/energy_cell_on.png-ddddaeafbe8fcf8fce63d8a58ab82019.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/energy_cell/assets/sprites/energy_cell_on.png"
dest_files=["res://.godot/imported/energy_cell_on.png-ddddaeafbe8fcf8fce63d8a58ab82019.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
@@ -0,0 +1,102 @@
[gd_scene format=3 uid="uid://d3fam2jq74kxq"]
[ext_resource type="Script" uid="uid://b25sqd4v2i3v2" path="res://entities/interactables/energy_cell/scripts/energy_cell.gd" id="1_nheea"]
[ext_resource type="Texture2D" uid="uid://ds65vxsiitxit" path="res://entities/interactables/energy_cell/assets/sprites/energy_cell_on.png" id="2_fnyaf"]
[ext_resource type="Texture2D" uid="uid://dh6jdqoy2xu65" path="res://entities/interactables/energy_cell/assets/sprites/energy_cell_off.png" id="3_t6ydv"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ylpt4"]
radius = 39.115215
[sub_resource type="Animation" id="Animation_lsc7u"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprites:scale:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1.0000001]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprites:scale:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1.0000001]
}
[sub_resource type="Animation" id="Animation_ei886"]
resource_name = "squeeze"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprites:scale:x")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.16666667, 0.33333334, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [1.0000001, 0.705, 1.5, 1.0000001]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprites:scale:y")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.16666667, 0.33333334, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [1.0000001, 1.5, 0.7, 1.0000001]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_d2c63"]
_data = {
&"RESET": SubResource("Animation_lsc7u"),
&"squeeze": SubResource("Animation_ei886")
}
[node name="EnergyCell" type="Area2D" unique_id=1375150025]
script = ExtResource("1_nheea")
used = true
default_interact_text = "OPEN"
available = false
default_info_title = "ENERGY_CELL"
default_info_desc = "ENERGY_CELL_DESC_TEXT"
metadata/_custom_type_script = "uid://dyprcd68fjstf"
[node name="Sprites" type="Node2D" parent="." unique_id=979185380]
scale = Vector2(1.0000001, 1.0000001)
[node name="SpriteOff" type="Sprite2D" parent="Sprites" unique_id=1278139902]
unique_name_in_owner = true
position = Vector2(0, -11.999998)
scale = Vector2(0.17999999, 0.17999999)
texture = ExtResource("3_t6ydv")
[node name="SpriteOn" type="Sprite2D" parent="Sprites" unique_id=750798992]
unique_name_in_owner = true
visible = false
position = Vector2(0, -11.999998)
scale = Vector2(0.17999999, 0.17999999)
texture = ExtResource("2_fnyaf")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=836925562]
position = Vector2(0, -11.999998)
shape = SubResource("CircleShape2D_ylpt4")
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1320210428]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_d2c63")
@@ -0,0 +1,38 @@
@tool
extends Interactable
class_name EnergyCell
const GIVEN_ENERGY = 1
@export var used = false : set = set_used
func _ready():
set_used()
func set_used(v = used):
used = v
available = not used
if is_node_ready():
%AnimationPlayer.play("squeeze")
await get_tree().create_timer(0.2).timeout
%SpriteOff.visible = used
%SpriteOn.visible = not used
func can_interact(p : Player) -> bool:
return p.data.energy < p.data.max_energy
func interact(p : Player) -> bool:
if not used and region:
used = true
available = false
p.data.energy += GIVEN_ENERGY
interacted.emit(p)
region.data.used_objects.append(name)
AudioManager.play_sfx("Recharge1")
return true
return false
@@ -0,0 +1 @@
uid://b25sqd4v2i3v2
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://daigb1xkyaytb"
path="res://.godot/imported/new_item.png-027fd9bb00b90a67f42e8f8d598ffa0e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/item_object/assets/sprites/new_item.png"
dest_files=["res://.godot/imported/new_item.png-027fd9bb00b90a67f42e8f8d598ffa0e.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
@@ -1,8 +1,10 @@
[gd_scene load_steps=8 format=3 uid="uid://bcj812ox8xv2t"]
[gd_scene format=3 uid="uid://bcj812ox8xv2t"]
[ext_resource type="Script" uid="uid://reliyx2pg7kf" path="res://entities/interactables/item_object/script/item_object_sprite.gd" id="1_wing4"]
[ext_resource type="Texture2D" uid="uid://daigb1xkyaytb" path="res://entities/interactables/item_object/assets/sprites/new_item.png" id="2_b6vos"]
[ext_resource type="Texture2D" uid="uid://bo3o2qf3i20ke" path="res://common/icons/scuba-diving-tank.svg" id="2_ng3e4"]
[ext_resource type="Texture2D" uid="uid://c1eiu5ag7lcp8" path="res://entities/interactables/item_object/assets/sprites/shadow.svg" id="2_ng201"]
[ext_resource type="Texture2D" uid="uid://dompaj451gklw" path="res://entities/player/assets/sprites/movement_particles.png" id="4_ng3e4"]
[sub_resource type="Animation" id="Animation_wing4"]
length = 0.001
@@ -95,22 +97,53 @@ _data = {
&"pickup": SubResource("Animation_ng3e4")
}
[node name="ItemObjectSprite" type="Node2D"]
[sub_resource type="Curve" id="Curve_b6vos"]
_data = [Vector2(0, 0.29213488), 0.0, 0.0, 0, 0, Vector2(0.3, 1), 0.0, 0.0, 0, 0, Vector2(0.63809526, 0.46067423), 0.0, 0.0, 0, 0, Vector2(0.9904762, 0.3820225), 0.0, 0.0, 0, 0]
point_count = 4
[sub_resource type="Gradient" id="Gradient_14kbc"]
offsets = PackedFloat32Array(0, 0.77729255, 1)
colors = PackedColorArray(0.5803922, 0.7058824, 0.8862745, 1, 0.5785, 0.70829165, 0.89, 1, 0.5785, 0.70829165, 0.89, 0)
[node name="ItemObjectSprite" type="Node2D" unique_id=69332129]
script = ExtResource("1_wing4")
[node name="Icon" type="Sprite2D" parent="."]
[node name="HasBeenInspectedSprite" type="Sprite2D" parent="." unique_id=446694920]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0.5803922)
position = Vector2(-1.4210855e-14, -13)
scale = Vector2(0.42, 0.42)
texture = ExtResource("2_b6vos")
[node name="Icon" type="Sprite2D" parent="." unique_id=2070904988]
texture = ExtResource("2_ng3e4")
[node name="Shadow" type="Sprite2D" parent="."]
[node name="Shadow" type="Sprite2D" parent="." unique_id=1621814025]
modulate = Color(1, 1, 1, 0.227451)
z_index = -1
position = Vector2(0, 23)
scale = Vector2(0.875, 0.875)
texture = ExtResource("2_ng201")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1385834581]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_ng3e4")
}
autoplay = "default"
libraries/ = SubResource("AnimationLibrary_ng3e4")
autoplay = &"default"
[node name="TractorBeam" type="CPUParticles2D" parent="." unique_id=382704689]
z_index = -1
position = Vector2(83, 0)
scale = Vector2(0.7, 0.7)
emitting = false
amount = 5
texture = ExtResource("4_ng3e4")
lifetime = 1.25
local_coords = true
particle_flag_align_y = true
direction = Vector2(-1, 0)
spread = 0.0
gravity = Vector2(0, 0)
initial_velocity_min = 100.0
initial_velocity_max = 100.0
scale_amount_curve = SubResource("Curve_b6vos")
color_ramp = SubResource("Gradient_14kbc")
@@ -3,26 +3,34 @@ class_name ItemObject
const ITEM_AREA_WIDTH = 20
const ITEM_SPRITE_SIZE = 40.
const SPRITE_SCENE : PackedScene = preload("res://entities/interactables/item_object/item_object_sprite.tscn")
const SPRITE_SCENE: PackedScene = preload("res://entities/interactables/item_object/item_object_sprite.tscn")
@export var item : Item :
@export var item: Item:
set(_item):
item = _item
if object_sprite:
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
object_sprite.generate_particles(item.get_particles())
object_sprite.set_has_been_inspected_sprite(item.has_been_inspected, item.get_rarity_color())
@onready var object_sprite : ItemObjectSprite = generate_sprite()
@onready var object_sprite: ItemObjectSprite = generate_sprite()
func _init(_item = null):
if _item:
item = _item
func inspect(is_inspected : bool = true):
item.has_been_inspected = true
object_sprite.set_has_been_inspected_sprite(item.has_been_inspected, item.get_rarity_color())
modulate = MODULATE_INSPECTED_COLOR if is_inspected else default_modulate
func _ready():
generate_collision(ITEM_AREA_WIDTH)
if item and object_sprite:
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
object_sprite.generate_particles(item.get_particles())
object_sprite.set_has_been_inspected_sprite(item.has_been_inspected, item.get_rarity_color())
func pointer_text() -> String:
var name_suffix = ""
@@ -42,21 +50,22 @@ func card_info() -> CardInfo:
func interact(player : Player) -> bool:
if player.can_pick_item(item):
await pickup_animation(player)
await pickup_animation(player.global_position)
queue_free()
player.pick_item(item)
item.has_been_inspected = true
return true
return false
func pickup_animation(player : Player):
func pickup_animation(target_position: Vector2):
available = false
var tween : Tween = get_tree().create_tween()
var tween: Tween = get_tree().create_tween()
if object_sprite:
object_sprite.pickup_animation()
await tween.tween_property(self, "position", player.position, 0.2).finished
Pointer.stop_inspect(self)
await tween.tween_property(self , "global_position", target_position, 0.2).finished
Pointer.stop_inspect(self )
func generate_sprite() -> ItemObjectSprite:
var sprite_node = SPRITE_SCENE.instantiate() as ItemObjectSprite
@@ -71,4 +80,4 @@ func generate_sprite() -> ItemObjectSprite:
return sprite_node
func save() -> EntityData:
return ItemObjectData.new(self)
return ItemObjectData.new(self )
@@ -1,7 +1,10 @@
extends Node2D
class_name ItemObjectSprite
const HAS_BEEN_INSPECTED_SPRITE_OPACITY = 0.3
@onready var icon_sprite = $Icon
@onready var tractor_beam: CPUParticles2D = $TractorBeam
const PARTICLES_SCENE : PackedScene = preload("res://common/vfx/particles/effect_particles.tscn")
@@ -22,5 +25,10 @@ func generate_particles(particles_params : Array[EffectParticles.Parameters]):
particles_emitter.setup_particles(params)
add_child(particles_emitter)
func set_has_been_inspected_sprite(has_been_inspected : bool, color := Color.WHITE):
color.a = HAS_BEEN_INSPECTED_SPRITE_OPACITY
%HasBeenInspectedSprite.visible = not has_been_inspected
%HasBeenInspectedSprite.modulate = color
func pickup_animation():
%AnimationPlayer.play("pickup")
Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bk2w3tophr7nh"
path="res://.godot/imported/talion_cell_off.png-f9e1927bb52c04ea9e2d4a53e89bb0e0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/talion_cell/assets/sprites/talion_cell_off.png"
dest_files=["res://.godot/imported/talion_cell_off.png-f9e1927bb52c04ea9e2d4a53e89bb0e0.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qef2wvgb62cb"
path="res://.godot/imported/talion_cell_on.png-a65f44148c257de0107a156068275044.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/talion_cell/assets/sprites/talion_cell_on.png"
dest_files=["res://.godot/imported/talion_cell_on.png-a65f44148c257de0107a156068275044.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
@@ -0,0 +1,40 @@
@tool
extends Interactable
class_name TalionCell
const SEED_RARITY = 2
@export var used = false : set = set_used
func _ready():
set_used()
func set_used(v = used):
used = v
available = not used
if is_node_ready():
%AnimationPlayer.play("squeeze")
await get_tree().create_timer(0.2).timeout
%SpriteOff.visible = used
%SpriteOn.visible = not used
func interact(p : Player) -> bool:
if not used and region:
used = true
available = false
var new_seed = Seed.generate_random(SEED_RARITY)
p.region.drop_item(
new_seed,
global_position,
10
)
interacted.emit(p)
region.data.used_objects.append(name)
AudioManager.play_sfx("Drop")
return true
return false
@@ -0,0 +1 @@
uid://1xhrot6srly6
@@ -0,0 +1,100 @@
[gd_scene format=3 uid="uid://cfxowdtmvxbtt"]
[ext_resource type="Script" uid="uid://1xhrot6srly6" path="res://entities/interactables/talion_cell/scripts/talion_cell.gd" id="1_lsc7u"]
[ext_resource type="Texture2D" uid="uid://bk2w3tophr7nh" path="res://entities/interactables/talion_cell/assets/sprites/talion_cell_off.png" id="2_ei886"]
[ext_resource type="Texture2D" uid="uid://qef2wvgb62cb" path="res://entities/interactables/talion_cell/assets/sprites/talion_cell_on.png" id="3_d2c63"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ylpt4"]
radius = 39.115215
[sub_resource type="Animation" id="Animation_lsc7u"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprites:scale:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1.0000001]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprites:scale:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1.0000001]
}
[sub_resource type="Animation" id="Animation_ei886"]
resource_name = "squeeze"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprites:scale:x")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.16666667, 0.33333334, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [1.0000001, 0.705, 1.5, 1.0000001]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprites:scale:y")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.16666667, 0.33333334, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [1.0000001, 1.5, 0.7, 1.0000001]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_d2c63"]
_data = {
&"RESET": SubResource("Animation_lsc7u"),
&"squeeze": SubResource("Animation_ei886")
}
[node name="TalionCell" type="Area2D" unique_id=1375150025]
script = ExtResource("1_lsc7u")
default_interact_text = "OPEN"
default_info_title = "TALION_CELL"
default_info_desc = "TALION_CELL_DESC_TEXT"
metadata/_custom_type_script = "uid://dyprcd68fjstf"
[node name="Sprites" type="Node2D" parent="." unique_id=979185380]
scale = Vector2(1.0000001, 1.0000001)
[node name="SpriteOff" type="Sprite2D" parent="Sprites" unique_id=1278139902]
unique_name_in_owner = true
visible = false
position = Vector2(0, -11.999998)
scale = Vector2(0.17999999, 0.17999999)
texture = ExtResource("2_ei886")
[node name="SpriteOn" type="Sprite2D" parent="Sprites" unique_id=750798992]
unique_name_in_owner = true
position = Vector2(0, -11.999998)
scale = Vector2(0.17999999, 0.17999999)
texture = ExtResource("3_d2c63")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=836925562]
position = Vector2(0, -11.999998)
shape = SubResource("CircleShape2D_ylpt4")
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1320210428]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_d2c63")
@@ -6,15 +6,18 @@ func _ready():
update()
func update():
%EnergyTextContainer.modulate = Color.WHITE if region.data.charges > 0 else Color.RED
%EnergyTextContainer.modulate = (
Color.WHITE if region.data.charges > 0 and region.data.state == RegionData.State.IN_PROGRESS
else Color.RED )
%EnergyText.text = str(region.data.charges)
if not region.data.pass_day_ended.is_connected(update):
region.data.pass_day_ended.connect(update)
func can_interact(_p : Player) -> bool:
return (
region != null
and region.data
and region.data.charges > 0
and region.data.state == RegionData.State.IN_PROGRESS
and region.data.charges > 0 and region.data.state == RegionData.State.IN_PROGRESS
)
func interact(_p: Player) -> bool:
@@ -15,9 +15,8 @@ font_size = 30
radius = 43.0
height = 116.0
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
radius = 38.45475
height = 76.9095
[sub_resource type="CircleShape2D" id="CircleShape2D_ot7vv"]
radius = 22.803507
[node name="TruckRecharge" type="Area2D" unique_id=1099196706]
script = ExtResource("1_ipgcv")
@@ -76,4 +75,4 @@ shape = SubResource("CapsuleShape2D_ot7vv")
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=842130596]
position = Vector2(12.000001, -41.000004)
rotation = 0.18545866
shape = SubResource("CapsuleShape2D_bjhct")
shape = SubResource("CircleShape2D_ot7vv")
@@ -2,6 +2,7 @@
extends InspectableEntity
class_name WinCristal
var order = 0
@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() :
@@ -20,7 +21,21 @@ func update():
func spawn_animation():
scale = Vector2.ZERO
%CristalPlayer.play()
match order:
0:
%CristalPlayer.play()
1:
%CristalPlayer2.play()
2:
%CristalPlayer3.play()
3:
%CristalPlayer4.play()
4:
%CristalPlayer5.play()
_:
%CristalPlayer6.play()
get_tree().create_tween().tween_property(self, "scale", Vector2.ONE, 0.3).set_trans(Tween.TRANS_BOUNCE)
func get_card_up_padding() -> float:
@@ -3,7 +3,12 @@
[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"]
[ext_resource type="AudioStream" uid="uid://bfhab51qe80j5" path="res://common/audio_manager/assets/sfx/fin_de_map/fin_de_map_cristal_1.wav" id="4_tfnwb"]
[ext_resource type="AudioStream" uid="uid://cr6y4e0p3xrqv" path="res://common/audio_manager/assets/sfx/fin_de_map/fin_de_map_cristal_2.wav" id="5_c8pdf"]
[ext_resource type="AudioStream" uid="uid://ccppo3l1vyd08" path="res://common/audio_manager/assets/sfx/fin_de_map/fin_de_map_cristal_3.wav" id="6_744fd"]
[ext_resource type="AudioStream" uid="uid://wphcqemoy810" path="res://common/audio_manager/assets/sfx/fin_de_map/fin_de_map_cristal_4.wav" id="7_am05r"]
[ext_resource type="AudioStream" uid="uid://v2snsj54xlkw" path="res://common/audio_manager/assets/sfx/fin_de_map/fin_de_map_cristal_5.wav" id="8_d7y1i"]
[ext_resource type="AudioStream" uid="uid://bvhnpk7pbh75t" path="res://common/audio_manager/assets/sfx/fin_de_map/fin_de_map_cristal_6.wav" id="9_laxd1"]
[sub_resource type="Resource" id="Resource_5lni1"]
script = ExtResource("2_vkbio")
@@ -30,11 +35,6 @@ region = Rect2(75, 527, 316, 399)
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")
@@ -50,6 +50,7 @@ shape = SubResource("CapsuleShape2D_vkbio")
unique_name_in_owner = true
[node name="AssetCristals" type="Sprite2D" parent="Sprites" unique_id=2111863528]
visible = false
scale = Vector2(0.4, 0.4)
texture = SubResource("AtlasTexture_5lni1")
offset = Vector2(0, -139.255)
@@ -63,7 +64,6 @@ 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)
@@ -78,5 +78,30 @@ flip_h = true
[node name="CristalPlayer" type="AudioStreamPlayer2D" parent="." unique_id=1879646229]
unique_name_in_owner = true
stream = SubResource("AudioStreamRandomizer_tfnwb")
stream = ExtResource("4_tfnwb")
bus = &"Sfx"
[node name="CristalPlayer2" type="AudioStreamPlayer2D" parent="." unique_id=786596923]
unique_name_in_owner = true
stream = ExtResource("5_c8pdf")
bus = &"Sfx"
[node name="CristalPlayer3" type="AudioStreamPlayer2D" parent="." unique_id=1324425771]
unique_name_in_owner = true
stream = ExtResource("6_744fd")
bus = &"Sfx"
[node name="CristalPlayer4" type="AudioStreamPlayer2D" parent="." unique_id=481950996]
unique_name_in_owner = true
stream = ExtResource("7_am05r")
bus = &"Sfx"
[node name="CristalPlayer5" type="AudioStreamPlayer2D" parent="." unique_id=155314990]
unique_name_in_owner = true
stream = ExtResource("8_d7y1i")
bus = &"Sfx"
[node name="CristalPlayer6" type="AudioStreamPlayer2D" parent="." unique_id=1866214122]
unique_name_in_owner = true
stream = ExtResource("9_laxd1")
bus = &"Sfx"
+6 -9
View File
@@ -6,27 +6,24 @@
[sub_resource type="AtlasTexture" id="AtlasTexture_khbsd"]
atlas = ExtResource("1_yh7e0")
region = Rect2(4497, 2359, 335, 454)
region = Rect2(1914, 1843, 213, 199)
[node name="Sprite" type="Sprite2D" unique_id=1642167049 node_paths=PackedStringArray("root", "attaches")]
texture = SubResource("AtlasTexture_khbsd")
script = ExtResource("2_a5yje")
part_name = "Base3"
part_name = "LeafE9"
type = 2
root = NodePath("Root")
attaches = NodePath("Attaches")
[node name="Root" type="Node2D" parent="." unique_id=1437082577]
position = Vector2(15, 184)
position = Vector2(-81, -42)
script = ExtResource("3_yh7e0")
attach_types = Array[int]([3])
[node name="Attaches" type="Node" parent="." unique_id=1834697767]
[node name="attach2" type="Node2D" parent="Attaches" unique_id=1063061640]
position = Vector2(-89, 45)
script = ExtResource("3_yh7e0")
attach_types = Array[int]([3])
[node name="attach1" type="Node2D" parent="Attaches" unique_id=539833351]
position = Vector2(-7, -161)
position = Vector2(-1, -24)
script = ExtResource("3_yh7e0")
attach_types = Array[int]([2])
+4 -3
View File
@@ -5,8 +5,8 @@
[ext_resource type="Texture2D" uid="uid://do3wxh7k38m7u" path="res://entities/plants/assets/sprites/seed_buried_texture.png" id="3_rbgiq"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_rbgiq"]
radius = 22.0
height = 50.0
radius = 26.0
height = 52.0
[sub_resource type="AtlasTexture" id="AtlasTexture_wyuub"]
atlas = ExtResource("3_j6jm5")
@@ -164,7 +164,7 @@ _data = {
script = ExtResource("1_pq8o7")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1893251777]
position = Vector2(0, -14)
position = Vector2(0, -2)
shape = SubResource("CapsuleShape2D_rbgiq")
[node name="Sprite" type="Sprite2D" parent="." unique_id=1693882598]
@@ -186,6 +186,7 @@ texture = ExtResource("3_rbgiq")
[node name="LifeTimeSprite" type="Sprite2D" parent="." unique_id=799762981]
unique_name_in_owner = true
visible = false
scale = Vector2(0.26000002, 0.26000005)
texture = SubResource("ViewportTexture_rbgiq")
@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://cqxmyd07qyj4g"]
[ext_resource type="Script" uid="uid://co46ywm8bgnfh" path="res://entities/plants/scripts/texture_builder/plant_attach.gd" id="1_us16y"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_attach.gd" id="1_us16y"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="2_ux8f6"]
[ext_resource type="Texture2D" uid="uid://bdwmandgxrjgn" path="res://entities/plants/assets/sprites/asset_plantes.png" id="3_qn1v0"]
@@ -4,34 +4,24 @@
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="2_nwj5t"]
[ext_resource type="Texture2D" uid="uid://bdwmandgxrjgn" path="res://entities/plants/assets/sprites/asset_plantes.png" id="3_n3ftt"]
[sub_resource type="Resource" id="Resource_0ss64"]
[sub_resource type="Resource" id="Resource_h5ver"]
script = ExtResource("1_h5ver")
position = Vector2(-46, 17)
position = Vector2(-41, -47)
attach_types = Array[int]([2])
[sub_resource type="Resource" id="Resource_0oofm"]
[sub_resource type="Resource" id="Resource_nwj5t"]
script = ExtResource("1_h5ver")
position = Vector2(116, 72)
attach_types = Array[int]([2])
[sub_resource type="Resource" id="Resource_yyxoq"]
script = ExtResource("1_h5ver")
position = Vector2(-38, -137)
attach_types = Array[int]([2])
[sub_resource type="Resource" id="Resource_0artd"]
script = ExtResource("1_h5ver")
position = Vector2(-11, -70)
attach_types = Array[int]([1, 3])
position = Vector2(60, -86)
attach_types = Array[int]([1])
[sub_resource type="AtlasTexture" id="AtlasTexture_yh7e0"]
atlas = ExtResource("3_n3ftt")
region = Rect2(1914, 1843, 213, 199)
region = Rect2(2802, 1568, 295, 348)
[resource]
resource_name = "LeafE7"
script = ExtResource("2_nwj5t")
texture = SubResource("AtlasTexture_yh7e0")
type = 2
root = SubResource("Resource_0artd")
attaches = Array[ExtResource("1_h5ver")]([SubResource("Resource_0ss64"), SubResource("Resource_0oofm"), SubResource("Resource_yyxoq")])
root = SubResource("Resource_nwj5t")
attaches = Array[ExtResource("1_h5ver")]([SubResource("Resource_h5ver")])
@@ -4,34 +4,34 @@
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="2_msfms"]
[ext_resource type="Texture2D" uid="uid://bdwmandgxrjgn" path="res://entities/plants/assets/sprites/asset_plantes.png" id="3_6eoa5"]
[sub_resource type="Resource" id="Resource_c3714"]
[sub_resource type="Resource" id="Resource_jbdpq"]
script = ExtResource("1_04w7e")
position = Vector2(-185, 82)
attach_types = Array[int]([2])
[sub_resource type="Resource" id="Resource_ia8hj"]
[sub_resource type="Resource" id="Resource_n4gj3"]
script = ExtResource("1_04w7e")
position = Vector2(-9, -37)
attach_types = Array[int]([2])
[sub_resource type="Resource" id="Resource_5a0lt"]
[sub_resource type="Resource" id="Resource_ymggq"]
script = ExtResource("1_04w7e")
position = Vector2(143, 24)
attach_types = Array[int]([2])
[sub_resource type="Resource" id="Resource_ee445"]
[sub_resource type="Resource" id="Resource_fbydt"]
script = ExtResource("1_04w7e")
position = Vector2(-196, 104)
attach_types = Array[int]([1, 3])
[sub_resource type="AtlasTexture" id="AtlasTexture_yh7e0"]
atlas = ExtResource("3_6eoa5")
region = Rect2(20, 2801, 461, 266)
region = Rect2(20, 2820, 461, 231)
[resource]
resource_name = "LeafH3"
resource_name = "LeafHA3"
script = ExtResource("2_msfms")
texture = SubResource("AtlasTexture_yh7e0")
type = 2
root = SubResource("Resource_ee445")
attaches = Array[ExtResource("1_04w7e")]([SubResource("Resource_c3714"), SubResource("Resource_ia8hj"), SubResource("Resource_5a0lt")])
root = SubResource("Resource_fbydt")
attaches = Array[ExtResource("1_04w7e")]([SubResource("Resource_jbdpq"), SubResource("Resource_n4gj3"), SubResource("Resource_ymggq")])
+3 -3
View File
@@ -9,10 +9,10 @@ const HARVESTED_SEED_DISPLACEMENT_FACTOR = 100
const RANDOM_MAX_GROW_INTERVAL = Region.MIN_PASS_DAY_ANIMATION_TIME/2. - 0.1
const PLANT_TYPE_ICON = preload("res://common/icons/seedling.svg")
const SCORE_ICON = preload("res://common/icons/growth.svg")
const DURATION_ICON = preload("res://common/icons/calendar-week.svg")
const DURATION_ICON = preload("res://common/icons/clock.svg")
const SHOVEL_ICON = preload("res://common/icons/shovel.svg")
const GROWING_ICON = preload("res://common/icons/chevrons-up.svg")
const LIFETIME_ICON= preload("res://common/icons/clock.svg")
const GROWING_ICON = preload("res://common/icons/clock-up.svg")
const LIFETIME_ICON= preload("res://common/icons/clock-death.svg")
const SEED_ICON = preload("res://common/icons/seeds.svg")
const SPRITE_SCENE : PackedScene = preload("res://entities/plants/plant_sprite.tscn")
+3 -3
View File
@@ -67,12 +67,12 @@ func get_growing_time() -> int:
for m in mutations:
growing_time = m.mutate_growing_time(self , growing_time)
return growing_time
return max(1,growing_time)
func get_score(state: State = get_state()) -> int:
var score = get_plant_info().get_base_score() if state == State.MATURE else 0
var mult := 1
var mult := 1.
for m in mutations:
score = m.mutate_score(self , score)
@@ -81,7 +81,7 @@ func get_score(state: State = get_state()) -> int:
for pd in nearby_plants:
score += pd.get_score_buff()
return max(0,score) * max(0,mult)
return ceili(max(0,score) * max(0,mult))
func get_state() -> State:
if day >= get_lifetime():
+18 -18
View File
@@ -5,26 +5,26 @@ var radius : int
var sprite : Circle
var collision_shape : CollisionShape2D
var show_influence : bool = false :
set(v):
show_influence = v
if sprite:
sprite.visible = v
set(v):
show_influence = v
if sprite:
sprite.visible = v
func _init(_radius = 100):
radius = _radius
radius = _radius
func _ready():
sprite = Circle.new()
# sprite.z_index = 100
sprite.radius = radius
sprite.fill = false
sprite.width = 1
sprite.opacity = 0.5
sprite.visible = show_influence
add_child(sprite)
sprite = Circle.new()
# sprite.z_index = 100
sprite.radius = radius
sprite.fill = false
sprite.width = 1
sprite.opacity = 0.5
sprite.visible = show_influence
add_child(sprite)
collision_shape = CollisionShape2D.new()
var circle_shape : CircleShape2D = CircleShape2D.new()
circle_shape.radius = radius
collision_shape.shape = circle_shape
add_child(collision_shape)
collision_shape = CollisionShape2D.new()
var circle_shape : CircleShape2D = CircleShape2D.new()
circle_shape.radius = radius
collision_shape.shape = circle_shape
add_child(collision_shape)
+8 -5
View File
@@ -2,6 +2,8 @@
extends Resource
class_name PlantMutation
const MAX_RARITY = 6
@export var level: int = 1
var id: String: get = get_mutation_id
@@ -32,7 +34,7 @@ func has_score(_plant_data: PlantData) -> bool:
func mutate_score(_plant_data: PlantData, score: int) -> int:
return score
func mutate_score_multiplier(_plant_data: PlantData, multiplier: int) -> int:
func mutate_score_multiplier(_plant_data: PlantData, multiplier: float) -> float:
return multiplier
func mutate_lifetime(_plant_data: PlantData, lifetime: int) -> int:
@@ -124,10 +126,11 @@ static func get_rarity_text(rarity) -> String:
static func get_rarity_color(rarity: int) -> Color:
var rarity_colors: Array[Color] = [
Color("2364AA"),
Color("25C147"),
Color("8B2DFF"),
Color("FF006E"),
Color("25c147"),
Color("00c6ca"),
Color("8b2dff"),
Color("ff006e"),
Color("ff5427"),
Color("FFA617"),
]
@@ -2,7 +2,7 @@
extends PlantMutation
class_name AncientMutation
const DEFAULT_DAY_FACTOR = 4
const DEFAULT_DAY_FACTOR = 3
func get_icon() -> Texture:
return preload("res://common/icons/wood.svg")
@@ -21,11 +21,15 @@ func get_mutation_description() -> String:
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
})
func mutate_seed_buff(_plant_data: PlantData, seed_buff) -> int:
return seed_buff + get_seed_buff()
func mutate_seed_buff(data: PlantData, seed_buff) -> int:
if data.get_state() == PlantData.State.MATURE:
return seed_buff + get_seed_buff()
return seed_buff
func mutate_score(_plant_data: PlantData, score: int) -> int:
return score + get_score_change()
func mutate_score(data: PlantData, score: int) -> int:
if data.get_state() == PlantData.State.MATURE:
return score + get_score_change()
return score
func get_seed_buff():
return level
@@ -16,8 +16,8 @@ func get_mutation_description() -> String:
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON)
})
func mutate_score_multiplier(plant_data: PlantData, multiplier: int) -> int:
return multiplier - 1
func mutate_score_multiplier(_pd: PlantData, _m: float) -> float:
return 0
func mutate_score_buff(plant_data: PlantData, score_buff : int) -> int:
if plant_data.get_state() == PlantData.State.MATURE:
@@ -2,7 +2,7 @@ extends PlantMutation
class_name ProlificMutation
func get_icon() -> Texture:
return preload("res://common/icons/droplets.svg")
return preload("res://common/icons/seeds.svg")
func get_mutation_id() -> String:
return "PROLIFIC"
@@ -16,7 +16,7 @@ func get_mutation_description() -> String:
"score_multiplier": get_score_multiplier() + 1,
})
func mutate_score_multiplier(plant_data: PlantData, multiplier: int) -> int:
func mutate_score_multiplier(plant_data: PlantData, multiplier: float) -> float:
if plant_data.decontamination_area_factor == 1.0:
return multiplier + get_score_multiplier()
return multiplier
@@ -1,7 +1,7 @@
extends PlantMutation
class_name SocialMutation
const DEFAULT_PLANT_BY_POINT = 4
const DEFAULT_PLANT_BY_POINT = 3
func get_icon() -> Texture:
return preload("res://common/icons/users-group.svg")
@@ -13,19 +13,19 @@ func get_mutation_name() -> String:
func get_mutation_description() -> String:
return tr("TOUGH_EFFECT_TEXT").format({
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
"score_multiplier": get_score_multiplier(),
"score_multiplier": get_score_multiplier() + 1.,
"growing_time": get_growing_time_increase(),
"growing_icon": Text.bbcode_icon(Plant.GROWING_ICON)
})
func mutate_score_multiplier(_plant_data: PlantData, multiplier: int) -> int:
return multiplier * get_score_multiplier()
func mutate_score_multiplier(_plant_data: PlantData, multiplier: float) -> float:
return multiplier + get_score_multiplier()
func mutate_growing_time(_plant_data: PlantData, growing_time: int) -> int:
return maxi(0, growing_time + get_growing_time_increase())
return growing_time + maxi(0, get_growing_time_increase())
func get_growing_time_increase()->int:
return 4 - level
func get_score_multiplier()->int:
return 2
func get_score_multiplier()->float:
return 0.5 * level
+2 -2
View File
@@ -56,8 +56,8 @@ func start_harvest_animation():
func set_display_lifetime_sprite(d := display_lifetime_sprite):
display_lifetime_sprite = d
if is_node_ready():
%LifeTimeSprite.visible = d
# if is_node_ready():
# %LifeTimeSprite.visible = d
func set_sprite_modulate(c := sprite_modulate):
sprite_modulate = c
@@ -77,7 +77,7 @@ func shuffle_weighted(array: Array, weights: Array[int]):
weights[i] = originalWeights[indices[i]]
func get_mutation_weight(level: int) -> int:
return 3 * level
return 2 * level
func build_seed_texture(random_seed: int) -> Texture:
rng.seed = random_seed
@@ -126,16 +126,19 @@ func build_plant_texture(plant_data: PlantData) -> Texture:
var weight_per_origin_type: Array[int] = origin_weights_base.values().duplicate()
var parts_to_place: Dictionary[OriginType, Array] # BRANCH_ORIGIN : Array[PlantPart], MUTATION_ORIGIN : Array[Array[PlantPart]], BASE_LEAF_ORIGIN : Array[PlantPart]
parts_to_place[OriginType.BRANCH_ORIGIN] = branches
parts_to_place[OriginType.BRANCH_ORIGIN] = branches.duplicate()
parts_to_place[OriginType.MUTATION_ORIGIN] = []
parts_to_place[OriginType.BASE_LEAF_ORIGIN] = base_leaves
parts_to_place[OriginType.BASE_LEAF_ORIGIN] = base_leaves.duplicate()
var mutation_weights: Array[int] = []
for mutation in plant_data.mutations:
if mutation.id in parts_mutation_associations:
parts_to_place[OriginType.MUTATION_ORIGIN].append(parts_mutation_associations[mutation.id].parts)
var mutation_parts := parts_mutation_associations[mutation.id].parts
parts_to_place[OriginType.MUTATION_ORIGIN].append(mutation_parts)
var mutation_weight := get_mutation_weight(mutation.level)
mutation_weights.append(mutation_weight)
weight_per_origin_type[OriginType.MUTATION_ORIGIN] += mutation_weight
if len(parts_to_place[OriginType.BASE_LEAF_ORIGIN]) > 0 and mutation_parts[0].type == PlantPart.PartType.LEAF_PART:
parts_to_place[OriginType.BASE_LEAF_ORIGIN].clear()
var flipped: bool = rng.randi() % 2 == 0
@@ -197,8 +200,8 @@ func get_part(all_parts: Dictionary[OriginType, Array], weight_per_origin_type:
var ind := find_random_matching_attach_ind(attach, all_parts[origin])
if ind >= 0:
weight_per_origin_type[origin] -= origin_weight_loss
weight_per_origin_type[((origin + 1) % 3) as OriginType] += origin_weight_gain
weight_per_origin_type[((origin + 2) % 3) as OriginType] += origin_weight_gain
for i in range(len(weight_per_origin_type) - 1):
weight_per_origin_type[((origin + i + 1) % 3)] += origin_weight_gain
return all_parts[origin][ind]
else: # find a mutation part to place
if weight_copy[originIndInd] < 0:
@@ -213,8 +216,8 @@ func get_part(all_parts: Dictionary[OriginType, Array], weight_per_origin_type:
mutation_weights[i] += mutation_weight_gain
mutation_weights[mutation_parts_ind] -= mutation_weight_gain + mutation_weight_loss
weight_per_origin_type[origin] -= origin_weight_loss
weight_per_origin_type[(origin + 1) % 3] += origin_weight_gain
weight_per_origin_type[(origin + 2) % 3] += origin_weight_gain
for i in range(len(weight_per_origin_type) - 1):
weight_per_origin_type[((origin + i + 1) % 3)] += origin_weight_gain
return parts_per_mutations[mutation_parts_ind][ind]
return null
+24 -3
View File
@@ -17,7 +17,10 @@ func _init(size : int = 1):
seeds_size = size
func current_is_tool() -> bool:
return current_item_ind < len(tools)
return ind_is_tool(current_item_ind)
func ind_is_tool(ind:int)->bool:
return ind < len(tools)
func set_current_item(new_ind: int):
if new_ind < 0:
@@ -73,16 +76,34 @@ func update_seeds_size(size = seeds_size):
while len(seeds) > size and seeds.find(null) != -1:
seeds.pop_at(seeds.find(null))
func add_item_at(item: Item, item_ind: int) -> bool:
if item.type == Item.ItemType.CONSUMABLE_ITEM:
return add_seed_at(item, item_ind - len(tools))
else:
return false
func add_seed_at(s: Item, seed_ind: int) -> bool:
update_seeds_size()
if seeds[seed_ind]:
return false
else:
seeds[seed_ind] = s
updated.emit(self)
return true
func get_all_items_size() -> int:
return len(tools) + len(seeds)
func get_all_items() -> Array[Item]:
return tools + seeds
func get_item(ind: int = current_item_ind) -> Item:
if ind < 0 || ind > len(get_all_items()):
if ind < 0 || ind > get_all_items_size():
return null
return get_all_items()[ind]
func has_item(item: Item) -> bool:
return get_all_items().has(item)
return tools.has(item) || seeds.has(item)
func has_item_with_name(name: String) -> bool:
var id = get_all_items().find_custom(
+21 -1
View File
@@ -14,8 +14,10 @@ enum ItemType {TOOL_ITEM, CONSUMABLE_ITEM}
@export var type: ItemType : get = get_item_type
@export var description: String : get = get_description
var icon: Texture2D : get = get_icon
var pointer: Texture2D : get = get_pointer
@export var usage_zone_radius: int = 5 : get = get_usage_zone_radius
@export var energy_usage : int = 1 : get = get_energy_used
@export var has_been_inspected : bool = false
func get_item_name() -> String:
return name
@@ -29,6 +31,15 @@ func get_description() -> String:
func get_icon() -> Texture2D:
return icon
func get_pointer() -> Texture2D:
return null
func get_clicked_pointer() -> Texture2D:
return null
func is_pointer_center() -> bool:
return false
func get_energy_used() -> int:
return energy_usage
@@ -44,12 +55,18 @@ func is_action_need_press_time() -> bool:
func get_action_press_time() -> float:
return DEFAULT_PRESS_TIME
func get_usage_object_affected(_i : Area2D) -> bool:
func deactivate_interactable() -> bool:
return false
func get_usage_objects_affected(_areas : Array[Area2D], _zone : Player.ActionZone) -> Array[Area2D]:
return []
func is_one_time_use():
return false
func snap_usage_to_grid():
return false
func can_use(_player : Player, _zone: Player.ActionZone) -> bool:
return false
@@ -88,3 +105,6 @@ func card_info() -> CardInfo:
func get_particles() -> Array[EffectParticles.Parameters]:
return []
func get_rarity_color() -> Color:
return Color.WHITE
@@ -13,6 +13,9 @@ func get_description() -> String:
func get_icon() -> Texture2D:
return preload("res://common/icons/broadcast.svg")
func get_pointer() -> Texture2D:
return preload("res://gui/pointer/assets/cursors/pointer-signal.svg")
func get_energy_used() -> int:
return 0
@@ -33,4 +36,3 @@ func use(player : Player, zone: Player.ActionZone):
detector_signal.global_position = zone.get_global_position()
player.region.add_child(detector_signal)
AudioManager.play_sfx("Signal")
+21 -11
View File
@@ -12,35 +12,45 @@ func get_description() -> String:
func get_icon() -> Texture2D:
return preload("res://common/icons/fork.svg")
func get_pointer() -> Texture2D:
return preload("res://gui/pointer/assets/cursors/pointer-fork.svg")
func get_item_type() -> ItemType:
return Item.ItemType.TOOL_ITEM
func snap_usage_to_grid():
return true
func get_energy_used() -> int:
return 1
func get_usage_zone_radius() -> int:
return 10
func get_usage_object_affected(i : Area2D) -> bool:
return i is Plant
func get_usage_objects_affected(areas : Array[Area2D], zone : Player.ActionZone) -> Array[Area2D]:
areas = areas.filter(
func (a): return a is Plant and a.position.distance_to(zone.area.position) < 5
)
if len(areas) == 0:
return []
else:
return [areas[0]]
func use_text() -> String:
return tr("HARVEST")
func can_use(_player : Player, zone : Player.ActionZone) -> bool:
var areas = zone.get_affected_areas()
for area in areas :
if area is Plant:
return true
var areas = get_usage_objects_affected(zone.get_affected_areas(), zone)
if len(areas) > 0:
return true
return false
func use(player : Player, zone : Player.ActionZone) -> bool:
var has_plant = false
for area in zone.get_affected_areas():
if area and area is Plant:
harvest(area, player)
await player.get_tree().create_timer(USE_INTERVAL).timeout
has_plant = true
var areas = get_usage_objects_affected(zone.get_affected_areas(), zone)
if len(areas) > 0:
harvest(areas[0], player)
has_plant = true
return has_plant
func harvest(p : Plant, _player: Player):
@@ -12,6 +12,9 @@ func get_description() -> String:
func get_icon() -> Texture2D:
return preload("res://common/icons/pick.svg")
func get_pointer() -> Texture2D:
return preload("res://gui/pointer/assets/cursors/pointer-dig.svg")
func get_energy_used() -> int:
return 1
+42 -11
View File
@@ -2,7 +2,6 @@ extends Item
class_name Seed
const SHOVEL_ICON = preload("res://common/icons/shovel.svg")
const GROWING_ICON = preload("res://common/icons/chevrons-up.svg")
const SCORE_ICON = preload("res://common/icons/growth.svg")
@export var plant_name : String
@@ -21,12 +20,16 @@ func _init(
static func generate_from_parent(plant_data : PlantData) -> Seed:
var mutations : Array[PlantMutation] = plant_data.mutations
var mutation_probability = GameInfo.game_data.current_run.plant_info.get_mutation_probability()
# Mutate for every time mutation probability exceed 1
while mutation_probability > 1:
mutations = mutate_mutations(plant_data.mutations)
mutation_probability -= 1
mutations.sort_custom(
func (a : PlantMutation, b : PlantMutation): return a.get_mutation_name() < b.get_mutation_name()
)
if (
plant_data.get_state() == PlantData.State.MATURE
and randf() < GameInfo.game_data.current_run.plant_info.get_mutation_probability()
@@ -62,14 +65,22 @@ func get_icon() -> Texture2D:
stored_icon = PlantTextureBuilder.build_seed_texture(plant_name.hash())
return stored_icon
func get_pointer() -> Texture2D:
return preload("res://gui/pointer/assets/cursors/pointer-seed.svg")
func get_energy_used() -> int:
return 1
func get_usage_zone_radius() -> int:
return 50
return 10
func get_usage_object_affected(i : Area2D) -> bool:
return i is PlantSprite
func get_usage_objects_affected(areas : Array[Area2D], _zone : Player.ActionZone) -> Array[Area2D]:
return areas.filter(
func(a): return a is PlantSprite
)
func snap_usage_to_grid():
return true
func use_text() -> String:
return tr("PLANT_%s") % plant_name
@@ -85,13 +96,12 @@ 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 PlantSprite:
if area is PlantSprite or area is TruckRecharge:
is_there_a_plant_here = true
var plant_tiles = Math.get_tiles_in_circle(
var plant_tiles = [Math.get_tile_from_pos(
zone.get_global_position(),
20
)
)] as Array[Vector2i]
return (
not is_there_a_plant_here
@@ -150,6 +160,15 @@ func get_particles() -> Array[EffectParticles.Parameters]:
return param
func get_rarity_color() -> Color:
var higher_rarity : int = -1
var higher_color : Color = Color.WHITE
for m in plant_mutations:
if m.get_rarity() > higher_rarity:
higher_rarity = m.get_rarity()
higher_color = PlantMutation.get_rarity_color(higher_rarity)
return higher_color
static func generate_first_mutations(rarity := 0) -> Array[PlantMutation]:
if rarity < 0:
@@ -168,13 +187,17 @@ static func generate_first_mutations(rarity := 0) -> Array[PlantMutation]:
static func mutate_mutations(mutations : Array[PlantMutation]) -> Array[PlantMutation]:
var mutation_possibility : Array[MutationPossibility] = []
var evolvable_mutations : Array[PlantMutation] = mutations.filter(
func (m : PlantMutation): return m.get_rarity() < PlantMutation.MAX_RARITY
)
if (
len(mutations) < GameInfo.game_data.current_run.plant_info.get_mutation_max_number()
):
mutation_possibility.append(AddMutation.new())
if len(mutations) > 0:
if len(evolvable_mutations) > 0:
mutation_possibility.append(UpgradeMutation.new())
var chosen_mutation_possibility = mutation_possibility.pick_random()
@@ -206,7 +229,15 @@ class UpgradeMutation extends MutationPossibility:
) -> Array[PlantMutation]:
var new_mutations = mutations.duplicate_deep()
new_mutations.pick_random().level += 1
var evolvable_mutations_id : Array[int] = []
for i in range(len(mutations)):
var m = mutations[i]
if m.get_rarity() < PlantMutation.MAX_RARITY:
evolvable_mutations_id.append(i)
if len(evolvable_mutations_id):
new_mutations[evolvable_mutations_id.pick_random()].level += 1
return new_mutations
@@ -13,6 +13,9 @@ func get_description() -> String:
func get_icon() -> Texture2D:
return preload("res://common/icons/rocket.svg")
func get_pointer() -> Texture2D:
return preload("res://gui/pointer/assets/cursors/pointer-ship.svg")
func get_energy_used() -> int:
return 0
@@ -17,8 +17,14 @@ func get_icon() -> Texture2D:
func get_usage_zone_radius() -> int:
return SHOVEL_ZONE_RADIUS
func get_usage_object_affected(i : Area2D) -> bool:
return i is Plant
func get_usage_objects_affected(areas : Array[Area2D], zone : Player.ActionZone) -> Array[Area2D]:
areas.sort_custom(
func (a1,a2): return a1.position.distance_to(zone.area.position) - a2.position.distance_to(zone.area.position)
)
if len(areas) == 0:
return []
else:
return [areas[0]]
func use_text() -> String:
return tr("DIG")
@@ -0,0 +1,59 @@
extends Item
class_name TractorBeam
const USE_INTERVAL = 0.15
func get_item_name() -> String:
return tr("TRACTOR_BEAM")
func get_description() -> String:
return tr("TRACTOR_BEAM_DESC_TEXT")
func get_icon() -> Texture2D:
return preload("res://common/icons/tractor-beam.svg")
func get_pointer() -> Texture2D:
return preload("res://gui/pointer/assets/cursors/pointer-hand.svg")
func get_clicked_pointer() -> Texture2D:
return preload("res://gui/pointer/assets/cursors/pointer-grab.svg")
func is_pointer_center() -> bool:
return true
func get_item_type() -> ItemType:
return Item.ItemType.TOOL_ITEM
func get_energy_used() -> int:
return 0
func get_usage_zone_radius() -> int:
return 0
func is_usage_need_proximity() -> bool:
return false
func deactivate_interactable() -> bool:
return true
func use_text() -> String:
return tr("")
func can_use(_player: Player, _zone: Player.ActionZone) -> bool:
return Pointer.inspected != null
func use(_player: Player, _zone: Player.ActionZone) -> bool:
if Pointer.dragging_inspected:
Pointer.stop_dragging()
if !Pointer.dragging_inspected:
AudioManager.play_sfx("TractorBeamDrop")
return true
else:
return false
else:
Pointer.start_dragging()
if Pointer.dragging_inspected:
AudioManager.play_sfx("TractorBeamTake")
return true
else:
return false
@@ -0,0 +1 @@
uid://drs03fydfofxx
@@ -2,6 +2,7 @@
extends Node2D
class_name DetectorSignal
const SIGNAL_DURATION = 1.2
const PARTICLES_DISTANCE = 180
const ICON_SIZE = 40
@@ -12,9 +13,18 @@ const DEFAULT_ICON = preload("res://common/icons/north-star.svg")
const ENERGY_ICON = preload("res://common/icons/bolt.svg")
const DOOR_ICON = preload("res://common/icons/logout.svg")
const PLANT_ICON = preload("res://common/icons/seedling.svg")
const SOUND_SOURCE : AudioStreamMP3 = preload("res://common/audio_manager/assets/sfx/signal/signal.mp3")
const SOUND_BASE_PITCH = 1.
const SOUND_NIVEL_LEVEL = 6
const CELL_DETECTION_MAX_DISTANCE = 2000.
const CELL_DETECTION_COLOR : Color = Color("#ff006e")
const CELL_DETECTION_MAX_PITCH = 1.5
var started_time = 0.
var signals : Array[DetectorSignalIndividual] = []
var nearest_cell : Node2D
var nearest_cell_distance := CELL_DETECTION_MAX_DISTANCE
@export_tool_button("Start", "Callable") var start = func(): started_time = 0
@@ -37,6 +47,15 @@ func _init(region : Region, pos : Vector2):
Color("ffa617ff")
),
)
if (
(e is EnergyCell
or e is TalionCell)
and e.available
and e.global_position.distance_to(pos) < nearest_cell_distance
):
nearest_cell = e
nearest_cell_distance = e.global_position.distance_to(pos)
# if e is Plant:
# signals.append(
# DetectorSignalIndividual.new(
@@ -44,15 +63,37 @@ func _init(region : Region, pos : Vector2):
# PLANT_ICON
# )
# )
func _ready():
var player = AudioStreamPlayer2D.new()
player.stream = SOUND_SOURCE
player.volume_db = -10
player.bus = &"Sfx"
player.pitch_scale = lerp(
CELL_DETECTION_MAX_PITCH,
SOUND_BASE_PITCH,
nearest_cell_distance/CELL_DETECTION_MAX_DISTANCE
)
player.pitch_scale = ceil(player.pitch_scale * SOUND_NIVEL_LEVEL) / SOUND_NIVEL_LEVEL
add_child(player)
player.play()
func _draw():
if started_time < SIGNAL_DURATION:
var color = lerp(
CELL_DETECTION_COLOR,
Color.WHITE,
nearest_cell_distance/CELL_DETECTION_MAX_DISTANCE
)
color.a = 0.7*1-started_time/SIGNAL_DURATION
draw_circle(
Vector2.ZERO,
started_time/SIGNAL_DURATION * PARTICLES_DISTANCE,
Color(1.,1.,1.,0.5*1-started_time/SIGNAL_DURATION),
color,
false,
5.
8.
)
for s in signals:
draw_texture_rect(
+52 -4
View File
@@ -6,6 +6,7 @@
[ext_resource type="Texture2D" uid="uid://c7ff87jniga5m" path="res://entities/player/assets/sprites/robot.png" id="4_bls4j"]
[ext_resource type="Texture2D" uid="uid://drgl0d51d4cf7" path="res://entities/player/assets/sprites/radial-gradient.png" id="5_8fjmc"]
[ext_resource type="Script" uid="uid://b1mmtgmi5oq86" path="res://entities/player/scripts/player_sprite.gd" id="5_fkugw"]
[ext_resource type="Texture2D" uid="uid://51255tpyl6vj" path="res://common/icons/no-bolt.svg" id="7_26q78"]
[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"]
@@ -15,13 +16,13 @@ radius = 13.0
radius = 40.0
[sub_resource type="Gradient" id="Gradient_qiwj3"]
offsets = PackedFloat32Array(0.37339056, 0.49785408)
offsets = PackedFloat32Array(0.25, 0.4)
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
width = 1000
height = 1000
fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(0.5, 0)
@@ -136,6 +137,41 @@ point_count = 2
offsets = PackedFloat32Array(0, 0.77729255, 1)
colors = PackedColorArray(0.5803922, 0.7058824, 0.8862745, 1, 0.5785, 0.70829165, 0.89, 1, 0.5785, 0.70829165, 0.89, 0)
[sub_resource type="Animation" id="Animation_bectd"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
[sub_resource type="Animation" id="Animation_wvtmh"]
resource_name = "bounce"
loop_mode = 1
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(2, 2),
"points": PackedFloat32Array(-1097.2793, 0, 0, 0, -139.75659, -1097.2793, 0, -112.66321, 0, 0),
"times": PackedFloat32Array(0, 1)
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7thud"]
_data = {
&"RESET": SubResource("Animation_bectd"),
&"bounce": SubResource("Animation_wvtmh")
}
[sub_resource type="Animation" id="Animation_fkugw"]
length = 0.001
tracks/0/type = "value"
@@ -256,6 +292,7 @@ position = Vector2(0, -17)
shape = SubResource("CircleShape2D_sglur")
[node name="InteractArea2D" type="Area2D" parent="." unique_id=1048722411]
unique_name_in_owner = true
position = Vector2(0, -12)
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea2D" unique_id=1242017003]
@@ -271,7 +308,7 @@ 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)
scale = Vector2(5.8320003, 5.8320003)
texture = SubResource("GradientTexture2D_26q78")
[node name="PlayerSprite" type="AnimatedSprite2D" parent="." unique_id=638545037]
@@ -303,6 +340,17 @@ gravity = Vector2(0, 100)
scale_amount_curve = SubResource("Curve_fkugw")
color_ramp = SubResource("Gradient_bls4j")
[node name="NoEnergyLeftIcon" type="Sprite2D" parent="PlayerSprite" unique_id=1059424679]
unique_name_in_owner = true
modulate = Color(1, 0, 0.43137255, 1)
position = Vector2(-15.239998, 0)
scale = Vector2(10.16, 10.16)
texture = ExtResource("7_26q78")
[node name="AnimationPlayer" type="AnimationPlayer" parent="PlayerSprite/NoEnergyLeftIcon" unique_id=390014722]
libraries/ = SubResource("AnimationLibrary_7thud")
autoplay = &"bounce"
[node name="MovementAudioStreamPlayer" type="AudioStreamPlayer" parent="." unique_id=20243230]
unique_name_in_owner = true
stream = ExtResource("7_qiwj3")
+101 -23
View File
@@ -6,13 +6,13 @@ const MAX_REACH = 100
const HOLDING_ITEM_SPRITE_SIZE = 20.
const TURN_ANIMATION_MINIMUM_THRESHOLD = 0.2
const SPEED = 350
const JUST_DROPPED_ITEM_UPDATE_INTERVAL = 1.
signal player_updated(player: Player)
signal upgraded
var terrain : Terrain
var region : Region :
get(): return terrain if terrain is Region else null
@export var region : Region
var data : PlayerData
var last_action_area_movement_timer : float = 100.
@@ -30,15 +30,23 @@ var instruction : Instruction = null :
if instruction and is_node_ready():
instruction.spawn_indicator(self)
var just_dropped_item_objects : Array = []
var last_just_dropped_item_objects_updated := 0.
var last_instruction_done := 0.
var elapsed_time := 0.
@onready var preview_zone : ActionZone = await setup_action_zone(Vector2.ZERO, null)
@onready var action_zone : ActionZone = await setup_action_zone(Vector2.ZERO, null)
func _ready():
data = GameInfo.game_data.player_data
data.updated.connect(_on_data_changed)
data.inventory.updated.connect(_on_inventory_updated)
player_updated.emit(self)
Pointer.player = self
setup_preview_zone(data.inventory.get_item())
%NoEnergyLeftIcon.visible = data.energy == 0
func appear(with_falling_animation = true):
if with_falling_animation:
@@ -48,13 +56,14 @@ func appear(with_falling_animation = true):
%AnimationPlayer.play("float")
func _input(_event) -> void:
if Input.is_action_pressed("change_item_left"):
data.inventory.change_current_item(1)
if Input.is_action_pressed("change_item_right"):
data.inventory.change_current_item(-1)
for i in range(1, 10):
if Input.is_action_pressed("item_" + str(i)):
data.inventory.set_current_item(i - 1)
if not Pointer.dragging_inspected:
if Input.is_action_pressed("change_item_left"):
data.inventory.change_current_item(1)
if Input.is_action_pressed("change_item_right"):
data.inventory.change_current_item(-1)
for i in range(1, 10):
if Input.is_action_pressed("item_" + str(i)):
data.inventory.set_current_item(i - 1)
# Méthode déclenchée par la classe region
func _start_pass_day():
@@ -70,6 +79,7 @@ func _end_pass_day():
controlling_player = true
func _process(delta):
elapsed_time += delta
last_action_area_movement_timer += delta
if controlling_player:
@@ -80,13 +90,19 @@ func _process(delta):
and instruction and instruction.can_be_done(self)
):
instruction.do(self)
last_instruction_done = elapsed_time
instruction = null
if instruction and instruction.need_movement:
if input_direction.length() != 0:
instruction = null
input_direction = calculate_direction_instruction_direction()
if instruction == null and action_zone and elapsed_time > last_instruction_done + 0.1:
action_zone.destroy()
action_zone = null
velocity = input_direction * SPEED
turn_animate(input_direction)
@@ -99,12 +115,44 @@ func _process(delta):
elif velocity != Vector2.ZERO and %MovementAudioStreamPlayer.playing == false:
%MovementAudioStreamPlayer.play()
# print("-----")
# print(elapsed_time)
# print(last_just_dropped_item_objects_updated)
if elapsed_time > last_just_dropped_item_objects_updated + JUST_DROPPED_ITEM_UPDATE_INTERVAL:
update_just_dropped_item_objects()
if GameInfo.settings_data.auto_pickup:
take_surrounding_seeds()
move_and_slide()
func _on_data_changed(pd : PlayerData):
%NoEnergyLeftIcon.visible = pd.energy == 0
func _on_inventory_updated(_inventory: Inventory):
setup_preview_zone(data.inventory.get_item())
emit_signal("player_updated", self)
func update_just_dropped_item_objects():
last_just_dropped_item_objects_updated = elapsed_time
var overlapping_areas = (%InteractArea2D as Area2D).get_overlapping_areas()
just_dropped_item_objects = just_dropped_item_objects.filter(
func (i : ItemObject): return i in overlapping_areas
)
func take_surrounding_seeds():
var overlapping_areas = (%InteractArea2D as Area2D).get_overlapping_areas()
if not data.inventory.is_full():
for area in overlapping_areas:
if (
area is ItemObject
and not area in just_dropped_item_objects
and not Pointer.dragging_inspected
):
area.interact(self)
return
func calculate_direction_instruction_direction() -> Vector2:
if (
instruction
@@ -189,7 +237,8 @@ func drop_item():
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)
var dropped_item_object = terrain.drop_item(item_to_drop, global_position)
just_dropped_item_objects.append(dropped_item_object)
AudioManager.play_sfx("Drop")
region.save()
@@ -244,8 +293,8 @@ func recharge(amount : int = data.max_energy):
func full_recharge():
data.energy = max(data.energy, data.max_energy)
func generate_action_zone(item : Item) -> ActionZone:
var zone = ActionZone.new(item)
func generate_action_zone(item : Item, preview = true) -> ActionZone:
var zone = ActionZone.new(item, region.plant_grid, preview)
if not get_parent().is_node_ready():
await get_parent().ready
@@ -261,12 +310,12 @@ func setup_preview_zone(item : Item):
preview_zone = null
if item:
preview_zone = await generate_action_zone(item)
preview_zone = await generate_action_zone(item, true)
func setup_action_zone(zone_position : Vector2, item: Item) -> ActionZone:
if action_zone:
action_zone.destroy()
action_zone = await generate_action_zone(item)
action_zone = await generate_action_zone(item, false)
action_zone.move_to_position(zone_position)
last_action_area_movement_timer = 0.
return action_zone
@@ -274,6 +323,7 @@ func setup_action_zone(zone_position : Vector2, item: Item) -> ActionZone:
func move_preview_zone(zone_position : Vector2):
if preview_zone:
preview_zone.move_to_position(zone_position)
preview_zone.update_preview(self)
class Instruction:
@@ -323,7 +373,7 @@ class Instruction:
player.get_tree().create_tween().tween_property(indicator, "modulate:a", 0.8, 0.2)
func abort(player : Player):
func abort(_player : Player):
indicator.queue_free()
class MoveInstruction extends Instruction:
@@ -372,12 +422,21 @@ class InteractableInstruction extends Instruction:
interactable.interact(player)
class ActionZone:
const ZONE_ACTIVATED_COLOR = Color("#96B3DB")
const ZONE_DEACTIVATED_COLOR = Color("#FF006E")
const ZONE_OPACITY = 0.6
var item : Item = null
var area : Area2D = Area2D.new()
var affected_areas : Array[Area2D]= []
var plant_grid : PlantGrid
var circle : Circle
var preview: bool
func _init(_i : Item):
func _init(_i : Item, _grid : PlantGrid, _preview = false):
item = _i
plant_grid = _grid
preview = _preview
if item and item.get_usage_zone_radius() > 0:
area = Area2D.new()
var collision_shape = CollisionShape2D.new()
@@ -387,19 +446,34 @@ class ActionZone:
collision_shape.shape = circle_shape
area.add_child(collision_shape)
circle = Circle.new(
item.get_usage_zone_radius(),
)
circle.fill = preview
circle.modulate.a = ZONE_OPACITY
area.add_child(circle)
circle.z_index = 100
func clear_preview_on_affected_area():
for a in affected_areas:
if a:
a.affect_preview(false)
func update_preview(player : Player):
update_preview_on_affected_area()
if circle:
circle.color = ZONE_ACTIVATED_COLOR if item.can_use(player, self) else ZONE_DEACTIVATED_COLOR
func update_preview_on_affected_area():
var detected_areas = get_affected_areas()
clear_preview_on_affected_area()
var new_affected_areas : Array[Area2D] = []
for a in detected_areas:
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)
if item:
for a in item.get_usage_objects_affected(detected_areas, self):
if a.has_method("affect_preview"):
a.affect_preview(true)
new_affected_areas.append(a)
affected_areas = new_affected_areas
func get_affected_areas() -> Array[Area2D]:
@@ -415,9 +489,13 @@ class ActionZone:
return Vector2.ZERO if area == null else area.global_position
func move_to_position(pos : Vector2):
if area:
update_preview_on_affected_area()
area.global_position = pos
if area and plant_grid:
if item and item.snap_usage_to_grid():
area.global_position = plant_grid.get_point_for_tile(
Math.get_tile_from_pos(pos)
)
else:
area.global_position = pos
func get_tiles() -> Array[Vector2i]:
return Math.get_tiles_in_circle(
+1 -1
View File
@@ -10,7 +10,7 @@ const DEFAULT_INVENTORY_SIZE = 3
@export var energy : int = DEFAULT_MAX_ENERGY :
set(v):
energy = v
energy = min(v,max_energy)
updated.emit(self)
@export var inventory := Inventory.new(DEFAULT_INVENTORY_SIZE)
+2
View File
@@ -1,6 +1,7 @@
[gd_scene format=3 uid="uid://b2tn4biidxwdo"]
[ext_resource type="PackedScene" uid="uid://111umh57ekg5" path="res://entities/player_3d/resources/3d_orchid.blend" id="1_4gn86"]
[ext_resource type="Script" uid="uid://belels58bosgj" path="res://entities/player_3d/scripts/dead_orchid.gd" id="1_lhvrd"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_xuy43"]
radius = 0.42504883
@@ -8,6 +9,7 @@ height = 0.8718262
[node name="DeadOrchid" type="RigidBody3D" unique_id=1056532235]
transform = Transform3D(-0.98981106, 0, 0.14238709, 0, 1, 0, -0.14238709, 0, -0.98981106, 0, 0, 0)
script = ExtResource("1_lhvrd")
[node name="3d_orchid" parent="." unique_id=1207424236 instance=ExtResource("1_4gn86")]
+38 -3
View File
@@ -2,15 +2,20 @@
[ext_resource type="Script" uid="uid://3rrym6yv7xyp" path="res://entities/player_3d/scripts/player_3d.gd" id="1_pvvbh"]
[ext_resource type="Material" uid="uid://cr7bp4fhh1ipr" path="res://entities/player_3d/resources/materials/post_process_quad.tres" id="2_fcmrk"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_o44vi"]
[ext_resource type="Texture2D" uid="uid://ba8vh5h3r6pr2" path="res://common/icons/focus.svg" id="4_sbfo8"]
[sub_resource type="QuadMesh" id="QuadMesh_o44vi"]
size = Vector2(2, 2)
size = Vector2(3, 3)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_eodxe"]
radius = 0.5854492
height = 1.7342377
[sub_resource type="LabelSettings" id="LabelSettings_fcmrk"]
font = ExtResource("4_o44vi")
font_size = 30
[sub_resource type="Gradient" id="Gradient_dqi2u"]
interpolation_mode = 1
offsets = PackedFloat32Array(0.7046632, 0.78238344, 1)
@@ -54,8 +59,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.19785136, 0)
current = true
near = 0.003
[node name="MeshInstance3D" type="MeshInstance3D" parent="Camera3D" unique_id=1477584785]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1755164e-08, 0, -0.46892682)
[node name="Outline" type="MeshInstance3D" parent="Camera3D" unique_id=1477584785]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.96128e-09, 0, -0.24486887)
mesh = SubResource("QuadMesh_o44vi")
surface_material_override/0 = ExtResource("2_fcmrk")
@@ -88,6 +93,36 @@ size_flags_vertical = 4
texture = ExtResource("4_sbfo8")
expand_mode = 1
[node name="3dTutorial" type="MarginContainer" parent="CanvasLayer" unique_id=259323543]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 15
theme_override_constants/margin_top = 15
theme_override_constants/margin_right = 15
theme_override_constants/margin_bottom = 15
[node name="MoveTutorial" type="Label" parent="CanvasLayer/3dTutorial" unique_id=1165378520]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_vertical = 0
text = "MOVE_WITH_RIGHT_CLICK_OR_WASD"
label_settings = SubResource("LabelSettings_fcmrk")
horizontal_alignment = 1
vertical_alignment = 1
[node name="InteractTutorial" type="Label" parent="CanvasLayer/3dTutorial" unique_id=1117243867]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
text = "INTERACT_WITH_LEFT_CLICK"
label_settings = SubResource("LabelSettings_fcmrk")
horizontal_alignment = 1
vertical_alignment = 1
[node name="CPUParticles3D" type="CPUParticles3D" parent="." unique_id=1470634574]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.66324395, 0)
amount = 5
@@ -5,7 +5,7 @@
[resource]
render_priority = 0
shader = ExtResource("1_tvsbc")
shader_parameter/step_count = 3
shader_parameter/step_count = 5
shader_parameter/thickness = 2.0000000149012003
shader_parameter/edge_color = Color(0.0627451, 0.05882353, 0.16862746, 1)
shader_parameter/fade_start = 100.0
@@ -0,0 +1,2 @@
extends RigidBody3D
class_name DeadOrchid
@@ -0,0 +1 @@
uid://belels58bosgj
+52 -20
View File
@@ -11,11 +11,13 @@ const MOUSE_SENSIVITY = 0.002
const RAY_LENGTH = 10.
const PUSH_FORCE = 0.6
var cockpit_action_hovered : Interactable3D = null
var action_hovered : Interactable3D = null
var query_mouse := false
@export var controlling_player = true
var kick_old_body_ach_sended = false
func _ready():
Dialogic.timeline_started.connect(
func():
@@ -28,22 +30,36 @@ func _ready():
controlling_player = true
)
%MoveTutorial.visible = not "3d_move" in GameInfo.game_data.tutorials_done
%InteractTutorial.visible = false
%Camera3D.fov = GameInfo.settings_data.fov
GameInfo.settings_data.fov_changed.connect(
func(fov : float):
%Camera3D.fov = fov
)
func _input(event):
if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
rotate_y(-event.relative.x * MOUSE_SENSIVITY)
%Camera3D.rotate_x(-event.relative.y * MOUSE_SENSIVITY)
%Camera3D.rotation.x = clampf($Camera3D.rotation.x, -deg_to_rad(70), deg_to_rad(70))
query_mouse = true
if event.is_action_pressed("action") and cockpit_action_hovered and cockpit_action_hovered.interactable:
cockpit_action_hovered.click()
var sensivity = GameInfo.settings_data.mouse_sensivity / 100
if controlling_player:
if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
rotate_y(-event.relative.x * sensivity)
%Camera3D.rotate_x(-event.relative.y * sensivity)
%Camera3D.rotation.x = clampf($Camera3D.rotation.x, -deg_to_rad(70), deg_to_rad(70))
query_mouse = true
if event.is_action_pressed("action") and action_hovered and action_hovered.interactable:
if %InteractTutorial.visible:
var tween = create_tween()
tween.tween_property(%InteractTutorial, "modulate:a", 0., 0.8)
GameInfo.game_data.tutorials_done.append("3d_action")
action_hovered.click()
func _physics_process(delta):
if controlling_player:
if query_mouse:
update_mouse_hovered_cockpit_actions()
update_mouse_hovered_actions()
%PointerTexture.texture = (
POINTER_ACTION_TEXTURE if cockpit_action_hovered != null and cockpit_action_hovered.interactable
POINTER_ACTION_TEXTURE if action_hovered != null and action_hovered.interactable
else POINTER_TEXTURE
)
query_mouse = false
@@ -60,6 +76,12 @@ func _physics_process(delta):
else:
velocity.x = move_toward(velocity.x, 0, speed)
velocity.z = move_toward(velocity.z, 0, speed)
if %MoveTutorial.visible and direction.length():
var tween = create_tween()
tween.tween_property(%MoveTutorial, "modulate:a", 0., 0.8)
GameInfo.game_data.tutorials_done.append("3d_move")
else :
velocity = Vector3.ZERO
@@ -70,12 +92,15 @@ func _physics_process(delta):
move_and_slide()
for i in get_slide_collision_count():
var collision = get_slide_collision(i)
if collision.get_collider() is RigidBody3D:
if collision.get_collider() is RigidBody3D:
collision.get_collider().apply_central_impulse(
-collision.get_normal() * PUSH_FORCE
)
if not kick_old_body_ach_sended and collision.get_collider() is DeadOrchid:
kick_old_body_ach_sended = true
SteamConnection.unlock_achievement(SteamConnection.ACH_KICK_YOUR_OLD_BODY)
func update_mouse_hovered_cockpit_actions() -> void:
func update_mouse_hovered_actions() -> void:
var space_state = get_world_3d().direct_space_state
var middle_screen = get_viewport().get_visible_rect().size / 2
@@ -87,12 +112,19 @@ func update_mouse_hovered_cockpit_actions() -> void:
var result = space_state.intersect_ray(query)
if result and result.collider and result.collider is Interactable3D:
if cockpit_action_hovered != result.collider:
if cockpit_action_hovered and cockpit_action_hovered != result.collider:
cockpit_action_hovered._on_mouse_exited()
cockpit_action_hovered = result.collider
cockpit_action_hovered._on_mouse_entered()
if action_hovered != result.collider:
if action_hovered and action_hovered != result.collider:
action_hovered._on_mouse_exited()
action_hovered = result.collider
action_hovered._on_mouse_entered()
if not "3d_action" in GameInfo.game_data.tutorials_done:
%InteractTutorial.visible = true
%InteractTutorial.modulate.a = 0.
var tween = create_tween()
tween.tween_property(%InteractTutorial, "modulate:a", 1., 0.2)
else :
if cockpit_action_hovered:
cockpit_action_hovered._on_mouse_exited()
cockpit_action_hovered = null
if action_hovered:
action_hovered._on_mouse_exited()
action_hovered = null
+4 -1
View File
@@ -1,9 +1,12 @@
extends Area2D
class_name Entity
var terrain : Terrain
var terrain : Terrain : set = set_terrain
var region : Region :
get(): return terrain if terrain is Region else null
func set_terrain(v : Terrain):
terrain = v
func save() -> EntityData:
return null