diff --git a/addons/dialogic/Editor/HomePage/icon_bg.png.import b/addons/dialogic/Editor/HomePage/icon_bg.png.import index 2160d4d..d89fb7c 100644 --- a/addons/dialogic/Editor/HomePage/icon_bg.png.import +++ b/addons/dialogic/Editor/HomePage/icon_bg.png.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://cvmlp5nxb2rer" -path="res://.godot/imported/icon_bg.png-5937ce0a857c4a8a9d624ea9ebf09a97.ctex" +path.s3tc="res://.godot/imported/icon_bg.png-5937ce0a857c4a8a9d624ea9ebf09a97.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/dialogic/Editor/HomePage/icon_bg.png" -dest_files=["res://.godot/imported/icon_bg.png-5937ce0a857c4a8a9d624ea9ebf09a97.ctex"] +dest_files=["res://.godot/imported/icon_bg.png-5937ce0a857c4a8a9d624ea9ebf09a97.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,4 +38,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/addons/dialogic/Modules/Call/icon.png.import b/addons/dialogic/Modules/Call/icon.png.import index 430260f..7d282da 100644 --- a/addons/dialogic/Modules/Call/icon.png.import +++ b/addons/dialogic/Modules/Call/icon.png.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://duvcdvtgy4h4b" -path="res://.godot/imported/icon.png-12e444f0ed59397c7537943ea85b475c.ctex" +path.s3tc="res://.godot/imported/icon.png-12e444f0ed59397c7537943ea85b475c.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/dialogic/Modules/Call/icon.png" -dest_files=["res://.godot/imported/icon.png-12e444f0ed59397c7537943ea85b475c.ctex"] +dest_files=["res://.godot/imported/icon.png-12e444f0ed59397c7537943ea85b475c.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,4 +38,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/common/assets/materials/default_3d.tres b/common/assets/materials/default_3d.tres index d7699e2..5f0468f 100644 --- a/common/assets/materials/default_3d.tres +++ b/common/assets/materials/default_3d.tres @@ -4,7 +4,7 @@ [resource] diffuse_mode = 3 -specular_mode = 2 +specular_mode = 1 albedo_texture = ExtResource("1_cc1ni") roughness = 0.0 rim_tint = 0.48 diff --git a/common/assets/materials/glass_3d.tres b/common/assets/materials/glass_3d.tres index f734993..100f459 100644 --- a/common/assets/materials/glass_3d.tres +++ b/common/assets/materials/glass_3d.tres @@ -5,5 +5,6 @@ [resource] transparency = 1 depth_draw_mode = 1 +shading_mode = 0 albedo_color = Color(1, 1, 1, 0.79607844) albedo_texture = ExtResource("1_buts1") diff --git a/common/audio_manager/assets/sfx/vending_machine/dragon-studio-power-off-386180.mp3 b/common/audio_manager/assets/sfx/vending_machine/dragon-studio-power-off-386180.mp3 new file mode 100644 index 0000000..f50744f Binary files /dev/null and b/common/audio_manager/assets/sfx/vending_machine/dragon-studio-power-off-386180.mp3 differ diff --git a/common/audio_manager/assets/sfx/vending_machine/dragon-studio-power-off-386180.mp3.import b/common/audio_manager/assets/sfx/vending_machine/dragon-studio-power-off-386180.mp3.import new file mode 100644 index 0000000..3d3dd18 --- /dev/null +++ b/common/audio_manager/assets/sfx/vending_machine/dragon-studio-power-off-386180.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://cbre45rky1f4v" +path="res://.godot/imported/dragon-studio-power-off-386180.mp3-995a97388623e0fa5d3ec6066bd36105.mp3str" + +[deps] + +source_file="res://common/audio_manager/assets/sfx/vending_machine/dragon-studio-power-off-386180.mp3" +dest_files=["res://.godot/imported/dragon-studio-power-off-386180.mp3-995a97388623e0fa5d3ec6066bd36105.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/common/audio_manager/assets/sfx/vending_machine/item-drop.wav b/common/audio_manager/assets/sfx/vending_machine/item-drop.wav new file mode 100644 index 0000000..84c9507 Binary files /dev/null and b/common/audio_manager/assets/sfx/vending_machine/item-drop.wav differ diff --git a/common/audio_manager/assets/sfx/vending_machine/item-drop.wav.import b/common/audio_manager/assets/sfx/vending_machine/item-drop.wav.import new file mode 100644 index 0000000..9b408cd --- /dev/null +++ b/common/audio_manager/assets/sfx/vending_machine/item-drop.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://da3srn8vx4erd" +path="res://.godot/imported/item-drop.wav-fe2fcf1f1129f0a2ca522c0426df7f6e.sample" + +[deps] + +source_file="res://common/audio_manager/assets/sfx/vending_machine/item-drop.wav" +dest_files=["res://.godot/imported/item-drop.wav-fe2fcf1f1129f0a2ca522c0426df7f6e.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/common/audio_manager/audio_manager.tscn b/common/audio_manager/audio_manager.tscn index ece3c64..e96a516 100644 --- a/common/audio_manager/audio_manager.tscn +++ b/common/audio_manager/audio_manager.tscn @@ -23,10 +23,12 @@ [ext_resource type="AudioStream" uid="uid://delq7gsdeqjq2" path="res://common/audio_manager/assets/sfx/respawn/respawn.wav" id="16_xmumj"] [ext_resource type="AudioStream" uid="uid://cbo4ld2yypmte" path="res://common/audio_manager/assets/sfx/harvest/harvest_5.wav" id="17_6w0re"] [ext_resource type="AudioStream" uid="uid://bdxkvaciw4mb3" path="res://common/audio_manager/assets/sfx/dig/dig_2.wav" id="17_bfg8q"] +[ext_resource type="AudioStream" uid="uid://da3srn8vx4erd" path="res://common/audio_manager/assets/sfx/vending_machine/item-drop.wav" id="18_ehr7m"] [ext_resource type="AudioStream" uid="uid://cs4y6sinpth8e" path="res://common/audio_manager/assets/sfx/recharge/recharge_capsule_1.wav" id="18_j8acj"] [ext_resource type="AudioStream" uid="uid://llxrlwfccywb" path="res://common/audio_manager/assets/sfx/dig/dig_3.wav" id="18_nlfrr"] [ext_resource type="AudioStream" uid="uid://c5nfoa6v3r5f7" path="res://common/audio_manager/assets/sfx/harvest/harvest_6.wav" id="18_o4guq"] [ext_resource type="AudioStream" uid="uid://bnkb51nb5ie5p" path="res://common/audio_manager/assets/sfx/door/stereogenicstudio-swish-swoosh-woosh-sfx-47-357152.mp3" id="18_yjs51"] +[ext_resource type="AudioStream" uid="uid://cbre45rky1f4v" path="res://common/audio_manager/assets/sfx/vending_machine/dragon-studio-power-off-386180.mp3" id="19_aedoe"] [ext_resource type="AudioStream" uid="uid://bbhkivgarlhqm" path="res://common/audio_manager/assets/sfx/recharge/recharge_capsule_2.wav" id="19_yjs51"] [ext_resource type="AudioStream" uid="uid://ccfubsk6135qy" path="res://common/audio_manager/assets/sfx/recharge/recharge_capsule_3.wav" id="20_4ojdh"] [ext_resource type="AudioStream" uid="uid://bjind1iji0gt7" path="res://common/audio_manager/assets/sfx/pick_up/pick_up_1.wav" id="20_pu6t4"] @@ -186,6 +188,15 @@ unique_name_in_owner = true [node name="Dig" type="AudioStreamPlayer" parent="Sfx" unique_id=486042600] stream = SubResource("AudioStreamRandomizer_6o1yh") +[node name="VendingMachineDrop" type="AudioStreamPlayer" parent="Sfx" unique_id=1161500181] +stream = ExtResource("18_ehr7m") +pitch_scale = 0.81 + +[node name="VendingMachineOff" type="AudioStreamPlayer" parent="Sfx" unique_id=743754597] +stream = ExtResource("19_aedoe") +volume_db = -14.149 +pitch_scale = 0.75 + [node name="DoorOpen" type="AudioStreamPlayer" parent="Sfx" unique_id=1440910292] stream = ExtResource("18_yjs51") volume_db = -15.565 diff --git a/common/audio_manager/scripts/audio_manager.gd b/common/audio_manager/scripts/audio_manager.gd index 6de5065..d14eb13 100644 --- a/common/audio_manager/scripts/audio_manager.gd +++ b/common/audio_manager/scripts/audio_manager.gd @@ -59,6 +59,8 @@ func _on_change_scene(scene : Scene): "BOREA": stop_all_musics() play_ambiance_alone("Borea", false) + "VENDING_MACHINE_ROOM": + stop_all_musics() # Fonction s'exécutant à chaque début de timeline func _on_timeline_started(): diff --git a/common/game_data/scripts/artefacts/artefact.gd b/common/game_data/scripts/artefacts/artefact.gd new file mode 100644 index 0000000..2277249 --- /dev/null +++ b/common/game_data/scripts/artefacts/artefact.gd @@ -0,0 +1,37 @@ +@abstract +extends Resource +class_name Artefact + +const ARTEFACT_ICON = preload("res://common/icons/cube-3d-sphere.svg") +const DESC_ICON = preload("res://common/icons/align-right.svg") + +@abstract func get_artefact_name() -> String + +@abstract func get_3d_scene() -> PackedScene + +func get_artefact_desc() -> String: + return "" + +func modify_player_max_energy(v : int) -> int: + return v + +func modify_player_inventory_size(v : int) -> int: + return v + +func card_info() -> CardInfo: + var info = CardInfo.new( + get_artefact_name(), + tr("ARTEFACT") + ) + info.important_stat_icon = ARTEFACT_ICON + + var desc_section := CardSectionInfo.new( + tr("DESCRIPTION"), + get_artefact_desc(), + ) + desc_section.title_icon = DESC_ICON + + info.sections.append(desc_section) + + return info + diff --git a/gui/artefacts/artefact.gd.uid b/common/game_data/scripts/artefacts/artefact.gd.uid similarity index 100% rename from gui/artefacts/artefact.gd.uid rename to common/game_data/scripts/artefacts/artefact.gd.uid diff --git a/gui/artefacts/pile/pile.blend b/common/game_data/scripts/artefacts/pile/pile.blend similarity index 100% rename from gui/artefacts/pile/pile.blend rename to common/game_data/scripts/artefacts/pile/pile.blend diff --git a/gui/artefacts/pile/pile.blend.import b/common/game_data/scripts/artefacts/pile/pile.blend.import similarity index 87% rename from gui/artefacts/pile/pile.blend.import rename to common/game_data/scripts/artefacts/pile/pile.blend.import index f289cb4..953436b 100644 --- a/gui/artefacts/pile/pile.blend.import +++ b/common/game_data/scripts/artefacts/pile/pile.blend.import @@ -4,12 +4,12 @@ importer="scene" importer_version=1 type="PackedScene" uid="uid://dolv2637emdbw" -path="res://.godot/imported/pile.blend-30b48bcbeddf39d9b6df3c289ba33608.scn" +path="res://.godot/imported/pile.blend-80c2c782d9d6ad4f0e2e2546a3d5b176.scn" [deps] -source_file="res://gui/artefacts/pile/pile.blend" -dest_files=["res://.godot/imported/pile.blend-30b48bcbeddf39d9b6df3c289ba33608.scn"] +source_file="res://common/game_data/scripts/artefacts/pile/pile.blend" +dest_files=["res://.godot/imported/pile.blend-80c2c782d9d6ad4f0e2e2546a3d5b176.scn"] [params] diff --git a/gui/artefacts/pile/pile.blend1 b/common/game_data/scripts/artefacts/pile/pile.blend1 similarity index 100% rename from gui/artefacts/pile/pile.blend1 rename to common/game_data/scripts/artefacts/pile/pile.blend1 diff --git a/common/game_data/scripts/artefacts/pile/pile.gd b/common/game_data/scripts/artefacts/pile/pile.gd new file mode 100644 index 0000000..2b5298a --- /dev/null +++ b/common/game_data/scripts/artefacts/pile/pile.gd @@ -0,0 +1,15 @@ +@tool +extends Artefact +class_name PileArtefact + +func get_artefact_name() -> String: + return "PILE" + +func get_artefact_desc() -> String: + return "PILE_DESC_TEXT" + +func get_3d_scene() -> PackedScene: + return preload("res://common/game_data/scripts/artefacts/pile/pile.blend") + +func modify_player_max_energy(v : int) -> int: + return v + 1 \ No newline at end of file diff --git a/gui/artefacts/pile/pile.gd.uid b/common/game_data/scripts/artefacts/pile/pile.gd.uid similarity index 100% rename from gui/artefacts/pile/pile.gd.uid rename to common/game_data/scripts/artefacts/pile/pile.gd.uid diff --git a/gui/artefacts/seed_case/seed_case.blend b/common/game_data/scripts/artefacts/seed_case/seed_case.blend similarity index 100% rename from gui/artefacts/seed_case/seed_case.blend rename to common/game_data/scripts/artefacts/seed_case/seed_case.blend diff --git a/gui/artefacts/seed_case/seed_case.blend.import b/common/game_data/scripts/artefacts/seed_case/seed_case.blend.import similarity index 86% rename from gui/artefacts/seed_case/seed_case.blend.import rename to common/game_data/scripts/artefacts/seed_case/seed_case.blend.import index bd20100..95f2768 100644 --- a/gui/artefacts/seed_case/seed_case.blend.import +++ b/common/game_data/scripts/artefacts/seed_case/seed_case.blend.import @@ -4,12 +4,12 @@ importer="scene" importer_version=1 type="PackedScene" uid="uid://cclvb8o3vofff" -path="res://.godot/imported/seed_case.blend-123afc7672467c4885837d27f75f5e08.scn" +path="res://.godot/imported/seed_case.blend-c6a943c9ac5e07f38ec4fc399a8f6f42.scn" [deps] -source_file="res://gui/artefacts/seed_case/seed_case.blend" -dest_files=["res://.godot/imported/seed_case.blend-123afc7672467c4885837d27f75f5e08.scn"] +source_file="res://common/game_data/scripts/artefacts/seed_case/seed_case.blend" +dest_files=["res://.godot/imported/seed_case.blend-c6a943c9ac5e07f38ec4fc399a8f6f42.scn"] [params] diff --git a/common/game_data/scripts/artefacts/seed_case/seed_case.gd b/common/game_data/scripts/artefacts/seed_case/seed_case.gd new file mode 100644 index 0000000..d6b623d --- /dev/null +++ b/common/game_data/scripts/artefacts/seed_case/seed_case.gd @@ -0,0 +1,15 @@ +@tool +extends Artefact +class_name SeedCaseArtefact + +func get_artefact_name() -> String: + return "SEED_CASE" + +func get_artefact_desc() -> String: + return "SEED_CASE_DESC_TEXT" + +func get_3d_scene() -> PackedScene: + return preload("res://common/game_data/scripts/artefacts/seed_case/seed_case.blend") + +func modify_player_inventory_size(v : int) -> int: + return v + 1 \ No newline at end of file diff --git a/gui/artefacts/seed_case/seed_case.gd.uid b/common/game_data/scripts/artefacts/seed_case/seed_case.gd.uid similarity index 100% rename from gui/artefacts/seed_case/seed_case.gd.uid rename to common/game_data/scripts/artefacts/seed_case/seed_case.gd.uid diff --git a/common/game_data/scripts/game_data.gd b/common/game_data/scripts/game_data.gd index f57f076..e90884e 100644 --- a/common/game_data/scripts/game_data.gd +++ b/common/game_data/scripts/game_data.gd @@ -3,15 +3,22 @@ class_name GameData enum GameMode {STORY,INFINITE} +signal current_run_updated(r : RunData) signal current_region_data_updated(p : RegionData) - -@export var current_run : RunData = null - -@export var current_region_data : RegionData = null @export var player_data : PlayerData = PlayerData.new() -@export var max_mutations_by_plant : int = 2 +@export var current_run : RunData = start_run() : + set(v): + current_run = v + current_run_updated.emit(v) + +@export var current_region_data : RegionData = null : + set(v): + current_region_data = v + current_region_data_updated.emit(v) + +@export var progression_data : ProgressionData = ProgressionData.new() @export var last_game_scene : Scene = null @@ -25,13 +32,18 @@ signal current_region_data_updated(p : RegionData) @export var dialogs_done : Array[String] = [] #Chemin des dialogues démarrés -func start_run(): - player_data.inventory.clear_items() +func start_run() -> RunData: + player_data.clear_inventory() current_run = RunData.new() + current_run.artefacts_changed.connect( + func(artefacts : Array[Artefact]): + player_data._on_artefacts_updated(artefacts) + ) current_run.current_run_point_changed.connect( func(rp : RunPoint): start_region(rp.region_parameter) ) + return current_run func reset_player(): player_data = PlayerData.new() @@ -42,7 +54,6 @@ func reset_all(): func start_region(region_param : RegionParameter): current_region_data = RegionData.new(region_param) - current_region_data_updated.emit(current_region_data) GameInfo.save_game_data() func give_up(): diff --git a/entities/plants/scripts/plant_archetype.gd b/common/game_data/scripts/progression_data.gd similarity index 52% rename from entities/plants/scripts/plant_archetype.gd rename to common/game_data/scripts/progression_data.gd index c43099c..7221757 100644 --- a/entities/plants/scripts/plant_archetype.gd +++ b/common/game_data/scripts/progression_data.gd @@ -1,14 +1,6 @@ extends Resource -class_name PlantArchetype +class_name ProgressionData -@export var archetype_name := Random.generate_random_word() -@export var plant_area_radius = 20 -@export var plant_influence_radius = 100 -@export var growing_time = 2 -@export var lifetime = 6 -@export var base_score = 1 -@export var seed_number = 2 -@export var seed_random_loose = 1 @export var available_mutations: Array[PlantMutation] = [ AncientMutation.new(), EphemeralMutation.new(), @@ -28,8 +20,9 @@ class_name PlantArchetype VivaciousMutation.new(), ] -static func get_all() -> Array[PlantArchetype]: - return [PlantArchetype.new()] +@export var available_artefacts: Array[Artefact] = [ + PileArtefact.new(), + SeedCaseArtefact.new() +] -static func get_random() -> PlantArchetype: - return get_all().pick_random() +@export var max_mutations_by_plant : int = 2 \ No newline at end of file diff --git a/common/game_data/scripts/progression_data.gd.uid b/common/game_data/scripts/progression_data.gd.uid new file mode 100644 index 0000000..bb67e25 --- /dev/null +++ b/common/game_data/scripts/progression_data.gd.uid @@ -0,0 +1 @@ +uid://cel2kwfmhvb0a diff --git a/common/game_data/scripts/run/run_data.gd b/common/game_data/scripts/run/run_data.gd index c11a43b..1ed92fa 100644 --- a/common/game_data/scripts/run/run_data.gd +++ b/common/game_data/scripts/run/run_data.gd @@ -6,7 +6,8 @@ enum State {STARTED, IN_PROGRESS, FINISHED} const RUN_POINTS_NEXT_NUMBER : int = 2 const RUN_POINT_MAX_LEVEL = 5 # TODO -signal current_run_point_changed +signal current_run_point_changed(rp : RunPoint) +signal artefacts_changed(artefact : Array[Artefact]) var run_seed = randi() @export var next_run_points : Array[RunPoint] = generate_next_run_points() @@ -18,7 +19,19 @@ var run_seed = randi() @export var last_used_modifier_name = "" -#region ------------------ Generation ------------------ +@export var artefacts : Array[Artefact] = [] + +var plant_info = RunDataPlantInfo.new(self) + +func get_state() -> State: + if not current_run_point: + return State.STARTED + elif current_run_point.level == RUN_POINT_MAX_LEVEL: + return State.FINISHED + else : + return State.IN_PROGRESS + +#region ------------------ Run Points ------------------ func generate_next_run_points(level = 0) -> Array[RunPoint]: @@ -35,13 +48,12 @@ func generate_next_run_points(level = 0) -> Array[RunPoint]: ) return next_run_points - func generate_next_run_point(level = 0) -> RunPoint: var region_parameter = RegionParameter.new() region_parameter.level = level - region_parameter.region_flags = get_region_flags(region_parameter) - region_parameter.modifiers = get_region_modifiers() + region_parameter.modifiers = get_bad_region_modifiers() + region_parameter.modifiers.append_array(get_good_region_modifiers()) return RunPoint.new( level, @@ -51,7 +63,6 @@ func generate_next_run_point(level = 0) -> RunPoint: func generate_borea_base_run_point() -> RunPoint: var region_parameter = RegionParameter.new() region_parameter.level = RUN_POINT_MAX_LEVEL - region_parameter.region_flags = get_region_flags(region_parameter) region_parameter.region_name = tr("BOREA_BASE") return RunPoint.new( @@ -59,16 +70,6 @@ func generate_borea_base_run_point() -> RunPoint: region_parameter ) -#endregion - -func get_state() -> State: - if not current_run_point: - return State.STARTED - elif current_run_point.level == RUN_POINT_MAX_LEVEL: - return State.FINISHED - else : - return State.IN_PROGRESS - func get_next_run_points() -> Array[RunPoint]: if current_run_point and current_run_point.level == RUN_POINT_MAX_LEVEL: return [] @@ -84,15 +85,10 @@ func choose_next_run_point(run_point : RunPoint) -> RunPoint: last_used_modifier_name = current_run_point.region_parameter.modifiers[0].get_modifier_name() return current_run_point -func get_region_flags(region_parameter : RegionParameter) -> Array[String]: - var flags : Array[String] = [] +func get_good_region_modifiers() -> Array[RegionModifier]: + return [VendingMachineModifier.new(),VendingMachineModifier.new()] - if region_parameter.level == RUN_POINT_MAX_LEVEL and GameInfo.game_data.game_mode == GameData.GameMode.STORY: - flags.append("borea") - - return flags - -func get_region_modifiers() -> Array[RegionModifier]: +func get_bad_region_modifiers() -> Array[RegionModifier]: var possible_modifiers : Array[RegionModifier] = [ AridModifier.new(), HumidModifier.new(), @@ -109,3 +105,13 @@ func get_region_modifiers() -> Array[RegionModifier]: last_used_modifier_name = choosen_modifier.get_modifier_name() return [choosen_modifier] + +#endregion + +#region ------------------ Artefacts ------------------ + +func add_artefacts(a: Artefact): + artefacts.append(a) + artefacts_changed.emit(artefacts) + +#endregion diff --git a/common/game_data/scripts/run/run_data_plant_info.gd b/common/game_data/scripts/run/run_data_plant_info.gd new file mode 100644 index 0000000..0a9bdc3 --- /dev/null +++ b/common/game_data/scripts/run/run_data_plant_info.gd @@ -0,0 +1,43 @@ +extends Node +class_name RunDataPlantInfo + +signal updated + +const DEFAULT_PLANT_AREA_RADIUS = 20 +const DEFAULT_PLANT_INFLUENCE_RADIUS = 100 +const DEFAULT_GROWING_TIME = 2 +const DEFAULT_LIFETIME = 6 +const DEFAULT_BASE_SCORE = 1 +const DEFAULT_SEED_NUMBER = 2 +const DEFAULT_SEED_RANDOM_LOOSE = 1 + +var run_data : RunData + +func _init( + _run_data : RunData +): + run_data = _run_data + +var region_modifiers : Array[RegionModifier] +var artefacts : Array[Artefact] = [] + +func get_plant_area_radius() -> int: + return DEFAULT_PLANT_AREA_RADIUS + +func get_plant_influence_radius() -> int: + return DEFAULT_PLANT_INFLUENCE_RADIUS + +func get_growing_time() -> int: + return DEFAULT_GROWING_TIME + +func get_lifetime() -> int: + return DEFAULT_LIFETIME + +func get_base_score() -> int: + return DEFAULT_BASE_SCORE + +func get_seed_number() -> int: + return DEFAULT_SEED_NUMBER + +func get_seed_random_loose() -> int: + return DEFAULT_SEED_RANDOM_LOOSE diff --git a/common/game_data/scripts/run/run_data_plant_info.gd.uid b/common/game_data/scripts/run/run_data_plant_info.gd.uid new file mode 100644 index 0000000..5530588 --- /dev/null +++ b/common/game_data/scripts/run/run_data_plant_info.gd.uid @@ -0,0 +1 @@ +uid://cf8sn5n5u2hd6 diff --git a/common/game_data/scripts/run/run_point.gd b/common/game_data/scripts/run/run_point.gd index 2f1a9e5..ba234d0 100644 --- a/common/game_data/scripts/run/run_point.gd +++ b/common/game_data/scripts/run/run_point.gd @@ -4,7 +4,7 @@ class_name RunPoint const DANGER_ICON = preload("res://common/icons/skull.svg") const TYPE_ICON = preload("res://common/icons/map-pin.svg") -const OBJECTIVE_ICON = preload("res://common/icons/dna.svg") +const OBJECTIVE_ICON = preload("res://common/icons/growth.svg") const CHARGE_ICON = preload("res://common/icons/bolt.svg") @export var level : int = 0 # X pos along the planet, and difficulty @@ -24,15 +24,20 @@ func _init( position = _position func card_info() -> CardInfo: - var info = CardInfo.new(region_parameter.region_name) - info.important_stat_icon = DANGER_ICON - info.important_stat_text = "%d" % level + var info = CardInfo.new( + region_parameter.region_name, + tr("REGION_TO_VISIT") + ) info.type_icon = TYPE_ICON info.stats.append_array([ - CardStatInfo.new(str(region_parameter.objective), OBJECTIVE_ICON), - CardStatInfo.new(str(region_parameter.charges), CHARGE_ICON), + CardStatInfo.new(str(region_parameter.get_objective()), OBJECTIVE_ICON), + CardStatInfo.new(str(region_parameter.get_charge()), CHARGE_ICON), ]) + for m in region_parameter.modifiers: + + info.sections.append(m.card_section()) + return info diff --git a/common/game_info/game_info.gd b/common/game_info/game_info.gd index 94432b8..aaded86 100644 --- a/common/game_info/game_info.gd +++ b/common/game_info/game_info.gd @@ -1,6 +1,6 @@ extends Node -const SAVE_GAME_LOCATION = "user://stw_demo_save.tres" +const SAVE_GAME_LOCATION = "user://stw_beta_save.tres" const SAVE_SETTINGS_LOCATION = "user://stw_settings.tres" var game_loaded = false diff --git a/common/icons/cactus.svg b/common/icons/cactus.svg new file mode 100644 index 0000000..bf82365 --- /dev/null +++ b/common/icons/cactus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/common/icons/cactus.svg.import b/common/icons/cactus.svg.import new file mode 100644 index 0000000..13ae302 --- /dev/null +++ b/common/icons/cactus.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dy1lkhowfs40l" +path="res://.godot/imported/cactus.svg-bf980582753f79920261a0227d753414.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://common/icons/cactus.svg" +dest_files=["res://.godot/imported/cactus.svg-bf980582753f79920261a0227d753414.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=2.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/common/icons/check.svg.import b/common/icons/check.svg.import index e5a6228..6855969 100644 --- a/common/icons/check.svg.import +++ b/common/icons/check.svg.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://80gifgp26h2g" -path="res://.godot/imported/check.svg-47a7b8486ac6d60efdca46538f2829a9.ctex" +path.s3tc="res://.godot/imported/check.svg-47a7b8486ac6d60efdca46538f2829a9.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://common/icons/check.svg" -dest_files=["res://.godot/imported/check.svg-47a7b8486ac6d60efdca46538f2829a9.ctex"] +dest_files=["res://.godot/imported/check.svg-47a7b8486ac6d60efdca46538f2829a9.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,7 +38,7 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 svg/scale=2.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/common/icons/cloud-rain.svg b/common/icons/cloud-rain.svg new file mode 100644 index 0000000..0ee9f28 --- /dev/null +++ b/common/icons/cloud-rain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/common/icons/cloud-rain.svg.import b/common/icons/cloud-rain.svg.import new file mode 100644 index 0000000..aad2505 --- /dev/null +++ b/common/icons/cloud-rain.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ce3hclmo0jcoh" +path="res://.godot/imported/cloud-rain.svg-80379b0936dff4583ecdd239d916ebab.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://common/icons/cloud-rain.svg" +dest_files=["res://.godot/imported/cloud-rain.svg-80379b0936dff4583ecdd239d916ebab.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=2.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/common/icons/cloud.svg b/common/icons/cloud.svg new file mode 100644 index 0000000..ad52114 --- /dev/null +++ b/common/icons/cloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/common/icons/cloud.svg.import b/common/icons/cloud.svg.import new file mode 100644 index 0000000..6ab5be8 --- /dev/null +++ b/common/icons/cloud.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ca5ay65v2piar" +path="res://.godot/imported/cloud.svg-3c8ab957b71c8c1031955ba13dd97127.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://common/icons/cloud.svg" +dest_files=["res://.godot/imported/cloud.svg-3c8ab957b71c8c1031955ba13dd97127.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=2.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/common/icons/droplet-off.svg b/common/icons/droplet-off.svg new file mode 100644 index 0000000..d6d461e --- /dev/null +++ b/common/icons/droplet-off.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/common/icons/droplet-off.svg.import b/common/icons/droplet-off.svg.import new file mode 100644 index 0000000..7f5f680 --- /dev/null +++ b/common/icons/droplet-off.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dei0604x87idg" +path="res://.godot/imported/droplet-off.svg-e7f02e8378325ae2ff9295f8e574f011.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://common/icons/droplet-off.svg" +dest_files=["res://.godot/imported/droplet-off.svg-e7f02e8378325ae2ff9295f8e574f011.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=2.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/common/icons/hand-grab.svg.import b/common/icons/hand-grab.svg.import index 0dcf32b..9a5641e 100644 --- a/common/icons/hand-grab.svg.import +++ b/common/icons/hand-grab.svg.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://4dwxhvjo0yye" -path="res://.godot/imported/hand-grab.svg-aedc27673ee0414dc711257574ee9c66.ctex" +path.s3tc="res://.godot/imported/hand-grab.svg-aedc27673ee0414dc711257574ee9c66.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://common/icons/hand-grab.svg" -dest_files=["res://.godot/imported/hand-grab.svg-aedc27673ee0414dc711257574ee9c66.ctex"] +dest_files=["res://.godot/imported/hand-grab.svg-aedc27673ee0414dc711257574ee9c66.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,7 +38,7 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 svg/scale=2.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/common/icons/hand-stop.svg.import b/common/icons/hand-stop.svg.import index eed0a38..df1969d 100644 --- a/common/icons/hand-stop.svg.import +++ b/common/icons/hand-stop.svg.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://3slhocr5wy3w" -path="res://.godot/imported/hand-stop.svg-bc0d0e986bcb4b50bdd5686b5bff814b.ctex" +path.s3tc="res://.godot/imported/hand-stop.svg-bc0d0e986bcb4b50bdd5686b5bff814b.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://common/icons/hand-stop.svg" -dest_files=["res://.godot/imported/hand-stop.svg-bc0d0e986bcb4b50bdd5686b5bff814b.ctex"] +dest_files=["res://.godot/imported/hand-stop.svg-bc0d0e986bcb4b50bdd5686b5bff814b.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,7 +38,7 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 svg/scale=2.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/common/icons/wind.svg b/common/icons/wind.svg new file mode 100644 index 0000000..1254017 --- /dev/null +++ b/common/icons/wind.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/common/icons/wind.svg.import b/common/icons/wind.svg.import new file mode 100644 index 0000000..dacedfd --- /dev/null +++ b/common/icons/wind.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bingjfdcqqd2q" +path="res://.godot/imported/wind.svg-b1263ce4dc951f76203e96e68da496a8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://common/icons/wind.svg" +dest_files=["res://.godot/imported/wind.svg-b1263ce4dc951f76203e96e68da496a8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=2.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/common/scene_manager/scene_manager.tscn b/common/scene_manager/scene_manager.tscn index 71e2488..4956f89 100644 --- a/common/scene_manager/scene_manager.tscn +++ b/common/scene_manager/scene_manager.tscn @@ -10,7 +10,8 @@ [ext_resource type="Resource" uid="uid://jegdqnd2sqi2" path="res://common/scene_manager/scenes/astra.tres" id="8_e28ni"] [ext_resource type="Resource" uid="uid://b3ebbo88ptrrc" path="res://common/scene_manager/scenes/garage.tres" id="9_msho1"] [ext_resource type="Resource" uid="uid://cvrs6qsq7mpa5" path="res://common/scene_manager/scenes/borea.tres" id="10_ytog4"] +[ext_resource type="Resource" uid="uid://cjoo5et437kr3" path="res://common/scene_manager/scenes/vending_machine_room.tres" id="11_chs32"] [node name="SceneManager" type="Node" unique_id=1630600782] script = ExtResource("1_1c0qu") -scenes = Array[ExtResource("2_c1lr7")]([ExtResource("3_e28ni"), ExtResource("4_msho1"), ExtResource("5_ytog4"), ExtResource("6_chs32"), ExtResource("7_ol3d5"), ExtResource("8_e28ni"), ExtResource("9_msho1"), ExtResource("10_ytog4")]) +scenes = Array[ExtResource("2_c1lr7")]([ExtResource("3_e28ni"), ExtResource("4_msho1"), ExtResource("5_ytog4"), ExtResource("6_chs32"), ExtResource("7_ol3d5"), ExtResource("8_e28ni"), ExtResource("9_msho1"), ExtResource("10_ytog4"), ExtResource("11_chs32")]) diff --git a/common/scene_manager/scenes/vending_machine_room.tres b/common/scene_manager/scenes/vending_machine_room.tres new file mode 100644 index 0000000..cec241d --- /dev/null +++ b/common/scene_manager/scenes/vending_machine_room.tres @@ -0,0 +1,10 @@ +[gd_resource type="Resource" script_class="Scene" format=3 uid="uid://cjoo5et437kr3"] + +[ext_resource type="Script" uid="uid://1ejbvr3431ac" path="res://common/scene_manager/scripts/scene.gd" id="1_2xhcl"] + +[resource] +script = ExtResource("1_2xhcl") +scene_id = "VENDING_MACHINE_ROOM" +scene_path = "res://stages/3d_scenes/vending_machine_room/vending_machine_room.tscn" +mouse_captured = true +metadata/_custom_type_script = "uid://1ejbvr3431ac" diff --git a/entities/interactable_3d/interactable_3d.gd b/entities/interactable_3d/interactable_3d.gd index d1460c0..9f565f3 100644 --- a/entities/interactable_3d/interactable_3d.gd +++ b/entities/interactable_3d/interactable_3d.gd @@ -2,6 +2,7 @@ extends Area3D class_name Interactable3D @export var interactable = true +@export var inspectable = false signal clicked @@ -12,16 +13,6 @@ func click(): if interactable: clicked.emit() -func _ready(): - if audio_player: - var default_volume := audio_player.volume_db - audio_player.volume_db += GameInfo.settings_data.sfx_volume - GameInfo.settings_data.sound_changed.connect( - func(settings : SettingsData): - audio_player.volume_db = default_volume + settings.sfx_volume - ) - - func play_audio(): if audio_player: audio_player.play() @@ -33,7 +24,14 @@ func stop_audio(): func _on_mouse_entered(): if hover_animation_player: hover_animation_player.play("hover") + if inspectable: + Pointer.inspect(self) func _on_mouse_exited(): if hover_animation_player: hover_animation_player.stop() + if inspectable: + Pointer.stop_inspect(self) + +func card_info() -> CardInfo: + return null diff --git a/entities/interactables/door/script/door.gd b/entities/interactables/door/script/door.gd index 2ff5330..7643ec3 100644 --- a/entities/interactables/door/script/door.gd +++ b/entities/interactables/door/script/door.gd @@ -4,6 +4,11 @@ class_name Door @export var to_scene_id = "" @export var icon : Texture : set = set_icon +@export var present : bool = false : set = set_present +@export var door_id : int + +func _init(): + default_interact_text = "ENTER" func _ready(): if available: @@ -11,10 +16,13 @@ func _ready(): else: %AnimatedSprite2D.play("closed") set_icon() + set_present() -func interact(_p : Player) -> bool: +func interact(p : Player) -> bool: if available and to_scene_id: - interacted.emit(_p) + p.region.data.entered_door = name + interacted.emit(p) + p.region.save() SceneManager.change_to_scene_id(to_scene_id) return available @@ -32,3 +40,11 @@ func set_icon(i: Texture = icon): icon = i if is_node_ready(): %Icon.texture = icon + +func set_present(p := present): + present = p + if present: + process_mode = Node.PROCESS_MODE_INHERIT + else: + process_mode = Node.PROCESS_MODE_DISABLED + visible = present \ No newline at end of file diff --git a/entities/interactables/truck/recharge/STW_Props_Batterie_V2.png.import b/entities/interactables/truck/recharge/STW_Props_Batterie_V2.png.import index ef3af48..58c94bf 100644 --- a/entities/interactables/truck/recharge/STW_Props_Batterie_V2.png.import +++ b/entities/interactables/truck/recharge/STW_Props_Batterie_V2.png.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://cqecty3kl6yg6" -path="res://.godot/imported/STW_Props_Batterie_V2.png-5149763f9e1dac76893ec05c148e8056.ctex" +path.s3tc="res://.godot/imported/STW_Props_Batterie_V2.png-5149763f9e1dac76893ec05c148e8056.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://entities/interactables/truck/recharge/STW_Props_Batterie_V2.png" -dest_files=["res://.godot/imported/STW_Props_Batterie_V2.png-5149763f9e1dac76893ec05c148e8056.ctex"] +dest_files=["res://.godot/imported/STW_Props_Batterie_V2.png-5149763f9e1dac76893ec05c148e8056.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,4 +38,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/entities/plants/resources/plant_mutations/ancient_mutation.tres b/entities/plants/resources/plant_mutations/ancient_mutation.tres deleted file mode 100644 index 0e782fb..0000000 --- a/entities/plants/resources/plant_mutations/ancient_mutation.tres +++ /dev/null @@ -1,19 +0,0 @@ -[gd_resource type="Resource" script_class="AncientMutation" format=3 uid="uid://dys1ehlg4kwh7"] - -[ext_resource type="Script" uid="uid://c7po0bstyg80u" path="res://entities/plants/scripts/plant_mutation/ancient_mutation.gd" id="1_5g2qg"] -[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_yqbjv"] -[ext_resource type="Resource" uid="uid://wxqxm6d5twdh" path="res://entities/plants/resources/plant_parts/Leaf8.tres" id="2_s2bpe"] -[ext_resource type="Resource" uid="uid://uoikjpno37bi" path="res://entities/plants/resources/plant_parts/Leaf9.tres" id="3_wfusp"] -[ext_resource type="Resource" uid="uid://c5gqwck2p5h5n" path="res://entities/plants/resources/plant_parts/Leaf10.tres" id="4_60d0x"] -[ext_resource type="Resource" uid="uid://c5fj1cw0f4mu6" path="res://entities/plants/resources/plant_parts/Leaf11.tres" id="5_ooo8j"] -[ext_resource type="Resource" uid="uid://dce788f0adauv" path="res://entities/plants/resources/plant_parts/Leaf12.tres" id="6_d0tr0"] -[ext_resource type="Resource" uid="uid://dd34dikqoynp3" path="res://entities/plants/resources/plant_parts/Leaf13.tres" id="7_jsy7o"] -[ext_resource type="Resource" uid="uid://bynje6g2wvuvl" path="res://entities/plants/resources/plant_parts/Leaf14.tres" id="8_m31fx"] -[ext_resource type="Resource" uid="uid://bd2op6q1masjt" path="res://entities/plants/resources/plant_parts/Leaf15.tres" id="9_78ar7"] -[ext_resource type="Resource" uid="uid://bvajuw0r47edw" path="res://entities/plants/resources/plant_parts/Leaf16.tres" id="10_dq1wt"] - -[resource] -script = ExtResource("1_5g2qg") -possible_parts = Array[ExtResource("1_yqbjv")]([ExtResource("2_s2bpe"), ExtResource("3_wfusp"), ExtResource("4_60d0x"), ExtResource("5_ooo8j"), ExtResource("6_d0tr0"), ExtResource("7_jsy7o"), ExtResource("8_m31fx"), ExtResource("9_78ar7"), ExtResource("10_dq1wt")]) -part_amount = 3 -metadata/_custom_type_script = "uid://c7po0bstyg80u" diff --git a/entities/plants/resources/plant_mutations/elitist_mutation.tres b/entities/plants/resources/plant_mutations/elitist_mutation.tres deleted file mode 100644 index 5d864d2..0000000 --- a/entities/plants/resources/plant_mutations/elitist_mutation.tres +++ /dev/null @@ -1,6 +0,0 @@ -[gd_resource type="Resource" script_class="ElitistMutation" load_steps=2 format=3 uid="uid://d38alhstybdtf"] - -[ext_resource type="Script" uid="uid://bt1xh7ss13e5e" path="res://entities/plants/scripts/plant_mutation/elitist_mutation.gd" id="1_jevqj"] - -[resource] -script = ExtResource("1_jevqj") diff --git a/entities/plants/resources/plant_mutations/ermit_mutation.tres b/entities/plants/resources/plant_mutations/ermit_mutation.tres deleted file mode 100644 index 678a78f..0000000 --- a/entities/plants/resources/plant_mutations/ermit_mutation.tres +++ /dev/null @@ -1,6 +0,0 @@ -[gd_resource type="Resource" script_class="ErmitMutation" load_steps=2 format=3 uid="uid://dktlbpira5kxb"] - -[ext_resource type="Script" uid="uid://domy822vgxfxs" path="res://entities/plants/scripts/plant_mutation/ermit_mutation.gd" id="1_yqhf5"] - -[resource] -script = ExtResource("1_yqhf5") diff --git a/entities/plants/resources/plant_mutations/precocious_mutation.tres b/entities/plants/resources/plant_mutations/precocious_mutation.tres deleted file mode 100644 index 5e2f8f6..0000000 --- a/entities/plants/resources/plant_mutations/precocious_mutation.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="Resource" script_class="PrecociousMutation" format=3 uid="uid://c3am7s5bjy8qk"] - -[ext_resource type="Script" uid="uid://cx5mg5vf62bia" path="res://entities/plants/scripts/plant_mutation/precocious_mutation.gd" id="1_wjcm0"] - -[resource] -script = ExtResource("1_wjcm0") -metadata/_custom_type_script = "uid://cx5mg5vf62bia" diff --git a/entities/plants/resources/plant_mutations/quality_mutation.tres b/entities/plants/resources/plant_mutations/quality_mutation.tres deleted file mode 100644 index be9139a..0000000 --- a/entities/plants/resources/plant_mutations/quality_mutation.tres +++ /dev/null @@ -1,14 +0,0 @@ -[gd_resource type="Resource" script_class="QualityMutation" format=3 uid="uid://uabbkvg1rciq"] - -[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_f2p7y"] -[ext_resource type="Script" uid="uid://bdobyk2j625lb" path="res://entities/plants/scripts/plant_mutation/quality_mutation.gd" id="1_u0ku1"] -[ext_resource type="Resource" uid="uid://crmvc77bqax1y" path="res://entities/plants/resources/plant_parts/Flower1.tres" id="2_1b5fn"] -[ext_resource type="Resource" uid="uid://c0hr7icfkjkoi" path="res://entities/plants/resources/plant_parts/Flower2.tres" id="3_k2uo3"] -[ext_resource type="Resource" uid="uid://clkoc1iccts2w" path="res://entities/plants/resources/plant_parts/Flower3.tres" id="4_ywc6r"] -[ext_resource type="Resource" uid="uid://bd8yapi1pokj6" path="res://entities/plants/resources/plant_parts/Flower4.tres" id="5_fnfed"] - -[resource] -script = ExtResource("1_u0ku1") -possible_parts = Array[ExtResource("1_f2p7y")]([ExtResource("2_1b5fn"), ExtResource("3_k2uo3"), ExtResource("4_ywc6r"), ExtResource("5_fnfed")]) -part_amount = 2 -metadata/_custom_type_script = "uid://bdobyk2j625lb" diff --git a/entities/plants/resources/plant_mutations/quick_mutation.tres b/entities/plants/resources/plant_mutations/quick_mutation.tres deleted file mode 100644 index e974102..0000000 --- a/entities/plants/resources/plant_mutations/quick_mutation.tres +++ /dev/null @@ -1,19 +0,0 @@ -[gd_resource type="Resource" script_class="QuickMutation" format=3 uid="uid://b04gaipu237sx"] - -[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_68ssf"] -[ext_resource type="Script" uid="uid://bhtq0cbrgu58v" path="res://entities/plants/scripts/plant_mutation/quick_mutation.gd" id="1_hr7tm"] -[ext_resource type="Resource" uid="uid://brmd6d3l8trqs" path="res://entities/plants/resources/plant_parts/BottomLeaf1.tres" id="2_37ogi"] -[ext_resource type="Resource" uid="uid://cfr33014u7ig5" path="res://entities/plants/resources/plant_parts/BottomLeaf2.tres" id="3_4wjrs"] -[ext_resource type="Resource" uid="uid://cf70m1us8mfqp" path="res://entities/plants/resources/plant_parts/BottomLeaf3.tres" id="4_w4xgf"] -[ext_resource type="Resource" uid="uid://ctlmah4ohqp25" path="res://entities/plants/resources/plant_parts/BottomLeaf4.tres" id="5_7gtu2"] -[ext_resource type="Resource" uid="uid://b8o4q0hsm84ov" path="res://entities/plants/resources/plant_parts/BottomLeaf5.tres" id="6_yoj6x"] -[ext_resource type="Resource" uid="uid://bb33v756anesy" path="res://entities/plants/resources/plant_parts/BottomLeaf6.tres" id="7_fuf4y"] -[ext_resource type="Resource" uid="uid://cbqrl72y0d1yg" path="res://entities/plants/resources/plant_parts/BottomLeaf7.tres" id="8_25vee"] -[ext_resource type="Resource" uid="uid://dwppani7gyjl5" path="res://entities/plants/resources/plant_parts/BottomLeaf8.tres" id="9_hqe0q"] -[ext_resource type="Resource" uid="uid://dkta1u1u0efxk" path="res://entities/plants/resources/plant_parts/BottomLeaf9.tres" id="10_mxd37"] - -[resource] -script = ExtResource("1_hr7tm") -possible_parts = Array[ExtResource("1_68ssf")]([ExtResource("2_37ogi"), ExtResource("3_4wjrs"), ExtResource("4_w4xgf"), ExtResource("5_7gtu2"), ExtResource("6_yoj6x"), ExtResource("7_fuf4y"), ExtResource("8_25vee"), ExtResource("9_hqe0q"), ExtResource("10_mxd37")]) -part_amount = 2 -metadata/_custom_type_script = "uid://bhtq0cbrgu58v" diff --git a/entities/plants/resources/plant_mutations/sociable_mutation.tres b/entities/plants/resources/plant_mutations/sociable_mutation.tres deleted file mode 100644 index a4a5580..0000000 --- a/entities/plants/resources/plant_mutations/sociable_mutation.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="Resource" script_class="SociableMutation" load_steps=2 format=3 uid="uid://bpkvdvael2ojh"] - -[ext_resource type="Script" uid="uid://b8q5xgvy85qeb" path="res://entities/plants/scripts/plant_mutation/sociable_mutation.gd" id="1_7u0mw"] - -[resource] -script = ExtResource("1_7u0mw") -metadata/_custom_type_script = "uid://b8q5xgvy85qeb" diff --git a/entities/plants/resources/plant_mutations/strong_mutation.tres b/entities/plants/resources/plant_mutations/strong_mutation.tres deleted file mode 100644 index 194cfb5..0000000 --- a/entities/plants/resources/plant_mutations/strong_mutation.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="Resource" script_class="StrongMutation" load_steps=2 format=3 uid="uid://co2r0jnkf8hyb"] - -[ext_resource type="Script" uid="uid://cwj3k4p6ci5t4" path="res://entities/plants/scripts/plant_mutation/strong_mutation.gd" id="1_c0ieg"] - -[resource] -script = ExtResource("1_c0ieg") -metadata/_custom_type_script = "uid://cwj3k4p6ci5t4" diff --git a/entities/plants/scripts/plant.gd b/entities/plants/scripts/plant.gd index 333ff69..ff19c2b 100644 --- a/entities/plants/scripts/plant.gd +++ b/entities/plants/scripts/plant.gd @@ -179,7 +179,7 @@ func save() -> EntityData: func card_info() -> CardInfo: var info = CardInfo.new( data.plant_name, - tr("MATURE") if data.is_mature() else tr("JUVENILE")# data.archetype.archetype_name + tr("MATURE") if data.is_mature() else tr("JUVENILE") ) info.important_stat_icon = SCORE_ICON diff --git a/entities/plants/scripts/plant_archetype.gd.uid b/entities/plants/scripts/plant_archetype.gd.uid deleted file mode 100644 index 40ee452..0000000 --- a/entities/plants/scripts/plant_archetype.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://chdj832c0rrky diff --git a/entities/plants/scripts/plant_data.gd b/entities/plants/scripts/plant_data.gd index e78009d..8f4d7ae 100644 --- a/entities/plants/scripts/plant_data.gd +++ b/entities/plants/scripts/plant_data.gd @@ -7,7 +7,6 @@ signal nearby_plant_updated() enum State {PLANTED, GROWING, MATURE, DEAD} -@export var archetype: PlantArchetype @export var plant_name: String @export var mutations: Array[PlantMutation] @export var day: int: @@ -16,24 +15,17 @@ enum State {PLANTED, GROWING, MATURE, DEAD} updated.emit(self ) @export var random_seed: int -@export var leafs = 0 # +1 score -@export var roots = 0 # +1 lifetime - -# var texture_builder: TextureBuilder = preload("res://entities/plants/scripts/texture_builder/texture_builder.tres") - var decontamination_area_factor = 0. var nearby_plants : Array[PlantData] func _init( _position: Vector2 = Vector2.ZERO, - _archetype: PlantArchetype = PlantArchetype.get_random(), _plant_name: String = Random.generate_random_word(), _mutations: Array[PlantMutation] = [], _day: int = 0, _random_seed = randi() ): position = _position - archetype = _archetype plant_name = _plant_name mutations = _mutations day = _day @@ -45,11 +37,13 @@ func _init( static func generate_from_seed(plant_seed: Seed, plant_position: Vector2) -> PlantData: return PlantData.new( plant_position, - plant_seed.plant_archetype, plant_seed.plant_name, plant_seed.plant_mutations ) +func get_plant_info() -> RunDataPlantInfo: + return GameInfo.game_data.current_run.plant_info + func load_entity() -> Entity: var plant = Plant.new( self @@ -57,7 +51,7 @@ func load_entity() -> Entity: return plant func get_lifetime() -> int: - var lifetime = archetype.lifetime + roots + var lifetime = get_plant_info().get_lifetime() for m in mutations: lifetime = m.mutate_lifetime(self , lifetime) @@ -68,7 +62,7 @@ func get_lifetime() -> int: return lifetime func get_growing_time() -> int: - var growing_time = archetype.growing_time + var growing_time = get_plant_info().get_growing_time() for m in mutations: growing_time = m.mutate_growing_time(self , growing_time) @@ -76,7 +70,7 @@ func get_growing_time() -> int: return growing_time func get_score(state: State = get_state()) -> int: - var score = archetype.base_score + leafs if state == State.MATURE else 0 + var score = get_plant_info().get_base_score() if state == State.MATURE else 0 var mult := 1 @@ -102,7 +96,7 @@ func is_mature() -> bool: return get_state() == State.MATURE func get_seed_number(state = get_state()): - var seed_number = archetype.seed_number if (state == State.MATURE or state == State.DEAD) else 0 + var seed_number = get_plant_info().get_seed_number() if (state == State.MATURE or state == State.DEAD) else 0 for m in mutations: seed_number = m.mutate_seed_number(self , seed_number) @@ -113,7 +107,7 @@ func get_seed_number(state = get_state()): return seed_number func get_seed_random_loose(): - var seed_random_loose = archetype.seed_random_loose + var seed_random_loose = get_plant_info().get_seed_random_loose() for m in mutations: seed_random_loose = m.mutate_seed_random_loose(self , seed_random_loose) diff --git a/entities/plants/scripts/texture_builder/part_assembler.gd b/entities/plants/scripts/texture_builder/part_assembler.gd index 0cdb168..d012f85 100644 --- a/entities/plants/scripts/texture_builder/part_assembler.gd +++ b/entities/plants/scripts/texture_builder/part_assembler.gd @@ -49,7 +49,7 @@ func generate_plants(): elif plant_state == PlantData.State.DEAD: plant_data.day = plant_data.get_lifetime() for j in n_mutation_per_plant: - plant_data.mutations.append(plant_data.archetype.available_mutations.pick_random()) + plant_data.mutations.append(GameInfo.game_data.progression_data.available_mutations.pick_random()) var plant: Plant = Plant.new(plant_data) print(plant.data.plant_name) %Plants.add_child(plant) diff --git a/entities/player/inventory/scripts/inventory.gd b/entities/player/inventory/scripts/inventory.gd index 1d0f005..39051e1 100644 --- a/entities/player/inventory/scripts/inventory.gd +++ b/entities/player/inventory/scripts/inventory.gd @@ -1,140 +1,142 @@ +@tool extends Resource class_name Inventory signal updated(inventory: Inventory) signal tool_added(item: Item) -@export var items: Array[Item] = [] +@export var tools: Array[Item] = [] +@export var seeds: Array[Item] = [] @export var current_item_ind: int = 0 # over both tools and items -@export var n_tools: int = 0 - -func _init(inventory_size: int = 1): - set_size(inventory_size) - -func get_n_item_slots() -> int: - return items.size() - n_tools - -func set_size(new_size: int): - if new_size >= 0: - items.resize(n_tools + new_size) - updated.emit(self ) - -func change_size(size_mod: int): - set_size(items.size() - n_tools + size_mod) +@export var seeds_size : int : + set(v): + seeds_size = v + update_seeds_size(v) +func _init(size : int = 1): + seeds_size = size + func current_is_tool() -> bool: - return current_item_ind >= 0 && current_item_ind < n_tools - -func get_best_available_slot_ind(): - if !current_is_tool() && items[current_item_ind] == null: - return current_item_ind - for i in range(n_tools, items.size()): - if items[i] == null: - return i - # it's full - if !current_is_tool(): - return current_item_ind - else: - return n_tools + return current_item_ind <= len(tools) func set_current_item(new_ind: int): - if new_ind >= items.size(): - return - if new_ind != current_item_ind: - current_item_ind = new_ind - updated.emit(self ) + current_item_ind = new_ind % (len(tools) + len(seeds)) + updated.emit(self) func change_current_item(ind_mod: int): - if items.size() == 0: - current_item_ind = 0 - return - var new_ind: int = current_item_ind + ind_mod - new_ind = new_ind % items.size() - if new_ind < 0: - new_ind += items.size() - set_current_item(new_ind) + set_current_item(current_item_ind + ind_mod) func add_item(item: Item) -> bool: if item.type != Item.ItemType.TOOL_ITEM: - var best_ind = get_best_available_slot_ind() - return set_item(item, best_ind) + return add_seed(item) elif item.type == Item.ItemType.TOOL_ITEM and not has_item_with_name(item.get_item_name()): - items.insert(n_tools, item) - if current_item_ind >= n_tools: - current_item_ind += 1 - n_tools += 1 - tool_added.emit(item) - updated.emit(self ) + add_tool(item) return true else: return false -func set_item(item: Item, ind: int = 0) -> bool: - if ind < 0 || ind >= items.size(): +func add_tool(tool: Item) -> bool: + if not has_item_with_name(tool.get_item_name()): + tools.append(tool) + updated.emit(self) + tool_added.emit(tool) + return true + else: return false - items[ind] = item - updated.emit(self ) - return true + +func add_seed(s: Item) -> bool: + update_seeds_size() + if not is_full(): + var ind = ( + current_item_ind - len(tools) if current_item_ind > len(tools) + else 0 + ) + + while seeds[ind] != null: + ind = (ind+1) % len(seeds) + + seeds[ind] = s + + updated.emit(self) + return true + else: + return false + +func update_seeds_size(size = seeds_size): + while size > len(seeds): + seeds.append(null) + + while len(seeds) > size and seeds.find(null) != -1: + seeds.pop_at(seeds.find(null)) + +func get_all_items() -> Array[Item]: + return tools + seeds func get_item(ind: int = current_item_ind) -> Item: - if ind < 0 || ind > items.size(): + if ind < 0 || ind > len(get_all_items()): return null - return items[ind] + return get_all_items()[ind] func has_item(item: Item) -> bool: - return items.has(item) + return get_all_items().has(item) func has_item_with_name(name: String) -> bool: - var id = items.find_custom( + var id = get_all_items().find_custom( (func (i : Item): return i and i.get_item_name() == name) ) return id != -1 -func remove_item(item: Item): - if item.type == Item.ItemType.TOOL_ITEM: - printerr("trying to remove a tool") +func remove_tool(ind : int): + if ind != -1: + tools.pop_at(ind) + updated.emit(self) + +func remove_seed(ind : int): + if ind != -1: + seeds[ind] = null + updated.emit(self) + update_seeds_size(seeds_size) + +func remove_item(item: Item) -> bool: + if tools.find(item) != -1: + remove_tool(tools.find(item)) + elif seeds.find(item) != -1: + remove_seed(seeds.find(item)) else: - var ind = items.find(item) - if ind >= 0: - items[ind] = null - updated.emit(self ) + return false + return true -func remove_item_at(ind: int = current_item_ind): - if ind < 0 || ind > items.size(): - return +func remove_item_at(ind: int = current_item_ind) -> bool: + if ind < 0 || ind > len(seeds) + len(tools): + return false - if ind < n_tools: - printerr("trying to remove a tool") - return - - items[ind] = null - updated.emit(self ) + if ind < len(tools): + remove_tool(ind) + else: + remove_seed(ind - len(tools)) + + return true func remove_current_item(): remove_item_at() func pop_item(ind: int = current_item_ind) -> Item: - if ind < 0 || ind > items.size(): - return + if ind < 0 || ind > len(seeds) + len(tools): + return null - if ind < n_tools: - printerr("trying to remove a tool") - return + var item_removed = get_item(ind) + + remove_item_at(ind) - var item_removed: Item = items[ind] - items[ind] = null - updated.emit(self ) return item_removed func is_full(): - for i in range(n_tools, items.size()): - if items[i] == null: + for i in range(len(seeds)): + if seeds[i] == null: return false return true -func clear_items(): - for i in range(n_tools, items.size()): - items[i] = null - updated.emit(self ) +func current_ind_on_tools() -> bool: + return current_item_ind < len(tools) diff --git a/entities/player/inventory/scripts/items/seed.gd b/entities/player/inventory/scripts/items/seed.gd index 1df4fc5..598a34c 100644 --- a/entities/player/inventory/scripts/items/seed.gd +++ b/entities/player/inventory/scripts/items/seed.gd @@ -10,18 +10,15 @@ const SCORE_ICON = preload("res://common/icons/growth.svg") const RARITY_POOL : Array[int] = [0,0,0,0,0,0,0,1,1,1] @export var plant_name : String -@export var plant_archetype: PlantArchetype @export var plant_mutations: Array[PlantMutation] @export var random_seed : int var stored_icon : Texture func _init( _plant_name : String = "", - _plant_archetype : PlantArchetype = PlantArchetype.get_random(), _plant_mutations : Array[PlantMutation] = [], ): plant_name = _plant_name - plant_archetype = _plant_archetype plant_mutations = _plant_mutations random_seed = randi() @@ -29,23 +26,18 @@ static func generate_from_parent(plant_data : PlantData) -> Seed: if randf() < MUTATION_PROBABILITY: return Seed.new( plant_data.plant_name, - plant_data.archetype, mutate_mutations(plant_data) ) else : return Seed.new( plant_data.plant_name, - plant_data.archetype, plant_data.mutations.duplicate_deep() ) static func generate_random() -> Seed: - var archetype = PlantArchetype.get_random() - var new_seed = Seed.new( Random.generate_random_word(), - PlantArchetype.get_random(), - [generate_first_mutation(archetype)] + [generate_first_mutation()] ) return new_seed @@ -142,10 +134,10 @@ func get_particles() -> Array[EffectParticles.Parameters]: return param -static func generate_first_mutation(archetype : PlantArchetype) -> PlantMutation: +static func generate_first_mutation() -> PlantMutation: var rarity : int = RARITY_POOL.pick_random() - var possible_mutation : PlantMutation = archetype.available_mutations.filter( + var possible_mutation : PlantMutation = GameInfo.game_data.progression_data.available_mutations.filter( func (m : PlantMutation): return m.get_base_rarity() <= rarity ).pick_random().duplicate_deep() @@ -162,7 +154,7 @@ static func mutate_mutations(parent : PlantData) -> Array[PlantMutation]: ] if ( - len(parent.mutations) >= GameInfo.game_data.max_mutations_by_plant + len(parent.mutations) >= GameInfo.game_data.progression_data.max_mutations_by_plant ): mutation_possibility = [ UpgradeMutation.new(), @@ -184,7 +176,7 @@ class MutationPossibility: class AddMutation extends MutationPossibility: func mutate(parent : PlantData)-> Array[PlantMutation]: var new_mutations = parent.mutations.duplicate_deep() - var possible_new_mutations = parent.archetype.available_mutations.duplicate_deep() + var possible_new_mutations = GameInfo.game_data.progression_data.available_mutations.duplicate_deep() possible_new_mutations = possible_new_mutations.filter( func (m : PlantMutation): diff --git a/entities/player/inventory/scripts/items/utils/detector_signal.gd b/entities/player/inventory/scripts/items/utils/detector_signal.gd index 61f1501..b6f9cb1 100644 --- a/entities/player/inventory/scripts/items/utils/detector_signal.gd +++ b/entities/player/inventory/scripts/items/utils/detector_signal.gd @@ -33,17 +33,17 @@ func _init(region : Region, pos : Vector2): signals.append( DetectorSignalIndividual.new( (pos - e.global_position).normalized().angle(), - DOOR_ICON, + (e as Door).icon, Color("ffa617ff") ), ) - if e is Plant: - signals.append( - DetectorSignalIndividual.new( - (pos - e.global_position).normalized().angle(), - PLANT_ICON - ) - ) + # if e is Plant: + # signals.append( + # DetectorSignalIndividual.new( + # (pos - e.global_position).normalized().angle(), + # PLANT_ICON + # ) + # ) func _draw(): if started_time < SIGNAL_DURATION: diff --git a/entities/player/scripts/player.gd b/entities/player/scripts/player.gd index ba05372..15f38ca 100644 --- a/entities/player/scripts/player.gd +++ b/entities/player/scripts/player.gd @@ -157,8 +157,8 @@ func pick_item(item : Item): func drop_item(): var ind_to_drop := data.inventory.current_item_ind while ( - (data.inventory.get_item(ind_to_drop) == null or ind_to_drop < data.inventory.n_tools) - and ind_to_drop < len(data.inventory.items) - 1 + (data.inventory.get_item(ind_to_drop) == null or ind_to_drop < len(data.inventory.tools)) + and ind_to_drop < len(data.inventory.get_all_items()) - 1 ): ind_to_drop += 1 var item_to_drop = data.inventory.pop_item(ind_to_drop) @@ -167,10 +167,6 @@ func drop_item(): AudioManager.play_sfx("Drop") region.save() -func delete_item(item: Item): - if !data.inventory.current_is_tool(): - data.inventory.remove_item(item) - func try_use_item(item : Item, use_position : Vector2): await setup_action_zone(use_position, item) instruction = ItemActionInstruction.new( diff --git a/entities/player/scripts/player_data.gd b/entities/player/scripts/player_data.gd index 60a2e07..64a0fbc 100644 --- a/entities/player/scripts/player_data.gd +++ b/entities/player/scripts/player_data.gd @@ -6,12 +6,36 @@ signal updated(player_data : PlayerData) const DEFAULT_MAX_ENERGY = 3 const DEFAULT_INVENTORY_SIZE = 3 -@export var max_energy : int = DEFAULT_MAX_ENERGY : - set(v): - max_energy = v - updated.emit(self) +@export var max_energy : int = DEFAULT_MAX_ENERGY + @export var energy : int = DEFAULT_MAX_ENERGY : set(v): energy = v updated.emit(self) -@export var inventory := Inventory.new(DEFAULT_INVENTORY_SIZE) \ No newline at end of file + +@export var inventory := Inventory.new(DEFAULT_INVENTORY_SIZE) + +func get_artefacts() -> Array[Artefact]: + if GameInfo and GameInfo.game_data and GameInfo.game_data.current_run: + return GameInfo.game_data.current_run.artefacts + return [] + +func _on_artefacts_updated(artefacts : Array[Artefact]): + inventory.seeds_size = calculate_inventory_size(artefacts) + max_energy = calculate_max_energy(artefacts) + updated.emit() + +func calculate_max_energy(artefacts : Array[Artefact]) -> int: + var v = DEFAULT_MAX_ENERGY + for a in artefacts: + v = a.modify_player_max_energy(v) + return v + +func calculate_inventory_size(artefacts : Array[Artefact]) -> int: + var v = DEFAULT_INVENTORY_SIZE + for a in artefacts: + v = a.modify_player_inventory_size(v) + return v + +func clear_inventory(): + inventory = Inventory.new(DEFAULT_INVENTORY_SIZE) diff --git a/entities/player_3d/scripts/player_3d.gd b/entities/player_3d/scripts/player_3d.gd index 34f446e..48ff4d7 100644 --- a/entities/player_3d/scripts/player_3d.gd +++ b/entities/player_3d/scripts/player_3d.gd @@ -33,7 +33,7 @@ func _input(event): %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: + if event.is_action_pressed("action") and cockpit_action_hovered and cockpit_action_hovered.interactable: cockpit_action_hovered.click() @@ -42,7 +42,7 @@ func _physics_process(delta): if query_mouse: update_mouse_hovered_cockpit_actions() %PointerTexture.texture = ( - POINTER_ACTION_TEXTURE if cockpit_action_hovered != null + POINTER_ACTION_TEXTURE if cockpit_action_hovered != null and cockpit_action_hovered.interactable else POINTER_TEXTURE ) query_mouse = false @@ -79,11 +79,12 @@ func update_mouse_hovered_cockpit_actions() -> void: query.collide_with_areas = true var result = space_state.intersect_ray(query) - if result and result.collider and result.collider is Interactable3D and result.collider.interactable: - 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 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() else : if cockpit_action_hovered: cockpit_action_hovered._on_mouse_exited() diff --git a/gui/artefacts/artefact.gd b/gui/artefacts/artefact.gd deleted file mode 100644 index 76d11d0..0000000 --- a/gui/artefacts/artefact.gd +++ /dev/null @@ -1,10 +0,0 @@ -@abstract -extends Resource -class_name Artefact - -@abstract func get_artefact_name() -> String - -@abstract func get_3d_scene() -> PackedScene - -# @abstract func card_info() -> CardInfo - diff --git a/gui/artefacts/pile/pile.gd b/gui/artefacts/pile/pile.gd deleted file mode 100644 index bd8357c..0000000 --- a/gui/artefacts/pile/pile.gd +++ /dev/null @@ -1,9 +0,0 @@ -@tool -extends Artefact -class_name PileArtefact - -func get_artefact_name() -> String: - return "PILE" - -func get_3d_scene() -> PackedScene: - return preload("res://gui/artefacts/pile/pile.blend") \ No newline at end of file diff --git a/gui/artefacts/seed_case/seed_case.gd b/gui/artefacts/seed_case/seed_case.gd deleted file mode 100644 index c195068..0000000 --- a/gui/artefacts/seed_case/seed_case.gd +++ /dev/null @@ -1,9 +0,0 @@ -@tool -extends Artefact -class_name SeedCaseArtefact - -func get_artefact_name() -> String: - return "SEED_CASE" - -func get_3d_scene() -> PackedScene: - return preload("res://gui/artefacts/seed_case/seed_case.blend") \ No newline at end of file diff --git a/gui/game/card/card.tscn b/gui/game/card/card.tscn index bc2151e..94a8782 100644 --- a/gui/game/card/card.tscn +++ b/gui/game/card/card.tscn @@ -53,7 +53,7 @@ _data = { } [node name="Card" type="PanelContainer" unique_id=1085885349] -custom_minimum_size = Vector2(300, 0) +custom_minimum_size = Vector2(450, 0) offset_right = 250.0 offset_bottom = 70.0 size_flags_horizontal = 0 diff --git a/gui/game/card/card_section.tscn b/gui/game/card/card_section.tscn index 5314e98..b67b97f 100644 --- a/gui/game/card/card_section.tscn +++ b/gui/game/card/card_section.tscn @@ -63,9 +63,8 @@ stretch_mode = 5 [node name="TitleText" type="Label" parent="MarginContainer/CardSectionContainer/CardSectionTitle" unique_id=1260458359] unique_name_in_owner = true layout_mode = 2 -size_flags_horizontal = 3 theme = ExtResource("1_t7m3x") -text = "Hello" +text = "Hella" label_settings = SubResource("LabelSettings_ycbno") [node name="Text" type="RichTextLabel" parent="MarginContainer/CardSectionContainer" unique_id=2102977326] @@ -74,7 +73,7 @@ layout_mode = 2 size_flags_horizontal = 3 theme = ExtResource("1_t7m3x") bbcode_enabled = true -text = "Lorem ipsum dolor sit amet" +text = "Hello" fit_content = true scroll_active = false vertical_alignment = 1 diff --git a/gui/game/card/card_visualiser.tscn b/gui/game/card/card_visualiser.tscn index 5430acd..3b199bb 100644 --- a/gui/game/card/card_visualiser.tscn +++ b/gui/game/card/card_visualiser.tscn @@ -46,8 +46,8 @@ metadata/_custom_type_script = "uid://dj2pv1hiwjfv0" shader = ExtResource("1_x54se") shader_parameter/fov = 90.0 shader_parameter/cull_back = true -shader_parameter/y_rot = -1.4576089e-33 -shader_parameter/x_rot = 9.688164e-35 +shader_parameter/y_rot = -7e-45 +shader_parameter/x_rot = 1.237e-42 shader_parameter/inset = 0.0 [sub_resource type="Animation" id="Animation_1et8x"] @@ -71,8 +71,8 @@ anchor_right = 0.5 anchor_bottom = 0.5 offset_left = -125.0 offset_top = -30.0 -offset_right = 125.0 -offset_bottom = 131.0 +offset_right = 225.0 +offset_bottom = 121.0 grow_horizontal = 2 grow_vertical = 2 scale = Vector2(1.0000002, 1.0000002) @@ -84,6 +84,7 @@ theme_override_constants/margin_top = -25 theme_override_constants/margin_right = -25 theme_override_constants/margin_bottom = -25 script = ExtResource("2_ntbk8") +card_width = 350 card_info = SubResource("Resource_eb1v6") [node name="SubViewportContainer" type="SubViewportContainer" parent="." unique_id=1594926759] @@ -96,14 +97,14 @@ mouse_filter = 2 unique_name_in_owner = true transparent_bg = true handle_input_locally = false -size = Vector2i(300, 211) +size = Vector2i(400, 201) size_2d_override_stretch = true render_target_update_mode = 4 [node name="CardContainer" type="MarginContainer" parent="SubViewportContainer/SubViewport" unique_id=1240228608] unique_name_in_owner = true -offset_right = 300.0 -offset_bottom = 211.0 +offset_right = 400.0 +offset_bottom = 201.0 mouse_filter = 2 theme_override_constants/margin_left = 25 theme_override_constants/margin_top = 25 @@ -112,7 +113,7 @@ theme_override_constants/margin_bottom = 25 [node name="Card" parent="SubViewportContainer/SubViewport/CardContainer" unique_id=1169470018 instance=ExtResource("1_we78f")] unique_name_in_owner = true -custom_minimum_size = Vector2(250, 0) +custom_minimum_size = Vector2(350, 0) layout_mode = 2 mouse_filter = 2 down_arrow = true diff --git a/gui/game/energy_info/energy_info.tscn b/gui/game/energy_info/energy_info.tscn index 877183d..497a71d 100644 --- a/gui/game/energy_info/energy_info.tscn +++ b/gui/game/energy_info/energy_info.tscn @@ -46,9 +46,9 @@ stretch_mode = 5 [node name="TextPlacer" type="MarginContainer" parent="." unique_id=1669037421] layout_mode = 2 size_flags_vertical = 0 -theme_override_constants/margin_left = 20 +theme_override_constants/margin_left = 26 theme_override_constants/margin_top = 9 -theme_override_constants/margin_right = 418 +theme_override_constants/margin_right = 691 [node name="EnergyCount" type="RichTextLabel" parent="TextPlacer" unique_id=1073572949] unique_name_in_owner = true @@ -74,11 +74,11 @@ metadata/_custom_type_script = "uid://0dhj8sdpil7q" [node name="BatteryViewport" type="SubViewport" parent="." unique_id=146346475] own_world_3d = true transparent_bg = true -size = Vector2i(529, 190) +size = Vector2i(800, 190) [node name="EnergyInfo3d" parent="BatteryViewport" unique_id=1798644168 instance=ExtResource("6_tj7lw")] unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.918, 2) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.918, 3.81) max_energy = 3 [node name="WorldEnvironment" type="WorldEnvironment" parent="BatteryViewport" unique_id=1322215759] diff --git a/gui/game/inventory_gui/inventory_3d.tscn b/gui/game/inventory_gui/inventory_3d.tscn index f01921b..7e7c79d 100644 --- a/gui/game/inventory_gui/inventory_3d.tscn +++ b/gui/game/inventory_gui/inventory_3d.tscn @@ -2,16 +2,25 @@ [ext_resource type="Script" uid="uid://c66acjl2dhd7x" path="res://gui/game/inventory_gui/scripts/inventory_3d.gd" id="1_k2pqu"] [ext_resource type="PackedScene" uid="uid://4r2ab6foer05" path="res://gui/game/inventory_gui/inventory_item/inventory_item_3d.tscn" id="2_1jdtu"] +[ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://entities/player/inventory/scripts/item.gd" id="3_qyq7r"] +[ext_resource type="Script" uid="uid://fnu2d6wna4yc" path="res://entities/player/inventory/scripts/inventory.gd" id="4_7pv7m"] [ext_resource type="PackedScene" uid="uid://yqq3unuxmtdl" path="res://gui/game/inventory_gui/assets/3d/item_separator.blend" id="13_8twi0"] +[sub_resource type="Resource" id="Resource_kcwow"] +script = ExtResource("4_7pv7m") +seeds = Array[ExtResource("3_qyq7r")]([null, null, null, null, null]) +seeds_size = 5 +metadata/_custom_type_script = "uid://fnu2d6wna4yc" + [node name="Inventory3D" type="Node3D" unique_id=810532522] script = ExtResource("1_k2pqu") inventory_item_scene = ExtResource("2_1jdtu") +test_inventory = SubResource("Resource_kcwow") [node name="Items3D" type="Node3D" parent="." unique_id=893360425] unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.65, 0, 0) [node name="ItemSeparator" parent="." unique_id=999679207 instance=ExtResource("13_8twi0")] unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1, 0, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.29999998, 0, 0) diff --git a/gui/game/inventory_gui/scripts/inventory_3d.gd b/gui/game/inventory_gui/scripts/inventory_3d.gd index e96b15f..0dd1b63 100644 --- a/gui/game/inventory_gui/scripts/inventory_3d.gd +++ b/gui/game/inventory_gui/scripts/inventory_3d.gd @@ -24,11 +24,11 @@ func _ready(): func update(inventory : Inventory): - var items = inventory.items + var items = inventory.get_all_items() if no_tools: - items = items.slice(inventory.n_tools, len(items)) + items = inventory.seeds - if len(items) != len(inventory_item_objects) or last_n_tools != inventory.n_tools: + if len(items) != len(inventory_item_objects) or last_n_tools != len(inventory.tools): create_inventory_objects(inventory) for i in range(len(items)): var item : Item= items[i] @@ -38,7 +38,7 @@ func update(inventory : Inventory): if not no_tools: if inventory.current_item_ind == i: object.state = ( - InventoryItem3D.State.TOOL if i < inventory.n_tools + InventoryItem3D.State.TOOL if i < len(inventory.tools) else InventoryItem3D.State.ITEM ) else: @@ -48,19 +48,19 @@ func update(inventory : Inventory): func create_inventory_objects(inventory : Inventory): for c in %Items3D.get_children(): c.queue_free() - last_n_tools = inventory.n_tools + last_n_tools = len(inventory.tools) inventory_item_objects = [] - var items = inventory.items + var items = inventory.get_all_items() if no_tools: - items = items.slice(inventory.n_tools, len(items)) + items = inventory.seeds for i in range(len(items)): var new_inventory_object := (inventory_item_scene.instantiate() as InventoryItem3D) %Items3D.add_child(new_inventory_object) new_inventory_object.position.x = -INVENTORY_OBJECT_SIZE * i - if i >= inventory.n_tools and not no_tools: + if i >= len(inventory.tools) and not no_tools: new_inventory_object.position.x -= SEPARATOR_SIZE inventory_item_objects.append(new_inventory_object) @@ -75,6 +75,6 @@ func create_inventory_objects(inventory : Inventory): ) / 2 %ItemSeparator.position.x = ( %Items3D.position.x - - (inventory.n_tools) * INVENTORY_OBJECT_SIZE + - (inventory.tools.size()) * INVENTORY_OBJECT_SIZE + SEPARATOR_SIZE/2 ) diff --git a/gui/game/inventory_gui/scripts/inventory_gui.gd b/gui/game/inventory_gui/scripts/inventory_gui.gd index b52748f..d9c63b1 100644 --- a/gui/game/inventory_gui/scripts/inventory_gui.gd +++ b/gui/game/inventory_gui/scripts/inventory_gui.gd @@ -18,9 +18,9 @@ func _ready(): update(GameInfo.game_data.player_data.inventory) func update(inventory: Inventory): - if last_inventory_size != len(inventory.items) or last_n_tools != inventory.n_tools: - last_inventory_size = len(inventory.items) - last_n_tools = inventory.n_tools + if last_inventory_size != len(inventory.get_all_items()) or last_n_tools != inventory.tools.size(): + last_inventory_size = len(inventory.get_all_items()) + last_n_tools = inventory.tools.size() generate_inventory_mouse_detectors(last_inventory_size, last_n_tools) func generate_inventory_mouse_detectors(inventory_size: int, n_tool : int, test = false): diff --git a/gui/game/inventory_gui/scripts/inventory_gui_item_mouse_detector.gd b/gui/game/inventory_gui/scripts/inventory_gui_item_mouse_detector.gd index 5242e29..e5a8e7e 100644 --- a/gui/game/inventory_gui/scripts/inventory_gui_item_mouse_detector.gd +++ b/gui/game/inventory_gui/scripts/inventory_gui_item_mouse_detector.gd @@ -22,8 +22,8 @@ func _ready(): func card_info() -> CardInfo: var inventory := GameInfo.game_data.player_data.inventory - if inventory and index < len(inventory.items): - var item = GameInfo.game_data.player_data.inventory.items[index] + if inventory and index < len(inventory.get_all_items()): + var item = GameInfo.game_data.player_data.inventory.get_all_items()[index] if item: return item.card_info() diff --git a/gui/game/tutorial/scripts/tutorial.gd b/gui/game/tutorial/scripts/tutorial.gd index ac127e7..c040c0d 100644 --- a/gui/game/tutorial/scripts/tutorial.gd +++ b/gui/game/tutorial/scripts/tutorial.gd @@ -25,7 +25,7 @@ var indicators : Array[InGameIndicator] Step.new( "SELECT_ITEM_WITH_SCROLL_CLICK_OR_NUMBER", (func (): - return player.data.inventory.current_item_ind != player.data.inventory.n_tools) + return player.data.inventory.current_item_ind != player.data.inventory.tools.size()) ), Step.new( "LEFT_CLICK_TO_USE_ITEMS", @@ -54,7 +54,7 @@ var indicators : Array[InGameIndicator] Step.new( "TAKE_A_SEED_BY_CLICKING_ON_IT", (func (): - return player.data.inventory.items.find_custom( + return player.data.inventory.seeds.find_custom( func(i:Item): return i is Seed ) != -1) ), diff --git a/gui/pointer/pointer.tscn b/gui/pointer/pointer.tscn index a6d901d..b7431c0 100644 --- a/gui/pointer/pointer.tscn +++ b/gui/pointer/pointer.tscn @@ -189,6 +189,7 @@ theme_override_constants/margin_bottom = 0 unique_name_in_owner = true modulate = Color(1, 1, 1, 0.5003133) material = SubResource("ShaderMaterial_6eft6") +custom_minimum_size = Vector2(66.16, 0) layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 8 diff --git a/gui/pointer/scripts/pointer.gd b/gui/pointer/scripts/pointer.gd index 29b9849..b3e525b 100644 --- a/gui/pointer/scripts/pointer.gd +++ b/gui/pointer/scripts/pointer.gd @@ -159,6 +159,7 @@ func update_card(): elif inspected is Control: %CardPosition.position = inspected.global_position + inspected.size / 2 + CARD_UP_PADDING * Vector2.UP elif inspected is Node3D: + %CardPosition.position = ( get_viewport().get_camera_3d().unproject_position(inspected.global_position) + CARD_UP_PADDING * Vector2.UP diff --git a/gui/ressources/menu.tres b/gui/ressources/menu.tres index 7c5ca10..765b89d 100644 --- a/gui/ressources/menu.tres +++ b/gui/ressources/menu.tres @@ -161,6 +161,7 @@ corner_radius_bottom_left = 5 [resource] Button/colors/font_color = Color(1, 1, 1, 1) +Button/colors/font_hover_color = Color(0.60122275, 0.6012229, 0.60122395, 1) Button/font_sizes/font_size = 25 Button/fonts/font = ExtResource("1_6ccgi") Button/styles/hover = SubResource("StyleBoxFlat_hv6r3") diff --git a/gui/vending_machine/assets/3d/vending_machine.blend1 b/gui/vending_machine/assets/3d/vending_machine.blend1 deleted file mode 100644 index 42eb334..0000000 Binary files a/gui/vending_machine/assets/3d/vending_machine.blend1 and /dev/null differ diff --git a/gui/vending_machine/scripts/vending_machine.gd b/gui/vending_machine/scripts/vending_machine.gd deleted file mode 100644 index 0b959aa..0000000 --- a/gui/vending_machine/scripts/vending_machine.gd +++ /dev/null @@ -1,88 +0,0 @@ -@tool -extends CanvasLayer -class_name VendingMachine - -enum State {CHOOSE,PAY,FETCH} -enum ChooseState {NONE,FIRST,SECOND} - -@export_tool_button("Update", "Callable") var update_action = update - -@export var state : State = State.CHOOSE : set = set_state -@export var choose_state : ChooseState = ChooseState.NONE : set = set_choose_state -@export var artefact_1 : Artefact = null : set = set_artifact_1 -@export var artefact_2 : Artefact = null : set = set_artifact_2 - -func _ready(): - update() - -func update(): - set_artifact_1() - set_artifact_2() - set_state() - -func set_state(s := state): - state = s - if is_node_ready(): - %PayButton.visible = state == State.PAY - %FetchButton.visible = state == State.FETCH - - match state: - State.CHOOSE: - %IndicationLabel.text = "CHOOSE_AN_ITEM" - State.PAY: - %IndicationLabel.text = "PAY_THE_PRICE" - State.FETCH: - %IndicationLabel.text = "GET_YOUR_ITEM" - -func set_choose_state(s := choose_state): - choose_state = s - if is_node_ready(): - %VendingMachine3d.screen_1_hide = s != ChooseState.FIRST - %VendingMachine3d.screen_2_hide = s != ChooseState.SECOND - -func set_artifact_1(a := artefact_1): - artefact_1 = a - if is_node_ready() and a: - %SelectButton1.text = a.get_artefact_name() - %VendingMachine3d.object_1_scene = a.get_3d_scene() - -func set_artifact_2(a := artefact_2): - artefact_2 = a - if is_node_ready() and a: - %SelectButton2.text = a.get_artefact_name() - %VendingMachine3d.object_2_scene = a.get_3d_scene() - - -func _on_fetch_button_button_down(): - pass # TODO : Adding the artifacts - - -func _on_pay_button_button_down(): - # TODO : The payment - if state == State.PAY and choose_state != ChooseState.NONE: - state = State.FETCH - - if choose_state == ChooseState.FIRST: - %VendingMachine3d.fall_object_1() - else : - %VendingMachine3d.fall_object_2() - -func _on_select_button_1_button_down(): - choose_state = ChooseState.FIRST - if state == State.CHOOSE: - state = State.PAY - -func _on_select_button_2_button_down(): - choose_state = ChooseState.SECOND - if state == State.CHOOSE: - state = State.PAY - -func _on_select_button_bis_1_button_down(): - choose_state = ChooseState.FIRST - if state == State.CHOOSE: - state = State.PAY - -func _on_select_button_bis_2_button_down(): - choose_state = ChooseState.SECOND - if state == State.CHOOSE: - state = State.PAY diff --git a/gui/vending_machine/scripts/vending_machine.gd.uid b/gui/vending_machine/scripts/vending_machine.gd.uid deleted file mode 100644 index 812982d..0000000 --- a/gui/vending_machine/scripts/vending_machine.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://d4jf1hruxqe6f diff --git a/gui/vending_machine/scripts/vending_machine_3d.gd b/gui/vending_machine/scripts/vending_machine_3d.gd deleted file mode 100644 index 31728b3..0000000 --- a/gui/vending_machine/scripts/vending_machine_3d.gd +++ /dev/null @@ -1,109 +0,0 @@ -@tool -extends Node3D -class_name VendingMachine3d - -const LINE_OBJECT_NUMBER = 5 -const LINE_OBJECT_SEPARATION = Vector3.LEFT * 0.2 -const FALLING_OBJECT_LINE_SHIFT = Vector3.FORWARD * 0.3 - -@export_tool_button("Update", "Callable") var update_action = update - -@export_tool_button("Fall Object 1", "Callable") var fall_object_1_action = fall_object_1 -@export_tool_button("Fall Object 1", "Callable") var fall_object_2_action = fall_object_2 - -@export var object_1_scene : PackedScene = null : set = set_object_1_scene -@export var object_2_scene : PackedScene = null : set = set_object_2_scene -@export var screen_1_hide : bool = true : set = set_screen_1_hide -@export var screen_2_hide : bool = true : set = set_screen_2_hide - -# func _input(_e): -# if Input.is_action_just_pressed("action"): -# fall_object([ -# %Line1, -# %Line2, -# %Line3, -# %Line4 -# ].pick_random()) - -func _ready(): - update() - -func update(): - set_object_1_scene() - set_object_2_scene() - set_screen_1_hide() - set_screen_2_hide() - -func set_object_1_scene(scene := object_1_scene): - if scene and is_node_ready(): - fill_lines(%Line1, scene.instantiate()) - fill_lines(%Line2, scene.instantiate()) - object_1_scene = scene - -func set_object_2_scene(scene := object_2_scene): - if scene and is_node_ready(): - fill_lines(%Line3, scene.instantiate()) - fill_lines(%Line4, scene.instantiate()) - object_2_scene = scene - -func set_screen_1_hide(v := screen_1_hide): - screen_1_hide = v - if is_node_ready(): - %HideScreen1.visible = v - -func set_screen_2_hide(v := screen_2_hide): - screen_2_hide = v - if is_node_ready(): - %HideScreen2.visible = v - -func fall_object_1(): - fall_object([ - %Line1, - %Line2 - ].pick_random()) - -func fall_object_2(): - fall_object([ - %Line3, - %Line4 - ].pick_random()) - -func fall_object(from_line : Node3D): - if len(from_line.get_children()): - var falling_object = create_falling_object() - - var object = from_line.get_children().pick_random() as Node3D - falling_object.global_position = object.global_position + FALLING_OBJECT_LINE_SHIFT - - var falling_model = object.duplicate() - falling_model.position = Vector3.ZERO - falling_object.add_child(falling_model) - falling_object.freeze = false - object.queue_free() - - %FallingObjects.add_child(falling_object) - -func clear_falling_objects(): - for c in %FallingObjects.get_children(): - c.queue_free() - -func create_falling_object() -> RigidBody3D: - var falling_object = RigidBody3D.new() - var falling_collider = CollisionShape3D.new() - var falling_shape = SphereShape3D.new() - falling_shape.radius = 0.08 - falling_collider.shape = falling_shape - falling_object.add_child(falling_collider) - falling_object.gravity_scale = 0.2 - - return falling_object - -func fill_lines(line : Node3D, object : Node3D): - for c in line.get_children(): - c.queue_free() - - for i in range(LINE_OBJECT_NUMBER): - var new_object = object.duplicate() - line.add_child(new_object) - new_object.position = i * LINE_OBJECT_SEPARATION - diff --git a/gui/vending_machine/vending_machine.tscn b/gui/vending_machine/vending_machine.tscn deleted file mode 100644 index c5aea09..0000000 --- a/gui/vending_machine/vending_machine.tscn +++ /dev/null @@ -1,399 +0,0 @@ -[gd_scene format=3 uid="uid://du308iardw46"] - -[ext_resource type="Script" uid="uid://d4jf1hruxqe6f" path="res://gui/vending_machine/scripts/vending_machine.gd" id="1_7iup0"] -[ext_resource type="Texture2D" uid="uid://bi5jo6pf0acjb" path="res://common/icons/carambola.svg" id="1_y06tm"] -[ext_resource type="PackedScene" uid="uid://blva21dapmm68" path="res://gui/vending_machine/vending_machine_3d.tscn" id="2_54ak6"] -[ext_resource type="Script" uid="uid://c6lr0fucklsto" path="res://gui/artefacts/pile/pile.gd" id="2_dvtve"] -[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="3_54ak6"] -[ext_resource type="Script" uid="uid://c7o5p4uk556v6" path="res://gui/artefacts/seed_case/seed_case.gd" id="3_fy3vt"] -[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="4_se5lc"] -[ext_resource type="Texture2D" uid="uid://bmersnaoira20" path="res://common/icons/building-store.svg" id="4_yho0h"] -[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="5_rrfqi"] -[ext_resource type="PackedScene" uid="uid://dolv2637emdbw" path="res://gui/artefacts/pile/pile.blend" id="6_dhfph"] -[ext_resource type="PackedScene" uid="uid://cclvb8o3vofff" path="res://gui/artefacts/seed_case/seed_case.blend" id="7_lv3q6"] -[ext_resource type="Texture2D" uid="uid://3slhocr5wy3w" path="res://common/icons/hand-stop.svg" id="12_bfufr"] -[ext_resource type="Texture2D" uid="uid://4dwxhvjo0yye" path="res://common/icons/hand-grab.svg" id="13_ub0g7"] - -[sub_resource type="Resource" id="Resource_dhfph"] -script = ExtResource("3_fy3vt") -metadata/_custom_type_script = "uid://c7o5p4uk556v6" - -[sub_resource type="Resource" id="Resource_lv3q6"] -script = ExtResource("2_dvtve") -metadata/_custom_type_script = "uid://c6lr0fucklsto" - -[sub_resource type="ViewportTexture" id="ViewportTexture_54ak6"] -viewport_path = NodePath("CenterContainer/Particles/SubViewport") - -[sub_resource type="Curve" id="Curve_yho0h"] -_limits = [-200.0, 200.0, 0.0, 1.0] -_data = [Vector2(0, -200), 0.0, 560.0, 0, 0, Vector2(0.08235294, 92.384125), 1336.3082, 1336.3082, 0, 0, Vector2(0.34901965, 200), 0.0, 0.0, 0, 0, Vector2(0.854902, -200), 0.0, 0.0, 0, 0] -point_count = 4 - -[sub_resource type="Gradient" id="Gradient_rrfqi"] -offsets = PackedFloat32Array(0, 0.8689956, 0.98253274) -colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) - -[sub_resource type="ViewportTexture" id="ViewportTexture_yho0h"] -viewport_path = NodePath("CenterContainer/VendingMachin/VendingMachineVP") - -[sub_resource type="Environment" id="Environment_y06tm"] -ambient_light_source = 2 -ambient_light_color = Color(1, 1, 1, 1) -ambient_light_energy = 2.29 -tonemap_exposure = 0.62 - -[sub_resource type="LabelSettings" id="LabelSettings_rrfqi"] -font = ExtResource("3_54ak6") -font_size = 20 - -[sub_resource type="LabelSettings" id="LabelSettings_se5lc"] -font = ExtResource("3_54ak6") -font_size = 14 - -[sub_resource type="LabelSettings" id="LabelSettings_7iup0"] -font = ExtResource("3_54ak6") -font_size = 40 - -[sub_resource type="Animation" id="Animation_fy3vt"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("CenterContainer/VendingMachin/IndicationLabel:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Color(1, 1, 1, 1)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("CenterContainer/VendingMachin/FetchButton:modulate") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Color(1, 1, 1, 1)] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("CenterContainer/VendingMachin/PayButton:modulate") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Color(1, 1, 1, 1)] -} - -[sub_resource type="Animation" id="Animation_41u7u"] -resource_name = "blink" -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("CenterContainer/VendingMachin/IndicationLabel:modulate") -tracks/0/interp = 2 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.4666667, 1.0666666), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0.5294118), Color(1, 1, 1, 1)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("CenterContainer/VendingMachin/FetchButton:modulate") -tracks/1/interp = 2 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 0.5, 1), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0.5294118), Color(1, 1, 1, 1)] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("CenterContainer/VendingMachin/PayButton:modulate") -tracks/2/interp = 2 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 0.53333336, 1), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0.5294118), Color(1, 1, 1, 1)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_dhfph"] -_data = { -&"RESET": SubResource("Animation_fy3vt"), -&"blink": SubResource("Animation_41u7u") -} - -[node name="VendingMachine" type="CanvasLayer" unique_id=287282444] -script = ExtResource("1_7iup0") -artefact_1 = SubResource("Resource_dhfph") -artefact_2 = SubResource("Resource_lv3q6") - -[node name="CenterContainer" type="Control" parent="." unique_id=317195558] -layout_mode = 3 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -288.0 -offset_top = -324.0 -offset_right = 288.0 -offset_bottom = 324.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Particles" type="TextureRect" parent="CenterContainer" unique_id=378633537] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -450.0 -offset_top = -450.0 -offset_right = 450.0 -offset_bottom = 450.0 -grow_horizontal = 2 -grow_vertical = 2 -texture = SubResource("ViewportTexture_54ak6") -expand_mode = 1 -stretch_mode = 5 - -[node name="SubViewport" type="SubViewport" parent="CenterContainer/Particles" unique_id=1096007664] -transparent_bg = true -size = Vector2i(900, 900) - -[node name="GPUParticles2D" type="CPUParticles2D" parent="CenterContainer/Particles/SubViewport" unique_id=1560379094] -position = Vector2(500, 500) -amount = 20 -texture = ExtResource("1_y06tm") -lifetime = 1.2 -preprocess = 1.0 -spread = 180.0 -gravity = Vector2(0, 0) -initial_velocity_min = 2.0 -initial_velocity_max = 2.0 -linear_accel_min = 5.0 -linear_accel_max = 5.0 -linear_accel_curve = SubResource("Curve_yho0h") -color_ramp = SubResource("Gradient_rrfqi") - -[node name="VendingMachin" type="TextureRect" parent="CenterContainer" unique_id=2108096957] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -322.25 -offset_top = -322.25 -offset_right = 322.25 -offset_bottom = 322.25 -grow_horizontal = 2 -grow_vertical = 2 -texture = SubResource("ViewportTexture_yho0h") -expand_mode = 2 -stretch_mode = 5 - -[node name="VendingMachineVP" type="SubViewport" parent="CenterContainer/VendingMachin" unique_id=824295205] -transparent_bg = true -size = Vector2i(568, 543) - -[node name="VendingMachine3d" parent="CenterContainer/VendingMachin/VendingMachineVP" unique_id=92614917 instance=ExtResource("2_54ak6")] -unique_name_in_owner = true -object_1_scene = ExtResource("7_lv3q6") -object_2_scene = ExtResource("6_dhfph") -screen_1_hide = true -screen_2_hide = true - -[node name="Camera3D" type="Camera3D" parent="CenterContainer/VendingMachin/VendingMachineVP" unique_id=1303604896] -transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0.375, -3) -keep_aspect = 0 -current = true -fov = 58.9 - -[node name="WorldEnvironment" type="WorldEnvironment" parent="CenterContainer/VendingMachin/VendingMachineVP" unique_id=1731409341] -environment = SubResource("Environment_y06tm") - -[node name="MachineNameLabel" type="Label" parent="CenterContainer/VendingMachin" unique_id=1373981633] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -66.0 -offset_top = -245.0 -offset_right = 126.0 -offset_bottom = -189.5 -grow_horizontal = 2 -grow_vertical = 2 -text = "ARTEFACTS_VENDING_MACHINE" -label_settings = SubResource("LabelSettings_rrfqi") -horizontal_alignment = 1 -vertical_alignment = 1 -autowrap_mode = 3 - -[node name="IndicationLabel" type="Label" parent="CenterContainer/VendingMachin" unique_id=1388081478] -unique_name_in_owner = true -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = 169.0 -offset_top = -160.0 -offset_right = 266.0 -offset_bottom = -37.0 -grow_horizontal = 2 -grow_vertical = 2 -text = "CHOOSE_AN_ITEM" -label_settings = SubResource("LabelSettings_se5lc") -horizontal_alignment = 1 -vertical_alignment = 1 -autowrap_mode = 3 - -[node name="SelectButton1" type="Button" parent="CenterContainer/VendingMachin" unique_id=2142322105] -unique_name_in_owner = true -layout_mode = 0 -offset_left = 39.25 -offset_top = 159.25 -offset_right = 176.25 -offset_bottom = 250.25 -theme = ExtResource("4_se5lc") -theme_override_font_sizes/font_size = 14 -text = "SEED_CASE" -flat = true -autowrap_mode = 3 - -[node name="SelectButton2" type="Button" parent="CenterContainer/VendingMachin" unique_id=65989609] -unique_name_in_owner = true -layout_mode = 0 -offset_left = 41.25 -offset_top = 273.0 -offset_right = 179.25 -offset_bottom = 372.25 -theme = ExtResource("4_se5lc") -theme_override_font_sizes/font_size = 14 -text = "PILE" -flat = true -autowrap_mode = 3 - -[node name="SelectButtonBis1" type="Button" parent="CenterContainer/VendingMachin" unique_id=741069555] -unique_name_in_owner = true -layout_mode = 0 -offset_left = 232.25 -offset_top = 161.25 -offset_right = 466.25 -offset_bottom = 254.25 -theme = ExtResource("4_se5lc") -theme_override_font_sizes/font_size = 14 -flat = true -autowrap_mode = 3 - -[node name="SelectButtonBis2" type="Button" parent="CenterContainer/VendingMachin" unique_id=1526377722] -unique_name_in_owner = true -layout_mode = 0 -offset_left = 221.25 -offset_top = 273.25 -offset_right = 465.5 -offset_bottom = 377.25 -theme = ExtResource("4_se5lc") -theme_override_font_sizes/font_size = 14 -flat = true -autowrap_mode = 3 - -[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VendingMachin" unique_id=190465213] -layout_mode = 0 -offset_left = 508.25 -offset_top = 320.25 -offset_right = 570.25 -offset_bottom = 366.25 -theme_override_constants/separation = 0 -alignment = 1 - -[node name="PriceLabel" type="Label" parent="CenterContainer/VendingMachin/HBoxContainer" unique_id=1448579465] -layout_mode = 2 -text = "3" -label_settings = SubResource("LabelSettings_7iup0") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="PriceIcon" type="TextureRect" parent="CenterContainer/VendingMachin/HBoxContainer" unique_id=253690587] -layout_mode = 2 -size_flags_horizontal = 3 -texture = ExtResource("5_rrfqi") -expand_mode = 1 -stretch_mode = 5 - -[node name="TextureRect" type="TextureRect" parent="CenterContainer/VendingMachin" unique_id=174895788] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = 3.0 -offset_top = -298.0 -offset_right = 42.0 -offset_bottom = -259.0 -grow_horizontal = 2 -grow_vertical = 2 -texture = ExtResource("4_yho0h") -expand_mode = 1 -stretch_mode = 5 - -[node name="FetchButton" type="TextureButton" parent="CenterContainer/VendingMachin" unique_id=986015945] -unique_name_in_owner = true -layout_mode = 0 -offset_left = 265.25 -offset_top = 478.25 -offset_right = 459.25 -offset_bottom = 567.25 -texture_normal = ExtResource("12_bfufr") -texture_pressed = ExtResource("13_ub0g7") -texture_hover = ExtResource("12_bfufr") -stretch_mode = 5 - -[node name="PayButton" type="TextureButton" parent="CenterContainer/VendingMachin" unique_id=1470524600] -unique_name_in_owner = true -layout_mode = 0 -offset_left = 491.25 -offset_top = 400.25 -offset_right = 599.25 -offset_bottom = 484.25 -texture_normal = ExtResource("12_bfufr") -texture_pressed = ExtResource("13_ub0g7") -texture_hover = ExtResource("12_bfufr") -stretch_mode = 5 - -[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1440649675] -libraries/ = SubResource("AnimationLibrary_dhfph") -autoplay = &"blink" - -[connection signal="button_down" from="CenterContainer/VendingMachin/SelectButton1" to="." method="_on_select_button_1_button_down"] -[connection signal="button_down" from="CenterContainer/VendingMachin/SelectButton2" to="." method="_on_select_button_2_button_down"] -[connection signal="button_down" from="CenterContainer/VendingMachin/SelectButtonBis1" to="." method="_on_select_button_bis_1_button_down"] -[connection signal="button_down" from="CenterContainer/VendingMachin/SelectButtonBis2" to="." method="_on_select_button_bis_2_button_down"] -[connection signal="button_down" from="CenterContainer/VendingMachin/FetchButton" to="." method="_on_fetch_button_button_down"] -[connection signal="button_down" from="CenterContainer/VendingMachin/PayButton" to="." method="_on_pay_button_button_down"] diff --git a/gui/vending_machine/vending_machine_3d.tscn b/gui/vending_machine/vending_machine_3d.tscn deleted file mode 100644 index 0aac8c1..0000000 --- a/gui/vending_machine/vending_machine_3d.tscn +++ /dev/null @@ -1,62 +0,0 @@ -[gd_scene format=3 uid="uid://blva21dapmm68"] - -[ext_resource type="PackedScene" uid="uid://5l3wve81irlc" path="res://gui/vending_machine/assets/3d/vending_machine.blend" id="1_28vvr"] -[ext_resource type="Script" uid="uid://d1prpiulsaqhn" path="res://gui/vending_machine/scripts/vending_machine_3d.gd" id="1_awnyh"] -[ext_resource type="PackedScene" uid="uid://cclvb8o3vofff" path="res://gui/artefacts/seed_case/seed_case.blend" id="2_7ycki"] -[ext_resource type="PackedScene" uid="uid://dolv2637emdbw" path="res://gui/artefacts/pile/pile.blend" id="3_fue4l"] - -[sub_resource type="Environment" id="Environment_28vvr"] -ambient_light_source = 2 -ambient_light_color = Color(1, 1, 1, 1) -ambient_light_energy = 2.29 -tonemap_exposure = 0.62 - -[sub_resource type="Gradient" id="Gradient_7ycki"] -colors = PackedColorArray(0.06318334, 0.059500005, 0.17, 1, 0.06318334, 0.059500005, 0.17, 1) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_vo550"] -gradient = SubResource("Gradient_7ycki") -height = 42 - -[node name="VendingMachine3d" type="Node3D" unique_id=92614917] -script = ExtResource("1_awnyh") -object_1_scene = ExtResource("3_fue4l") -object_2_scene = ExtResource("2_7ycki") -screen_1_hide = false -screen_2_hide = false - -[node name="Model" parent="." unique_id=2067475525 instance=ExtResource("1_28vvr")] - -[node name="Line1" type="Node3D" parent="." unique_id=1631780989] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30948043, 0.971, 0) - -[node name="Line2" type="Node3D" parent="." unique_id=29729480] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30941665, 0.74758303, 0) - -[node name="Line3" type="Node3D" parent="." unique_id=532403895] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30941665, 0.5122718, 0) - -[node name="Line4" type="Node3D" parent="." unique_id=290175423] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30941665, 0.26622266, 0) - -[node name="FallingObjects" type="Node3D" parent="." unique_id=1744524061] -unique_name_in_owner = true - -[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1595767490] -environment = SubResource("Environment_28vvr") - -[node name="HideScreen1" type="Sprite3D" parent="." unique_id=1626145809] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.89098024, 0.88590515, -0.55653703) -visible = false -texture = SubResource("GradientTexture2D_vo550") - -[node name="HideScreen2" type="Sprite3D" parent="." unique_id=121839387] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.89098024, 0.34462702, -0.55653703) -visible = false -texture = SubResource("GradientTexture2D_vo550") diff --git a/project.godot b/project.godot index 89807d3..ba85731 100644 --- a/project.godot +++ b/project.godot @@ -16,7 +16,7 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true config/name="Seeding The Wasteland" config/description="Seeding planets is a survival, managment and cosy game in which you play a little gardener robot." -config/version="alpha-1.3.1" +config/version="beta-1" run/main_scene="uid://c5bruelvqbm1k" config/features=PackedStringArray("4.6", "Forward Plus") config/icon="uid://df0y0s666ui4h" @@ -30,12 +30,12 @@ buses/default_bus_layout="uid://b4cpfxfs74sb8" PlantTextureBuilder="*uid://b8gqdgabrjaml" Pointer="*res://gui/pointer/pointer.tscn" AudioManager="*res://common/audio_manager/audio_manager.tscn" -GameInfo="*res://common/game_info/game_info.gd" Pause="*res://gui/pause/pause.tscn" Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd" LoadingScreen="*res://gui/loading_screen/loading_screen.tscn" SceneManager="*res://common/scene_manager/scene_manager.tscn" SteamConnection="*uid://bq12bubjof2mo" +GameInfo="*res://common/game_info/game_info.gd" [dialogic] diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend b/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend index 5c250b3..28b56b9 100644 Binary files a/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend and b/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend differ diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend1 b/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend1 index be4b6a4..5c250b3 100644 Binary files a/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend1 and b/stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend1 differ diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend new file mode 100644 index 0000000..d9e289c Binary files /dev/null and b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend differ diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend.import b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend.import new file mode 100644 index 0000000..88b3012 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend.import @@ -0,0 +1,68 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://i28ngc4hgq85" +path="res://.godot/imported/screen.blend-f05722182a95a41f2104aab7afc27fbd.scn" + +[deps] + +source_file="res://stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend" +dest_files=["res://.godot/imported/screen.blend-f05722182a95a41f2104aab7afc27fbd.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": { +"Material": { +"use_external/enabled": true, +"use_external/fallback_path": "res://common/assets/materials/default_3d.tres", +"use_external/path": "uid://dvvi1k5c5iowc" +} +} +} +blender/nodes/visible=0 +blender/nodes/active_collection_only=false +blender/nodes/punctual_lights=true +blender/nodes/cameras=true +blender/nodes/custom_properties=true +blender/nodes/modifiers=1 +blender/meshes/colors=false +blender/meshes/uvs=true +blender/meshes/normals=true +blender/meshes/export_geometry_nodes_instances=false +blender/meshes/gpu_instances=false +blender/meshes/tangents=true +blender/meshes/skins=2 +blender/meshes/export_bones_deforming_mesh_only=false +blender/materials/unpack_enabled=true +blender/materials/export_materials=1 +blender/animation/limit_playback=true +blender/animation/always_sample=true +blender/animation/group_tracks=true +gltf/naming_version=2 diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend1 b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend1 new file mode 100644 index 0000000..d3a767f Binary files /dev/null and b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend1 differ diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend index eb1ad48..667255e 100644 Binary files a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend and b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend differ diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend1 b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend1 index 5e3d68b..72e5368 100644 Binary files a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend1 and b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend1 differ diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend new file mode 100644 index 0000000..3f044aa Binary files /dev/null and b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend differ diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend.import b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend.import new file mode 100644 index 0000000..8df47dc --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend.import @@ -0,0 +1,68 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://b4wdov3y1ulyb" +path="res://.godot/imported/shelf.blend-71d6b6a0b2e3a015b18c034dd3a9475a.scn" + +[deps] + +source_file="res://stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend" +dest_files=["res://.godot/imported/shelf.blend-71d6b6a0b2e3a015b18c034dd3a9475a.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": { +"Material": { +"use_external/enabled": true, +"use_external/fallback_path": "res://common/assets/materials/default_3d.tres", +"use_external/path": "uid://dvvi1k5c5iowc" +} +} +} +blender/nodes/visible=0 +blender/nodes/active_collection_only=false +blender/nodes/punctual_lights=true +blender/nodes/cameras=true +blender/nodes/custom_properties=true +blender/nodes/modifiers=1 +blender/meshes/colors=false +blender/meshes/uvs=true +blender/meshes/normals=true +blender/meshes/export_geometry_nodes_instances=false +blender/meshes/gpu_instances=false +blender/meshes/tangents=true +blender/meshes/skins=2 +blender/meshes/export_bones_deforming_mesh_only=false +blender/materials/unpack_enabled=true +blender/materials/export_materials=1 +blender/animation/limit_playback=true +blender/animation/always_sample=true +blender/animation/group_tracks=true +gltf/naming_version=2 diff --git a/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend1 b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend1 new file mode 100644 index 0000000..18d9ca4 Binary files /dev/null and b/stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend1 differ diff --git a/stages/3d_scenes/cockpit_scene/cockpit.tscn b/stages/3d_scenes/cockpit_scene/cockpit.tscn index bb120fb..be3ae10 100644 --- a/stages/3d_scenes/cockpit_scene/cockpit.tscn +++ b/stages/3d_scenes/cockpit_scene/cockpit.tscn @@ -7,7 +7,9 @@ [ext_resource type="PackedScene" uid="uid://by45bbbnf0k13" path="res://gui/game/objective_progress_bar/gauge_3d.tscn" id="4_ers7b"] [ext_resource type="PackedScene" uid="uid://d01cp8xl0rme4" path="res://gui/game/energy_info/energy_info_3d.tscn" id="6_ogqwl"] [ext_resource type="PackedScene" uid="uid://jjkw4edrewsk" path="res://stages/3d_scenes/cockpit_scene/assets/3d/furnitures/closet.blend" id="7_lnpag"] -[ext_resource type="PackedScene" uid="uid://cv0ehgy3d1kmj" path="res://stages/3d_scenes/cockpit_scene/dashboard.tscn" id="8_seqvk"] +[ext_resource type="PackedScene" uid="uid://cv0ehgy3d1kmj" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn" id="8_seqvk"] +[ext_resource type="PackedScene" uid="uid://cgw2ct7smispo" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/shelf.tscn" id="11_w4l7d"] +[ext_resource type="PackedScene" uid="uid://dd6k80rhux1do" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/plant_info_screen.tscn" id="12_pxmsf"] [ext_resource type="PackedScene" uid="uid://da7a74dg30q1l" path="res://entities/player_3d/player_3D.tscn" id="13_a2cx2"] [ext_resource type="PackedScene" uid="uid://blvetnnib2ks0" path="res://stages/3d_scenes/cockpit_scene/assets/3d/cockpit2.blend" id="17_omtjc"] @@ -84,12 +86,12 @@ interactable = false [node name="Gauge3D" parent="." unique_id=232507348 instance=ExtResource("4_ers7b")] unique_name_in_owner = true -transform = Transform3D(-0.06800815, 0.07331366, -3.2046419e-09, 0, -4.371139e-09, -0.1, -0.07331366, -0.06800815, 2.9727303e-09, 1.1649051, -0.56147563, 4.99477) +transform = Transform3D(-4.371139e-09, 0, 0.1, -0.06187238, 0.07856086, -2.7045277e-09, -0.07856086, -0.06187238, -3.4340044e-09, -0.034603596, 1.1559428, 5.314687) progress = 1.78 [node name="EnergyInfo3d" parent="." unique_id=1798644168 instance=ExtResource("6_ogqwl")] unique_name_in_owner = true -transform = Transform3D(0.23, 0, 0, 0, 0.23, 0, 0, 0, 0.23, -1.2966455, -0.51924133, 4.2738743) +transform = Transform3D(0.23, 0, 0, 0, 0.23, 0, 0, 0, 0.23, -1.2966455, -0.8972735, 4.2738743) max_energy = 3 [node name="Furnitures" type="Node3D" parent="." unique_id=1095424400] @@ -103,3 +105,9 @@ transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 1.13 [node name="Dashboard" parent="." unique_id=1374334508 instance=ExtResource("8_seqvk")] unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.035136223, -0.7094687, 6.45286) + +[node name="Shelf" parent="." unique_id=1769159984 instance=ExtResource("11_w4l7d")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.1218804, -1.0799314, 2.6211417) + +[node name="PlantInfoScreen" parent="." unique_id=1881622243 instance=ExtResource("12_pxmsf")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.2386853, -0.047743827, 4.020312) diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/artefact_diplayer.tscn b/stages/3d_scenes/cockpit_scene/cockpit_elements/artefact_diplayer.tscn new file mode 100644 index 0000000..e44733d --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/artefact_diplayer.tscn @@ -0,0 +1,19 @@ +[gd_scene format=3 uid="uid://xsgcpgsxmboy"] + +[ext_resource type="Script" uid="uid://bejxdxbdddqgx" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/artefact_diplayer.gd" id="1_mb4w6"] + +[sub_resource type="SphereShape3D" id="SphereShape3D_uy2vb"] +radius = 0.17572357 + +[node name="ArtefactDiplayer" type="Area3D" unique_id=676305823] +script = ExtResource("1_mb4w6") +interactable = false +inspectable = true +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=494100172] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.02765441, 0) +shape = SubResource("SphereShape3D_uy2vb") + +[node name="Model" type="Node3D" parent="." unique_id=1722072978] +unique_name_in_owner = true diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn b/stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn new file mode 100644 index 0000000..9ec8700 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/dashboard.tscn @@ -0,0 +1,384 @@ +[gd_scene format=3 uid="uid://cv0ehgy3d1kmj"] + +[ext_resource type="Script" uid="uid://fet6urfgiiwr" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd" id="1_vks67"] +[ext_resource type="Texture2D" uid="uid://cgmxjom200bej" path="res://common/icons/chevrons-up.svg" id="2_eij3d"] +[ext_resource type="PackedScene" uid="uid://cs5gir1u8jbrg" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/holo_content.tscn" id="3_go2gd"] +[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_7u0n5"] +[ext_resource type="Script" uid="uid://bj4d1x8n8ina" path="res://entities/interactable_3d/interactable_3d.gd" id="5_g7q16"] +[ext_resource type="PackedScene" uid="uid://bnvqwsxgrd14y" path="res://stages/3d_scenes/cockpit_scene/assets/3d/dashboard.blend" id="6_emtfq"] +[ext_resource type="Script" uid="uid://vf8nm8ch1p8s" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard_run_point_screen.gd" id="7_lskho"] +[ext_resource type="PackedScene" uid="uid://cdvegfgvp7053" path="res://stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend" id="8_psxhb"] +[ext_resource type="Texture2D" uid="uid://bsgmxvuphn73c" path="res://common/icons/arrow-narrow-down.svg" id="9_v1m0r"] +[ext_resource type="PackedScene" uid="uid://crbjmwumboelw" path="res://gui/game/inventory_gui/inventory_3d.tscn" id="10_y1ysr"] +[ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://entities/player/inventory/scripts/item.gd" id="11_3cel1"] +[ext_resource type="Script" uid="uid://fnu2d6wna4yc" path="res://entities/player/inventory/scripts/inventory.gd" id="12_oix5e"] + +[sub_resource type="ViewportTexture" id="ViewportTexture_cvt2p"] +viewport_path = NodePath("Holo/SubViewport") + +[sub_resource type="ViewportTexture" id="ViewportTexture_5d7hc"] +viewport_path = NodePath("StatusScreen/SubViewport") + +[sub_resource type="SphereShape3D" id="SphereShape3D_vlkbw"] + +[sub_resource type="ViewportTexture" id="ViewportTexture_qbi61"] +viewport_path = NodePath("MainScreen/MainScreenSprite/SubViewport") + +[sub_resource type="Animation" id="Animation_vlkbw"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("MainScreenSprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(1, 1, 1)] +} + +[sub_resource type="Animation" id="Animation_qbi61"] +resource_name = "hover" +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("MainScreenSprite:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.5, 1), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector3(1, 1, 1), Vector3(1.2, 1.2, 1.2), Vector3(1, 1, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_2ofl5"] +_data = { +&"RESET": SubResource("Animation_vlkbw"), +&"hover": SubResource("Animation_qbi61") +} + +[sub_resource type="ViewportTexture" id="ViewportTexture_2ofl5"] +viewport_path = NodePath("RightScreen/RightScreenAction/SubViewport") + +[sub_resource type="SphereShape3D" id="SphereShape3D_2q8cl"] +radius = 0.34611636 + +[sub_resource type="Animation" id="Animation_stoj6"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("%RightScreenAction:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(1, 1.0000002, 1)] +} + +[sub_resource type="Animation" id="Animation_5d7hc"] +resource_name = "hover" +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("%RightScreenAction:scale") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.5, 1), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector3(1, 1.0000002, 1), Vector3(1.2, 1.2, 1.2), Vector3(1, 1.0000002, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_h8fs1"] +_data = { +&"RESET": SubResource("Animation_stoj6"), +&"hover": SubResource("Animation_5d7hc") +} + +[sub_resource type="Animation" id="Animation_2kujw"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("LeftScreenAction:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(1, 1.0000002, 1)] +} + +[sub_resource type="Animation" id="Animation_2q8cl"] +resource_name = "hover" +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("LeftScreenAction:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0.033333335, 0.53333336, 1), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector3(1, 1.0000002, 1), Vector3(1.2, 1.2, 1.2), Vector3(1, 1.0000002, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_cvt2p"] +_data = { +&"RESET": SubResource("Animation_2kujw"), +&"hover": SubResource("Animation_2q8cl") +} + +[sub_resource type="Resource" id="Resource_ne0dp"] +script = ExtResource("12_oix5e") +items = Array[ExtResource("11_3cel1")]([null, null, null]) +n_tools = 1 +metadata/_custom_type_script = "uid://fnu2d6wna4yc" + +[node name="Dashboard" type="Node3D" unique_id=1374334508] +script = ExtResource("1_vks67") +main_screen_icon = ExtResource("2_eij3d") +destination_title = "TO_BOREA_BASE" + +[node name="Holo" type="Sprite3D" parent="." unique_id=1067303692] +unique_name_in_owner = true +transform = Transform3D(-1, 0, -8.742278e-08, 0, 1.0000002, 0, 8.742278e-08, 0, -1, 0, 0.83082896, 0.33655214) +pixel_size = 0.004 +texture = SubResource("ViewportTexture_cvt2p") + +[node name="SubViewport" type="SubViewport" parent="Holo" unique_id=471832787] +disable_3d = true +transparent_bg = true +size = Vector2i(365, 68) + +[node name="HoloContent" parent="Holo/SubViewport" unique_id=668915500 instance=ExtResource("3_go2gd")] +unique_name_in_owner = true +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -162.0 +offset_top = -28.0 +offset_right = 162.0 +offset_bottom = 28.0 +grow_horizontal = 2 +grow_vertical = 2 +stop_name = "" + +[node name="StatusScreen" type="Sprite3D" parent="." unique_id=1257606535] +unique_name_in_owner = true +transform = Transform3D(-1, 0, -8.742278e-08, 0, 1.0000002, 0, 8.742278e-08, 0, -1, 0, 1.0703605, 0.35432142) +modulate = Color(1, 0, 0.43137255, 1) +pixel_size = 0.003 +texture = SubResource("ViewportTexture_5d7hc") + +[node name="SubViewport" type="SubViewport" parent="StatusScreen" unique_id=1357189828] +disable_3d = true +transparent_bg = true +size = Vector2i(435, 98) + +[node name="VBoxContainer" type="VBoxContainer" parent="StatusScreen/SubViewport" unique_id=2076282975] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_constants/separation = -10 +alignment = 1 + +[node name="StatusLabel" type="Label" parent="StatusScreen/SubViewport/VBoxContainer" unique_id=86551380] +unique_name_in_owner = true +layout_mode = 2 +text = "Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla " +label_settings = ExtResource("4_7u0n5") +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="MainScreen" type="Area3D" parent="." unique_id=874806978 node_paths=PackedStringArray("hover_animation_player")] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.42284742, 0.4816055) +script = ExtResource("5_g7q16") +interactable = false +hover_animation_player = NodePath("HoverAnimationPlayer") +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="CollisionShape3D" type="CollisionShape3D" parent="MainScreen" unique_id=1935076244] +shape = SubResource("SphereShape3D_vlkbw") + +[node name="MainScreenSprite" type="Sprite3D" parent="MainScreen" unique_id=1081515212] +unique_name_in_owner = true +transform = Transform3D(-1, 8.0014914e-08, 5.4146472e-08, 7.923836e-08, 0.35859588, 0.9334929, 5.5276644e-08, 0.9334929, -0.35859588, 0, 0, 0) +visible = false +pixel_size = 0.003 +texture = SubResource("ViewportTexture_qbi61") + +[node name="SubViewport" type="SubViewport" parent="MainScreen/MainScreenSprite" unique_id=1101534363] +transparent_bg = true +size = Vector2i(150, 150) + +[node name="VBoxContainer" type="VBoxContainer" parent="MainScreen/MainScreenSprite/SubViewport" unique_id=758261583] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_constants/separation = -10 +alignment = 1 + +[node name="MainScreenIcon" type="TextureRect" parent="MainScreen/MainScreenSprite/SubViewport/VBoxContainer" unique_id=1128176178] +unique_name_in_owner = true +custom_minimum_size = Vector2(100, 100) +layout_mode = 2 +texture = ExtResource("2_eij3d") +expand_mode = 3 +stretch_mode = 5 + +[node name="MainScreenLabel" type="Label" parent="MainScreen/MainScreenSprite/SubViewport/VBoxContainer" unique_id=2102392578] +unique_name_in_owner = true +layout_mode = 2 +text = "Take Off" +label_settings = ExtResource("4_7u0n5") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="HoverAnimationPlayer" type="AnimationPlayer" parent="MainScreen" unique_id=74243401] +libraries/ = SubResource("AnimationLibrary_2ofl5") + +[node name="DashboardModel" parent="." unique_id=635273073 instance=ExtResource("6_emtfq")] + +[node name="RightScreen" type="Area3D" parent="." unique_id=748959616 node_paths=PackedStringArray("action_icon", "action_label", "hover_animation_player")] +unique_name_in_owner = true +transform = Transform3D(0.6401096, -0.4515857, -0.6215544, 0, 0.809017, -0.58778524, 0.76828337, 0.37624705, 0.51785964, -0.65, 0.5, 0.2) +script = ExtResource("7_lskho") +action_icon = NodePath("RightScreenAction/SubViewport/VBoxContainer/RightScreenActionIcon") +action_label = NodePath("RightScreenAction/SubViewport/VBoxContainer/RightScreenActionLabel") +inspectable = true +hover_animation_player = NodePath("RightScreenHoverAnimationPlayer") +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="RightScreenModel" parent="RightScreen" unique_id=2091343612 instance=ExtResource("8_psxhb")] +transform = Transform3D(-1, -2.9802322e-08, -2.9802322e-08, 0, 1, 0, -2.9802322e-08, 1.4901161e-08, 1, 0, -0.07, 0.05) + +[node name="RightScreenAction" type="Sprite3D" parent="RightScreen" unique_id=1289027629] +unique_name_in_owner = true +transform = Transform3D(-1, 2.9802298e-08, 1.509958e-07, 2.9802322e-08, 1.0000002, 2.0861621e-07, -1.509958e-07, 2.0861626e-07, -1, -0.01, -0.04, -0.015) +pixel_size = 0.0015 +texture = SubResource("ViewportTexture_2ofl5") + +[node name="SubViewport" type="SubViewport" parent="RightScreen/RightScreenAction" unique_id=837587699] +transparent_bg = true +size = Vector2i(150, 180) + +[node name="VBoxContainer" type="VBoxContainer" parent="RightScreen/RightScreenAction/SubViewport" unique_id=536772063] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_constants/separation = -10 +alignment = 1 + +[node name="RightScreenActionIcon" type="TextureRect" parent="RightScreen/RightScreenAction/SubViewport/VBoxContainer" unique_id=788824067] +unique_name_in_owner = true +custom_minimum_size = Vector2(100, 100) +layout_mode = 2 +texture = ExtResource("9_v1m0r") +expand_mode = 3 +stretch_mode = 5 + +[node name="RightScreenActionLabel" type="Label" parent="RightScreen/RightScreenAction/SubViewport/VBoxContainer" unique_id=2019588267] +unique_name_in_owner = true +layout_mode = 2 +text = "Uwoqos Uwoqos " +label_settings = ExtResource("4_7u0n5") +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="RightScreen" unique_id=1017949170] +transform = Transform3D(1, -2.9802322e-08, -2.9802322e-08, 0, 1, 0, 2.9802322e-08, 1.4901161e-08, 1, 0, 0, 0) +shape = SubResource("SphereShape3D_2q8cl") + +[node name="RightScreenHoverAnimationPlayer" type="AnimationPlayer" parent="RightScreen" unique_id=1823283272] +libraries/ = SubResource("AnimationLibrary_h8fs1") + +[node name="LeftScreen" type="Area3D" parent="." unique_id=1517503720 node_paths=PackedStringArray("action_icon", "action_label", "hover_animation_player")] +unique_name_in_owner = true +transform = Transform3D(0.6401096, 0.4515857, 0.6215543, 0, 0.809017, -0.5877852, -0.76828337, 0.37624705, 0.5178596, 0.65, 0.5, 0.2) +script = ExtResource("7_lskho") +action_icon = NodePath("LeftScreenAction/SubViewport/VBoxContainer/LeftScreenActionIcon") +action_label = NodePath("LeftScreenAction/SubViewport/VBoxContainer/LeftScreenActionLabel") +inspectable = true +hover_animation_player = NodePath("LeftScreenHoverAnimationPlayer") +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="LeftScreenModel" parent="LeftScreen" unique_id=996232811 instance=ExtResource("8_psxhb")] +transform = Transform3D(1, -1.509958e-07, -8.742278e-08, 1.509958e-07, 1, -1.4901156e-08, 8.742278e-08, 1.49011425e-08, 1, 0, -0.07, 0.05) + +[node name="LeftScreenAction" type="Sprite3D" parent="LeftScreen" unique_id=442886447] +transform = Transform3D(-1, 5.3045827e-08, 1.509958e-07, 5.3045838e-08, 1.0000002, 1.5913756e-07, -1.5099579e-07, 1.5913761e-07, -1, 0.01, -0.04, -0.015) +pixel_size = 0.0015 +texture = SubResource("ViewportTexture_2ofl5") + +[node name="SubViewport" type="SubViewport" parent="LeftScreen/LeftScreenAction" unique_id=1031174751] +transparent_bg = true +size = Vector2i(150, 180) + +[node name="VBoxContainer" type="VBoxContainer" parent="LeftScreen/LeftScreenAction/SubViewport" unique_id=1664945780] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_constants/separation = -10 +alignment = 1 + +[node name="LeftScreenActionIcon" type="TextureRect" parent="LeftScreen/LeftScreenAction/SubViewport/VBoxContainer" unique_id=266510290] +custom_minimum_size = Vector2(100, 100) +layout_mode = 2 +texture = ExtResource("9_v1m0r") +expand_mode = 3 +stretch_mode = 5 + +[node name="LeftScreenActionLabel" type="Label" parent="LeftScreen/LeftScreenAction/SubViewport/VBoxContainer" unique_id=448288889] +layout_mode = 2 +text = "Uwoqos Uwoqos " +label_settings = ExtResource("4_7u0n5") +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="LeftScreen" unique_id=1931637253] +transform = Transform3D(1, -2.9802322e-08, -2.9802322e-08, 0, 1, 0, 2.9802322e-08, 1.4901161e-08, 1, 0, 0, 0) +shape = SubResource("SphereShape3D_2q8cl") + +[node name="LeftScreenHoverAnimationPlayer" type="AnimationPlayer" parent="LeftScreen" unique_id=972807531] +libraries/ = SubResource("AnimationLibrary_cvt2p") + +[node name="Inventory3D" parent="." unique_id=810532522 instance=ExtResource("10_y1ysr")] +unique_name_in_owner = true +transform = Transform3D(1, 0, 8.940697e-08, 0, 1, 0, -8.940697e-08, 0, 1, 0, 0.5876103, 0.89364576) +no_tools = true +test_inventory = SubResource("Resource_ne0dp") diff --git a/stages/3d_scenes/cockpit_scene/holo_content.tscn b/stages/3d_scenes/cockpit_scene/cockpit_elements/holo_content.tscn similarity index 96% rename from stages/3d_scenes/cockpit_scene/holo_content.tscn rename to stages/3d_scenes/cockpit_scene/cockpit_elements/holo_content.tscn index d3196c0..76c47f9 100644 --- a/stages/3d_scenes/cockpit_scene/holo_content.tscn +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/holo_content.tscn @@ -1,6 +1,6 @@ [gd_scene format=3 uid="uid://cs5gir1u8jbrg"] -[ext_resource type="Script" uid="uid://d1t0br6cacipb" path="res://stages/3d_scenes/cockpit_scene/scripts/holo_content.gd" id="1_30o21"] +[ext_resource type="Script" uid="uid://d1t0br6cacipb" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/holo_content.gd" id="1_30o21"] [ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_bw0fn"] [ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="1_wkgid"] diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/plant_info_screen.tscn b/stages/3d_scenes/cockpit_scene/cockpit_elements/plant_info_screen.tscn new file mode 100644 index 0000000..5c71743 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/plant_info_screen.tscn @@ -0,0 +1,139 @@ +[gd_scene format=3 uid="uid://dd6k80rhux1do"] + +[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="1_82utc"] +[ext_resource type="PackedScene" uid="uid://i28ngc4hgq85" path="res://stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen.blend" id="1_c5x8t"] +[ext_resource type="Script" uid="uid://bdwlxwoqf3dcj" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/plant_info_screen.gd" id="1_d4qoj"] +[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="2_5jpjd"] +[ext_resource type="Texture2D" uid="uid://dhy4ewvqvlxyi" path="res://common/icons/clock.svg" id="2_xwbvs"] +[ext_resource type="Texture2D" uid="uid://cgmxjom200bej" path="res://common/icons/chevrons-up.svg" id="4_a7tuo"] +[ext_resource type="Texture2D" uid="uid://c2qg7ikkylfv4" path="res://common/icons/seeds.svg" id="4_ihffg"] + +[sub_resource type="ViewportTexture" id="ViewportTexture_c5x8t"] +viewport_path = NodePath("Sprite3D/SubViewport") + +[sub_resource type="LabelSettings" id="LabelSettings_5jpjd"] +font = ExtResource("1_82utc") +font_size = 15 + +[sub_resource type="LabelSettings" id="LabelSettings_xwbvs"] +font = ExtResource("1_82utc") +font_size = 20 + +[node name="PlantInfoScreen" type="Node3D" unique_id=1881622243] +script = ExtResource("1_d4qoj") + +[node name="Sprite3D" type="Sprite3D" parent="." unique_id=1624784968] +transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -0.00714764, 0, 0) +pixel_size = 0.004 +texture = SubResource("ViewportTexture_c5x8t") + +[node name="SubViewport" type="SubViewport" parent="Sprite3D" unique_id=1689184715] +disable_3d = true +transparent_bg = true +size = Vector2i(207, 145) + +[node name="VBoxContainer" type="VBoxContainer" parent="Sprite3D/SubViewport" unique_id=1462242714] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/separation = 16 +alignment = 1 + +[node name="Label" type="Label" parent="Sprite3D/SubViewport/VBoxContainer" unique_id=1148366912] +layout_mode = 2 +size_flags_vertical = 1 +text = "PLANT_DEFAULT_ATTRIBUTES" +label_settings = SubResource("LabelSettings_5jpjd") +horizontal_alignment = 1 +autowrap_mode = 3 + +[node name="StatsContainer" type="HFlowContainer" parent="Sprite3D/SubViewport/VBoxContainer" unique_id=1585516203] +layout_mode = 2 +theme_override_constants/h_separation = 8 +theme_override_constants/v_separation = 8 +alignment = 1 +last_wrap_alignment = 2 + +[node name="ScoreStat" type="HBoxContainer" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer" unique_id=2037793125] +layout_mode = 2 +theme_override_constants/separation = 0 +alignment = 1 + +[node name="ScoreIcon" type="TextureRect" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer/ScoreStat" unique_id=1399775561] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +texture = ExtResource("2_5jpjd") +expand_mode = 3 + +[node name="ScoreLabel" type="Label" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer/ScoreStat" unique_id=2071958510] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 +text = "3" +label_settings = SubResource("LabelSettings_xwbvs") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="LifetimeStat" type="HBoxContainer" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer" unique_id=1750151233] +layout_mode = 2 +theme_override_constants/separation = 0 +alignment = 1 + +[node name="LifetimeIcon" type="TextureRect" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer/LifetimeStat" unique_id=855540661] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +texture = ExtResource("2_xwbvs") +expand_mode = 3 + +[node name="LifetimeLabel" type="Label" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer/LifetimeStat" unique_id=1042555843] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 +text = "3" +label_settings = SubResource("LabelSettings_xwbvs") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="GrowingStat" type="HBoxContainer" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer" unique_id=1246515659] +layout_mode = 2 +theme_override_constants/separation = 0 +alignment = 1 + +[node name="GrowingIcon" type="TextureRect" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer/GrowingStat" unique_id=613724045] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +texture = ExtResource("4_a7tuo") +expand_mode = 3 + +[node name="GrowingLabel" type="Label" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer/GrowingStat" unique_id=1156190508] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 +text = "3" +label_settings = SubResource("LabelSettings_xwbvs") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="SeedStat" type="HBoxContainer" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer" unique_id=2140421429] +layout_mode = 2 +theme_override_constants/separation = 0 +alignment = 1 + +[node name="SeedIcon" type="TextureRect" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer/SeedStat" unique_id=313311026] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +texture = ExtResource("4_ihffg") +expand_mode = 3 + +[node name="SeedLabel" type="Label" parent="Sprite3D/SubViewport/VBoxContainer/StatsContainer/SeedStat" unique_id=1670358044] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 +text = "1-2" +label_settings = SubResource("LabelSettings_xwbvs") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ScreenModel" parent="." unique_id=1871285491 instance=ExtResource("1_c5x8t")] diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/artefact_diplayer.gd b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/artefact_diplayer.gd new file mode 100644 index 0000000..36b9161 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/artefact_diplayer.gd @@ -0,0 +1,23 @@ +@tool +extends Interactable3D +class_name ArtefactDisplayer + +@export var artefact : Artefact : set = set_artefact + +func _ready(): + set_artefact() + +func set_artefact(a := artefact): + if is_node_ready(): + for c in %Model.get_children(): + c.queue_free() + + if a: + var new_model = a.get_3d_scene().instantiate() + %Model.add_child(new_model) + artefact = a + +func card_info() -> CardInfo: + if artefact: + return artefact.card_info() + return null diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/artefact_diplayer.gd.uid b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/artefact_diplayer.gd.uid new file mode 100644 index 0000000..6856d95 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/artefact_diplayer.gd.uid @@ -0,0 +1 @@ +uid://bejxdxbdddqgx diff --git a/stages/3d_scenes/cockpit_scene/scripts/dashboard.gd b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd similarity index 59% rename from stages/3d_scenes/cockpit_scene/scripts/dashboard.gd rename to stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd index 6b3f90a..ada2aa7 100644 --- a/stages/3d_scenes/cockpit_scene/scripts/dashboard.gd +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd @@ -90,43 +90,10 @@ func set_status_text(v := status_text): func set_left_stop(v := left_stop): left_stop = v if is_node_ready(): - %LeftScreenAction.visible = left_stop != null - %LeftScreen.interactable = left_stop != null - %LeftScreenStats.visible = left_stop != null - %LeftScreenInfos.visible = left_stop and len(left_stop.region_parameter.modifiers) > 0 - if left_stop: - %LeftScreenActionIcon.texture = LAND_ICON - %LeftScreenActionLabel.text = left_stop.region_parameter.get_region_name() - - %LeftScreenStat1Icon.texture = GROWTH_ICON - %LeftScreenStat1Label.text = str(left_stop.region_parameter.get_objective()) - - %LeftScreenStat2Icon.texture = CHARGE_ICON - %LeftScreenStat2Label.text = str(left_stop.region_parameter.get_charge()) - - if len(left_stop.region_parameter.modifiers) > 0: - var modifier : RegionModifier = left_stop.region_parameter.modifiers[0] - %LeftScreenInfoTitle.text = "%s %d" % [ modifier.get_modifier_name(), modifier.level ] - %LeftScreenInfoText.text = modifier.get_description() + %LeftScreen.run_point = left_stop func set_right_stop(v := right_stop): right_stop = v if is_node_ready(): - %RightScreenAction.visible = right_stop != null - %RightScreen.interactable = right_stop != null - %RightScreenStats.visible = right_stop != null - %RightScreenInfos.visible = right_stop and len(right_stop.region_parameter.modifiers) > 0 - if right_stop: - %RightScreenActionIcon.texture = LAND_ICON - %RightScreenActionLabel.text = right_stop.region_parameter.get_region_name() - - %RightScreenStat1Icon.texture = GROWTH_ICON - %RightScreenStat1Label.text = str(right_stop.region_parameter.get_objective()) - - %RightScreenStat2Icon.texture = CHARGE_ICON - %RightScreenStat2Label.text = str(right_stop.region_parameter.get_charge()) - - if len(right_stop.region_parameter.modifiers) > 0: - var modifier : RegionModifier = right_stop.region_parameter.modifiers[0] - %RightScreenInfoTitle.text = "%s %d" % [ modifier.get_modifier_name(), modifier.level ] - %RightScreenInfoText.text = modifier.get_description() + %RightScreen.run_point = right_stop + \ No newline at end of file diff --git a/stages/3d_scenes/cockpit_scene/scripts/dashboard.gd.uid b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd.uid similarity index 100% rename from stages/3d_scenes/cockpit_scene/scripts/dashboard.gd.uid rename to stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard.gd.uid diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard_run_point_screen.gd b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard_run_point_screen.gd new file mode 100644 index 0000000..0ed2466 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard_run_point_screen.gd @@ -0,0 +1,26 @@ +extends Interactable3D + +const LAND_ICON = preload("res://common/icons/arrow-narrow-down.svg") + +var run_point : RunPoint : set = set_run_point + +@export var action_icon : TextureRect +@export var action_label : Label + +func _ready(): + set_run_point() + +func set_run_point(rp := run_point): + run_point = rp + if is_node_ready(): + action_icon.visible = rp != null + action_label.visible = rp != null + interactable = rp != null + if rp: + action_icon.texture = LAND_ICON + action_label.text = rp.region_parameter.get_region_name() + +func card_info() -> CardInfo: + if run_point: + return run_point.card_info() + return null diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard_run_point_screen.gd.uid b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard_run_point_screen.gd.uid new file mode 100644 index 0000000..2e57cc9 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/dashboard_run_point_screen.gd.uid @@ -0,0 +1 @@ +uid://vf8nm8ch1p8s diff --git a/stages/3d_scenes/cockpit_scene/scripts/holo_content.gd b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/holo_content.gd similarity index 100% rename from stages/3d_scenes/cockpit_scene/scripts/holo_content.gd rename to stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/holo_content.gd diff --git a/stages/3d_scenes/cockpit_scene/scripts/holo_content.gd.uid b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/holo_content.gd.uid similarity index 100% rename from stages/3d_scenes/cockpit_scene/scripts/holo_content.gd.uid rename to stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/holo_content.gd.uid diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/plant_info_screen.gd b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/plant_info_screen.gd new file mode 100644 index 0000000..cfa2708 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/plant_info_screen.gd @@ -0,0 +1,16 @@ +extends Node3D +class_name PlantInfoScreen + +func _ready(): + update_plant_info() + +func update_plant_info(): + var plant_info : RunDataPlantInfo = GameInfo.game_data.current_run.plant_info + + %ScoreLabel.text = "%d" % plant_info.get_base_score() + %LifetimeLabel.text = "%d" % plant_info.get_lifetime() + %GrowingLabel.text = "%d" % plant_info.get_growing_time() + %SeedLabel.text = "%d-%d" % [ + plant_info.get_seed_number() - plant_info.get_seed_random_loose(), + plant_info.get_seed_number() + ] diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/plant_info_screen.gd.uid b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/plant_info_screen.gd.uid new file mode 100644 index 0000000..2ed4e03 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/plant_info_screen.gd.uid @@ -0,0 +1 @@ +uid://bdwlxwoqf3dcj diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/shelf.gd b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/shelf.gd new file mode 100644 index 0000000..9397f83 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/shelf.gd @@ -0,0 +1,24 @@ +extends Node3D + + +var run_data : RunData + +func _ready(): + run_data = GameInfo.game_data.current_run + if run_data: + set_up_artefacts_displayers(run_data.artefacts) + else : + set_up_artefacts_displayers([]) + +func set_up_artefacts_displayers(artefacts : Array[Artefact]): + var artefact_displayers = %ArtefactsDisplayers.get_children() as Array[ArtefactDisplayer] + for i in range(len(artefact_displayers)): + var artefact_displayer = artefact_displayers[i] + if not artefact_displayer.is_node_ready(): + await artefact_displayer.ready + if i < len(artefacts): + artefact_displayer.artefact = artefacts[i] + artefact_displayer.inspectable = true + else: + artefact_displayer.artefact = null + artefact_displayer.inspectable = false diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/shelf.gd.uid b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/shelf.gd.uid new file mode 100644 index 0000000..c5f0511 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/shelf.gd.uid @@ -0,0 +1 @@ +uid://cmtxsbaae8ouj diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/shelf.tscn b/stages/3d_scenes/cockpit_scene/cockpit_elements/shelf.tscn new file mode 100644 index 0000000..e85a3b1 --- /dev/null +++ b/stages/3d_scenes/cockpit_scene/cockpit_elements/shelf.tscn @@ -0,0 +1,115 @@ +[gd_scene format=3 uid="uid://cgw2ct7smispo"] + +[ext_resource type="Script" uid="uid://cmtxsbaae8ouj" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/scripts/shelf.gd" id="1_c7oq5"] +[ext_resource type="PackedScene" uid="uid://b4wdov3y1ulyb" path="res://stages/3d_scenes/cockpit_scene/assets/3d/furnitures/shelf.blend" id="1_rch3t"] +[ext_resource type="PackedScene" uid="uid://xsgcpgsxmboy" path="res://stages/3d_scenes/cockpit_scene/cockpit_elements/artefact_diplayer.tscn" id="2_rch3t"] +[ext_resource type="Script" uid="uid://c6lr0fucklsto" path="res://common/game_data/scripts/artefacts/pile/pile.gd" id="4_rxey1"] +[ext_resource type="Script" uid="uid://c7o5p4uk556v6" path="res://common/game_data/scripts/artefacts/seed_case/seed_case.gd" id="5_dthy8"] + +[sub_resource type="Resource" id="Resource_iiahi"] +script = ExtResource("4_rxey1") +metadata/_custom_type_script = "uid://c6lr0fucklsto" + +[sub_resource type="Resource" id="Resource_uck24"] +script = ExtResource("5_dthy8") +metadata/_custom_type_script = "uid://c7o5p4uk556v6" + +[sub_resource type="Resource" id="Resource_jfo8c"] +script = ExtResource("4_rxey1") +metadata/_custom_type_script = "uid://c6lr0fucklsto" + +[sub_resource type="Resource" id="Resource_xwcbk"] +script = ExtResource("5_dthy8") +metadata/_custom_type_script = "uid://c7o5p4uk556v6" + +[sub_resource type="Resource" id="Resource_64gay"] +script = ExtResource("4_rxey1") +metadata/_custom_type_script = "uid://c6lr0fucklsto" + +[node name="Shelf" type="Node3D" unique_id=1769159984] +script = ExtResource("1_c7oq5") + +[node name="Model" parent="." unique_id=1202025071 instance=ExtResource("1_rch3t")] + +[node name="ArtefactsDisplayers" type="Node3D" parent="." unique_id=973221092] +unique_name_in_owner = true + +[node name="ArtefactDiplayer" parent="ArtefactsDisplayers" unique_id=676305823 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.9, 0.42064568) +artefact = SubResource("Resource_iiahi") + +[node name="ArtefactDiplayer2" parent="ArtefactsDisplayers" unique_id=1000126744 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.9, 0.22064568) +artefact = SubResource("Resource_uck24") + +[node name="ArtefactDiplayer3" parent="ArtefactsDisplayers" unique_id=1862027914 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.9, 0.020645678) +artefact = SubResource("Resource_jfo8c") + +[node name="ArtefactDiplayer4" parent="ArtefactsDisplayers" unique_id=610725901 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.9, -0.17935432) +artefact = SubResource("Resource_xwcbk") + +[node name="ArtefactDiplayer5" parent="ArtefactsDisplayers" unique_id=2087800888 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.9, -0.37935433) +artefact = SubResource("Resource_64gay") + +[node name="ArtefactDiplayer6" parent="ArtefactsDisplayers" unique_id=1318896402 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.47160196, 0.42064568) +artefact = SubResource("Resource_iiahi") + +[node name="ArtefactDiplayer7" parent="ArtefactsDisplayers" unique_id=1642327446 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.47160196, 0.22064568) +artefact = SubResource("Resource_uck24") + +[node name="ArtefactDiplayer8" parent="ArtefactsDisplayers" unique_id=1762567100 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.47160196, 0.020645678) +artefact = SubResource("Resource_jfo8c") + +[node name="ArtefactDiplayer9" parent="ArtefactsDisplayers" unique_id=368097306 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.47160196, -0.17935432) +artefact = SubResource("Resource_xwcbk") + +[node name="ArtefactDiplayer10" parent="ArtefactsDisplayers" unique_id=901158149 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.47160196, -0.37935433) +artefact = SubResource("Resource_64gay") + +[node name="ArtefactDiplayer11" parent="ArtefactsDisplayers" unique_id=951216882 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 1.350719, 0.42064568) +artefact = SubResource("Resource_iiahi") + +[node name="ArtefactDiplayer12" parent="ArtefactsDisplayers" unique_id=1610084306 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 1.350719, 0.22064568) +artefact = SubResource("Resource_uck24") + +[node name="ArtefactDiplayer13" parent="ArtefactsDisplayers" unique_id=1537097690 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 1.350719, 0.020645678) +artefact = SubResource("Resource_jfo8c") + +[node name="ArtefactDiplayer14" parent="ArtefactsDisplayers" unique_id=569710522 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 1.350719, -0.17935432) +artefact = SubResource("Resource_xwcbk") + +[node name="ArtefactDiplayer15" parent="ArtefactsDisplayers" unique_id=1193787739 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 1.350719, -0.37935433) +artefact = SubResource("Resource_64gay") + +[node name="ArtefactDiplayer16" parent="ArtefactsDisplayers" unique_id=1486453136 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.00010251999, 0.42064568) +artefact = SubResource("Resource_iiahi") + +[node name="ArtefactDiplayer17" parent="ArtefactsDisplayers" unique_id=1614343088 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.00010251999, 0.22064568) +artefact = SubResource("Resource_uck24") + +[node name="ArtefactDiplayer18" parent="ArtefactsDisplayers" unique_id=1240310117 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.00010251999, 0.020645678) +artefact = SubResource("Resource_jfo8c") + +[node name="ArtefactDiplayer19" parent="ArtefactsDisplayers" unique_id=1690298607 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.00010251999, -0.17935432) +artefact = SubResource("Resource_xwcbk") + +[node name="ArtefactDiplayer20" parent="ArtefactsDisplayers" unique_id=119436302 instance=ExtResource("2_rch3t")] +transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0.00010251999, -0.37935433) +artefact = SubResource("Resource_64gay") diff --git a/stages/3d_scenes/cockpit_scene/cockpit_elements/stw-commpack (2).zip b/stages/3d_scenes/cockpit_scene/cockpit_elements/stw-commpack (2).zip new file mode 100644 index 0000000..e4d7140 Binary files /dev/null and b/stages/3d_scenes/cockpit_scene/cockpit_elements/stw-commpack (2).zip differ diff --git a/stages/3d_scenes/cockpit_scene/cockpit_scene.tscn b/stages/3d_scenes/cockpit_scene/cockpit_scene.tscn index 5185b81..0ed903c 100644 --- a/stages/3d_scenes/cockpit_scene/cockpit_scene.tscn +++ b/stages/3d_scenes/cockpit_scene/cockpit_scene.tscn @@ -27,11 +27,9 @@ background_color = Color(0.35150164, 0.49048376, 0.5493753, 1) sky = SubResource("Sky_fp4e7") ambient_light_source = 3 ambient_light_color = Color(1, 1, 1, 1) -ambient_light_sky_contribution = 0.85 -ambient_light_energy = 2.0 +ambient_light_sky_contribution = 0.15 +ambient_light_energy = 0.75 reflected_light_source = 2 -tonemap_mode = 2 -tonemap_exposure = 0.7 tonemap_white = 1.84 glow_enabled = true glow_intensity = 0.22 diff --git a/stages/3d_scenes/cockpit_scene/dashboard.tscn b/stages/3d_scenes/cockpit_scene/dashboard.tscn deleted file mode 100644 index 4cbb398..0000000 --- a/stages/3d_scenes/cockpit_scene/dashboard.tscn +++ /dev/null @@ -1,614 +0,0 @@ -[gd_scene format=3 uid="uid://cv0ehgy3d1kmj"] - -[ext_resource type="Script" uid="uid://fet6urfgiiwr" path="res://stages/3d_scenes/cockpit_scene/scripts/dashboard.gd" id="1_2q8cl"] -[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="1_sp2xx"] -[ext_resource type="PackedScene" uid="uid://bnvqwsxgrd14y" path="res://stages/3d_scenes/cockpit_scene/assets/3d/dashboard.blend" id="1_u2frr"] -[ext_resource type="Script" uid="uid://bj4d1x8n8ina" path="res://entities/interactable_3d/interactable_3d.gd" id="1_vlkbw"] -[ext_resource type="PackedScene" uid="uid://cdvegfgvp7053" path="res://stages/3d_scenes/cockpit_scene/assets/3d/furnitures/screen_1.blend" id="2_awdc5"] -[ext_resource type="Texture2D" uid="uid://cgmxjom200bej" path="res://common/icons/chevrons-up.svg" id="2_vlkbw"] -[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="7_2ofl5"] -[ext_resource type="PackedScene" uid="uid://cs5gir1u8jbrg" path="res://stages/3d_scenes/cockpit_scene/holo_content.tscn" id="7_f7ho8"] -[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="8_f5peh"] -[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="9_2kujw"] -[ext_resource type="Texture2D" uid="uid://bsgmxvuphn73c" path="res://common/icons/arrow-narrow-down.svg" id="13_5d7hc"] -[ext_resource type="PackedScene" uid="uid://crbjmwumboelw" path="res://gui/game/inventory_gui/inventory_3d.tscn" id="17_inbnt"] -[ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://entities/player/inventory/scripts/item.gd" id="18_qm808"] -[ext_resource type="Script" uid="uid://fnu2d6wna4yc" path="res://entities/player/inventory/scripts/inventory.gd" id="19_kh1yg"] - -[sub_resource type="ViewportTexture" id="ViewportTexture_cvt2p"] -viewport_path = NodePath("Holo/SubViewport") - -[sub_resource type="ViewportTexture" id="ViewportTexture_5d7hc"] -viewport_path = NodePath("StatusScreen/SubViewport") - -[sub_resource type="SphereShape3D" id="SphereShape3D_vlkbw"] - -[sub_resource type="ViewportTexture" id="ViewportTexture_qbi61"] -viewport_path = NodePath("MainScreen/MainScreenSprite/SubViewport") - -[sub_resource type="Animation" id="Animation_vlkbw"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("MainScreenSprite:scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(1, 1, 1)] -} - -[sub_resource type="Animation" id="Animation_qbi61"] -resource_name = "hover" -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("MainScreenSprite:scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.5, 1), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Vector3(1, 1, 1), Vector3(1.2, 1.2, 1.2), Vector3(1, 1, 1)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_2ofl5"] -_data = { -&"RESET": SubResource("Animation_vlkbw"), -&"hover": SubResource("Animation_qbi61") -} - -[sub_resource type="ViewportTexture" id="ViewportTexture_2ofl5"] -viewport_path = NodePath("RightScreen/RightScreenAction/SubViewport") - -[sub_resource type="ViewportTexture" id="ViewportTexture_f5peh"] -viewport_path = NodePath("RightScreen/RightScreenStats/SubViewport") - -[sub_resource type="LabelSettings" id="LabelSettings_2kujw"] -font = ExtResource("8_f5peh") -font_size = 20 - -[sub_resource type="ViewportTexture" id="ViewportTexture_stoj6"] -viewport_path = NodePath("RightScreen/RightScreenInfos/SubViewport") - -[sub_resource type="LabelSettings" id="LabelSettings_2d2u0"] -font = ExtResource("8_f5peh") -font_size = 20 - -[sub_resource type="SphereShape3D" id="SphereShape3D_2q8cl"] - -[sub_resource type="Animation" id="Animation_2kujw"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("RightScreenAction:scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(1, 1.0000002, 1)] -} - -[sub_resource type="Animation" id="Animation_2q8cl"] -resource_name = "hover" -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("RightScreenAction:scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.46666667, 1), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Vector3(1, 1.0000002, 1), Vector3(1.2, 1.2, 1.2), Vector3(1, 1.0000002, 1)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_cvt2p"] -_data = { -&"RESET": SubResource("Animation_2kujw"), -&"hover": SubResource("Animation_2q8cl") -} - -[sub_resource type="ViewportTexture" id="ViewportTexture_2kujw"] -viewport_path = NodePath("LeftScreen/LeftScreenAction/SubViewport") - -[sub_resource type="ViewportTexture" id="ViewportTexture_2q8cl"] -viewport_path = NodePath("LeftScreen/LeftScreenStats/SubViewport") - -[sub_resource type="ViewportTexture" id="ViewportTexture_h8fs1"] -viewport_path = NodePath("LeftScreen/LeftScreenInfos/SubViewport") - -[sub_resource type="SphereShape3D" id="SphereShape3D_2kujw"] - -[sub_resource type="Animation" id="Animation_cvt2p"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("LeftScreenAction:scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(1, 1.0000001, 1)] -} - -[sub_resource type="Animation" id="Animation_stoj6"] -resource_name = "hover" -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("LeftScreenAction:scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.46666667, 0.96666664), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Vector3(1, 1.0000001, 1), Vector3(1.2, 1.2, 1.2), Vector3(1, 1.0000001, 1)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_5d7hc"] -_data = { -&"RESET": SubResource("Animation_cvt2p"), -&"hover": SubResource("Animation_stoj6") -} - -[sub_resource type="Resource" id="Resource_ne0dp"] -script = ExtResource("19_kh1yg") -items = Array[ExtResource("18_qm808")]([null, null, null]) -n_tools = 1 -metadata/_custom_type_script = "uid://fnu2d6wna4yc" - -[node name="Dashboard" type="Node3D" unique_id=1374334508] -script = ExtResource("1_2q8cl") -main_screen_icon = ExtResource("2_vlkbw") -main_screen_text = null -stop_name = null -stop_title = null -destination_title = "TO_BOREA_BASE" - -[node name="Holo" type="Sprite3D" parent="." unique_id=1067303692] -unique_name_in_owner = true -transform = Transform3D(-1, 0, -8.742278e-08, 0, 1.0000002, 0, 8.742278e-08, 0, -1, 0, 0.83082896, 0.33655214) -pixel_size = 0.004 -texture = SubResource("ViewportTexture_cvt2p") - -[node name="SubViewport" type="SubViewport" parent="Holo" unique_id=471832787] -transparent_bg = true -size = Vector2i(365, 68) - -[node name="HoloContent" parent="Holo/SubViewport" unique_id=668915500 instance=ExtResource("7_f7ho8")] -unique_name_in_owner = true -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -162.0 -offset_top = -28.0 -offset_right = 162.0 -offset_bottom = 28.0 -grow_horizontal = 2 -grow_vertical = 2 -stop_name = "" - -[node name="StatusScreen" type="Sprite3D" parent="." unique_id=1257606535] -unique_name_in_owner = true -transform = Transform3D(-1, 0, -8.742278e-08, 0, 1.0000002, 0, 8.742278e-08, 0, -1, 0, 1.0703605, 0.35432142) -modulate = Color(1, 0, 0.43137255, 1) -pixel_size = 0.003 -texture = SubResource("ViewportTexture_5d7hc") - -[node name="SubViewport" type="SubViewport" parent="StatusScreen" unique_id=1357189828] -transparent_bg = true -size = Vector2i(435, 98) - -[node name="VBoxContainer" type="VBoxContainer" parent="StatusScreen/SubViewport" unique_id=2076282975] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = -10 -alignment = 1 - -[node name="StatusLabel" type="Label" parent="StatusScreen/SubViewport/VBoxContainer" unique_id=86551380] -unique_name_in_owner = true -layout_mode = 2 -text = "Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla " -label_settings = ExtResource("1_sp2xx") -horizontal_alignment = 1 -vertical_alignment = 1 -autowrap_mode = 3 - -[node name="MainScreen" type="Area3D" parent="." unique_id=874806978 node_paths=PackedStringArray("hover_animation_player")] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.42284742, 0.4816055) -script = ExtResource("1_vlkbw") -interactable = false -hover_animation_player = NodePath("HoverAnimationPlayer") -metadata/_custom_type_script = "uid://bj4d1x8n8ina" - -[node name="CollisionShape3D" type="CollisionShape3D" parent="MainScreen" unique_id=1935076244] -shape = SubResource("SphereShape3D_vlkbw") - -[node name="MainScreenSprite" type="Sprite3D" parent="MainScreen" unique_id=1081515212] -unique_name_in_owner = true -transform = Transform3D(-1, 8.0014914e-08, 5.4146472e-08, 7.923836e-08, 0.35859588, 0.9334929, 5.5276644e-08, 0.9334929, -0.35859588, 0, 0, 0) -visible = false -pixel_size = 0.003 -texture = SubResource("ViewportTexture_qbi61") - -[node name="SubViewport" type="SubViewport" parent="MainScreen/MainScreenSprite" unique_id=1101534363] -transparent_bg = true -size = Vector2i(150, 150) - -[node name="VBoxContainer" type="VBoxContainer" parent="MainScreen/MainScreenSprite/SubViewport" unique_id=758261583] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = -10 -alignment = 1 - -[node name="MainScreenIcon" type="TextureRect" parent="MainScreen/MainScreenSprite/SubViewport/VBoxContainer" unique_id=1128176178] -unique_name_in_owner = true -custom_minimum_size = Vector2(100, 100) -layout_mode = 2 -texture = ExtResource("2_vlkbw") -expand_mode = 3 -stretch_mode = 5 - -[node name="MainScreenLabel" type="Label" parent="MainScreen/MainScreenSprite/SubViewport/VBoxContainer" unique_id=2102392578] -unique_name_in_owner = true -layout_mode = 2 -text = "Take Off" -label_settings = ExtResource("1_sp2xx") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="HoverAnimationPlayer" type="AnimationPlayer" parent="MainScreen" unique_id=74243401] -libraries/ = SubResource("AnimationLibrary_2ofl5") - -[node name="DashboardModel" parent="." unique_id=635273073 instance=ExtResource("1_u2frr")] - -[node name="RightScreen" type="Area3D" parent="." unique_id=748959616 node_paths=PackedStringArray("hover_animation_player")] -unique_name_in_owner = true -transform = Transform3D(0.6401096, -0.4515857, -0.6215544, 0, 0.809017, -0.58778524, 0.76828337, 0.37624705, 0.51785964, -0.7, 0.5, -0.15) -script = ExtResource("1_vlkbw") -hover_animation_player = NodePath("HoverAnimationPlayer") -metadata/_custom_type_script = "uid://bj4d1x8n8ina" - -[node name="RightScreenModel" parent="RightScreen" unique_id=462452406 instance=ExtResource("2_awdc5")] -transform = Transform3D(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) - -[node name="RightScreenAction" type="Sprite3D" parent="RightScreen" unique_id=1289027629] -unique_name_in_owner = true -transform = Transform3D(-1, 0, -1.509958e-07, 0, 1.0000002, 0, 1.509958e-07, 0, -1, -0.18746918, -0.04759717, -0.04654131) -pixel_size = 0.002 -texture = SubResource("ViewportTexture_2ofl5") - -[node name="SubViewport" type="SubViewport" parent="RightScreen/RightScreenAction" unique_id=837587699] -transparent_bg = true -size = Vector2i(150, 180) - -[node name="VBoxContainer" type="VBoxContainer" parent="RightScreen/RightScreenAction/SubViewport" unique_id=536772063] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = -10 -alignment = 1 - -[node name="RightScreenActionIcon" type="TextureRect" parent="RightScreen/RightScreenAction/SubViewport/VBoxContainer" unique_id=788824067] -unique_name_in_owner = true -custom_minimum_size = Vector2(100, 100) -layout_mode = 2 -texture = ExtResource("13_5d7hc") -expand_mode = 3 -stretch_mode = 5 - -[node name="RightScreenActionLabel" type="Label" parent="RightScreen/RightScreenAction/SubViewport/VBoxContainer" unique_id=2019588267] -unique_name_in_owner = true -layout_mode = 2 -text = "Uwoqos Uwoqos " -label_settings = ExtResource("1_sp2xx") -horizontal_alignment = 1 -vertical_alignment = 1 -autowrap_mode = 3 - -[node name="RightScreenStats" type="Sprite3D" parent="RightScreen" unique_id=282782621] -unique_name_in_owner = true -transform = Transform3D(-1, -5.5879354e-08, 1.1920929e-07, -2.9802322e-08, 0.86602557, -0.50000024, -2.0861626e-07, -0.5000001, -0.86602545, -0.14474958, 0.2707073, -0.057207607) -pixel_size = 0.002 -texture = SubResource("ViewportTexture_f5peh") - -[node name="SubViewport" type="SubViewport" parent="RightScreen/RightScreenStats" unique_id=131851122] -transparent_bg = true -size = Vector2i(170, 75) - -[node name="HBoxContainer" type="HBoxContainer" parent="RightScreen/RightScreenStats/SubViewport" unique_id=578755335] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_right = 15.0 -offset_bottom = 51.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = 10 -alignment = 1 - -[node name="RightScreenStat1" type="VBoxContainer" parent="RightScreen/RightScreenStats/SubViewport/HBoxContainer" unique_id=164391708] -layout_mode = 2 -theme_override_constants/separation = -10 - -[node name="RightScreenStat1Icon" type="TextureRect" parent="RightScreen/RightScreenStats/SubViewport/HBoxContainer/RightScreenStat1" unique_id=1950512302] -unique_name_in_owner = true -custom_minimum_size = Vector2(50, 50) -layout_mode = 2 -texture = ExtResource("7_2ofl5") -expand_mode = 3 -stretch_mode = 5 - -[node name="RightScreenStat1Label" type="Label" parent="RightScreen/RightScreenStats/SubViewport/HBoxContainer/RightScreenStat1" unique_id=965157290] -unique_name_in_owner = true -layout_mode = 2 -text = "0" -label_settings = SubResource("LabelSettings_2kujw") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="RightScreenStat2" type="VBoxContainer" parent="RightScreen/RightScreenStats/SubViewport/HBoxContainer" unique_id=882311617] -layout_mode = 2 -theme_override_constants/separation = -10 - -[node name="RightScreenStat2Icon" type="TextureRect" parent="RightScreen/RightScreenStats/SubViewport/HBoxContainer/RightScreenStat2" unique_id=33385693] -unique_name_in_owner = true -custom_minimum_size = Vector2(50, 50) -layout_mode = 2 -texture = ExtResource("9_2kujw") -expand_mode = 3 -stretch_mode = 5 - -[node name="RightScreenStat2Label" type="Label" parent="RightScreen/RightScreenStats/SubViewport/HBoxContainer/RightScreenStat2" unique_id=1607645733] -unique_name_in_owner = true -layout_mode = 2 -text = "0" -label_settings = SubResource("LabelSettings_2kujw") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="RightScreenInfos" type="Sprite3D" parent="RightScreen" unique_id=449647859] -unique_name_in_owner = true -transform = Transform3D(-0.9902686, -2.9802322e-08, -0.13917324, 0, 1.0000002, -1.4901161e-08, 0.13917324, 5.9604645e-08, -0.99026823, 0.293737, 0.079518735, -0.035522263) -pixel_size = 0.002 -texture = SubResource("ViewportTexture_stoj6") - -[node name="SubViewport" type="SubViewport" parent="RightScreen/RightScreenInfos" unique_id=606992481] -transparent_bg = true -size = Vector2i(117, 138) - -[node name="HBoxContainer" type="VBoxContainer" parent="RightScreen/RightScreenInfos/SubViewport" unique_id=112944532] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = 10 - -[node name="RightScreenInfoTitle" type="Label" parent="RightScreen/RightScreenInfos/SubViewport/HBoxContainer" unique_id=1621744309] -unique_name_in_owner = true -layout_mode = 2 -text = "Hello" -label_settings = SubResource("LabelSettings_2d2u0") -horizontal_alignment = 1 -autowrap_mode = 2 - -[node name="RightScreenInfoText" type="RichTextLabel" parent="RightScreen/RightScreenInfos/SubViewport/HBoxContainer" unique_id=2134092583] -unique_name_in_owner = true -layout_mode = 2 -theme_override_font_sizes/normal_font_size = 14 -theme_override_font_sizes/bold_font_size = 14 -theme_override_font_sizes/bold_italics_font_size = 14 -theme_override_font_sizes/italics_font_size = 14 -theme_override_font_sizes/mono_font_size = 14 -bbcode_enabled = true -text = "Lorem ipsum dolor sir amet" -fit_content = true -horizontal_alignment = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="RightScreen" unique_id=1017949170] -shape = SubResource("SphereShape3D_2q8cl") - -[node name="HoverAnimationPlayer" type="AnimationPlayer" parent="RightScreen" unique_id=1284640853] -libraries/ = SubResource("AnimationLibrary_cvt2p") - -[node name="LeftScreen" type="Area3D" parent="." unique_id=1913589420 node_paths=PackedStringArray("hover_animation_player")] -unique_name_in_owner = true -transform = Transform3D(-0.6401098, -0.4515857, -0.6215544, 0, -0.809017, 0.58778524, 0.7682836, -0.37624705, -0.51785964, 0.7, 0.5, -0.15) -script = ExtResource("1_vlkbw") -hover_animation_player = NodePath("HoverAnimationPlayer") -metadata/_custom_type_script = "uid://bj4d1x8n8ina" - -[node name="LeftScreenModel" parent="LeftScreen" unique_id=596888679 instance=ExtResource("2_awdc5")] -transform = Transform3D(-0.99999976, 0, 0, 0, -1, 0, 0, 0, -0.99999994, 0, 0, 0) - -[node name="LeftScreenAction" type="Sprite3D" parent="LeftScreen" unique_id=764341277] -unique_name_in_owner = true -transform = Transform3D(1, 1.5099579e-07, 1.509958e-07, 1.509958e-07, -1.0000001, -1.4901158e-07, 1.5099577e-07, 1.4901163e-07, -1, -0.21238875, 0.06833798, 0.06593077) -pixel_size = 0.002 -texture = SubResource("ViewportTexture_2kujw") - -[node name="SubViewport" type="SubViewport" parent="LeftScreen/LeftScreenAction" unique_id=1596245800] -transparent_bg = true -size = Vector2i(150, 180) - -[node name="VBoxContainer" type="VBoxContainer" parent="LeftScreen/LeftScreenAction/SubViewport" unique_id=306736368] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = -10 -alignment = 1 - -[node name="LeftScreenActionIcon" type="TextureRect" parent="LeftScreen/LeftScreenAction/SubViewport/VBoxContainer" unique_id=2129330680] -unique_name_in_owner = true -custom_minimum_size = Vector2(100, 100) -layout_mode = 2 -texture = ExtResource("13_5d7hc") -expand_mode = 3 -stretch_mode = 5 - -[node name="LeftScreenActionLabel" type="Label" parent="LeftScreen/LeftScreenAction/SubViewport/VBoxContainer" unique_id=1631525309] -unique_name_in_owner = true -layout_mode = 2 -text = "Ujuqyt Ujuqyt" -label_settings = ExtResource("1_sp2xx") -horizontal_alignment = 1 -vertical_alignment = 1 -autowrap_mode = 3 - -[node name="LeftScreenStats" type="Sprite3D" parent="LeftScreen" unique_id=2023558675] -unique_name_in_owner = true -transform = Transform3D(0.9999999, -1.0058284e-07, -1.1920929e-07, 2.9802322e-08, -0.8660252, -0.50000006, 2.9802322e-08, 0.5000003, -0.86602545, -0.16182363, -0.27932125, 0.064277686) -pixel_size = 0.002 -texture = SubResource("ViewportTexture_2q8cl") - -[node name="SubViewport" type="SubViewport" parent="LeftScreen/LeftScreenStats" unique_id=1118622284] -transparent_bg = true -size = Vector2i(170, 75) - -[node name="HBoxContainer" type="HBoxContainer" parent="LeftScreen/LeftScreenStats/SubViewport" unique_id=324458085] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_right = 15.0 -offset_bottom = 51.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = 10 -alignment = 1 - -[node name="LeftScreenStat1" type="VBoxContainer" parent="LeftScreen/LeftScreenStats/SubViewport/HBoxContainer" unique_id=224841193] -layout_mode = 2 -theme_override_constants/separation = -10 - -[node name="LeftScreenStat1Icon" type="TextureRect" parent="LeftScreen/LeftScreenStats/SubViewport/HBoxContainer/LeftScreenStat1" unique_id=127811144] -unique_name_in_owner = true -custom_minimum_size = Vector2(50, 50) -layout_mode = 2 -texture = ExtResource("7_2ofl5") -expand_mode = 3 -stretch_mode = 5 - -[node name="LeftScreenStat1Label" type="Label" parent="LeftScreen/LeftScreenStats/SubViewport/HBoxContainer/LeftScreenStat1" unique_id=148471301] -unique_name_in_owner = true -layout_mode = 2 -text = "10" -label_settings = SubResource("LabelSettings_2kujw") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="LeftScreenStat2" type="VBoxContainer" parent="LeftScreen/LeftScreenStats/SubViewport/HBoxContainer" unique_id=476423329] -layout_mode = 2 -theme_override_constants/separation = -10 - -[node name="LeftScreenStat2Icon" type="TextureRect" parent="LeftScreen/LeftScreenStats/SubViewport/HBoxContainer/LeftScreenStat2" unique_id=2139266172] -unique_name_in_owner = true -custom_minimum_size = Vector2(50, 50) -layout_mode = 2 -texture = ExtResource("9_2kujw") -expand_mode = 3 -stretch_mode = 5 - -[node name="LeftScreenStat2Label" type="Label" parent="LeftScreen/LeftScreenStats/SubViewport/HBoxContainer/LeftScreenStat2" unique_id=1826154156] -unique_name_in_owner = true -layout_mode = 2 -text = "10" -label_settings = SubResource("LabelSettings_2kujw") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="LeftScreenInfos" type="Sprite3D" parent="LeftScreen" unique_id=409182409] -unique_name_in_owner = true -transform = Transform3D(0.9902684, 1.2166894e-08, 0.13917312, 0, -0.9999996, 8.7422784e-08, 0.13917315, -8.6571944e-08, -0.9902682, 0.28543925, -0.055610895, 0.046822492) -pixel_size = 0.002 -texture = SubResource("ViewportTexture_h8fs1") - -[node name="SubViewport" type="SubViewport" parent="LeftScreen/LeftScreenInfos" unique_id=1150656373] -transparent_bg = true -size = Vector2i(117, 138) - -[node name="HBoxContainer" type="VBoxContainer" parent="LeftScreen/LeftScreenInfos/SubViewport" unique_id=667177655] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = 10 - -[node name="LeftScreenInfoTitle" type="Label" parent="LeftScreen/LeftScreenInfos/SubViewport/HBoxContainer" unique_id=743864123] -unique_name_in_owner = true -layout_mode = 2 -text = "Hello hella" -label_settings = SubResource("LabelSettings_2d2u0") -horizontal_alignment = 1 -autowrap_mode = 2 - -[node name="LeftScreenInfoText" type="RichTextLabel" parent="LeftScreen/LeftScreenInfos/SubViewport/HBoxContainer" unique_id=101599500] -unique_name_in_owner = true -layout_mode = 2 -theme_override_font_sizes/normal_font_size = 14 -theme_override_font_sizes/bold_font_size = 14 -theme_override_font_sizes/bold_italics_font_size = 14 -theme_override_font_sizes/italics_font_size = 14 -theme_override_font_sizes/mono_font_size = 14 -bbcode_enabled = true -text = "Lorem ipsum dolor sir amet" -fit_content = true -horizontal_alignment = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="LeftScreen" unique_id=1983450336] -shape = SubResource("SphereShape3D_2kujw") - -[node name="HoverAnimationPlayer" type="AnimationPlayer" parent="LeftScreen" unique_id=332045443] -libraries/ = SubResource("AnimationLibrary_5d7hc") - -[node name="Inventory3D" parent="." unique_id=810532522 instance=ExtResource("17_inbnt")] -unique_name_in_owner = true -transform = Transform3D(1, 0, 8.940697e-08, 0, 1, 0, -8.940697e-08, 0, 1, 0, 0.5876103, 0.89364576) -no_tools = true -test_inventory = SubResource("Resource_ne0dp") diff --git a/stages/3d_scenes/ship_garage/scripts/ship_garage.gd b/stages/3d_scenes/ship_garage/scripts/ship_garage.gd index 6bf6ff2..a58cf01 100644 --- a/stages/3d_scenes/ship_garage/scripts/ship_garage.gd +++ b/stages/3d_scenes/ship_garage/scripts/ship_garage.gd @@ -9,7 +9,7 @@ func _input(_e): if ( Input.is_action_pressed("drop") and Input.is_action_pressed("move_right") - and Input.is_action_pressed("move_left") + and Input.is_action_pressed("move_left") and Input.is_action_just_pressed("action") ): GameInfo.game_data.dialogs_done.append(DIALOG_PATH) diff --git a/gui/vending_machine/assets/3d/vending_machine.blend b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine.blend similarity index 54% rename from gui/vending_machine/assets/3d/vending_machine.blend rename to stages/3d_scenes/vending_machine_room/assets/3d/vending_machine.blend index b83202b..18e382f 100644 Binary files a/gui/vending_machine/assets/3d/vending_machine.blend and b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine.blend differ diff --git a/gui/vending_machine/assets/3d/vending_machine.blend.import b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine.blend.import similarity index 85% rename from gui/vending_machine/assets/3d/vending_machine.blend.import rename to stages/3d_scenes/vending_machine_room/assets/3d/vending_machine.blend.import index ea1632d..aefbc38 100644 --- a/gui/vending_machine/assets/3d/vending_machine.blend.import +++ b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine.blend.import @@ -4,12 +4,12 @@ importer="scene" importer_version=1 type="PackedScene" uid="uid://5l3wve81irlc" -path="res://.godot/imported/vending_machine.blend-07b605eb32be6fa48a7c007c48e05515.scn" +path="res://.godot/imported/vending_machine.blend-d2b640c8f4d0c595cec0b5e84bca50ad.scn" [deps] -source_file="res://gui/vending_machine/assets/3d/vending_machine.blend" -dest_files=["res://.godot/imported/vending_machine.blend-07b605eb32be6fa48a7c007c48e05515.scn"] +source_file="res://stages/3d_scenes/vending_machine_room/assets/3d/vending_machine.blend" +dest_files=["res://.godot/imported/vending_machine.blend-d2b640c8f4d0c595cec0b5e84bca50ad.scn"] [params] diff --git a/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend new file mode 100644 index 0000000..60559c2 Binary files /dev/null and b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend differ diff --git a/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend.import b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend.import new file mode 100644 index 0000000..39c0651 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend.import @@ -0,0 +1,68 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://2qxf6qj8tnlk" +path="res://.godot/imported/vending_machine_room.blend-0bcded09a5a1444815bdcab5bef77fff.scn" + +[deps] + +source_file="res://stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend" +dest_files=["res://.godot/imported/vending_machine_room.blend-0bcded09a5a1444815bdcab5bef77fff.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": { +"Material": { +"use_external/enabled": true, +"use_external/fallback_path": "res://common/assets/materials/default_3d.tres", +"use_external/path": "uid://dvvi1k5c5iowc" +} +} +} +blender/nodes/visible=0 +blender/nodes/active_collection_only=false +blender/nodes/punctual_lights=true +blender/nodes/cameras=true +blender/nodes/custom_properties=true +blender/nodes/modifiers=1 +blender/meshes/colors=false +blender/meshes/uvs=true +blender/meshes/normals=true +blender/meshes/export_geometry_nodes_instances=false +blender/meshes/gpu_instances=false +blender/meshes/tangents=true +blender/meshes/skins=2 +blender/meshes/export_bones_deforming_mesh_only=false +blender/materials/unpack_enabled=true +blender/materials/export_materials=1 +blender/animation/limit_playback=true +blender/animation/always_sample=true +blender/animation/group_tracks=true +gltf/naming_version=2 diff --git a/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend1 b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend1 new file mode 100644 index 0000000..6dfba6a Binary files /dev/null and b/stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend1 differ diff --git a/stages/3d_scenes/vending_machine_room/assets/sounds/alex_jauk-vending-machines-ambient-noise-236027.mp3 b/stages/3d_scenes/vending_machine_room/assets/sounds/alex_jauk-vending-machines-ambient-noise-236027.mp3 new file mode 100644 index 0000000..af4ebb8 Binary files /dev/null and b/stages/3d_scenes/vending_machine_room/assets/sounds/alex_jauk-vending-machines-ambient-noise-236027.mp3 differ diff --git a/stages/3d_scenes/vending_machine_room/assets/sounds/alex_jauk-vending-machines-ambient-noise-236027.mp3.import b/stages/3d_scenes/vending_machine_room/assets/sounds/alex_jauk-vending-machines-ambient-noise-236027.mp3.import new file mode 100644 index 0000000..6a4581a --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/assets/sounds/alex_jauk-vending-machines-ambient-noise-236027.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://bynxc84w03so4" +path="res://.godot/imported/alex_jauk-vending-machines-ambient-noise-236027.mp3-9aff8d37b15f5aeb214a1b811e990715.mp3str" + +[deps] + +source_file="res://stages/3d_scenes/vending_machine_room/assets/sounds/alex_jauk-vending-machines-ambient-noise-236027.mp3" +dest_files=["res://.godot/imported/alex_jauk-vending-machines-ambient-noise-236027.mp3-9aff8d37b15f5aeb214a1b811e990715.mp3str"] + +[params] + +loop=true +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_3d.gd b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_3d.gd new file mode 100644 index 0000000..b9103c3 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_3d.gd @@ -0,0 +1,208 @@ +@tool +extends Node3D +class_name VendingMachine3d + +const LINE_OBJECT_NUMBER = 5 +const LINE_OBJECT_SEPARATION = Vector3.LEFT * 0.2 +const FALLING_OBJECT_LINE_SHIFT = Vector3.FORWARD * 0.3 + +enum State {CHOOSE,PAY,FETCH,DONE, OFF} +enum ChooseState {NONE,FIRST,SECOND} + +@export_tool_button("Update", "Callable") var update_action = update + +@export_tool_button("Fall Object 1", "Callable") var fall_object_1_action = fall_object_1 +@export_tool_button("Fall Object 1", "Callable") var fall_object_2_action = fall_object_2 + +@export var state : State = State.CHOOSE : set = set_state +@export var choose_state : ChooseState = ChooseState.NONE +@export var artefact_1 : Artefact = null : set = set_artefact_1 +@export var artefact_2 : Artefact = null : set = set_artefact_2 +@export var price : VendingMachinePrice = null : set = set_price + +# func _input(_e): +# if Input.is_action_just_pressed("action"): +# fall_object([ +# %Line1, +# %Line2, +# %Line3, +# %Line4 +# ].pick_random()) + +func _ready(): + update() + +func update(): + set_artefact_1() + set_artefact_2() + set_state() + set_price() + +func set_state(s := state): + state = s + %Select1Interactable.visible = s == State.CHOOSE or s == State.PAY + %Select1Interactable.interactable = (s == State.CHOOSE or s == State.PAY) and artefact_1 != null + + %Select2Interactable.visible = s == State.CHOOSE or s == State.PAY + %Select2Interactable.interactable = s == State.CHOOSE or s == State.PAY and artefact_2 != null + + %PayInteractable.visible = s == State.PAY + %PayInteractable.interactable = s == State.PAY + + %FetchInteractable.visible = s == State.FETCH + %FetchInteractable.interactable = s == State.FETCH + + %TopScreen.visible = s != State.OFF + %InfoScreen.visible = s != State.OFF + %PriceScreen.visible = s != State.OFF + %Light.visible = s != State.OFF + %SoundEffect.playing = s != State.OFF + + match state: + State.CHOOSE: + %InfoScreenLabel.text = "CHOOSE_AN_ITEM" + State.PAY: + if get_choosen_artefact(): + var choosen_artefact_name = get_choosen_artefact().get_artefact_name() + %InfoScreenLabel.text = tr("PAY_THE_PRICE_FOR").format({ + "item_name": tr(choosen_artefact_name), + }) + State.FETCH: + %InfoScreenLabel.text = "GET_YOUR_ITEM" + State.DONE: + %InfoScreenLabel.text = "THANK_YOU_FOR_YOUR_PURCHASE" + +func set_artefact_1(a := artefact_1): + if is_node_ready(): + if a: + fill_lines(%Line1, a.get_3d_scene().instantiate()) + fill_lines(%Line2, a.get_3d_scene().instantiate()) + else: + clear_line(%Line1) + clear_line(%Line2) + %Select1Interactable.artefact = a + artefact_1 = a + +func set_artefact_2(a := artefact_2): + if is_node_ready(): + if a: + fill_lines(%Line3, a.get_3d_scene().instantiate()) + fill_lines(%Line4, a.get_3d_scene().instantiate()) + else: + clear_line(%Line3) + clear_line(%Line4) + %Select2Interactable.artefact = a + artefact_2 = a + +func set_price(p := price): + if p and is_node_ready(): + %PriceScreenLabel.text = p.get_text() + %PriceScreenIcon.texture = p.get_icon() + if not Engine.is_editor_hint(): + %PriceScreenContentSprite.modulate = Color.WHITE if p.can_pay(GameInfo.game_data.player_data) else Color.RED + %PayIcon.modulate = Color.WHITE if p.can_pay(GameInfo.game_data.player_data) else Color.RED + price = p + +func fall_object_1(): + fall_object([ + %Line1, + %Line2 + ].pick_random()) + +func fall_object_2(): + fall_object([ + %Line3, + %Line4 + ].pick_random()) + +func fall_object(from_line : Node3D): + if len(from_line.get_children()): + var falling_object = create_falling_object() + + var object = from_line.get_children().pick_random() as Node3D + + var falling_model = object.duplicate() + falling_model.position = Vector3.ZERO + falling_object.add_child(falling_model) + falling_object.freeze = false + object.queue_free() + + %FallingObjects.add_child(falling_object) + falling_object.global_position = object.global_position + FALLING_OBJECT_LINE_SHIFT.rotated(Vector3.UP, rotation.y) + +func clear_falling_objects(): + for c in %FallingObjects.get_children(): + c.queue_free() + +func create_falling_object() -> RigidBody3D: + var falling_object = RigidBody3D.new() + var falling_collider = CollisionShape3D.new() + var falling_shape = SphereShape3D.new() + falling_shape.radius = 0.08 + falling_collider.shape = falling_shape + falling_object.add_child(falling_collider) + falling_object.gravity_scale = 0.2 + + return falling_object + +func fill_lines(line : Node3D, object : Node3D): + clear_line(line) + + for i in range(LINE_OBJECT_NUMBER): + var new_object = object.duplicate() + line.add_child(new_object) + new_object.position = i * LINE_OBJECT_SEPARATION + +func clear_line(line : Node3D): + for c in line.get_children(): + c.queue_free() + +func get_choosen_artefact() -> Artefact: + if choose_state == ChooseState.FIRST: + return artefact_1 + elif choose_state == ChooseState.SECOND: + return artefact_2 + return null + +func _on_select_1_interactable_clicked(): + AudioManager.play_sfx("Screen_interaction") + choose_state = ChooseState.FIRST + state = State.PAY + + +func _on_select_2_interactable_clicked(): + AudioManager.play_sfx("Screen_interaction") + choose_state = ChooseState.SECOND + state = State.PAY + + +func _on_pay_interactable_clicked(): + if price.can_pay(GameInfo.game_data.player_data): + AudioManager.play_sfx("Drop") + price.pay(GameInfo.game_data.player_data) + if choose_state == ChooseState.FIRST: + fall_object_1() + else: + fall_object_2() + + state = State.FETCH + get_tree().create_timer(1.).timeout.connect( + func (): + AudioManager.play_sfx("VendingMachineDrop") + ) + + +func _on_fetch_interactable_clicked(): + AudioManager.play_sfx("PickUp") + clear_falling_objects() + if GameInfo.game_data and GameInfo.game_data.current_region_data and GameInfo.game_data.current_run: + GameInfo.game_data.current_region_data.completed_doors.append(GameInfo.game_data.current_region_data.entered_door) + GameInfo.game_data.current_run.add_artefacts(get_choosen_artefact().duplicate()) + + state = State.DONE + + get_tree().create_timer(3.).timeout.connect( + func (): + state = State.OFF + AudioManager.play_sfx("VendingMachineOff") + ) diff --git a/gui/vending_machine/scripts/vending_machine_3d.gd.uid b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_3d.gd.uid similarity index 100% rename from gui/vending_machine/scripts/vending_machine_3d.gd.uid rename to stages/3d_scenes/vending_machine_room/scripts/vending_machine_3d.gd.uid diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_energy_price.gd b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_energy_price.gd new file mode 100644 index 0000000..edf9759 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_energy_price.gd @@ -0,0 +1,22 @@ +@tool +extends VendingMachinePrice +class_name VendingMachineEnergyPrice + +@export var energy : int + +func _init( + _energy := 1 +): + energy = _energy + +func get_icon() -> Texture: + return preload("res://common/icons/bolt.svg") + +func get_text() -> String: + return "%d" % energy + +func can_pay(player_data: PlayerData) -> bool: + return player_data.energy >= energy + +func pay(player_data: PlayerData) -> void: + player_data.energy -= energy \ No newline at end of file diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_energy_price.gd.uid b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_energy_price.gd.uid new file mode 100644 index 0000000..e497a82 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_energy_price.gd.uid @@ -0,0 +1 @@ +uid://bioeudg633y06 diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_price.gd b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_price.gd new file mode 100644 index 0000000..ea8b9d1 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_price.gd @@ -0,0 +1,10 @@ +@tool +@abstract +extends Resource +class_name VendingMachinePrice + + +@abstract func get_icon() -> Texture +@abstract func get_text() -> String +@abstract func can_pay(player_data: PlayerData) -> bool +@abstract func pay(player_data: PlayerData) -> void \ No newline at end of file diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_price.gd.uid b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_price.gd.uid new file mode 100644 index 0000000..d0e8ab7 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_price.gd.uid @@ -0,0 +1 @@ +uid://hixfit7u4hqs diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_room.gd b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_room.gd new file mode 100644 index 0000000..a7886ab --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_room.gd @@ -0,0 +1,28 @@ +extends Node3D + +func _ready(): + var rng := RandomNumberGenerator.new() + rng.seed = GameInfo.game_data.current_region_data.entered_door.hash() + + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + + var all_vending_machines = %VendingMachines.get_children() as Array[VendingMachine3d] + var vending_machine : VendingMachine3d = all_vending_machines[rng.randi()%len(all_vending_machines)] + + var available_artefacts = GameInfo.game_data.progression_data.available_artefacts + var artefacts = [] + + while len(artefacts) < 2: + var artefact = available_artefacts[rng.randi()%len(available_artefacts)] + if artefacts.find_custom( + func (a : Artefact): return a.get_artefact_name() == artefact.get_artefact_name() + ) == -1: + artefacts.append(artefact) + + vending_machine.artefact_1 = artefacts[0] + vending_machine.artefact_2 = artefacts[1] + vending_machine.price = VendingMachineEnergyPrice.new(2) + vending_machine.state = VendingMachine3d.State.CHOOSE + +func _on_exit_clicked(): + SceneManager.change_to_scene_id('REGION') diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_room.gd.uid b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_room.gd.uid new file mode 100644 index 0000000..53a9697 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_room.gd.uid @@ -0,0 +1 @@ +uid://miw8kvslhrao diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_select_interactable.gd b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_select_interactable.gd new file mode 100644 index 0000000..e70b675 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_select_interactable.gd @@ -0,0 +1,10 @@ +extends Interactable3D +class_name VendingMachineSelectInteractable + +@export var artefact : Artefact + +func card_info() -> CardInfo: + if artefact: + return artefact.card_info() + return null + diff --git a/stages/3d_scenes/vending_machine_room/scripts/vending_machine_select_interactable.gd.uid b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_select_interactable.gd.uid new file mode 100644 index 0000000..6baf7bd --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/scripts/vending_machine_select_interactable.gd.uid @@ -0,0 +1 @@ +uid://cpdtt25r2ne23 diff --git a/stages/3d_scenes/vending_machine_room/vending_machine_3d.tscn b/stages/3d_scenes/vending_machine_room/vending_machine_3d.tscn new file mode 100644 index 0000000..b9757d0 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/vending_machine_3d.tscn @@ -0,0 +1,332 @@ +[gd_scene format=3 uid="uid://blva21dapmm68"] + +[ext_resource type="PackedScene" uid="uid://5l3wve81irlc" path="res://stages/3d_scenes/vending_machine_room/assets/3d/vending_machine.blend" id="1_28vvr"] +[ext_resource type="Script" uid="uid://d1prpiulsaqhn" path="res://stages/3d_scenes/vending_machine_room/scripts/vending_machine_3d.gd" id="1_awnyh"] +[ext_resource type="Script" uid="uid://bioeudg633y06" path="res://stages/3d_scenes/vending_machine_room/scripts/vending_machine_energy_price.gd" id="4_tvcj6"] +[ext_resource type="Script" uid="uid://bj4d1x8n8ina" path="res://entities/interactable_3d/interactable_3d.gd" id="5_babpq"] +[ext_resource type="Texture2D" uid="uid://bmersnaoira20" path="res://common/icons/building-store.svg" id="5_f6clw"] +[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="6_1vufv"] +[ext_resource type="Texture2D" uid="uid://3slhocr5wy3w" path="res://common/icons/hand-stop.svg" id="6_c54xj"] +[ext_resource type="Texture2D" uid="uid://cwewx7cdy085h" path="res://common/icons/help-hexagon.svg" id="7_1vufv"] +[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="8_5gq8t"] +[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="9_p1py0"] +[ext_resource type="Script" uid="uid://cpdtt25r2ne23" path="res://stages/3d_scenes/vending_machine_room/scripts/vending_machine_select_interactable.gd" id="10_js246"] +[ext_resource type="AudioStream" uid="uid://bynxc84w03so4" path="res://stages/3d_scenes/vending_machine_room/assets/sounds/alex_jauk-vending-machines-ambient-noise-236027.mp3" id="12_js246"] + +[sub_resource type="Resource" id="Resource_vrdoi"] +script = ExtResource("4_tvcj6") +energy = 3 +metadata/_custom_type_script = "uid://bioeudg633y06" + +[sub_resource type="Environment" id="Environment_28vvr"] +ambient_light_source = 2 +ambient_light_color = Color(1, 1, 1, 1) +ambient_light_energy = 2.29 +tonemap_exposure = 0.62 + +[sub_resource type="Gradient" id="Gradient_f6clw"] +colors = PackedColorArray(0.13725491, 0.39215687, 0.6666667, 1, 0.14509805, 0.75686276, 0.2784314, 1) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_1vufv"] +gradient = SubResource("Gradient_f6clw") +width = 102 +height = 34 +fill_from = Vector2(0.491453, 1) +fill_to = Vector2(0.49158248, 0) + +[sub_resource type="ViewportTexture" id="ViewportTexture_5gq8t"] +viewport_path = NodePath("TopScreen/TopScreenContent") + +[sub_resource type="Gradient" id="Gradient_5gq8t"] +colors = PackedColorArray(0.13725491, 0.39215687, 0.6666667, 1, 0.14509805, 0.75686276, 0.2784314, 1) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_p1py0"] +gradient = SubResource("Gradient_5gq8t") +width = 41 +height = 52 +fill_from = Vector2(0.491453, 1) +fill_to = Vector2(0.49158248, 0) + +[sub_resource type="ViewportTexture" id="ViewportTexture_p1py0"] +viewport_path = NodePath("InfoScreen/InfoScreenContent") + +[sub_resource type="LabelSettings" id="LabelSettings_p1py0"] +font = ExtResource("8_5gq8t") +font_size = 15 + +[sub_resource type="Gradient" id="Gradient_js246"] +colors = PackedColorArray(0.13725491, 0.39215687, 0.6666667, 1, 0.14509805, 0.75686276, 0.2784314, 1) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_tvcj6"] +gradient = SubResource("Gradient_js246") +width = 41 +height = 27 +fill_from = Vector2(0.491453, 1) +fill_to = Vector2(0.49158248, 0) + +[sub_resource type="ViewportTexture" id="ViewportTexture_js246"] +viewport_path = NodePath("PriceScreen/PriceScreenContent") + +[sub_resource type="LabelSettings" id="LabelSettings_tvcj6"] +font = ExtResource("8_5gq8t") +font_size = 30 + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_p1py0"] +radius = 0.23339844 +height = 1.2451172 + +[sub_resource type="Animation" id="Animation_vrdoi"] +length = 0.001 + +[sub_resource type="Animation" id="Animation_sfrja"] +resource_name = "hover" +loop_mode = 1 + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_40f8c"] +_data = { +&"RESET": SubResource("Animation_vrdoi"), +&"hover": SubResource("Animation_sfrja") +} + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_babpq"] +radius = 0.23339844 +height = 0.5097656 + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ia2hc"] +radius = 0.23339844 +height = 0.8841553 + +[node name="VendingMachine3d" type="Node3D" unique_id=92614917] +script = ExtResource("1_awnyh") +price = SubResource("Resource_vrdoi") + +[node name="Model" parent="." unique_id=1993368617 instance=ExtResource("1_28vvr")] + +[node name="Line1" type="Node3D" parent="." unique_id=1631780989] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30948043, 0.971, 0) + +[node name="Line2" type="Node3D" parent="." unique_id=29729480] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30941665, 0.74758303, 0) + +[node name="Line3" type="Node3D" parent="." unique_id=532403895] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30941665, 0.5122718, 0) + +[node name="Line4" type="Node3D" parent="." unique_id=290175423] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30941665, 0.26622266, 0) + +[node name="FallingObjects" type="Node3D" parent="." unique_id=1744524061] +unique_name_in_owner = true + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1595767490] +environment = SubResource("Environment_28vvr") + +[node name="TopScreen" type="Sprite3D" parent="." unique_id=1430672096] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.10305387, 1.3142496, -0.5496552) +texture = SubResource("GradientTexture2D_1vufv") + +[node name="TopScreenContentSprite" type="Sprite3D" parent="TopScreen" unique_id=21415415] +transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, -0.026914358) +pixel_size = 0.003 +texture = SubResource("ViewportTexture_5gq8t") + +[node name="TopScreenContent" type="SubViewport" parent="TopScreen" unique_id=1108583219] +disable_3d = true +transparent_bg = true +size = Vector2i(341, 115) + +[node name="VBoxContainer" type="VBoxContainer" parent="TopScreen/TopScreenContent" unique_id=1069568148] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +alignment = 1 + +[node name="TopScreenIcon" type="TextureRect" parent="TopScreen/TopScreenContent/VBoxContainer" unique_id=22441432] +custom_minimum_size = Vector2(50, 50) +layout_mode = 2 +texture = ExtResource("5_f6clw") +expand_mode = 1 +stretch_mode = 5 + +[node name="TopScreenLabel" type="Label" parent="TopScreen/TopScreenContent/VBoxContainer" unique_id=1868758207] +layout_mode = 2 +text = "VENDING_MACHINE" +label_settings = ExtResource("6_1vufv") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="InfoScreen" type="Sprite3D" parent="." unique_id=1684330093] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.9165541, 0.7847517, -0.5685998) +texture = SubResource("GradientTexture2D_p1py0") + +[node name="InfoScreenContentSprite" type="Sprite3D" parent="InfoScreen" unique_id=1389338749] +transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, -0.026914358) +pixel_size = 0.003 +texture = SubResource("ViewportTexture_p1py0") + +[node name="InfoScreenContent" type="SubViewport" parent="InfoScreen" unique_id=475736608] +disable_3d = true +transparent_bg = true +size = Vector2i(122, 147) + +[node name="VBoxContainer" type="VBoxContainer" parent="InfoScreen/InfoScreenContent" unique_id=885857578] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +alignment = 1 + +[node name="InfoScreenIcon" type="TextureRect" parent="InfoScreen/InfoScreenContent/VBoxContainer" unique_id=350553652] +custom_minimum_size = Vector2(50, 50) +layout_mode = 2 +texture = ExtResource("7_1vufv") +expand_mode = 1 +stretch_mode = 5 + +[node name="InfoScreenLabel" type="Label" parent="InfoScreen/InfoScreenContent/VBoxContainer" unique_id=1569152531] +unique_name_in_owner = true +layout_mode = 2 +text = "CHOOSE_AN_ITEM" +label_settings = SubResource("LabelSettings_p1py0") +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="PriceScreen" type="Sprite3D" parent="." unique_id=204599448] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.9165541, 0.27790964, -0.5685998) +texture = SubResource("GradientTexture2D_tvcj6") + +[node name="PriceScreenContentSprite" type="Sprite3D" parent="PriceScreen" unique_id=833489935] +unique_name_in_owner = true +transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, -0.026914358) +pixel_size = 0.003 +texture = SubResource("ViewportTexture_js246") + +[node name="PriceScreenContent" type="SubViewport" parent="PriceScreen" unique_id=1939196004] +disable_3d = true +transparent_bg = true +size = Vector2i(134, 96) + +[node name="HBoxContainer" type="HBoxContainer" parent="PriceScreen/PriceScreenContent" unique_id=1566763310] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +alignment = 1 + +[node name="PriceScreenLabel" type="Label" parent="PriceScreen/PriceScreenContent/HBoxContainer" unique_id=718480172] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 1 +text = "3" +label_settings = SubResource("LabelSettings_tvcj6") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="PriceScreenIcon" type="TextureRect" parent="PriceScreen/PriceScreenContent/HBoxContainer" unique_id=762921627] +unique_name_in_owner = true +custom_minimum_size = Vector2(50, 50) +layout_mode = 2 +texture = ExtResource("9_p1py0") +expand_mode = 1 +stretch_mode = 5 + +[node name="Select1Interactable" type="Area3D" parent="." unique_id=957239971] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.08462322, 0.884176, -0.18582645) +script = ExtResource("10_js246") +interactable = false +inspectable = true +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Select1Interactable" unique_id=794286242] +transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, -0.0017700195, 0, -0.29349226) +shape = SubResource("CapsuleShape3D_p1py0") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Select1Interactable" unique_id=668034332] +libraries/ = SubResource("AnimationLibrary_40f8c") + +[node name="Select2Interactable" type="Area3D" parent="." unique_id=1801318420] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.08462322, 0.381873, -0.18582645) +script = ExtResource("10_js246") +inspectable = true +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Select2Interactable" unique_id=923668306] +transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, -0.0017700195, 0, -0.29349226) +shape = SubResource("CapsuleShape3D_p1py0") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Select2Interactable" unique_id=1970787304] +libraries/ = SubResource("AnimationLibrary_40f8c") + +[node name="PayInteractable" type="Area3D" parent="." unique_id=1389533845] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.93483126, -0.122846335, -0.66631746) +visible = false +script = ExtResource("5_babpq") +interactable = false +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="CollisionShape3D" type="CollisionShape3D" parent="PayInteractable" unique_id=733209921] +transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, -0.0017700195, 0, 0.09913331) +shape = SubResource("CapsuleShape3D_babpq") + +[node name="PayIcon" type="Sprite3D" parent="PayInteractable" unique_id=1480977661] +unique_name_in_owner = true +transform = Transform3D(1.3891655, 0, 0, 0, 1.2388325, -0.6285498, 0, 0.6285498, 1.2388325, 0, 0, 0) +pixel_size = 0.004 +texture = ExtResource("6_c54xj") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="PayInteractable" unique_id=1407995680] +libraries/ = SubResource("AnimationLibrary_40f8c") + +[node name="FetchInteractable" type="Area3D" parent="." unique_id=2063544686] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.13864326, -0.45181414, -0.66631746) +visible = false +script = ExtResource("5_babpq") +interactable = false +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="CollisionShape3D" type="CollisionShape3D" parent="FetchInteractable" unique_id=691431446] +transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, -0.0017700195, 0, 0.09913331) +shape = SubResource("CapsuleShape3D_ia2hc") + +[node name="FetchIcon" type="Sprite3D" parent="FetchInteractable" unique_id=2088783242] +transform = Transform3D(1.1707262, 0, 0, 0, 1.0440322, -0.5297136, 0, 0.5297136, 1.0440322, 0, 0, 0) +pixel_size = 0.004 +texture = ExtResource("6_c54xj") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="FetchInteractable" unique_id=1814331959] +libraries/ = SubResource("AnimationLibrary_40f8c") + +[node name="Light" type="OmniLight3D" parent="." unique_id=23464893] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.089285016, 0.9888365, -0.40412843) +light_energy = 2.313 +shadow_enabled = true +omni_range = 2.5571291 + +[node name="SoundEffect" type="AudioStreamPlayer3D" parent="." unique_id=496779284] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.19407654) +stream = ExtResource("12_js246") +volume_db = -25.143 +autoplay = true +bus = &"Sfx" + +[connection signal="clicked" from="Select1Interactable" to="." method="_on_select_1_interactable_clicked"] +[connection signal="clicked" from="Select2Interactable" to="." method="_on_select_2_interactable_clicked"] +[connection signal="clicked" from="PayInteractable" to="." method="_on_pay_interactable_clicked"] +[connection signal="clicked" from="FetchInteractable" to="." method="_on_fetch_interactable_clicked"] diff --git a/stages/3d_scenes/vending_machine_room/vending_machine_room.blend1 b/stages/3d_scenes/vending_machine_room/vending_machine_room.blend1 new file mode 100644 index 0000000..ba44a2d Binary files /dev/null and b/stages/3d_scenes/vending_machine_room/vending_machine_room.blend1 differ diff --git a/stages/3d_scenes/vending_machine_room/vending_machine_room.tscn b/stages/3d_scenes/vending_machine_room/vending_machine_room.tscn new file mode 100644 index 0000000..e275c51 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/vending_machine_room.tscn @@ -0,0 +1,133 @@ +[gd_scene format=3 uid="uid://gnqodi7hw7sl"] + +[ext_resource type="Script" uid="uid://miw8kvslhrao" path="res://stages/3d_scenes/vending_machine_room/scripts/vending_machine_room.gd" id="1_1x1k5"] +[ext_resource type="PackedScene" uid="uid://da7a74dg30q1l" path="res://entities/player_3d/player_3D.tscn" id="4_dv00w"] +[ext_resource type="PackedScene" uid="uid://2qxf6qj8tnlk" path="res://stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend" id="5_1x1k5"] +[ext_resource type="Script" uid="uid://bj4d1x8n8ina" path="res://entities/interactable_3d/interactable_3d.gd" id="5_g3jtw"] +[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://common/icons/logout.svg" id="6_i4cp5"] +[ext_resource type="PackedScene" uid="uid://blva21dapmm68" path="res://stages/3d_scenes/vending_machine_room/vending_machine_3d.tscn" id="6_rf1ya"] + +[sub_resource type="Environment" id="Environment_1x1k5"] +background_mode = 2 +sky_custom_fov = 61.7 +ambient_light_source = 3 +ambient_light_color = Color(1, 1, 1, 1) +ambient_light_sky_contribution = 0.85 +ambient_light_energy = 2.0 +reflected_light_source = 2 +tonemap_mode = 2 +tonemap_exposure = 0.7 +tonemap_white = 1.84 +glow_enabled = true +glow_intensity = 0.22 +glow_bloom = 0.22 +glow_hdr_threshold = 0.79 +glow_hdr_scale = 0.0 +glow_hdr_luminance_cap = 5.63 +fog_enabled = true +fog_mode = 1 +fog_light_color = Color(0.13725491, 0.39215687, 0.6666667, 1) +fog_density = 0.1831 +fog_aerial_perspective = 0.113 +fog_sky_affect = 0.0 +volumetric_fog_sky_affect = 0.0 +adjustment_enabled = true +adjustment_saturation = 1.3 + +[sub_resource type="Animation" id="Animation_pxmsf"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite3D:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(0.99999994, 1, 0.99999994)] +} + +[sub_resource type="Animation" id="Animation_u7lr8"] +resource_name = "hover" +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite3D:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.46666667, 1), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector3(0.99999994, 1, 0.99999994), Vector3(1.2, 1.2, 1.2), Vector3(0.99999994, 1, 0.99999994)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_gq4rr"] +_data = { +&"RESET": SubResource("Animation_pxmsf"), +&"hover": SubResource("Animation_u7lr8") +} + +[sub_resource type="BoxShape3D" id="BoxShape3D_0j6i6"] +size = Vector3(2.2807465, 0.83758545, 2.7016602) + +[node name="VendingMachineRoom" type="Node3D" unique_id=707746738] +script = ExtResource("1_1x1k5") + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1067763548] +environment = SubResource("Environment_1x1k5") + +[node name="Player3D" parent="." unique_id=549819967 instance=ExtResource("4_dv00w")] +unique_name_in_owner = true +transform = Transform3D(0, 0, -0.99999994, 0, 1, 0, 0.99999994, 0, 0, 4.944984, 1.2635367, 24.252193) +speed = 5.0 + +[node name="vending_machine_room" parent="." unique_id=1777370304 instance=ExtResource("5_1x1k5")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.009907, 0, 24.24866) + +[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=1122387138] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.8885746, 1.075707, 25.081566) +light_color = Color(1, 0.6509804, 0.09019608, 1) + +[node name="Exit" type="Area3D" parent="." unique_id=446224653 node_paths=PackedStringArray("hover_animation_player")] +unique_name_in_owner = true +transform = Transform3D(-4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 0, 0, 1, 3.680644, 1.1590724, 25.183067) +script = ExtResource("5_g3jtw") +hover_animation_player = NodePath("HoverAnimationPlayer") +metadata/_custom_type_script = "uid://bj4d1x8n8ina" + +[node name="Sprite3D" type="Sprite3D" parent="Exit" unique_id=1963479858] +transform = Transform3D(-4.3711385e-08, -1, -4.3711385e-08, 0, -4.371139e-08, 0.99999994, -0.99999994, 4.371139e-08, 1.9106853e-15, 0.1646713, -0.017980576, 0) +pixel_size = 0.005 +texture = ExtResource("6_i4cp5") + +[node name="HoverAnimationPlayer" type="AnimationPlayer" parent="Exit" unique_id=971962983] +libraries/ = SubResource("AnimationLibrary_gq4rr") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Exit" unique_id=1996267072] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.14810944, -0.081207275, 0.35961914) +shape = SubResource("BoxShape3D_0j6i6") + +[node name="VendingMachines" type="Node3D" parent="." unique_id=151258495] +unique_name_in_owner = true + +[node name="VendingMachine3d" parent="VendingMachines" unique_id=92614917 instance=ExtResource("6_rf1ya")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.409475, 0.7967659, 26.737188) +state = 4 + +[node name="VendingMachine3d4" parent="VendingMachines" unique_id=284398440 instance=ExtResource("6_rf1ya")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 11.409475, 0.7967659, 26.737188) +state = 4 + +[node name="VendingMachine3d2" parent="VendingMachines" unique_id=854345189 instance=ExtResource("6_rf1ya")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.4200993, 0.7967659, 26.737188) +state = 4 + +[node name="VendingMachine3d3" parent="VendingMachines" unique_id=589582853 instance=ExtResource("6_rf1ya")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.283085, 0.7967659, 26.737188) +state = 4 + +[connection signal="clicked" from="Exit" to="." method="_on_exit_clicked"] diff --git a/stages/3d_scenes/vending_machine_room/vending_machine_room.tscn13386183010.tmp b/stages/3d_scenes/vending_machine_room/vending_machine_room.tscn13386183010.tmp new file mode 100644 index 0000000..ca68412 --- /dev/null +++ b/stages/3d_scenes/vending_machine_room/vending_machine_room.tscn13386183010.tmp @@ -0,0 +1,100 @@ +[gd_scene format=3 uid="uid://gnqodi7hw7sl"] + +[ext_resource type="Script" uid="uid://miw8kvslhrao" path="res://stages/3d_scenes/vending_machine_room/scripts/vending_machine_room.gd" id="1_1x1k5"] +[ext_resource type="Shader" uid="uid://bv2rghn44mrrf" path="res://stages/title_screen/resources/shaders/stars.gdshader" id="2_fx15d"] +[ext_resource type="Texture2D" uid="uid://cww35xu1yqivp" path="res://stages/3d_scenes/cockpit_scene/assets/textures/sky.png" id="3_tc1s4"] +[ext_resource type="PackedScene" uid="uid://da7a74dg30q1l" path="res://entities/player_3d/player_3D.tscn" id="4_dv00w"] +[ext_resource type="PackedScene" uid="uid://2qxf6qj8tnlk" path="res://stages/3d_scenes/vending_machine_room/assets/3d/vending_machine_room.blend" id="5_1x1k5"] +[ext_resource type="PackedScene" uid="uid://blva21dapmm68" path="res://stages/3d_scenes/vending_machine_room/vending_machine_3d.tscn" id="6_rf1ya"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_mwti2"] +shader = ExtResource("2_fx15d") +shader_parameter/sky_color = Color(0.03, 0.05, 0.11, 1) +shader_parameter/star_base_color = Color(0.8, 1, 0.3, 1) +shader_parameter/star_hue_offset = 0.6 +shader_parameter/star_intensity = 0.08 +shader_parameter/star_twinkle_speed = 0.8 +shader_parameter/star_twinkle_intensity = 0.2 +shader_parameter/layer_scale = 20.0 +shader_parameter/layer_scale_step = 10.0 +shader_parameter/layers_count = 3 + +[sub_resource type="Sky" id="Sky_kdvug"] +sky_material = SubResource("ShaderMaterial_mwti2") + +[sub_resource type="Environment" id="Environment_1x1k5"] +background_mode = 2 +sky = SubResource("Sky_kdvug") +sky_custom_fov = 61.7 +ambient_light_source = 3 +ambient_light_color = Color(1, 1, 1, 1) +ambient_light_sky_contribution = 0.85 +ambient_light_energy = 2.0 +reflected_light_source = 2 +tonemap_mode = 2 +tonemap_exposure = 0.7 +tonemap_white = 1.84 +glow_enabled = true +glow_intensity = 0.22 +glow_bloom = 0.22 +glow_hdr_threshold = 0.79 +glow_hdr_scale = 0.0 +glow_hdr_luminance_cap = 5.63 +fog_enabled = true +fog_mode = 1 +fog_light_color = Color(0.13725491, 0.39215687, 0.6666667, 1) +fog_density = 0.1831 +fog_aerial_perspective = 0.113 +fog_sky_affect = 0.0 +volumetric_fog_sky_affect = 0.0 +adjustment_enabled = true +adjustment_saturation = 1.3 + +[sub_resource type="SphereMesh" id="SphereMesh_ovhgo"] +flip_faces = true + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jwd5g"] +shading_mode = 0 +albedo_color = Color(0.5882353, 0.7019608, 0.85882354, 1) +albedo_texture = ExtResource("3_tc1s4") + +[node name="VendingMachineRoom" type="Node3D" unique_id=707746738] +script = ExtResource("1_1x1k5") + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1067763548] +environment = SubResource("Environment_1x1k5") + +[node name="DaySky" type="MeshInstance3D" parent="WorldEnvironment" unique_id=1108386443] +transform = Transform3D(1000, 0, 0, 0, 1000, 0, 0, 0, 1000, 0, 0, 0) +mesh = SubResource("SphereMesh_ovhgo") +surface_material_override/0 = SubResource("StandardMaterial3D_jwd5g") + +[node name="Player3D" parent="." unique_id=549819967 instance=ExtResource("4_dv00w")] +unique_name_in_owner = true +transform = Transform3D(0, 0, -0.99999994, 0, 1, 0, 0.99999994, 0, 0, 4.944984, 1.2635367, 24.252193) +speed = 5.0 + +[node name="vending_machine_room" parent="." unique_id=1088213414 instance=ExtResource("5_1x1k5")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.009907, 0, 24.24866) + +[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=1122387138] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.323474, 2.8448656, 25.081566) + +[node name="VendingMachine3d" parent="." unique_id=92614917 instance=ExtResource("6_rf1ya")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.409475, 0.7967659, 26.737188) +choose_state = 0 + +[node name="VendingMachine3d4" parent="." unique_id=284398440 instance=ExtResource("6_rf1ya")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 11.409475, 0.7967659, 26.737188) +state = 4 +choose_state = 0 + +[node name="VendingMachine3d2" parent="." unique_id=854345189 instance=ExtResource("6_rf1ya")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.4200993, 0.7967659, 26.737188) +state = 4 +choose_state = 0 + +[node name="VendingMachine3d3" parent="." unique_id=589582853 instance=ExtResource("6_rf1ya")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.283085, 0.7967659, 26.737188) +state = 4 +choose_state = 0 diff --git a/stages/terrain/region/region.tscn b/stages/terrain/region/region.tscn index ca63627..c47345a 100644 --- a/stages/terrain/region/region.tscn +++ b/stages/terrain/region/region.tscn @@ -16,6 +16,7 @@ [ext_resource type="Texture2D" uid="uid://b752eqq4cm7ve" path="res://common/icons/building-factory-2.svg" id="11_fwgig"] [ext_resource type="Texture2D" uid="uid://dg00xnpp6ixls" path="res://common/icons/server-2.svg" id="12_mlppq"] [ext_resource type="Texture2D" uid="uid://1ynlp05wj0hm" path="res://common/icons/rocket.svg" id="13_r4e5h"] +[ext_resource type="Texture2D" uid="uid://bmersnaoira20" path="res://common/icons/building-store.svg" id="16_0e2h6"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_qdnee"] shader = ExtResource("2_ktnx3") @@ -116,6 +117,7 @@ camera = NodePath("../../Camera") [node name="PassDay" parent="." unique_id=1144772570 instance=ExtResource("3_ktnx3")] unique_name_in_owner = true +visible = false [node name="RegionGui" type="CanvasLayer" parent="." unique_id=2024485651] layer = 2 @@ -144,6 +146,7 @@ position = Vector2(-405, -151) unique_name_in_owner = true visible = false icon = ExtResource("11_fwgig") +present = null default_info_title = "ASTRA_FACTORY" default_info_desc = "ASTRA_FACTORY_TEXT" @@ -153,6 +156,7 @@ visible = false position = Vector2(91, -177) to_scene_id = "BOREA" icon = ExtResource("12_mlppq") +present = null default_interact_text = "ENTER" available = true default_info_title = "BOREA_BASE" @@ -164,10 +168,23 @@ visible = false position = Vector2(91, -177) to_scene_id = "GARAGE" icon = ExtResource("13_r4e5h") +present = null default_interact_text = "ENTER" default_info_title = "MYSTERIOUS_DOOR" default_info_desc = "MYSTERIOUS_DOOR_TEXT" +[node name="VendingMachineDoor" parent="Entities" unique_id=580707365 instance=ExtResource("8_2f6js")] +unique_name_in_owner = true +visible = false +position = Vector2(91, -177) +to_scene_id = "VENDING_MACHINE_DOOR" +icon = ExtResource("16_0e2h6") +present = null +default_interact_text = "ENTER" +available = true +default_info_title = "VENDING_MACHINES" +default_info_desc = "MYSTERIOUS_DOOR_TEXT" + [node name="Camera" parent="." unique_id=1399042986 node_paths=PackedStringArray("following") instance=ExtResource("8_fwgig")] following = NodePath("../Entities/Player") diff --git a/stages/terrain/region/scripts/chunk.gd b/stages/terrain/region/scripts/chunk.gd index b69b109..b9ef698 100644 --- a/stages/terrain/region/scripts/chunk.gd +++ b/stages/terrain/region/scripts/chunk.gd @@ -1,4 +1,3 @@ -@tool extends Node2D class_name Chunk @@ -37,18 +36,18 @@ var generation_semaphore : Semaphore var all_tiles : Array[Vector2i] var all_global_tiles : Array[Vector2i] -@export_tool_button("Update", "Callable") var update_action = func(): - generation_semaphore.post() - for c in get_children(): - c.queue_free() +# @export_tool_button("Update", "Callable") var update_action = func(): +# generation_semaphore.post() +# for c in get_children(): +# c.queue_free() - setup_position() - # queue_redraw() - generate() +# setup_position() +# # queue_redraw() +# generate() -@export_tool_button("Clear", "Callable") var clear_action = func(): - for c in get_children(): - c.queue_free() +# @export_tool_button("Clear", "Callable") var clear_action = func(): +# for c in get_children(): +# c.queue_free() func _init( _chunk_coord : Vector2i = Vector2i.ZERO, diff --git a/stages/terrain/region/scripts/modifiers/arid_modifier.gd b/stages/terrain/region/scripts/modifiers/arid_modifier.gd index dd9b200..7a235cb 100644 --- a/stages/terrain/region/scripts/modifiers/arid_modifier.gd +++ b/stages/terrain/region/scripts/modifiers/arid_modifier.gd @@ -7,8 +7,12 @@ func get_modifier_name() -> String: func get_description() -> String: return tr("ARID_MODIFIER_DESC_TEXT") +func get_icon() -> Texture: + return preload("res://common/icons/droplet-off.svg") + func modify_decontamination_threshold(decontamination_threshold : float) -> float: return decontamination_threshold * (0.5) func modify_start_decontamination_zone_radius(start_decontamination_zone_radius : int) -> int: - return max(1,roundi(start_decontamination_zone_radius * (0.5))) \ No newline at end of file + return max(1,roundi(start_decontamination_zone_radius * (0.5))) + diff --git a/stages/terrain/region/scripts/modifiers/harsh_modifier.gd b/stages/terrain/region/scripts/modifiers/harsh_modifier.gd index 07ab239..056aed6 100644 --- a/stages/terrain/region/scripts/modifiers/harsh_modifier.gd +++ b/stages/terrain/region/scripts/modifiers/harsh_modifier.gd @@ -7,5 +7,8 @@ func get_modifier_name() -> String: func get_description() -> String: return tr("HARSH_MODIFIER_DESC_TEXT") +func get_icon() -> Texture: + return preload("res://common/icons/wind.svg") + func modify_objective(objective : int) -> int: return roundi(objective * 1.5) \ No newline at end of file diff --git a/stages/terrain/region/scripts/modifiers/humid_modifier.gd b/stages/terrain/region/scripts/modifiers/humid_modifier.gd index 06c3739..a75209c 100644 --- a/stages/terrain/region/scripts/modifiers/humid_modifier.gd +++ b/stages/terrain/region/scripts/modifiers/humid_modifier.gd @@ -7,5 +7,8 @@ func get_modifier_name() -> String: func get_description() -> String: return tr("HUMID_MODIFIER_DESC_TEXT") +func get_icon() -> Texture: + return preload("res://common/icons/cloud-rain.svg") + func modify_charge(charge : int) -> int: return charge - 2 \ No newline at end of file diff --git a/stages/terrain/region/scripts/modifiers/poor_modifier.gd b/stages/terrain/region/scripts/modifiers/poor_modifier.gd index f56911d..0a6c0a2 100644 --- a/stages/terrain/region/scripts/modifiers/poor_modifier.gd +++ b/stages/terrain/region/scripts/modifiers/poor_modifier.gd @@ -7,5 +7,8 @@ func get_modifier_name() -> String: func get_description() -> String: return tr("POOR_MODIFIER_DESC_TEXT") +func get_icon() -> Texture: + return preload("res://common/icons/cactus.svg") + func modify_cristal_threshold(cristal_threshold : float) -> float: return cristal_threshold * 0.5 \ No newline at end of file diff --git a/stages/terrain/region/scripts/modifiers/region_modifier.gd b/stages/terrain/region/scripts/modifiers/region_modifier.gd index d8f67b9..a6b9e68 100644 --- a/stages/terrain/region/scripts/modifiers/region_modifier.gd +++ b/stages/terrain/region/scripts/modifiers/region_modifier.gd @@ -2,20 +2,41 @@ extends Resource class_name RegionModifier +const DEFAULT_MODIFIER_COLOR = Color("ff006eff") +const DEFAULT_ICON = preload("res://common/icons/cloud.svg") + +const DOOR_SCENE = preload("res://entities/interactables/door/door.tscn") + var level : int = 1 var modifier_name : String : get = get_modifier_name var description : String : get = get_description +var flags : Array[String] : get = get_flags +@export var modifier_seed : int = 0 func _init(_level : int = 1): + if modifier_seed == 0: + modifier_seed = randi() level = _level @abstract func get_modifier_name() -> String @abstract func get_description() -> String +func get_icon() -> Texture: + return DEFAULT_ICON + +func get_card_section_color() -> Color: + return DEFAULT_MODIFIER_COLOR + func get_difficulty_score() -> float: return float(level) +func get_flags() -> Array[String]: + return [] + +func region_ready(_region : Region) -> void: + pass + func modify_charge(charge : int) -> int: return charge @@ -32,4 +53,32 @@ func modify_cristal_threshold(cristal_threshold : float) -> float: return cristal_threshold func modify_start_decontamination_zone_radius(start_decontamination_zone_radius : int) -> int: - return start_decontamination_zone_radius \ No newline at end of file + return start_decontamination_zone_radius + + +func card_section() -> CardSectionInfo: + var section := CardSectionInfo.new( + get_modifier_name(), + get_description(), + ) + + section.title_icon = get_icon() + section.color = get_card_section_color() + + return section + +func generate_door( + title : String, + desc : String, + scene_id : String, + icon : Texture +) -> Door: + var new_door = DOOR_SCENE.instantiate() as Door + new_door.name = "Door%d" % modifier_seed + new_door.to_scene_id = scene_id + new_door.default_info_title = title + new_door.default_info_desc = desc + new_door.icon = icon + new_door.present = true + + return new_door \ No newline at end of file diff --git a/stages/terrain/region/scripts/modifiers/vending_machine_modifier.gd b/stages/terrain/region/scripts/modifiers/vending_machine_modifier.gd new file mode 100644 index 0000000..cbd306d --- /dev/null +++ b/stages/terrain/region/scripts/modifiers/vending_machine_modifier.gd @@ -0,0 +1,31 @@ +extends RegionModifier +class_name VendingMachineModifier + +const VENDING_MACHINES_ICON = preload("res://common/icons/building-store.svg") + +func get_modifier_name() -> String: + return tr("VENDING_MACHINES") + +func get_description() -> String: + return tr("VENDING_MACHINES_MODIFIER_DESC_TEXT") + +func get_icon() -> Texture: + return preload("res://common/icons/building-store.svg") + +func get_card_section_color() -> Color: + return Color("25c147") + +func region_ready(region) -> void: + var new_vending_machine_door = generate_door( + tr("VENDING_MACHINES"), + tr("VENDING_MACHINES_DOOR_DESC_TEXT"), + "VENDING_MACHINE_ROOM", + VENDING_MACHINES_ICON + ) + new_vending_machine_door.available = region.data.completed_doors.find(new_vending_machine_door.name) == -1 + + region.add_entity(new_vending_machine_door) + region.random_move_object(new_vending_machine_door,Region.DOORS_RANDOM_MOVEMENT) + +func get_difficulty_score() -> float: + return 0 diff --git a/stages/terrain/region/scripts/modifiers/vending_machine_modifier.gd.uid b/stages/terrain/region/scripts/modifiers/vending_machine_modifier.gd.uid new file mode 100644 index 0000000..c29e0ba --- /dev/null +++ b/stages/terrain/region/scripts/modifiers/vending_machine_modifier.gd.uid @@ -0,0 +1 @@ +uid://b1k5c8lxkbgby diff --git a/stages/terrain/region/scripts/region.gd b/stages/terrain/region/scripts/region.gd index c52df7b..44c1720 100644 --- a/stages/terrain/region/scripts/region.gd +++ b/stages/terrain/region/scripts/region.gd @@ -9,6 +9,7 @@ const TILE_SET : TileSet = preload("res://stages/terrain/region/resources/moss_b const TILE_SCALE = 1 const TILE_SIZE : int = roundi(TILE_SET.tile_size.x * TILE_SCALE) const SPAWN_OBJECT_RANDOM_MOVEMENT = 200 +const DOORS_RANDOM_MOVEMENT = 3000 const CHUNK_TILE_SIZE : int = 10 const CHUNK_SIZE = CHUNK_TILE_SIZE * TILE_SIZE @@ -79,10 +80,11 @@ func _ready(): generate_near_chunks(player) - spawn_object_random_move(%RechargeStation) + random_move_object(%RechargeStation, SPAWN_OBJECT_RANDOM_MOVEMENT) %RechargeStation.update() - spawn_object_random_move(%BoreaDoor) - spawn_object_random_move(%ShipGarageDoor) + + for m in data.modifiers: + m.region_ready(self) if not "tutorial" in data.flags: GameInfo.game_data.player_data.inventory.add_item(Detector.new()) @@ -159,33 +161,29 @@ func save(): data.player_position = player.global_position GameInfo.save_game_data() -func spawn_object_random_move(object : Node2D, offset : Vector2 = Vector2.ZERO): +func random_move_object( + object : Node2D, + random_movement: int = SPAWN_OBJECT_RANDOM_MOVEMENT, + offset : Vector2 = Vector2.ZERO +): var rng := RandomNumberGenerator.new() rng.seed = data.region_seed + object.name.hash() object.position = Vector2( - rng.randf_range(-SPAWN_OBJECT_RANDOM_MOVEMENT,+SPAWN_OBJECT_RANDOM_MOVEMENT), - rng.randf_range(-SPAWN_OBJECT_RANDOM_MOVEMENT,SPAWN_OBJECT_RANDOM_MOVEMENT) + rng.randf_range(-random_movement,random_movement), + rng.randf_range(-random_movement,random_movement) ) + offset + dig_hole(object.position, 3) + func setup_flagged_properties(): - - %AstraDoor.visible = false - %ShipGarageDoor.visible = false - %BoreaDoor.visible = false - - %AstraDoor.process_mode = Node.PROCESS_MODE_DISABLED - %ShipGarageDoor.process_mode = Node.PROCESS_MODE_DISABLED - %BoreaDoor.process_mode = Node.PROCESS_MODE_DISABLED - - for f in data.flags: + for i in range(len(data.flags)): + var f = data.flags[i] match f: "tutorial": - %AstraDoor.visible = true - %ShipGarageDoor.visible = true - - %AstraDoor.process_mode = Node.PROCESS_MODE_INHERIT - %ShipGarageDoor.process_mode = Node.PROCESS_MODE_INHERIT + %AstraDoor.present = true + %ShipGarageDoor.present = true + random_move_object(%ShipGarageDoor,SPAWN_OBJECT_RANDOM_MOVEMENT) %AstraDoor.available = false %ShipGarageDoor.available = data.state == RegionData.State.SUCCEEDED @@ -196,13 +194,12 @@ func setup_flagged_properties(): %ShipGarageDoor.available = true ) "borea": - %BoreaDoor.visible = true + %BoreaDoor.present = true + random_move_object(%BoreaDoor,SPAWN_OBJECT_RANDOM_MOVEMENT) + %RechargeStation.visible = false - - %BoreaDoor.process_mode = Node.PROCESS_MODE_INHERIT %RechargeStation.process_mode = Node.PROCESS_MODE_DISABLED - func is_chunk_generated(coord : Vector2i): return generated_chunks.find_custom( func (c: Chunk) : return get_chunk_key(c.chunk_coord) == get_chunk_key(coord) @@ -262,7 +259,6 @@ func is_coords_decontaminated(tiles_coords : Array[Vector2i]): return false return true - func dig_rocks(tiles_coords : Array[Vector2i], save_tiles_diff := true, loot := true): if save_tiles_diff : data.rock_tiles_data.update_tiles_diff(tiles_coords, TilesDiffData.TileDiff.ABSENT) @@ -277,6 +273,19 @@ func dig_rocks(tiles_coords : Array[Vector2i], save_tiles_diff := true, loot := chunk.rock_layer.remove_rocks([local_coord]) +func dig_hole(game_pos: Vector2, size : int): + var hole_tiles : Array[Vector2i] = [] + var tile_position := Vector2i( + roundi(game_pos.x/float(Region.TILE_SIZE)), + roundi(game_pos.y/float(Region.TILE_SIZE)) + ) + for x in range(-size, size): + for y in range(-size, size): + var coord = Vector2i(x,y) + if coord.distance_to(Vector2.ZERO) < size: + hole_tiles.append(coord + tile_position) + dig_rocks(hole_tiles,false,false) + func loot_talion(coord : Vector2i): var new_seed = Seed.generate_random() drop_item( diff --git a/stages/terrain/region/scripts/region_data.gd b/stages/terrain/region/scripts/region_data.gd index a3b6711..b7f9747 100644 --- a/stages/terrain/region/scripts/region_data.gd +++ b/stages/terrain/region/scripts/region_data.gd @@ -37,14 +37,21 @@ const PLAYER_ROCK_HOLE_RADIUS = 5 @export var player_spawn : Vector2 +@export var entered_door = "" +@export var completed_doors : Array[String] = [] # List of completed doors +@export var modifiers : Array[RegionModifier] + + @export var charges : int : set(v): charges = v - update() + if GameInfo: + update() @export var objective : int : set(v): objective = v - update() + if GameInfo: + update() @export var rock_tiles_data : TilesDiffData @export var decontamination_tiles_data : TilesDiffData @@ -64,6 +71,7 @@ func _init( cristal_threshold = parameter.get_cristal_threshold() start_decontamination_hole_radius = parameter.get_start_decontamination_zone_radius() flags = parameter.get_region_flags() + modifiers = parameter.modifiers player_spawn = get_random_spawn_position() player_position = player_spawn @@ -176,4 +184,4 @@ func edit_map_origin(): rock_tiles_data.update_tiles_diff(player_hole_tiles, TilesDiffData.TileDiff.ABSENT) -#endregion \ No newline at end of file +#endregion diff --git a/stages/terrain/region/scripts/region_parameter.gd b/stages/terrain/region/scripts/region_parameter.gd index b71ca08..914ee1e 100644 --- a/stages/terrain/region/scripts/region_parameter.gd +++ b/stages/terrain/region/scripts/region_parameter.gd @@ -46,7 +46,12 @@ func get_region_name() -> String: return region_name func get_region_flags() -> Array[String]: - return region_flags + var f := region_flags + + for m in modifiers: + f.append_array(m.get_flags()) + + return f func get_region_level() -> int: return level @@ -102,4 +107,8 @@ func get_start_decontamination_zone_radius() -> int: for m in modifiers: zone_radius = m.modify_start_decontamination_zone_radius(zone_radius) - return zone_radius \ No newline at end of file + return zone_radius + +func card_info() -> CardInfo: + return null + #TODO \ No newline at end of file diff --git a/stages/title_screen/title_screen.tscn b/stages/title_screen/title_screen.tscn index aece542..cecb945 100644 --- a/stages/title_screen/title_screen.tscn +++ b/stages/title_screen/title_screen.tscn @@ -23,7 +23,7 @@ shader = ExtResource("8_pjo5j") shader_parameter/strength = 5.00000023424012 shader_parameter/mix_percentage = 0.3 -[sub_resource type="FastNoiseLite" id="FastNoiseLite_rf16a"] +[sub_resource type="FastNoiseLite" id="FastNoiseLite_pjo5j"] frequency = 1.0 [sub_resource type="ShaderMaterial" id="ShaderMaterial_7a1qq"] @@ -208,7 +208,7 @@ size = Vector2i(1980, 1080) [node name="Planet3d" parent="SubViewport" unique_id=926789923 instance=ExtResource("5_7a1qq")] unique_name_in_owner = true -noise = SubResource("FastNoiseLite_rf16a") +noise = SubResource("FastNoiseLite_pjo5j") [node name="Camera3D" type="Camera3D" parent="SubViewport" unique_id=806252928] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.369979, 0, 64.323425) diff --git a/translation/game/gui.csv b/translation/game/gui.csv index cdd3671..f147c68 100644 --- a/translation/game/gui.csv +++ b/translation/game/gui.csv @@ -9,7 +9,7 @@ SEEDS,Seeds,Graines TERRAINS,Terrains,Terrains FERTILE_LAND_TEXT,[b]Fertile Land[/b] Seeds can only be planted on this zone,[b]Terre fertile[/b] Des graines peuvent être plantées dans cette zone ROCK_TEXT,[b]Rock[/b] Can be dug with a Pickaxe,[b]Roche[/b] Peut être creusée avec une pioche -TALION_VEIN_TEXT,"[b]Talion Vein[/b] Can be dug with a pickaxe, contains random seeds","[b]Veine de Talion[/b] Peut être creusée avec une pickaxe, contient des graines aléatoire" +TALION_VEIN_TEXT,"[b]Talion Vein[/b] Can be dug with a pickaxe, contains random seeds","[b]Veine de Talion[/b] Peut être creusée avec une pioche, contient des graines aléatoire" OK,Ok,Ok GARDEN,Garden,Jardin COMMA,", ","," @@ -229,6 +229,8 @@ HUMID,Humid,Humide HUMID_MODIFIER_DESC_TEXT,Reduce the number of [b]Recharge[/b],Réduit le nombre de [b]Recharge[/b] POOR,Poor,Pauvre POOR_MODIFIER_DESC_TEXT,Reduce the number of [b]Talion Veins[/b],Réduit le nombre de [b]Veine de Talion[/b] +VENDING_MACHINES,Vending Machines,Distributeurs +VENDING_MACHINES_MODIFIER_DESC_TEXT,A room with old vending machine is in the area,Une pièce avec de vieux distributeurs se trouve dans la zone PASS_THE_MYSTERIOUS_DOOR,Go through the mysterious door,Franchissez la porte mystérieuse NEXT_STOP,Next Stop,Prochain arrêt ORBIT,Orbit,Orbite @@ -236,8 +238,16 @@ RECHARGE_NUMBER,Recharge Number,Nombre de recharge ORCHID_ENERGY,Orchid's energy,Énergie d'Orchid NEW_TOOL,New tool,Nouvel Outil PILE,Pile,Pile, +PILE_DESC_TEXT,Give an extra energy cell,Donne une cellule d'énergie supplémentaire SEED_CASE,Seed Case,Emplacement de graine +SEED_CASE_DESC_TEXT,Give an extra case to store and transport seeds between regions, Donne un emplacement supplémentaire pour garder et transporter une graine entre les régions ARTEFACTS_VENDING_MACHINE,Artefacts Vending Machine,Distributeur d'Artefacts +ARTEFACT,Artefact,Artefact CHOOSE_AN_ITEM,Choose an item,Choisissez un objet -PAY_THE_PRICE,Pay the price,Payez le prix -GET_YOUR_ITEM,Get your item,Récupérez votre objet \ No newline at end of file +PAY_THE_PRICE_FOR,Pay the price for {item_name},Payez le prix pour {item_name} +GET_YOUR_ITEM,Get your item,Récupérez votre objet +PLANT_DEFAULT_ATTRIBUTES,Plant Default Attributes,Attributs des plantes par défaut +INSPECT,Inspect,Inspecter +VENDING_MACHINE,Vending Machine,Distributeur +VENDING_MACHINES_DOOR_DESC_TEXT,"An ancient room filled with old vending machines","Une pièce ancienne remplie de vieux distributeurs" +THANK_YOU_FOR_YOUR_PURCHASE,Thank you for your purchase,Merci pour votre achat \ No newline at end of file