Feature pour l'alpha 1.3

* Ajout d'un mode infini (pour nos hard core gamers)
* Ajout d'un message de découverte d'un nouvel outil
* Séparation de la pelle en deux outils : la pioche et la fourche
* Amélioration de la lisibilité des capsules d'énergies
* Changement léger des texture du sol et de la pierre
* Correction d'un bug lors du clic frénétique sur le porte de sortie du vaisseau
* Ajout d'un icône de recharge
* Fix de la mutation Ancien qui ne s'améliorait pas au niveau 4

+ début de dev des artefacts avec un distributeur
This commit is contained in:
2026-03-27 17:28:20 +01:00
parent 28dfc94da6
commit d45fab6a3d
90 changed files with 1896 additions and 577 deletions

View File

@@ -123,32 +123,34 @@ available = false
metadata/_custom_type_script = "uid://dyprcd68fjstf"
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1809395872]
scale = Vector2(1.3906125, 1.3906125)
shape = SubResource("RectangleShape2D_y51rk")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=879120806]
unique_name_in_owner = true
scale = Vector2(0.33, 0.33)
scale = Vector2(0.45890215, 0.45890215)
sprite_frames = SubResource("SpriteFrames_4aafg")
animation = &"closed"
frame_progress = 0.78603315
frame_progress = 0.69717133
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1875435966]
position = Vector2(0.99999994, -41)
scale = Vector2(0.2833334, 0.28333336)
position = Vector2(0.6254329, -56.177567)
scale = Vector2(0.39400694, 0.3940069)
texture = SubResource("GradientTexture2D_wnnbj")
[node name="Icon" type="Sprite2D" parent="." unique_id=874210487]
unique_name_in_owner = true
position = Vector2(1, -42)
scale = Vector2(0.4583333, 0.4583333)
position = Vector2(0.62543297, -57.177567)
scale = Vector2(0.63736403, 0.63736403)
texture = ExtResource("2_6w4e0")
[node name="DoorScreen" type="Sprite2D" parent="." unique_id=236947304]
position = Vector2(5.684342e-14, 2.2737368e-13)
scale = Vector2(0.33, 0.33)
scale = Vector2(0.45890215, 0.45890215)
texture = ExtResource("12_6w4e0")
[node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=521638741]
scale = Vector2(1.3906125, 1.3906125)
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=676936346]
position = Vector2(0, 12)

View File

@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
[ext_resource type="Texture2D" uid="uid://btd145u4gsl6e" path="res://entities/interactables/truck/recharge/STW_Props_Batterie_Batterie.png" id="2_ot7vv"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
[ext_resource type="Texture2D" uid="uid://cymrmhsihkj44" path="res://common/icons/recharge.svg" id="3_ot7vv"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_ot7vv"]
[ext_resource type="Texture2D" uid="uid://bhi3mwl23flwp" path="res://entities/interactables/truck/recharge/STW_Props_Batterie_Glass_V2.png" id="5_2okh4"]
[ext_resource type="Texture2D" uid="uid://c01f6ja6btsep" path="res://entities/interactables/truck/recharge/STW_Props_Batterie_TERRE.png" id="6_2okh4"]
@@ -44,7 +44,7 @@ alignment = 1
[node name="TextureRect" type="TextureRect" parent="EnergyTextContainer" unique_id=2088496808]
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
texture = ExtResource("3_jcfmm")
texture = ExtResource("3_ot7vv")
expand_mode = 1
stretch_mode = 5

View File

@@ -26,7 +26,7 @@ func get_day_factor():
return max(1, DEFAULT_DAY_FACTOR - level)
func get_score_increase():
return max(1, level - DEFAULT_DAY_FACTOR)
return max(1, level - DEFAULT_DAY_FACTOR + 1)
func mutate_score(data : PlantData, score) -> int:
if data.get_state() != PlantData.State.MATURE:

View File

@@ -2,6 +2,7 @@ extends Resource
class_name Inventory
signal updated(inventory: Inventory)
signal tool_added(item: Item)
@export var items: Array[Item] = []
@export var current_item_ind: int = 0 # over both tools and items
@@ -9,8 +10,6 @@ signal updated(inventory: Inventory)
func _init(inventory_size: int = 1):
set_size(inventory_size)
add_item(Detector.new())
add_item(Shovel.new())
func get_n_item_slots() -> int:
return items.size() - n_tools
@@ -60,11 +59,12 @@ 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)
elif item.type == Item.ItemType.TOOL_ITEM && !items.has(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 )
return true
else:
@@ -85,6 +85,13 @@ func get_item(ind: int = current_item_ind) -> Item:
func has_item(item: Item) -> bool:
return items.has(item)
func has_item_with_name(name: String) -> bool:
var id = 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")

View File

@@ -4,44 +4,45 @@ class_name Fork
const USE_INTERVAL = 0.15
func get_item_name() -> String:
return tr("FORK")
return tr("FORK")
func get_description() -> String:
return tr("FORK_DESC_TEXT")
return tr("FORK_DESC_TEXT")
func get_icon() -> Texture2D:
return preload("res://common/icons/fork.svg")
return preload("res://common/icons/fork.svg")
func get_item_type() -> ItemType:
return Item.ItemType.TOOL_ITEM
return Item.ItemType.TOOL_ITEM
func get_energy_used() -> int:
return 1
return 1
func get_usage_zone_radius() -> int:
return 50
return 10
func get_usage_object_affected(i : InspectableEntity) -> bool:
return i is Plant
return i is Plant
func use_text() -> String:
return tr("HARVEST")
return tr("HARVEST")
func can_use(_player : Player, zone : Player.ActionZone) -> bool:
var areas = zone.get_affected_areas()
for area in areas :
if area is Plant:
return true
return false
var areas = zone.get_affected_areas()
for area in areas :
if area is Plant:
return true
return false
func use(player : Player, zone : Player.ActionZone) -> bool:
for area in zone.get_affected_areas():
if area and area is Plant:
harvest(area, player)
await player.get_tree().create_timer(USE_INTERVAL).timeout
return true
var has_plant = false
for area in zone.get_affected_areas():
if area and area is Plant:
harvest(area, player)
await player.get_tree().create_timer(USE_INTERVAL).timeout
has_plant = true
return has_plant
func harvest(p : Plant, _player: Player):
AudioManager.play_sfx("Harvest")
p.harvest()
AudioManager.play_sfx("Harvest")
p.harvest()

View File

@@ -1,7 +1,7 @@
extends Item
class_name Pickaxe
const USE_INTERVAL = 0.15
const DIG_PARTICLES := preload("res://entities/player/inventory/scripts/items/utils/dig_particles.tscn")
func get_item_name() -> String:
return tr("PICKAXE")
@@ -29,13 +29,17 @@ func can_use(_player : Player, zone : Player.ActionZone) -> bool:
return true
return false
func use(_player : Player, zone : Player.ActionZone) -> bool:
func use(player : Player, zone : Player.ActionZone) -> bool:
var bodies = zone.area.get_overlapping_bodies()
var rock_layer_id = bodies.find_custom(func (b) : return b is RockLayer)
if rock_layer_id != -1:
var rock_layer : RockLayer = bodies[rock_layer_id]
var rock_layers = bodies.filter(func (b) : return b is RockLayer)
if len(rock_layers):
player.region.dig_rocks(zone.get_tiles())
return rock_layer.dig_rocks(zone.get_tiles())
var particles := (DIG_PARTICLES.instantiate() as DigParticleEmmitter)
player.region.add_child(particles)
particles.global_position = zone.get_global_position()
particles.emit()
AudioManager.play_sfx("Mining")
return false
return true

View File

@@ -1,3 +1,4 @@
@tool
extends Fork
class_name Shovel