ajout des mutation et refonte de l'inspecteur
* ajout des mutations #86 * changement de l'objectif #85 * refonte de l'inspecteur #71 * changement léger de la plantation * les plantes ne donnent que des graines de leurs espèces * refonte partielle du code, refacto
@@ -14,11 +14,12 @@ func _init():
|
||||
current_planet_data_updated.emit(v)
|
||||
|
||||
@export var unlocked_plant_types : Array[PlantType] = []
|
||||
|
||||
@export var unlocked_plant_mutations : Array[PlantMutation] = []
|
||||
@export var unlocked_machines : Array[MachineType] = []
|
||||
|
||||
func set_default_unlocked():
|
||||
unlocked_plant_types = all_plant_types()
|
||||
unlocked_plant_mutations = all_plant_mutations()
|
||||
unlocked_machines = all_machines()
|
||||
|
||||
func all_plant_types() -> Array[PlantType]:
|
||||
@@ -34,4 +35,16 @@ func all_machines() -> Array[MachineType]:
|
||||
preload("res://entities/interactables/machines/compost/compost_types/energy_compost.tres"),
|
||||
preload("res://entities/interactables/machines/compost/compost_types/seed_compost.tres"),
|
||||
preload("res://entities/interactables/machines/solar_pannel/solar_pannel.tres"),
|
||||
]
|
||||
|
||||
func all_plant_mutations() -> Array[PlantMutation]:
|
||||
return [
|
||||
preload("res://entities/plants/resources/plant_mutations/ancient_mutation.tres"),
|
||||
preload("res://entities/plants/resources/plant_mutations/elitist_mutation.tres"),
|
||||
preload("res://entities/plants/resources/plant_mutations/ermit_mutation.tres"),
|
||||
preload("res://entities/plants/resources/plant_mutations/precocious_mutation.tres"),
|
||||
preload("res://entities/plants/resources/plant_mutations/quality_mutation.tres"),
|
||||
preload("res://entities/plants/resources/plant_mutations/quick_mutation.tres"),
|
||||
preload("res://entities/plants/resources/plant_mutations/sociable_mutation.tres"),
|
||||
preload("res://entities/plants/resources/plant_mutations/strong_mutation.tres"),
|
||||
]
|
||||
@@ -4,8 +4,8 @@ class_name PlanetData
|
||||
signal quota_number_updated(quota : int)
|
||||
signal contamination_updated(decontamination_surface : float)
|
||||
|
||||
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MAX_SIZE = 400.
|
||||
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MIN_SIZE = 100.
|
||||
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MAX_SIZE = 200.
|
||||
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MIN_SIZE = 50.
|
||||
const DEFAULT_BASE_SIZE = Vector2(2000,2000)
|
||||
|
||||
@export var base_size : Vector2 = Vector2(2000,2000)
|
||||
@@ -76,15 +76,17 @@ func generate_objective_rewards(level = 0) -> Array[ObjectiveReward]:
|
||||
|
||||
#region ------------------ Quotas ------------------
|
||||
func get_quota(n = 0) -> int:
|
||||
var first_quota = 50
|
||||
var quota_adding = n * 100
|
||||
var first_quotas = [
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
50,
|
||||
]
|
||||
|
||||
if n == 0:
|
||||
return first_quota
|
||||
elif n < 0:
|
||||
return 0
|
||||
|
||||
return get_quota(n - 1) + quota_adding
|
||||
if n > len(first_quotas):
|
||||
return pow(n, 3)
|
||||
else:
|
||||
return first_quotas[n]
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
1
common/icons/calendar-week.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-calendar-week"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z" /><path d="M16 3v4" /><path d="M8 3v4" /><path d="M4 11h16" /><path d="M7 14h.013" /><path d="M10.01 14h.005" /><path d="M13.01 14h.005" /><path d="M16.015 14h.005" /><path d="M13.015 17h.005" /><path d="M7.01 17h.005" /><path d="M10.01 17h.005" /></svg>
|
||||
|
After Width: | Height: | Size: 653 B |
43
common/icons/calendar-week.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d3ksdxepcjoot"
|
||||
path="res://.godot/imported/calendar-week.svg-f1d046aa939d08136bae8aa2cbcb1851.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/calendar-week.svg"
|
||||
dest_files=["res://.godot/imported/calendar-week.svg-f1d046aa939d08136bae8aa2cbcb1851.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=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
1
common/icons/chevrons-up.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevrons-up"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 11l5 -5l5 5" /><path d="M7 17l5 -5l5 5" /></svg>
|
||||
|
After Width: | Height: | Size: 367 B |
43
common/icons/chevrons-up.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cgmxjom200bej"
|
||||
path="res://.godot/imported/chevrons-up.svg-0e13296c91df78f04c4a0dc047c12352.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/chevrons-up.svg"
|
||||
dest_files=["res://.godot/imported/chevrons-up.svg-0e13296c91df78f04c4a0dc047c12352.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
|
||||
1
common/icons/copy.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-copy"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" /></svg>
|
||||
|
After Width: | Height: | Size: 581 B |
43
common/icons/copy.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cgefjpkvs8noj"
|
||||
path="res://.godot/imported/copy.svg-ced7a45cd1b36cd374b809aa5519b488.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/copy.svg"
|
||||
dest_files=["res://.godot/imported/copy.svg-ced7a45cd1b36cd374b809aa5519b488.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
|
||||
1
common/icons/dna.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-dna"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14.828 14.828a4 4 0 1 0 -5.656 -5.656a4 4 0 0 0 5.656 5.656z" /><path d="M9.172 20.485a4 4 0 1 0 -5.657 -5.657" /><path d="M14.828 3.515a4 4 0 0 0 5.657 5.657" /></svg>
|
||||
|
After Width: | Height: | Size: 477 B |
43
common/icons/dna.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://baaujfw8piywi"
|
||||
path="res://.godot/imported/dna.svg-0d37cb06a607035637eb8d87826b10a6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/dna.svg"
|
||||
dest_files=["res://.godot/imported/dna.svg-0d37cb06a607035637eb8d87826b10a6.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
|
||||
1
common/icons/growth.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-growth"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M16.5 15a4.5 4.5 0 0 0 -4.5 4.5m4.5 -8.5a4.5 4.5 0 0 0 -4.5 4.5m4.5 -8.5a4.5 4.5 0 0 0 -4.5 4.5m-4 3.5c2.21 0 4 2.015 4 4.5m-4 -8.5c2.21 0 4 2.015 4 4.5m-4 -8.5c2.21 0 4 2.015 4 4.5m0 -7.5v6" /></svg>
|
||||
|
After Width: | Height: | Size: 511 B |
43
common/icons/growth.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bt3g5bmar0icf"
|
||||
path="res://.godot/imported/growth.svg-48236356d5fd42c9e5085fb182bc9588.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/growth.svg"
|
||||
dest_files=["res://.godot/imported/growth.svg-48236356d5fd42c9e5085fb182bc9588.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
|
||||
1
common/icons/north-star.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-north-star"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12h18" /><path d="M12 21v-18" /><path d="M7.5 7.5l9 9" /><path d="M7.5 16.5l9 -9" /></svg>
|
||||
|
After Width: | Height: | Size: 408 B |
43
common/icons/north-star.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b671vii4ecwiu"
|
||||
path="res://.godot/imported/north-star.svg-82ea4f92d13f676657ade91e1d583997.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/north-star.svg"
|
||||
dest_files=["res://.godot/imported/north-star.svg-82ea4f92d13f676657ade91e1d583997.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
|
||||
1
common/icons/rotate-rectangle.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-rotate-rectangle"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.09 4.01l.496 -.495a2 2 0 0 1 2.828 0l7.071 7.07a2 2 0 0 1 0 2.83l-7.07 7.07a2 2 0 0 1 -2.83 0l-7.07 -7.07a2 2 0 0 1 0 -2.83l3.535 -3.535h-3.988" /><path d="M7.05 11.038v-3.988" /></svg>
|
||||
|
After Width: | Height: | Size: 510 B |
43
common/icons/rotate-rectangle.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bcjkds8n5qu6x"
|
||||
path="res://.godot/imported/rotate-rectangle.svg-b6ceae7bc4f1e7e0c15941862218ce00.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/rotate-rectangle.svg"
|
||||
dest_files=["res://.godot/imported/rotate-rectangle.svg-b6ceae7bc4f1e7e0c15941862218ce00.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
|
||||
1
common/icons/seedling-off.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-seedling-off"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11.412 7.407a6.025 6.025 0 0 0 -2.82 -2.82m-4.592 -.587h-1v2a6 6 0 0 0 6 6h3" /><path d="M12 14a6 6 0 0 1 .255 -1.736m1.51 -2.514a5.981 5.981 0 0 1 4.235 -1.75h3v1c0 2.158 -1.14 4.05 -2.85 5.107m-3.15 .893h-3" /><path d="M12 20v-8" /><path d="M3 3l18 18" /></svg>
|
||||
|
After Width: | Height: | Size: 581 B |
43
common/icons/seedling-off.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dqj5q5lhvsvys"
|
||||
path="res://.godot/imported/seedling-off.svg-8aea0c8abb5542563aa509a335639378.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/seedling-off.svg"
|
||||
dest_files=["res://.godot/imported/seedling-off.svg-8aea0c8abb5542563aa509a335639378.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
|
||||
1
common/icons/skull.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-skull"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 4c4.418 0 8 3.358 8 7.5c0 1.901 -.755 3.637 -2 4.96l0 2.54a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1v-2.54c-1.245 -1.322 -2 -3.058 -2 -4.96c0 -4.142 3.582 -7.5 8 -7.5z" /><path d="M10 17v3" /><path d="M14 17v3" /><path d="M9 11m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M15 11m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>
|
||||
|
After Width: | Height: | Size: 631 B |
43
common/icons/skull.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b43thuq8piv18"
|
||||
path="res://.godot/imported/skull.svg-1f3a01497295060c28293df722ed0ddd.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/skull.svg"
|
||||
dest_files=["res://.godot/imported/skull.svg-1f3a01497295060c28293df722ed0ddd.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
|
||||
1
common/icons/wood.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-wood"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 5.5m-6 0a6 2.5 0 1 0 12 0a6 2.5 0 1 0 -12 0" /><path d="M18 5.5v4.626a1.415 1.415 0 0 1 1.683 2.18l-.097 .108l-1.586 1.586v4c0 1.61 -2.54 2.925 -5.725 3l-.275 0c-3.314 0 -6 -1.343 -6 -3v-2l-1.586 -1.586a1.414 1.414 0 0 1 1.586 -2.287v-6.627" /><path d="M10 12.5v1.5" /><path d="M14 16v1" /></svg>
|
||||
|
After Width: | Height: | Size: 609 B |
43
common/icons/wood.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://0hbdgalf04e"
|
||||
path="res://.godot/imported/wood.svg-8c01b6ea74bf5bfddd224ed747b01c06.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/icons/wood.svg"
|
||||
dest_files=["res://.godot/imported/wood.svg-8c01b6ea74bf5bfddd224ed747b01c06.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
|
||||
@@ -25,11 +25,21 @@ func get_usage_zone_radius() -> int:
|
||||
func is_one_time_use():
|
||||
return false
|
||||
|
||||
func can_use(_player : Player, zone: Area2D) -> bool:
|
||||
func can_use(_player : Player, zone: Player.ActionZone) -> bool:
|
||||
return false
|
||||
|
||||
func use_text() -> String:
|
||||
return ""
|
||||
|
||||
func use(_player : Player, zone: Area2D):
|
||||
func use(_player : Player, zone: Player.ActionZone):
|
||||
return false
|
||||
|
||||
func inspector_info() -> Inspector.Info:
|
||||
return Inspector.Info.new(
|
||||
get_item_name(),
|
||||
get_description(),
|
||||
get_icon()
|
||||
)
|
||||
|
||||
func get_particles() -> Array[Particles.Parameters]:
|
||||
return []
|
||||
@@ -29,11 +29,11 @@ func use_text() -> String:
|
||||
func is_one_time_use():
|
||||
return true
|
||||
|
||||
func can_use(player : Player, zone : Area2D) -> bool:
|
||||
return player.planet.is_in_base(zone.global_position)
|
||||
func can_use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
return player.planet.is_in_base(zone.get_global_position())
|
||||
|
||||
func use(player : Player, zone : Area2D) -> bool:
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
if machine_type and machine_level:
|
||||
player.planet.instantiate_machine(machine_type, machine_level, zone.global_position)
|
||||
player.planet.instantiate_machine(machine_type, machine_level, zone.get_global_position())
|
||||
return true
|
||||
return false
|
||||
|
||||
@@ -24,9 +24,9 @@ func use_text() -> String:
|
||||
func is_one_time_use():
|
||||
return true
|
||||
|
||||
func can_use(player : Player, zone : Area2D) -> bool:
|
||||
func can_use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
return true
|
||||
|
||||
func use(player : Player, zone : Area2D) -> bool:
|
||||
player.planet.instantiate_entity(scene, zone.global_position)
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
player.planet.instantiate_entity(scene, zone.get_global_position())
|
||||
return true
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
extends Item
|
||||
class_name Seed
|
||||
|
||||
const MUTATION_PROBABILITY = 0.2
|
||||
|
||||
const SHOVEL_ICON = preload("res://common/icons/shovel.svg")
|
||||
const GROWING_ICON = preload("res://common/icons/chevrons-up.svg")
|
||||
const SCORE_ICON = preload("res://common/icons/growth.svg")
|
||||
|
||||
@export var plant_type: PlantType
|
||||
@export var plant_mutations: Array[PlantMutation]
|
||||
|
||||
func get_item_name() -> String:
|
||||
return plant_type.name
|
||||
|
||||
func get_description() -> String:
|
||||
return plant_type.description
|
||||
return ""
|
||||
|
||||
func get_icon() -> Texture2D:
|
||||
return plant_type.seed_texture
|
||||
@@ -15,8 +22,15 @@ func get_icon() -> Texture2D:
|
||||
func get_energy_used() -> int:
|
||||
return 1
|
||||
|
||||
func _init(_plant_type : PlantType = null):
|
||||
func get_usage_zone_radius() -> int:
|
||||
return 30
|
||||
|
||||
func _init(
|
||||
_plant_type : PlantType = null,
|
||||
_parent_mutation : Array[PlantMutation] = []
|
||||
):
|
||||
plant_type = _plant_type
|
||||
plant_mutations = Seed.mutate(_parent_mutation)
|
||||
|
||||
func use_text() -> String:
|
||||
return "Plant " + plant_type.name
|
||||
@@ -24,14 +38,134 @@ func use_text() -> String:
|
||||
func is_one_time_use():
|
||||
return true
|
||||
|
||||
func can_use(player : Player, zone : Area2D) -> bool:
|
||||
func can_use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
var is_there_a_plant_here = false
|
||||
for area in zone.get_overlapping_areas() :
|
||||
for area in zone.area.get_overlapping_areas() :
|
||||
if area is Plant:
|
||||
is_there_a_plant_here = true
|
||||
|
||||
var is_there_contamination_in_zone = false
|
||||
for point in zone.get_points_in_zone():
|
||||
if player.planet.is_there_contamination(point):
|
||||
is_there_contamination_in_zone = true
|
||||
|
||||
return not is_there_a_plant_here and not player.planet.is_there_contamination(zone.global_position)
|
||||
return not is_there_a_plant_here and not is_there_contamination_in_zone
|
||||
|
||||
func use(player : Player, zone : Area2D) -> bool:
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
player.play_sfx("dig")
|
||||
return player.planet.plant(plant_type, zone.global_position)
|
||||
return player.planet.plant(
|
||||
plant_type,
|
||||
zone.get_global_position(),
|
||||
plant_mutations
|
||||
)
|
||||
|
||||
func inspector_info() -> Inspector.Info:
|
||||
var info = Inspector.Info.new(
|
||||
get_item_name(),
|
||||
get_description(),
|
||||
get_icon()
|
||||
)
|
||||
|
||||
for m in plant_mutations:
|
||||
info.framed_infos.append(
|
||||
PlantMutation.get_framed_info_from_mutation(m)
|
||||
)
|
||||
|
||||
info.framed_infos.append_array(
|
||||
PlantEffect.get_framed_info_from_all_trigger_effects(
|
||||
plant_type.default_mature_effects,
|
||||
plant_type.default_harvest_effects,
|
||||
plant_type.default_cyclic_effects
|
||||
)
|
||||
)
|
||||
|
||||
info.stat_infos = [
|
||||
Inspector.StatInfo.new(
|
||||
"[b]%d[/b] points when mature" % plant_type.default_plant_score,
|
||||
SCORE_ICON
|
||||
),
|
||||
Inspector.StatInfo.new(
|
||||
"Grow in [b]%d[/b] days" % plant_type.default_growing_time,
|
||||
GROWING_ICON
|
||||
)
|
||||
]
|
||||
|
||||
return info
|
||||
|
||||
func get_particles() -> Array[Particles.Parameters]:
|
||||
var param : Array[Particles.Parameters] = []
|
||||
|
||||
for m in plant_mutations:
|
||||
param.append(
|
||||
Particles.Parameters.new(
|
||||
m.get_icon(),
|
||||
PlantMutation.get_rarity_color(m)
|
||||
)
|
||||
)
|
||||
|
||||
return param
|
||||
|
||||
static func mutate(parent_mutation : Array[PlantMutation] = []) -> Array[PlantMutation]:
|
||||
|
||||
if randf() > MUTATION_PROBABILITY:
|
||||
return parent_mutation
|
||||
|
||||
var possible_mutations : Array[MutationPossibility] = [
|
||||
AddMutation.new()
|
||||
]
|
||||
|
||||
if len(parent_mutation):
|
||||
possible_mutations.append_array( [
|
||||
UpgradeMutation.new(),
|
||||
RemoveMutation.new(),
|
||||
])
|
||||
|
||||
var chosen_mutation = possible_mutations.pick_random()
|
||||
|
||||
return chosen_mutation.mutate(parent_mutation)
|
||||
|
||||
|
||||
class MutationPossibility:
|
||||
func mutate(_parent_mutation : Array[PlantMutation] = [])-> Array[PlantMutation]:
|
||||
return []
|
||||
|
||||
class DontMutate extends MutationPossibility:
|
||||
func mutate(parent_mutation : Array[PlantMutation] = [])-> Array[PlantMutation]:
|
||||
return parent_mutation
|
||||
|
||||
class AddMutation extends MutationPossibility:
|
||||
func mutate(parent_mutation : Array[PlantMutation] = [])-> Array[PlantMutation]:
|
||||
var new_mutations = parent_mutation.duplicate_deep()
|
||||
var mut = PlantMutation.random_mutation()
|
||||
|
||||
if mut:
|
||||
var existing_mut_id = new_mutations.find_custom(func(m:PlantMutation): m.get_mutation_name() == mut.get_mutation_name())
|
||||
|
||||
if existing_mut_id >= 0:
|
||||
new_mutations[existing_mut_id].level += 1
|
||||
else :
|
||||
new_mutations.append(mut)
|
||||
|
||||
return new_mutations
|
||||
|
||||
class UpgradeMutation extends MutationPossibility:
|
||||
func mutate(
|
||||
parent_mutation : Array[PlantMutation] = []
|
||||
) -> Array[PlantMutation]:
|
||||
var new_mutations = parent_mutation.duplicate_deep()
|
||||
|
||||
new_mutations.pick_random().level += 1
|
||||
|
||||
return new_mutations
|
||||
|
||||
class RemoveMutation extends MutationPossibility:
|
||||
func mutate(parent_mutation : Array[PlantMutation] = [])-> Array[PlantMutation]:
|
||||
var new_mutations :Array[PlantMutation] = parent_mutation.duplicate_deep()
|
||||
|
||||
var mut_to_remove = new_mutations.pick_random()
|
||||
if mut_to_remove.level > 1:
|
||||
mut_to_remove.level -= 1
|
||||
else:
|
||||
new_mutations.remove_at(new_mutations.find(mut_to_remove))
|
||||
|
||||
return new_mutations
|
||||
|
||||
@@ -2,7 +2,7 @@ extends Item
|
||||
class_name Shovel
|
||||
|
||||
const USE_INTERVAL = 0.15
|
||||
const SHOVEL_ZONE_RADIUS = 50
|
||||
const SHOVEL_ZONE_RADIUS = 30
|
||||
|
||||
func get_item_name() -> String:
|
||||
return "Shovel"
|
||||
@@ -22,16 +22,16 @@ func get_usage_zone_radius() -> int:
|
||||
func use_text() -> String:
|
||||
return "Dig"
|
||||
|
||||
func can_use(_player : Player, zone : Area2D) -> bool:
|
||||
var areas = zone.get_overlapping_areas()
|
||||
func can_use(_player : Player, zone : Player.ActionZone) -> bool:
|
||||
var areas = zone.area.get_overlapping_areas()
|
||||
for area in areas :
|
||||
if area is Plant or area is UndergroundLoot:
|
||||
return true
|
||||
return false
|
||||
|
||||
func use(player : Player, zone : Area2D) -> bool:
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
dig(
|
||||
zone.get_overlapping_areas(),
|
||||
zone.area.get_overlapping_areas(),
|
||||
player
|
||||
)
|
||||
|
||||
|
||||
17
common/vfx/circle/scripts/circle.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Sprite2D
|
||||
class_name Circle
|
||||
|
||||
@export var radius : int = 0
|
||||
@export var color : Color = Color.WHITE
|
||||
@export var opacity : float = 1.0
|
||||
@export var fill : bool = true
|
||||
@export var width : int = -1
|
||||
|
||||
func _draw():
|
||||
draw_circle(
|
||||
Vector2.ZERO,
|
||||
radius,
|
||||
Color(color.r, color.g, color.b, color.a * opacity),
|
||||
fill,
|
||||
width
|
||||
)
|
||||
1
common/vfx/circle/scripts/circle.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c60a1bjcuj4hd
|
||||
32
common/vfx/particles/particles.tscn
Normal file
@@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://bg7jmrwdgdqg4"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="1_88fy1"]
|
||||
[ext_resource type="Script" uid="uid://bddlpqlfrydn8" path="res://common/vfx/particles/scripts/particles.gd" id="1_faap1"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_xmi7c"]
|
||||
_limits = [-200.0, 200.0, 0.0, 1.0]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.2513369, 200), 0.0, 0.0, 0, 0, Vector2(0.7540107, -200), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="Curve" id="Curve_22a4c"]
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.2620321, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_li6gc"]
|
||||
offsets = PackedFloat32Array(0, 0.80172414, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 0.65882355, 1, 1, 1, 0.72156864, 1, 1, 1, 0)
|
||||
|
||||
[node name="Particles" type="CPUParticles2D"]
|
||||
amount = 1
|
||||
texture = ExtResource("1_88fy1")
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 30.0
|
||||
gravity = Vector2(0, -20)
|
||||
tangential_accel_min = -0.1
|
||||
tangential_accel_max = 0.1
|
||||
tangential_accel_curve = SubResource("Curve_xmi7c")
|
||||
scale_amount_min = 0.4
|
||||
scale_amount_max = 0.6
|
||||
scale_amount_curve = SubResource("Curve_22a4c")
|
||||
color_ramp = SubResource("Gradient_li6gc")
|
||||
script = ExtResource("1_faap1")
|
||||
18
common/vfx/particles/scripts/particles.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
extends CPUParticles2D
|
||||
class_name Particles
|
||||
|
||||
func setup_particles(param : Parameters):
|
||||
texture = param.texture
|
||||
modulate = param.color
|
||||
emitting = true
|
||||
|
||||
class Parameters:
|
||||
var texture : Texture
|
||||
var color : Color
|
||||
|
||||
func _init(
|
||||
_texture : Texture,
|
||||
_color : Color = Color.WHITE
|
||||
):
|
||||
texture = _texture
|
||||
color = _color
|
||||
1
common/vfx/particles/scripts/particles.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bddlpqlfrydn8
|
||||