Ajout des mutation Nettoyage, Ermite, Tropicale, Rhizome et Spontanée
This commit is contained in:
Binary file not shown.
@@ -38,6 +38,11 @@ func get_all_mutations() -> Array[PlantMutation]:
|
|||||||
GenerousMutation.new(),
|
GenerousMutation.new(),
|
||||||
ProtectiveMutation.new(),
|
ProtectiveMutation.new(),
|
||||||
PureMutation.new(),
|
PureMutation.new(),
|
||||||
|
CleaningMutation.new(),
|
||||||
|
ErmitMutation.new(),
|
||||||
|
TropicalMutation.new(),
|
||||||
|
RhizomeMutation.new(),
|
||||||
|
SpontaneousMutation.new()
|
||||||
]
|
]
|
||||||
|
|
||||||
func get_all_artifacts() -> Array[Artefact]:
|
func get_all_artifacts() -> Array[Artefact]:
|
||||||
|
|||||||
23
common/icons/bug.svg
Normal file
23
common/icons/bug.svg
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="currentColor"
|
||||||
|
class="icon icon-tabler icons-tabler-filled icon-tabler-bug"
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<path
|
||||||
|
stroke="none"
|
||||||
|
d="M0 0h24v24H0z"
|
||||||
|
fill="none"
|
||||||
|
id="path1" />
|
||||||
|
<path
|
||||||
|
d="M12 4a4 4 0 0 1 3.995 3.8l.005 .2a1 1 0 0 1 .428 .096l3.033 -1.938a1 1 0 1 1 1.078 1.684l-3.015 1.931a7.17 7.17 0 0 1 .476 2.227h3a1 1 0 0 1 0 2h-3v1a6.01 6.01 0 0 1 -.195 1.525l2.708 1.616a1 1 0 1 1 -1.026 1.718l-2.514 -1.501a6.002 6.002 0 0 1 -3.973 2.56v-5.918a1 1 0 0 0 -2 0v5.917a6.002 6.002 0 0 1 -3.973 -2.56l-2.514 1.503a1 1 0 1 1 -1.026 -1.718l2.708 -1.616a6.01 6.01 0 0 1 -.195 -1.526v-1h-3a1 1 0 0 1 0 -2h3.001v-.055a7 7 0 0 1 .474 -2.173l-3.014 -1.93a1 1 0 1 1 1.078 -1.684l3.032 1.939l.024 -.012l.068 -.027l.019 -.005l.016 -.006l.032 -.008l.04 -.013l.034 -.007l.034 -.004l.045 -.008l.015 -.001l.015 -.002l.087 -.004a4 4 0 0 1 4 -4zm0 2a2 2 0 0 0 -2 2h4a2 2 0 0 0 -2 -2z"
|
||||||
|
id="path2"
|
||||||
|
style="fill:#ffffff;fill-opacity:1" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
43
common/icons/bug.svg.import
Normal file
43
common/icons/bug.svg.import
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://ceoxyc8lxuqet"
|
||||||
|
path="res://.godot/imported/bug.svg-30d611f322c5908f7609c3e1222553c7.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://common/icons/bug.svg"
|
||||||
|
dest_files=["res://.godot/imported/bug.svg-30d611f322c5908f7609c3e1222553c7.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
|
||||||
23
common/icons/christmas-tree.svg
Normal file
23
common/icons/christmas-tree.svg
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="currentColor"
|
||||||
|
class="icon icon-tabler icons-tabler-filled icon-tabler-christmas-tree"
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<path
|
||||||
|
stroke="none"
|
||||||
|
d="M0 0h24v24H0z"
|
||||||
|
fill="none"
|
||||||
|
id="path1" />
|
||||||
|
<path
|
||||||
|
d="M15 19v1a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2v-1zm-10 -1c-.89 0 -1.337 -1.077 -.707 -1.707l2.855 -2.857l-1.464 -.487a1 1 0 0 1 -.472 -1.565l.08 -.091l3.019 -3.02l-.758 -.379a1 1 0 0 1 -.343 -1.507l.083 -.094l4 -4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 -.26 1.601l-.759 .379l3.02 3.02a1 1 0 0 1 -.279 1.61l-.113 .046l-1.465 .487l2.856 2.857c.603 .602 .22 1.614 -.593 1.701l-.114 .006z"
|
||||||
|
id="path2"
|
||||||
|
style="fill:#ffffff;fill-opacity:1" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 892 B |
43
common/icons/christmas-tree.svg.import
Normal file
43
common/icons/christmas-tree.svg.import
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dofqju0k1nguf"
|
||||||
|
path="res://.godot/imported/christmas-tree.svg-2d675a899996dc14dfea64e4ba2ac385.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://common/icons/christmas-tree.svg"
|
||||||
|
dest_files=["res://.godot/imported/christmas-tree.svg-2d675a899996dc14dfea64e4ba2ac385.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 +1,31 @@
|
|||||||
<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-cloud-rain"><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path d="M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7" /><path d="M11 13v2m0 3v2m4 -5v2m0 3v2" /></svg>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="icon icon-tabler icons-tabler-outline icon-tabler-cloud-rain"
|
||||||
|
version="1.1"
|
||||||
|
id="svg3"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs3" />
|
||||||
|
<path
|
||||||
|
stroke="none"
|
||||||
|
d="M0 0h24v24H0z"
|
||||||
|
fill="none"
|
||||||
|
id="path1" />
|
||||||
|
<path
|
||||||
|
d="M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7"
|
||||||
|
id="path2"
|
||||||
|
style="stroke:#ffffff;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
d="M11 13v2m0 3v2m4 -5v2m0 3v2"
|
||||||
|
id="path3"
|
||||||
|
style="stroke:#ffffff;stroke-opacity:1" />
|
||||||
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 780 B |
23
common/icons/leaf.svg
Normal file
23
common/icons/leaf.svg
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="currentColor"
|
||||||
|
class="icon icon-tabler icons-tabler-filled icon-tabler-leaf"
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<path
|
||||||
|
stroke="none"
|
||||||
|
d="M0 0h24v24H0z"
|
||||||
|
fill="none"
|
||||||
|
id="path1" />
|
||||||
|
<path
|
||||||
|
d="M3.055 14.328l-.018 -.168l-.004 -.043a11 11 0 0 1 -.047 -1.12c.018 -6.29 4.29 -9.997 13 -9.997h4.014a1 1 0 0 1 1 1l-.002 2.057c-.498 8.701 -4.74 12.943 -11.998 12.943h-2.631a16 16 0 0 0 -.375 2.11a1 1 0 1 1 -1.988 -.22q .174 -1.568 .58 -2.947l-.118 -.146l-.208 -.28l-.157 -.229l-.182 -.293l-.098 -.171l-.065 -.122a6 6 0 0 1 -.397 -.941l-.072 -.237l-.085 -.327l-.057 -.268l-.043 -.242zm8.539 -4.242c-2.845 1.265 -4.854 3.13 -6.108 5.583q .098 .2 .218 .4l.185 .281l.07 .097q .12 .164 .258 .329l.197 .224h.649c1.037 -2.271 2.777 -3.946 5.343 -5.086a1 1 0 0 0 -.812 -1.828"
|
||||||
|
id="path2"
|
||||||
|
style="fill:#ffffff;fill-opacity:1" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
43
common/icons/leaf.svg.import
Normal file
43
common/icons/leaf.svg.import
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://koow6s66cvqk"
|
||||||
|
path="res://.godot/imported/leaf.svg-64997ac177eb77fe732afcb627c1b7f7.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://common/icons/leaf.svg"
|
||||||
|
dest_files=["res://.godot/imported/leaf.svg-64997ac177eb77fe732afcb627c1b7f7.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
|
||||||
31
common/icons/sparkles.svg
Normal file
31
common/icons/sparkles.svg
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="currentColor"
|
||||||
|
class="icon icon-tabler icons-tabler-filled icon-tabler-sparkles"
|
||||||
|
version="1.1"
|
||||||
|
id="svg4"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs4" />
|
||||||
|
<path
|
||||||
|
stroke="none"
|
||||||
|
d="M0 0h24v24H0z"
|
||||||
|
fill="none"
|
||||||
|
id="path1" />
|
||||||
|
<path
|
||||||
|
d="M16 19a1 1 0 0 1 0 -2a1 1 0 0 0 1 -1c0 -1.333 2 -1.333 2 0a1 1 0 0 0 1 1c1.333 0 1.333 2 0 2a1 1 0 0 0 -1 1c0 1.333 -2 1.333 -2 0a1 1 0 0 0 -1 -1"
|
||||||
|
id="path2"
|
||||||
|
style="fill:#ffffff;fill-opacity:1" />
|
||||||
|
<path
|
||||||
|
d="M3 11a5 5 0 0 0 5 -5c0 -1.333 2 -1.333 2 0a5 5 0 0 0 5 5c1.333 0 1.333 2 0 2a5 5 0 0 0 -5 5a1 1 0 0 1 -2 0a5 5 0 0 0 -5 -5c-1.333 0 -1.333 -2 0 -2"
|
||||||
|
id="path3"
|
||||||
|
style="fill:#ffffff;fill-opacity:1" />
|
||||||
|
<path
|
||||||
|
d="M16 7a1 1 0 0 1 0 -2a1 1 0 0 0 1 -1c0 -1.333 2 -1.333 2 0a1 1 0 0 0 1 1c1.333 0 1.333 2 0 2a1 1 0 0 0 -1 1c0 1.333 -2 1.333 -2 0a1 1 0 0 0 -1 -1"
|
||||||
|
id="path4"
|
||||||
|
style="fill:#ffffff;fill-opacity:1" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
43
common/icons/sparkles.svg.import
Normal file
43
common/icons/sparkles.svg.import
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://djq2l8aun82ou"
|
||||||
|
path="res://.godot/imported/sparkles.svg-916e1088ab60f75f5f1370971c1faf2d.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://common/icons/sparkles.svg"
|
||||||
|
dest_files=["res://.godot/imported/sparkles.svg-916e1088ab60f75f5f1370971c1faf2d.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
|
||||||
@@ -125,7 +125,8 @@ func calculate_plant_score(
|
|||||||
func harvest():
|
func harvest():
|
||||||
var do_produce_seeds := true
|
var do_produce_seeds := true
|
||||||
for m in data.mutations:
|
for m in data.mutations:
|
||||||
do_produce_seeds = do_produce_seeds && m.produce_seeds()
|
if m.nullify_seed_production():
|
||||||
|
do_produce_seeds = false
|
||||||
|
|
||||||
if do_produce_seeds:
|
if do_produce_seeds:
|
||||||
for i in range(data.get_seed_number()):
|
for i in range(data.get_seed_number()):
|
||||||
@@ -159,10 +160,11 @@ func die():
|
|||||||
|
|
||||||
var do_produce_seeds := true
|
var do_produce_seeds := true
|
||||||
for m in data.mutations:
|
for m in data.mutations:
|
||||||
do_produce_seeds = do_produce_seeds && m.produce_seeds_on_maturation()
|
if m.nullify_seed_production():
|
||||||
|
do_produce_seeds = false
|
||||||
|
|
||||||
if do_produce_seeds:
|
if do_produce_seeds:
|
||||||
for i in range(data.get_seed_number()):
|
for i in range(data.get_seed_number(data.get_state())):
|
||||||
await produce_seed()
|
await produce_seed()
|
||||||
|
|
||||||
AudioManager.play_sfx("Harvest")
|
AudioManager.play_sfx("Harvest")
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ func get_growing_time() -> int:
|
|||||||
return max(1,growing_time)
|
return max(1,growing_time)
|
||||||
|
|
||||||
func get_score(state: State = get_state()) -> int:
|
func get_score(state: State = get_state()) -> int:
|
||||||
|
for m in mutations:
|
||||||
|
if m.nullify_score(self):
|
||||||
|
return 0
|
||||||
|
|
||||||
var score = get_plant_info().get_base_score() if state == State.MATURE else 0
|
var score = get_plant_info().get_base_score() if state == State.MATURE else 0
|
||||||
|
|
||||||
var mult := 1.
|
var mult := 1.
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ func get_mutation_name() -> String:
|
|||||||
func mutate_plant_data(_plant_data: PlantData):
|
func mutate_plant_data(_plant_data: PlantData):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func has_score(_plant_data: PlantData) -> bool:
|
func nullify_score(_plant_data: PlantData) -> bool:
|
||||||
return true
|
return false
|
||||||
|
|
||||||
func mutate_score(_plant_data: PlantData, score: int) -> int:
|
func mutate_score(_plant_data: PlantData, score: int) -> int:
|
||||||
return score
|
return score
|
||||||
@@ -43,8 +43,8 @@ func mutate_lifetime(_plant_data: PlantData, lifetime: int) -> int:
|
|||||||
func mutate_growing_time(_plant_data: PlantData, growing_time: int) -> int:
|
func mutate_growing_time(_plant_data: PlantData, growing_time: int) -> int:
|
||||||
return growing_time
|
return growing_time
|
||||||
|
|
||||||
func produce_seeds() -> bool:
|
func nullify_seed_production() -> bool:
|
||||||
return true
|
return false
|
||||||
|
|
||||||
func mutate_seed_number(_plant_data: PlantData, seed_number: int) -> int:
|
func mutate_seed_number(_plant_data: PlantData, seed_number: int) -> int:
|
||||||
return seed_number
|
return seed_number
|
||||||
@@ -82,6 +82,9 @@ func get_level_for_rarity(rarity: int) -> int:
|
|||||||
func get_rarity() -> int:
|
func get_rarity() -> int:
|
||||||
return get_base_rarity() + level - 1
|
return get_base_rarity() + level - 1
|
||||||
|
|
||||||
|
func is_max_level() -> bool:
|
||||||
|
return get_base_rarity() + level < MAX_RARITY
|
||||||
|
|
||||||
func card_info() -> CardInfo:
|
func card_info() -> CardInfo:
|
||||||
var info = CardInfo.new(
|
var info = CardInfo.new(
|
||||||
get_mutation_name(),
|
get_mutation_name(),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ extends PlantMutation
|
|||||||
class_name CleaningMutation
|
class_name CleaningMutation
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
func get_icon() -> Texture:
|
||||||
return preload("res://common/icons/alert-triangle.svg")
|
return preload("res://common/icons/bug.svg")
|
||||||
|
|
||||||
func get_mutation_id() -> String:
|
func get_mutation_id() -> String:
|
||||||
return "CLEANING"
|
return "CLEANING"
|
||||||
@@ -22,4 +22,4 @@ func _start_dead_effect(plant: Plant):
|
|||||||
))
|
))
|
||||||
|
|
||||||
func get_purification_radius() -> int:
|
func get_purification_radius() -> int:
|
||||||
return level + 1 # one more than purification
|
return level * 2
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ func get_mutation_description() -> String:
|
|||||||
|
|
||||||
func _start_day_effect(plant: Plant):
|
func _start_day_effect(plant: Plant):
|
||||||
var cut_left := get_cutable_per_day()
|
var cut_left := get_cutable_per_day()
|
||||||
for p in plant.data.nearby_plants:
|
|
||||||
if cut_left > 0 && p.is_mature():
|
# Ne fonctionnera pas, nearby plants c'est des plantData donc on peut pas faire d'action dessus
|
||||||
p.harvest()
|
# for p in plant.data.nearby_plants:
|
||||||
cut_left -= 1
|
# if cut_left > 0 && p.is_mature():
|
||||||
|
# p.harvest()
|
||||||
|
# cut_left -= 1
|
||||||
|
|
||||||
func get_cutable_per_day() -> int:
|
func get_cutable_per_day() -> int:
|
||||||
return level
|
return level
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
extends PlantMutation
|
|
||||||
class_name EnergizingMutation
|
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
|
||||||
return preload("res://common/icons/alert-triangle.svg")
|
|
||||||
|
|
||||||
func get_base_rarity() -> int:
|
|
||||||
return 1
|
|
||||||
|
|
||||||
func get_mutation_id() -> String:
|
|
||||||
return "ENERGIZING"
|
|
||||||
|
|
||||||
func get_mutation_name() -> String:
|
|
||||||
return tr("ENERGIZING")
|
|
||||||
|
|
||||||
func get_mutation_description() -> String:
|
|
||||||
return tr("ENERGIZING_EFFECT_TEXT").format({
|
|
||||||
"bonus_energy": get_bonus_energy()
|
|
||||||
})
|
|
||||||
|
|
||||||
func _start_dead_effect(plant: Plant):
|
|
||||||
plant.region.player.data.energy += get_bonus_energy()
|
|
||||||
|
|
||||||
func get_bonus_energy() -> int:
|
|
||||||
return level
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://byj1hq1w42i7
|
|
||||||
@@ -2,26 +2,27 @@ extends PlantMutation
|
|||||||
class_name ErmitMutation
|
class_name ErmitMutation
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
func get_icon() -> Texture:
|
||||||
return preload("res://common/icons/alert-triangle.svg")
|
return preload("res://common/icons/christmas-tree.svg")
|
||||||
|
|
||||||
func get_mutation_id() -> String:
|
func get_mutation_id() -> String:
|
||||||
return "ERMIT"
|
return "HERMIT"
|
||||||
|
|
||||||
func get_mutation_name() -> String:
|
func get_mutation_name() -> String:
|
||||||
return tr("ERMIT")
|
return tr("HERMIT")
|
||||||
|
|
||||||
func get_mutation_description() -> String:
|
func get_mutation_description() -> String:
|
||||||
return tr("ERMIT_EFFECT_TEXT").format(
|
return tr("HERMIT_EFFECT_TEXT").format(
|
||||||
{
|
{
|
||||||
"score_increase": get_score_increase(),
|
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
|
||||||
|
"score_multiplier": get_score_multiplier() + 1.0,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func has_score(plant_data: PlantData) -> bool:
|
func nullify_score(plant_data: PlantData) -> bool:
|
||||||
return false if plant_data.nearby_plants.size() > 0 else true
|
return true if len(plant_data.nearby_plants) > 0 else false
|
||||||
|
|
||||||
func mutate_score(plant_data: PlantData, score: int) -> int:
|
func mutate_score_multiplier(_plant_data: PlantData, multiplier: float) -> float:
|
||||||
return score + get_score_increase() if plant_data.nearby_plants.size() == 0 else 0
|
return multiplier + get_score_multiplier()
|
||||||
|
|
||||||
func get_score_increase():
|
func get_score_multiplier()->float:
|
||||||
return 2 * level
|
return level
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ func get_mutation_description() -> String:
|
|||||||
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON)
|
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON)
|
||||||
})
|
})
|
||||||
|
|
||||||
func mutate_score_multiplier(_pd: PlantData, _m: float) -> float:
|
func nullify_score(_plant_data: PlantData) -> bool:
|
||||||
return 0
|
return true
|
||||||
|
|
||||||
func mutate_score_buff(plant_data: PlantData, score_buff : int) -> int:
|
func mutate_score_buff(plant_data: PlantData, score_buff : int) -> int:
|
||||||
if plant_data.get_state() == PlantData.State.MATURE:
|
if plant_data.get_state() == PlantData.State.MATURE:
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
uid://beualsis6xc8a
|
|
||||||
@@ -2,7 +2,7 @@ extends PlantMutation
|
|||||||
class_name PurificationMutation
|
class_name PurificationMutation
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
func get_icon() -> Texture:
|
||||||
return preload("res://common/icons/droplet.svg")
|
return preload("res://common/icons/leaf.svg")
|
||||||
|
|
||||||
func get_mutation_id() -> String:
|
func get_mutation_id() -> String:
|
||||||
return "PURIFICATION"
|
return "PURIFICATION"
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
extends PlantMutation
|
extends PlantMutation
|
||||||
class_name RhizomeMutation
|
class_name RhizomeMutation
|
||||||
|
|
||||||
|
const DIG_PARTICLES := preload("res://entities/player/inventory/scripts/items/utils/dig_particles.tscn")
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
func get_icon() -> Texture:
|
||||||
return preload("res://common/icons/alert-triangle.svg")
|
return preload("res://common/icons/pick.svg")
|
||||||
|
|
||||||
func get_mutation_id() -> String:
|
func get_mutation_id() -> String:
|
||||||
return "RHIZOME"
|
return "RHIZOME"
|
||||||
@@ -16,7 +18,17 @@ func get_mutation_description() -> String:
|
|||||||
})
|
})
|
||||||
|
|
||||||
func _start_maturation_effect(plant: Plant):
|
func _start_maturation_effect(plant: Plant):
|
||||||
plant.region.dig_hole(plant.global_position, get_digging_radius())
|
plant.region.dig_rocks(
|
||||||
|
Math.get_tiles_in_circle(
|
||||||
|
plant.global_position,
|
||||||
|
get_digging_radius() * (Region.TILE_SIZE + Region.TILE_SIZE / 2.)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
var particles := (DIG_PARTICLES.instantiate() as DigParticleEmmitter)
|
||||||
|
plant.region.add_child(particles)
|
||||||
|
particles.global_position = plant.get_global_position()
|
||||||
|
particles.emit()
|
||||||
|
|
||||||
func get_digging_radius() -> int:
|
func get_digging_radius() -> int:
|
||||||
return level
|
return level
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
extends PlantMutation
|
extends PlantMutation
|
||||||
class_name SolarMutation
|
class_name SolarMutation
|
||||||
|
|
||||||
|
# Du coup on va probablement pas la mettre celle là
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
func get_icon() -> Texture:
|
||||||
return preload("res://common/icons/alert-triangle.svg")
|
return preload("res://common/icons/alert-triangle.svg")
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,13 @@ extends PlantMutation
|
|||||||
class_name SpontaneousMutation
|
class_name SpontaneousMutation
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
func get_icon() -> Texture:
|
||||||
return preload("res://common/icons/droplet.svg")
|
return preload("res://common/icons/sparkles.svg")
|
||||||
|
|
||||||
func get_base_rarity() -> int:
|
func get_base_rarity() -> int:
|
||||||
return 1
|
return 0
|
||||||
|
|
||||||
|
func is_max_level() -> bool:
|
||||||
|
return true
|
||||||
|
|
||||||
func get_mutation_id() -> String:
|
func get_mutation_id() -> String:
|
||||||
return "SPONTANEOUS"
|
return "SPONTANEOUS"
|
||||||
@@ -14,19 +17,12 @@ func get_mutation_name() -> String:
|
|||||||
return tr("SPONTANEOUS")
|
return tr("SPONTANEOUS")
|
||||||
|
|
||||||
func get_mutation_description() -> String:
|
func get_mutation_description() -> String:
|
||||||
return tr("SPONTANEOUS_EFFECT_TEXT").format({
|
return tr("SPONTANEOUS_EFFECT_TEXT")
|
||||||
"bonus_seed": get_bonus_seed()
|
|
||||||
})
|
|
||||||
|
|
||||||
func produce_seeds() -> bool:
|
func nullify_seed_production() -> bool:
|
||||||
return false
|
return true
|
||||||
|
|
||||||
func mutate_seed_number(_plant_data: PlantData, seed_number: int) -> int:
|
|
||||||
return seed_number + get_bonus_seed()
|
|
||||||
|
|
||||||
func _start_maturation_effect(plant: Plant):
|
func _start_maturation_effect(plant: Plant):
|
||||||
for i in range(plant.data.get_seed_number()):
|
for i in range(plant.data.get_seed_number()):
|
||||||
await plant.produce_seed()
|
await plant.produce_seed()
|
||||||
|
|
||||||
func get_bonus_seed() -> int:
|
|
||||||
return level - 1
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
extends PlantMutation
|
extends PlantMutation
|
||||||
class_name HumideMutation
|
class_name TropicalMutation
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
func get_icon() -> Texture:
|
||||||
return preload("res://common/icons/shield.svg")
|
return preload("res://common/icons/cloud-rain.svg")
|
||||||
|
|
||||||
func get_mutation_id() -> String:
|
func get_mutation_id() -> String:
|
||||||
return "HUMIDE"
|
return "TROPICAL"
|
||||||
|
|
||||||
func get_mutation_name() -> String:
|
func get_mutation_name() -> String:
|
||||||
return tr("HUMIDE")
|
return tr("TROPICAL")
|
||||||
|
|
||||||
func get_mutation_description() -> String:
|
func get_mutation_description() -> String:
|
||||||
return tr("HUMIDE_EFFECT_TEXT").format({
|
return tr("TROPICAL_EFFECT_TEXT").format({
|
||||||
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
|
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
|
||||||
"score_multiplier": get_score_multiplier() + 1.,
|
"score_multiplier": get_score_multiplier() + 1.,
|
||||||
})
|
})
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://c4ruhg7wg2kta
|
||||||
@@ -180,20 +180,24 @@ static func generate_first_mutations(rarity := 0) -> Array[PlantMutation]:
|
|||||||
|
|
||||||
var possible_mutation : PlantMutation = GameInfo.game_data.progression_data.get_available_mutations().filter(
|
var possible_mutation : PlantMutation = GameInfo.game_data.progression_data.get_available_mutations().filter(
|
||||||
func (m : PlantMutation): return m.get_base_rarity() <= rarity
|
func (m : PlantMutation): return m.get_base_rarity() <= rarity
|
||||||
).pick_random().duplicate_deep()
|
).pick_random()
|
||||||
|
|
||||||
var level_to_add = rarity - possible_mutation.get_base_rarity()
|
if possible_mutation:
|
||||||
|
possible_mutation = possible_mutation.duplicate_deep()
|
||||||
|
|
||||||
possible_mutation.level += level_to_add
|
var level_to_add = rarity - possible_mutation.get_base_rarity()
|
||||||
|
|
||||||
return [possible_mutation]
|
possible_mutation.level += level_to_add
|
||||||
|
|
||||||
|
return [possible_mutation]
|
||||||
|
return []
|
||||||
|
|
||||||
static func mutate_mutations(mutations : Array[PlantMutation], nearby_mutations : Array[PlantMutation]) -> Array[PlantMutation]:
|
static func mutate_mutations(mutations : Array[PlantMutation], nearby_mutations : Array[PlantMutation]) -> Array[PlantMutation]:
|
||||||
|
|
||||||
var mutation_possibility : Array[MutationPossibility] = []
|
var mutation_possibility : Array[MutationPossibility] = []
|
||||||
|
|
||||||
var evolvable_mutations : Array[PlantMutation] = mutations.filter(
|
var evolvable_mutations : Array[PlantMutation] = mutations.filter(
|
||||||
func (m : PlantMutation): return m.get_rarity() < PlantMutation.MAX_RARITY
|
func (m : PlantMutation): return not m.is_max_level()
|
||||||
)
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -206,7 +210,7 @@ static func mutate_mutations(mutations : Array[PlantMutation], nearby_mutations
|
|||||||
|
|
||||||
var chosen_mutation_possibility = mutation_possibility.pick_random()
|
var chosen_mutation_possibility = mutation_possibility.pick_random()
|
||||||
|
|
||||||
return chosen_mutation_possibility.mutate(mutations)
|
return chosen_mutation_possibility.mutate(mutations,nearby_mutations)
|
||||||
|
|
||||||
class MutationPossibility:
|
class MutationPossibility:
|
||||||
func mutate(_mutations : Array[PlantMutation], _nearby_mutations : Array[PlantMutation])-> Array[PlantMutation]:
|
func mutate(_mutations : Array[PlantMutation], _nearby_mutations : Array[PlantMutation])-> Array[PlantMutation]:
|
||||||
|
|||||||
@@ -92,6 +92,16 @@ GENEROUS,Generous,Généreux
|
|||||||
GENEROUS_EFFECT_TEXT,"When mature, add [b]{score_buff}[/b]{score_icon} to all nearby plants, but no longer make point","Si mature, ajoute [b]{score_buff}[/b]{score_icon} à toutes les plantes à proximité, mais ne génère plus de points"
|
GENEROUS_EFFECT_TEXT,"When mature, add [b]{score_buff}[/b]{score_icon} to all nearby plants, but no longer make point","Si mature, ajoute [b]{score_buff}[/b]{score_icon} à toutes les plantes à proximité, mais ne génère plus de points"
|
||||||
PROTECTIVE,Protective,Protecteur
|
PROTECTIVE,Protective,Protecteur
|
||||||
PROTECTIVE_EFFECT_TEXT,"Add [b]{lifetime_buff}[/b]{lifetime_icon} to all nearby plants","Ajoute [b]{lifetime_buff}[/b]{lifetime_icon} à toutes les plantes à proximité"
|
PROTECTIVE_EFFECT_TEXT,"Add [b]{lifetime_buff}[/b]{lifetime_icon} to all nearby plants","Ajoute [b]{lifetime_buff}[/b]{lifetime_icon} à toutes les plantes à proximité"
|
||||||
|
CLEANING,Cleaning,Nettoyage
|
||||||
|
CLEANING_EFFECT_TEXT,"At the end of its lifetime, create fertile zone in a radius of [b]{purification_radius}[/b]","À la fin de sa durée de vie, créée une zone fertile dans un rayon de [b]{purification_radius}[/b]"
|
||||||
|
HERMIT,Hermit,Ermite
|
||||||
|
HERMIT_EFFECT_TEXT,"Multiplies {score_icon} by [b]{score_multiplier}[/b] but make no points near other plants","Multiplie {score_icon} par [b]{score_multiplier}[/b] mais ne fait aucun point si à proximité d'autres plantes"
|
||||||
|
TROPICAL,Tropical,Tropical
|
||||||
|
TROPICAL_EFFECT_TEXT,Multiplies {score_icon} by [b]{score_multiplier}[/b] if the day is rainy (1/4 chance),"Multiplie {score_icon} par [b]{score_multiplier}[/b] s'il pleut (1 chance sur 4)"
|
||||||
|
RHIZOME,Rhizome,Rhizome
|
||||||
|
RHIZOME_EFFECT_TEXT,"On maturation, dig on a radius of {digging_radius} around","À la maturation, creuse sur un rayon de {digging_radius} autour"
|
||||||
|
SPONTANEOUS,Spontaneous,Spontanée
|
||||||
|
SPONTANEOUS_EFFECT_TEXT,Now produces seeds only on maturation,Produit maintenant des graines uniquement à la maturation
|
||||||
COST_%d_ENERGY,Cost %d energy,Coûte %d d'énergie
|
COST_%d_ENERGY,Cost %d energy,Coûte %d d'énergie
|
||||||
ONE_TIME_USE,Single use,Usage unique
|
ONE_TIME_USE,Single use,Usage unique
|
||||||
BUILD_%s,Build %s,Construit %s
|
BUILD_%s,Build %s,Construit %s
|
||||||
|
|||||||
|
Reference in New Issue
Block a user