Compare commits
3 Commits
281f42d90c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d724e2c63 | ||
|
|
45281057f2 | ||
|
|
53e86be2ce |
@@ -207,7 +207,7 @@ func change_ambiances_volume(db_change := 0., fade := DEFAULT_FADE_TIME):
|
||||
|
||||
# Joue un
|
||||
# - player_name : Nom de la Node dans la scène Godot à jouer
|
||||
func play_sfx(sfx_name : String, pitch = 1.):
|
||||
func play_sfx(sfx_name : String, _pitch = 1.):
|
||||
var player := %Sfx.find_child(sfx_name) as AudioStreamPlayer
|
||||
if player:
|
||||
player.play()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cf554gg3t0miv"
|
||||
path="res://.godot/imported/energy_cell_off - SAVE.png-1628a904600f784017aee64f240ea4ec.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/energy_cell/assets/sprites/energy_cell_off - SAVE.png"
|
||||
dest_files=["res://.godot/imported/energy_cell_off - SAVE.png-1628a904600f784017aee64f240ea4ec.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 42 KiB |
@@ -131,7 +131,6 @@ libraries/ = SubResource("AnimationLibrary_ng3e4")
|
||||
autoplay = &"default"
|
||||
|
||||
[node name="TractorBeam" type="CPUParticles2D" parent="." unique_id=382704689]
|
||||
z_index = -1
|
||||
position = Vector2(83, 0)
|
||||
scale = Vector2(0.7, 0.7)
|
||||
emitting = false
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://8jej5dv8qy13"
|
||||
path="res://.godot/imported/talion_cell_off - SAVE.png-ab748f617cf76620f977b70e834f8ac8.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/talion_cell/assets/sprites/talion_cell_off - SAVE.png"
|
||||
dest_files=["res://.godot/imported/talion_cell_off - SAVE.png-ab748f617cf76620f977b70e834f8ac8.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 46 KiB |
@@ -4,14 +4,17 @@ class_name Battery3d
|
||||
|
||||
const MAX_BATTERY_GAUGE_SPRITE_SCALE = 2.525
|
||||
|
||||
@export var powered : bool = true : set = set_powered
|
||||
@export var powered: bool = true
|
||||
|
||||
func _ready():
|
||||
set_powered()
|
||||
|
||||
func set_powered(_powered : bool = powered):
|
||||
func set_powered(_powered: bool = powered, with_animation: bool = true):
|
||||
var old_powered = powered
|
||||
powered = _powered
|
||||
if is_node_ready() and old_powered != powered:
|
||||
if with_animation:
|
||||
var tween: Tween = get_tree().create_tween()
|
||||
tween.tween_property(%NonPoweredBatteryGauge, "scale:y", 0. if powered else MAX_BATTERY_GAUGE_SPRITE_SCALE, 0.3)
|
||||
else:
|
||||
%NonPoweredBatteryGauge.scale.y = 0. if powered else MAX_BATTERY_GAUGE_SPRITE_SCALE
|
||||
|
||||
@@ -13,7 +13,7 @@ var max_energy := 0
|
||||
func update(
|
||||
_energy : int,
|
||||
_max_energy : int,
|
||||
_with_animation := true,
|
||||
with_animation := true,
|
||||
):
|
||||
var changed = (energy != _energy or max_energy != _max_energy)
|
||||
if changed:
|
||||
@@ -23,7 +23,7 @@ func update(
|
||||
|
||||
# if with_animation:
|
||||
# %EnergyAnimationPlayer.bounce()
|
||||
%EnergyInfo3d.energy = energy
|
||||
%EnergyInfo3d.set_energy(energy, with_animation)
|
||||
%EnergyInfo3d.max_energy = max_energy
|
||||
%EnergyCount.text = energy_count_text
|
||||
%EnergyCount.modulate = Color.WHITE if energy > 0 else Color.RED
|
||||
@@ -5,7 +5,7 @@ const BATTERY_SCENE = preload("res://gui/game/energy_info/battery_3d.tscn")
|
||||
const BATTERY_SHIFT = Vector3(0, 0, -1)
|
||||
|
||||
@export var max_energy: int = 0: set = set_max_energy
|
||||
@export var energy : int = 0 : set = set_energy
|
||||
@export var energy: int = 0
|
||||
|
||||
func _ready():
|
||||
set_max_energy()
|
||||
@@ -24,7 +24,7 @@ func set_max_energy(_max_energy : int = max_energy):
|
||||
await get_tree().create_timer(0.1).timeout
|
||||
set_energy()
|
||||
|
||||
func set_energy(_energy : int = energy):
|
||||
func set_energy(_energy: int = energy, with_animation: bool = true):
|
||||
energy = _energy
|
||||
if is_node_ready():
|
||||
var energy_count = 0
|
||||
@@ -32,5 +32,5 @@ func set_energy(_energy : int = energy):
|
||||
if not battery.is_node_ready():
|
||||
await battery.ready
|
||||
if battery is Battery3d:
|
||||
battery.powered = energy_count < energy
|
||||
battery.set_powered(energy_count < energy, with_animation)
|
||||
energy_count += 1
|
||||
|
||||
@@ -149,10 +149,10 @@ func process_player_actions(delta: float):
|
||||
%ActionProgressBar.value = 0.
|
||||
|
||||
if Input.is_action_just_pressed("action"):
|
||||
if inspected is InventoryGuiItemMouseDetector:
|
||||
GameInfo.game_data.player_data.inventory.set_current_item(inspected.index)
|
||||
elif can_use_item and not current_selected_item.is_action_need_press_time() and current_selected_item.deactivate_interactable():
|
||||
if can_use_item and not current_selected_item.is_action_need_press_time() and current_selected_item.deactivate_interactable():
|
||||
player.try_use_item(current_selected_item, player.get_global_mouse_position())
|
||||
elif inspected is InventoryGuiItemMouseDetector:
|
||||
GameInfo.game_data.player_data.inventory.set_current_item(inspected.index)
|
||||
elif can_interact:
|
||||
var interactable = inspected as Interactable
|
||||
player.try_interact(interactable)
|
||||
@@ -273,7 +273,7 @@ func update_cursor():
|
||||
hotspot = Vector2(cursor.get_width() / 2., cursor.get_height() / 2.)
|
||||
elif can_interact:
|
||||
cursor = action_cursor
|
||||
Input.set_custom_mouse_cursor(cursor,0,hotspot)
|
||||
Input.set_custom_mouse_cursor(cursor, Input.CURSOR_ARROW, hotspot)
|
||||
|
||||
func stop_inspect(node: Node):
|
||||
if not dragging_inspected:
|
||||
@@ -296,6 +296,9 @@ func start_dragging():
|
||||
player.region.save()
|
||||
else:
|
||||
dragging_inspected = false
|
||||
GameInfo.game_data.player_data.inventory.set_current_item(inspected.index)
|
||||
else:
|
||||
dragging_inspected = false
|
||||
if dragging_inspected:
|
||||
all_inspected.clear()
|
||||
all_inspected.append(inspected)
|
||||
@@ -306,10 +309,10 @@ func stop_dragging():
|
||||
dragging_inspected = false
|
||||
if inspected is ItemObject:
|
||||
inspected.object_sprite.tractor_beam.emitting = false
|
||||
if (
|
||||
inspected_inventory_slot is InventoryGuiItemMouseDetector
|
||||
and GameInfo.game_data.player_data.inventory.add_item_at(inspected.item, inspected_inventory_slot.index)
|
||||
):
|
||||
if inspected_inventory_slot is InventoryGuiItemMouseDetector:
|
||||
if GameInfo.game_data.player_data.inventory.add_item_at(inspected.item, inspected_inventory_slot.index):
|
||||
all_inspected.clear()
|
||||
inspected.queue_free()
|
||||
inspected = null
|
||||
inspect(inspected_inventory_slot)
|
||||
else:
|
||||
stop_inspect(inspected)
|
||||
|
||||
Reference in New Issue
Block a user