Ajout d'un effet visuel sur les nouvelles graines, et dev en cours de l'imprimante 3D

This commit is contained in:
2026-06-22 20:16:27 +02:00
parent af91337017
commit 5bdf8db609
17 changed files with 166 additions and 8 deletions

Binary file not shown.

View File

@@ -0,0 +1,9 @@
[gd_scene format=3 uid="uid://cthjy6sifcogo"]
[ext_resource type="PackedScene" uid="uid://bql646jknccr0" path="res://entities/interactable_3d/3d_printer/assets/3d/3d_printer.blend" id="1_w8y4a"]
[node name="3dPrinter" type="Node3D" unique_id=1603073620]
[node name="3d_printer" parent="." unique_id=2066223847 instance=ExtResource("1_w8y4a")]
[editable path="3d_printer"]

View File

@@ -0,0 +1,71 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bql646jknccr0"
path="res://.godot/imported/3d_printer.blend-764f02f73d7ba9dc897cfc0819ee7cc5.scn"
[deps]
source_file="res://entities/interactable_3d/3d_printer/assets/3d/3d_printer.blend"
dest_files=["res://.godot/imported/3d_printer.blend-764f02f73d7ba9dc897cfc0819ee7cc5.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={
"materials": {
"Default3D": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
"use_external/path": "uid://dvvi1k5c5iowc"
}
}
}
blender/nodes/visible=0
blender/nodes/active_collection_only=false
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/vertex_colors=1
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/export_geometry_nodes_instances=false
blender/meshes/gpu_instances=false
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true
gltf/naming_version=2
gltf/texture_map_mode=1

View File

@@ -16,6 +16,8 @@ dest_files=["res://.godot/imported/cristal_crack.blend-127c21c2b9bb4a6237729dd3a
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
@@ -52,7 +54,7 @@ blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/vertex_colors=2
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/export_geometry_nodes_instances=false
@@ -66,3 +68,4 @@ blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true
gltf/naming_version=2
gltf/texture_map_mode=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://daigb1xkyaytb"
path="res://.godot/imported/new_item.png-027fd9bb00b90a67f42e8f8d598ffa0e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/item_object/assets/sprites/new_item.png"
dest_files=["res://.godot/imported/new_item.png-027fd9bb00b90a67f42e8f8d598ffa0e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,6 +1,7 @@
[gd_scene format=3 uid="uid://bcj812ox8xv2t"]
[ext_resource type="Script" uid="uid://reliyx2pg7kf" path="res://entities/interactables/item_object/script/item_object_sprite.gd" id="1_wing4"]
[ext_resource type="Texture2D" uid="uid://daigb1xkyaytb" path="res://entities/interactables/item_object/assets/sprites/new_item.png" id="2_b6vos"]
[ext_resource type="Texture2D" uid="uid://bo3o2qf3i20ke" path="res://common/icons/scuba-diving-tank.svg" id="2_ng3e4"]
[ext_resource type="Texture2D" uid="uid://c1eiu5ag7lcp8" path="res://entities/interactables/item_object/assets/sprites/shadow.svg" id="2_ng201"]
[ext_resource type="Texture2D" uid="uid://dompaj451gklw" path="res://entities/player/assets/sprites/movement_particles.png" id="4_ng3e4"]
@@ -107,6 +108,13 @@ colors = PackedColorArray(0.5803922, 0.7058824, 0.8862745, 1, 0.5785, 0.70829165
[node name="ItemObjectSprite" type="Node2D" unique_id=69332129]
script = ExtResource("1_wing4")
[node name="HasBeenInspectedSprite" type="Sprite2D" parent="." unique_id=446694920]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0.5803922)
position = Vector2(-1.4210855e-14, -13)
scale = Vector2(0.42, 0.42)
texture = ExtResource("2_b6vos")
[node name="Icon" type="Sprite2D" parent="." unique_id=2070904988]
texture = ExtResource("2_ng3e4")

View File

@@ -11,6 +11,7 @@ const SPRITE_SCENE: PackedScene = preload("res://entities/interactables/item_obj
if object_sprite:
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
object_sprite.generate_particles(item.get_particles())
object_sprite.set_has_been_inspected_sprite(item.has_been_inspected, item.get_rarity_color())
@onready var object_sprite: ItemObjectSprite = generate_sprite()
@@ -18,11 +19,18 @@ func _init(_item = null):
if _item:
item = _item
func inspect(is_inspected : bool = true):
item.has_been_inspected = true
object_sprite.set_has_been_inspected_sprite(item.has_been_inspected, item.get_rarity_color())
modulate = MODULATE_INSPECTED_COLOR if is_inspected else default_modulate
func _ready():
generate_collision(ITEM_AREA_WIDTH)
if item and object_sprite:
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
object_sprite.generate_particles(item.get_particles())
object_sprite.set_has_been_inspected_sprite(item.has_been_inspected, item.get_rarity_color())
func pointer_text() -> String:
var name_suffix = ""
@@ -45,6 +53,7 @@ func interact(player : Player) -> bool:
await pickup_animation(player.global_position)
queue_free()
player.pick_item(item)
item.has_been_inspected = true
return true
return false

View File

@@ -1,6 +1,8 @@
extends Node2D
class_name ItemObjectSprite
const HAS_BEEN_INSPECTED_SPRITE_OPACITY = 0.3
@onready var icon_sprite = $Icon
@onready var tractor_beam: CPUParticles2D = $TractorBeam
@@ -23,5 +25,10 @@ func generate_particles(particles_params : Array[EffectParticles.Parameters]):
particles_emitter.setup_particles(params)
add_child(particles_emitter)
func set_has_been_inspected_sprite(has_been_inspected : bool, color := Color.WHITE):
color.a = HAS_BEEN_INSPECTED_SPRITE_OPACITY
%HasBeenInspectedSprite.visible = not has_been_inspected
%HasBeenInspectedSprite.modulate = color
func pickup_animation():
%AnimationPlayer.play("pickup")

View File

@@ -17,6 +17,7 @@ var icon: Texture2D : get = get_icon
var pointer: Texture2D : get = get_pointer
@export var usage_zone_radius: int = 5 : get = get_usage_zone_radius
@export var energy_usage : int = 1 : get = get_energy_used
@export var has_been_inspected : bool = false
func get_item_name() -> String:
return name
@@ -104,3 +105,6 @@ func card_info() -> CardInfo:
func get_particles() -> Array[EffectParticles.Parameters]:
return []
func get_rarity_color() -> Color:
return Color.WHITE

View File

@@ -40,11 +40,9 @@ func use_text() -> String:
return tr("HARVEST")
func can_use(_player : Player, zone : Player.ActionZone) -> bool:
print(zone)
var areas = get_usage_objects_affected(zone.get_affected_areas(), zone)
if len(areas) > 0:
return true
print("nope")
return false
func use(player : Player, zone : Player.ActionZone) -> bool:

View File

@@ -160,6 +160,15 @@ func get_particles() -> Array[EffectParticles.Parameters]:
return param
func get_rarity_color() -> Color:
var higher_rarity : int = -1
var higher_color : Color = Color.WHITE
for m in plant_mutations:
if m.get_rarity() > higher_rarity:
higher_rarity = m.get_rarity()
higher_color = PlantMutation.get_rarity_color(higher_rarity)
return higher_color
static func generate_first_mutations(rarity := 0) -> Array[PlantMutation]:
if rarity < 0: