fix post-proto
* ajout d'un fondu de musique au changement de phase * résolution de bugs en tout genre
This commit is contained in:
@@ -45,10 +45,10 @@ y_sort_enabled = true
|
||||
position = Vector2(33, -75)
|
||||
|
||||
[node name="TruckLadder" parent="Entities" instance=ExtResource("9_gisiu")]
|
||||
position = Vector2(33, -139)
|
||||
position = Vector2(50, -135)
|
||||
|
||||
[node name="TruckRecharge" parent="Entities" instance=ExtResource("10_cnjsq")]
|
||||
position = Vector2(-36, -154)
|
||||
position = Vector2(-46, -152)
|
||||
|
||||
[node name="Planet" parent="." node_paths=PackedStringArray("quota_reward", "import_entities_from_node") instance=ExtResource("8_t31p7")]
|
||||
loot_item_number = Array[int]([1])
|
||||
|
||||
@@ -64,14 +64,11 @@ func plant(
|
||||
type,
|
||||
plant_mutations
|
||||
)
|
||||
|
||||
plants.append(new_plant)
|
||||
planet_data.score_by_plant.append(0)
|
||||
new_plant.harvested.connect(_on_plant_harvested)
|
||||
new_plant.state_changed.connect(_on_plant_state_changed)
|
||||
new_plant.ready.connect(
|
||||
func(): update_garden_score()
|
||||
)
|
||||
get_tree().create_timer(0.05).timeout.connect(update_garden_score)
|
||||
return new_plant
|
||||
|
||||
func _on_plant_state_changed(_p: Plant):
|
||||
@@ -85,7 +82,8 @@ func remove_plant(p: Plant):
|
||||
if id >= 0:
|
||||
plants.remove_at(id)
|
||||
planet_data.score_by_plant.remove_at(id)
|
||||
update_garden_score()
|
||||
|
||||
get_tree().create_timer(0.05).timeout.connect(update_garden_score)
|
||||
|
||||
|
||||
func update_garden_score():
|
||||
|
||||
@@ -116,7 +116,6 @@ func plant(
|
||||
if garden.is_in_garden(plant_position):
|
||||
var new_plant = garden.plant(type, plant_mutations)
|
||||
add_entity(new_plant, plant_position)
|
||||
garden.update_garden_score()
|
||||
return true
|
||||
return false
|
||||
|
||||
@@ -142,8 +141,7 @@ func pass_day():
|
||||
|
||||
if data.garden_score >= data.get_quota_score():
|
||||
reach_quota()
|
||||
|
||||
if data.quota_days <= 0:
|
||||
elif data.quota_days <= 0:
|
||||
day_limit_exceed.emit(self)
|
||||
|
||||
save()
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
extends Resource
|
||||
class_name TruckData
|
||||
|
||||
@export var rewards_given : Array[Reward] = []
|
||||
@export var rewards : Array[Reward] = []
|
||||
@export var rewarded_times : int = 0
|
||||
@export var compost_containing_seeds : Array[int] = []
|
||||
@export var entities_saved_data : Array[EntityData] = []
|
||||
@export var entities_saved_data : Array[EntityData] = []
|
||||
|
||||
@@ -21,7 +21,10 @@ func _ready():
|
||||
for i in range(len(composts)):
|
||||
var compost = composts[i]
|
||||
compost.containing_seed = data.compost_containing_seeds[i]
|
||||
compost.filled.connect(func (c: Compost): data.compost_containing_seeds[i] = c.containing_seed)
|
||||
compost.filled.connect(
|
||||
func (c: Compost):
|
||||
data.compost_containing_seeds[i] = c.containing_seed
|
||||
)
|
||||
|
||||
if i < len(data.rewards):
|
||||
compost.reward = data.rewards[i]
|
||||
@@ -35,6 +38,7 @@ func _ready():
|
||||
|
||||
func _on_compost_rewarded(c: Compost):
|
||||
data.rewarded_times += 1
|
||||
data.rewards_given.append(c.reward)
|
||||
c.reward = generate_reward()
|
||||
|
||||
func get_compost_rewards() -> Array[Reward]:
|
||||
@@ -45,26 +49,41 @@ func get_compost_rewards() -> Array[Reward]:
|
||||
return rewards
|
||||
|
||||
func get_random_reward_cost() -> int:
|
||||
return randi_range(1 + data.rewarded_times * 2, 2 + data.rewarded_times * 2)
|
||||
return randi_range(data.rewarded_times + 1, data.rewarded_times + 2)
|
||||
|
||||
func get_possible_rewards() -> Array[Reward]:
|
||||
return [
|
||||
var possible_rewards : Array[Reward] = [
|
||||
UpgradeMaxEnergyReward.new(get_random_reward_cost() + 2),
|
||||
UpgradeMaxInventoryReward.new(get_random_reward_cost()),
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Blueprint.new(preload("res://entities/interactables/machines/solar_pannel/solar_pannel.tres"))
|
||||
),
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Knife.new()
|
||||
),
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Trowel.new()
|
||||
)
|
||||
]
|
||||
|
||||
if data.rewards_given.find_custom(
|
||||
func(r : Reward):
|
||||
return r is GiveItemReward and r.item is Trowel
|
||||
) == -1:
|
||||
possible_rewards.append(
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Knife.new()
|
||||
)
|
||||
)
|
||||
if data.rewards_given.find_custom(
|
||||
func(r : Reward):
|
||||
return r is GiveItemReward and r.item is Knife
|
||||
) == -1:
|
||||
possible_rewards.append(
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Trowel.new()
|
||||
)
|
||||
)
|
||||
|
||||
return possible_rewards
|
||||
|
||||
func generate_reward() -> Reward:
|
||||
var max_tries = 3
|
||||
var reward = get_possible_rewards().pick_random()
|
||||
|
||||
BIN
stages/title_screen/assets/textures/title.png
Normal file
BIN
stages/title_screen/assets/textures/title.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
40
stages/title_screen/assets/textures/title.png.import
Normal file
40
stages/title_screen/assets/textures/title.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cdpqg3pkjcw2h"
|
||||
path="res://.godot/imported/title.png-d45063d896f6ee3d177f9178ce51f6b0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/title_screen/assets/textures/title.png"
|
||||
dest_files=["res://.godot/imported/title.png-d45063d896f6ee3d177f9178ce51f6b0.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
|
||||
@@ -7,12 +7,14 @@ class_name Planet3D
|
||||
@export var radius : float = 8.0 :
|
||||
set(v):
|
||||
radius = maxf(1.0, v)
|
||||
update_terrain()
|
||||
update_water()
|
||||
if is_node_ready():
|
||||
update_terrain()
|
||||
update_water()
|
||||
@export var details : int = 64:
|
||||
set(v):
|
||||
details = maxi(1,v)
|
||||
update_terrain()
|
||||
if is_node_ready():
|
||||
update_terrain()
|
||||
|
||||
|
||||
@export_group("Terrain")
|
||||
@@ -24,8 +26,9 @@ class_name Planet3D
|
||||
@export var height : float = 1.0 :
|
||||
set(v):
|
||||
height = maxf(0.0, v)
|
||||
update_terrain()
|
||||
update_water()
|
||||
if is_node_ready():
|
||||
update_terrain()
|
||||
update_water()
|
||||
@export var terrain_material : Material:
|
||||
set(v):
|
||||
terrain_material = v
|
||||
@@ -34,17 +37,20 @@ class_name Planet3D
|
||||
|
||||
@export_tool_button("Random Noise", "Callable") var update_action = func():
|
||||
noise = generate_noise()
|
||||
update_terrain()
|
||||
if is_node_ready():
|
||||
update_terrain()
|
||||
|
||||
@export_group("Water")
|
||||
@export_range(0.0,1.0,0.05) var water_level := 0.:
|
||||
set(v):
|
||||
water_level = v
|
||||
update_water()
|
||||
if is_node_ready():
|
||||
update_water()
|
||||
@export var water_detail := 64:
|
||||
set(v):
|
||||
water_detail = maxi(1, v)
|
||||
update_water()
|
||||
if is_node_ready():
|
||||
update_water()
|
||||
@export var water_material : Material:
|
||||
set(v):
|
||||
water_material = v
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_4ph5l"]
|
||||
[ext_resource type="Script" uid="uid://cwmp2une7hobe" path="res://stages/title_screen/scripts/title_screen.gd" id="1_6yuhi"]
|
||||
[ext_resource type="Texture2D" uid="uid://nx4wxpr6mk8l" path="res://gui/menu/assets/texture/SeedingPlanetsLogo.png" id="2_qnk88"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_6yuhi"]
|
||||
[ext_resource type="Texture2D" uid="uid://cdpqg3pkjcw2h" path="res://stages/title_screen/assets/textures/title.png" id="3_y6tw6"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_y6tw6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cm5b7w7j6527f" path="res://stages/title_screen/planet_3d.tscn" id="5_7a1qq"]
|
||||
[ext_resource type="Shader" uid="uid://bv2rghn44mrrf" path="res://stages/title_screen/resources/shaders/stars.gdshader" id="7_y6tw6"]
|
||||
@@ -11,8 +11,8 @@
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_6yuhi"]
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_6yuhi"]
|
||||
seed = 263046432
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_7a1qq"]
|
||||
seed = -856983584
|
||||
frequency = 1.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_7a1qq"]
|
||||
@@ -87,7 +87,7 @@ alignment = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 20
|
||||
theme_override_constants/separation = 40
|
||||
alignment = 1
|
||||
|
||||
[node name="Logo" type="TextureRect" parent="MarginContainer/GridContainer/VBoxContainer"]
|
||||
@@ -96,7 +96,7 @@ custom_minimum_size = Vector2(400, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
texture = ExtResource("2_qnk88")
|
||||
texture = ExtResource("3_y6tw6")
|
||||
expand_mode = 5
|
||||
stretch_mode = 5
|
||||
|
||||
@@ -168,7 +168,7 @@ size = Vector2i(1980, 1080)
|
||||
|
||||
[node name="Planet3d" parent="SubViewport" instance=ExtResource("5_7a1qq")]
|
||||
unique_name_in_owner = true
|
||||
noise = SubResource("FastNoiseLite_6yuhi")
|
||||
noise = SubResource("FastNoiseLite_7a1qq")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="SubViewport"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 64.323425)
|
||||
|
||||
Reference in New Issue
Block a user