diff --git a/common/audio_manager/scripts/audio_manager.gd b/common/audio_manager/scripts/audio_manager.gd index 6bf5703..477e11d 100644 --- a/common/audio_manager/scripts/audio_manager.gd +++ b/common/audio_manager/scripts/audio_manager.gd @@ -335,8 +335,8 @@ class AudioLaunch extends AudioAction: parent_node : Node, current_players : Array[String] ) -> Array[String]: - var player = manager.get_player_from_node(player_name,parent_node) - if player and not player in current_players: + var player := manager.get_player_from_node(player_name,parent_node) + if player and not player.name in current_players: manager.start_player(player, from_random_time, fade_time) current_players.append(player_name) return current_players diff --git a/common/plant_texture_builder/plant_texture_builder.tscn b/common/plant_texture_builder/plant_texture_builder.tscn index 004baaa..6986e5b 100644 --- a/common/plant_texture_builder/plant_texture_builder.tscn +++ b/common/plant_texture_builder/plant_texture_builder.tscn @@ -120,18 +120,17 @@ parts = Array[ExtResource("2_cfiqo")]([ExtResource("21_alra6"), ExtResource("22_ part_amount = 4 metadata/_custom_type_script = "uid://cfjd8jelpm8dt" -[sub_resource type="Resource" id="Resource_cfiqo"] -script = ExtResource("16_c3tk3") -parts = Array[ExtResource("2_cfiqo")]([ExtResource("43_y02ao"), ExtResource("44_s8rsj")]) -part_amount = 3 -metadata/_custom_type_script = "uid://cfjd8jelpm8dt" - [sub_resource type="Resource" id="Resource_jbu3q"] script = ExtResource("16_c3tk3") parts = Array[ExtResource("2_cfiqo")]([ExtResource("45_coupj"), ExtResource("46_ggud5"), ExtResource("47_ufbqh")]) part_amount = 5 metadata/_custom_type_script = "uid://cfjd8jelpm8dt" +[sub_resource type="Resource" id="Resource_b21au"] +script = ExtResource("16_c3tk3") +parts = Array[ExtResource("2_cfiqo")]([ExtResource("43_y02ao"), ExtResource("44_s8rsj")]) +metadata/_custom_type_script = "uid://cfjd8jelpm8dt" + [sub_resource type="Resource" id="Resource_cynqk"] script = ExtResource("47_jbu3q") color_textures = Array[Texture]([ExtResource("48_21cjy"), ExtResource("49_rs2ow")]) @@ -156,7 +155,7 @@ parts_mutation_associations = Dictionary[String, ExtResource("16_c3tk3")]({ "FERTILE": SubResource("Resource_nfxo0"), "PURIFICATION": SubResource("Resource_s8rsj"), "QUICK": SubResource("Resource_14c4k"), -"SOCIAL": SubResource("Resource_cfiqo"), +"SOCIABLE": SubResource("Resource_b21au"), "TOUGH": SubResource("Resource_jbu3q") }) chance_to_have_part = 0.9 diff --git a/entities/plants/scripts/plant_mutation/ephemeral_mutation.gd b/entities/plants/scripts/plant_mutation/ephemeral_mutation.gd index 6d29e3b..e0ce298 100644 --- a/entities/plants/scripts/plant_mutation/ephemeral_mutation.gd +++ b/entities/plants/scripts/plant_mutation/ephemeral_mutation.gd @@ -14,10 +14,16 @@ func get_mutation_name() -> String: return tr("EPHEMERAL") func get_mutation_description() -> String: - return tr("EPHEMERAL_EFFECT_TEXT_LEVEL_%d") % level + return tr("EPHEMERAL_EFFECT_TEXT_LEVEL").format({"seed_number": level, "lifetime_change": get_lifetime_change()}) func mutate_lifetime(_plant_data: PlantData, lifetime: int) -> int: - return lifetime - ceil(0.5 * level) + return lifetime - get_lifetime_change() func mutate_seed_number(_plant_data: PlantData, seed_number: int): return seed_number + level + +func get_seed_increase() -> int: + return floori((level + 1.0) / 2) + +func get_lifetime_change() -> int: + return maxi(0, 6 - get_seed_increase()) diff --git a/entities/plants/scripts/plant_mutation/purification_mutation.gd b/entities/plants/scripts/plant_mutation/purification_mutation.gd index 6d75d16..a0d98be 100644 --- a/entities/plants/scripts/plant_mutation/purification_mutation.gd +++ b/entities/plants/scripts/plant_mutation/purification_mutation.gd @@ -14,8 +14,11 @@ func get_mutation_name() -> String: return tr("PURIFICATION") func get_mutation_description() -> String: - return tr("PURIFICATION_EFFECT_TEXT_LEVEL_%d") % level + return tr("PURIFICATION_EFFECT_TEXT_LEVEL_%d") % get_purification_radius() func _start_maturation_effect(_plant : Plant): print("Implement purification maturation effect") pass + +func get_purification_radius() -> int: + return level diff --git a/entities/plants/scripts/plant_mutation/quick_mutation.gd b/entities/plants/scripts/plant_mutation/quick_mutation.gd index d0a151d..9bd719d 100644 --- a/entities/plants/scripts/plant_mutation/quick_mutation.gd +++ b/entities/plants/scripts/plant_mutation/quick_mutation.gd @@ -14,10 +14,16 @@ func get_mutation_name() -> String: return tr("QUICK") func get_mutation_description() -> String: - return tr("QUICK_EFFECT_TEXT_LEVEL_%d") % level + return tr("QUICK_EFFECT_TEXT_LEVEL").format({"score_increase": get_score_increase(), "lifetime_decrease": get_lifetime_decrease()}) -func mutate_score(_plant_data : PlantData, score : int) -> int: +func mutate_score(_plant_data: PlantData, score: int) -> int: return score + level -func mutate_growing_time(_data : PlantData, grow_time : int) -> int: - return max(grow_time - level, 1) +func mutate_lifetime(_plant_data: PlantData, lifetime: int) -> int: + return max(lifetime - level, 1) + +func get_score_increase() -> int: + return floori((level + 1.0) / 2) + +func get_lifetime_decrease() -> int: + return maxi(0, 6 - get_score_increase()) diff --git a/entities/plants/scripts/plant_mutation/social_mutation.gd b/entities/plants/scripts/plant_mutation/social_mutation.gd index 8651e70..da86c24 100644 --- a/entities/plants/scripts/plant_mutation/social_mutation.gd +++ b/entities/plants/scripts/plant_mutation/social_mutation.gd @@ -8,14 +8,17 @@ func get_base_rarity() -> int: return 0 func get_mutation_id() -> String: - return "SOCIAL" + return "SOCIABLE" func get_mutation_name() -> String: - return tr("SOCIAL") + return tr("SOCIABLE") func get_mutation_description() -> String: - return tr("SOCIAL_EFFECT_TEXT_LEVEL_%d") % level + return tr("SOCIABLE_EFFECT_TEXT_LEVEL").format({"near_amount": get_near_plants_around()}) -func mutate_score(_plant_data : PlantData, score : int) -> int: - printerr("TODO:: implement SOCIAL score based on plants around") +func mutate_score(_plant_data: PlantData, score: int) -> int: + printerr("TODO:: implement SOCIABLE score based on plants around") return score + level + +func get_near_plants_around(): + return 5 - level diff --git a/entities/plants/scripts/plant_mutation/tough_mutation.gd b/entities/plants/scripts/plant_mutation/tough_mutation.gd index 0197678..5d2a1dd 100644 --- a/entities/plants/scripts/plant_mutation/tough_mutation.gd +++ b/entities/plants/scripts/plant_mutation/tough_mutation.gd @@ -14,10 +14,13 @@ func get_mutation_name() -> String: return tr("TOUGH") func get_mutation_description() -> String: - return tr("TOUGH_EFFECT_TEXT_LEVEL_%d") % [3 - level] + return tr("TOUGH_EFFECT_TEXT_LEVEL_%d") % get_growing_time_increase() func mutate_score_multiplier(_plant_data: PlantData, multiplier: int) -> int: - return multiplier + 2 + return multiplier * 2 func mutate_growing_time(_plant_data: PlantData, growing_time: int) -> int: - return growing_time + maxi(0, 3 - level) + return growing_time + get_growing_time_increase() + +func get_growing_time_increase()->int: + return maxi(0, 3 - level) diff --git a/translation/game/gui.csv b/translation/game/gui.csv index 7a27c30..f9bd8bd 100644 --- a/translation/game/gui.csv +++ b/translation/game/gui.csv @@ -79,13 +79,19 @@ PRECOCIOUS_EFFECT_TEXT_LEVEL_%d,Grants [b]%d[/b] garden points while the plant i QUALITY,Quality,Qualité QUALITY_EFFECT_TEXT_LEVEL_%d,Grants [b]%d[/b] garden points if the plant is mature.,Donne [b]%d[/b] points de jardin si la plante est mature. QUICK,Quick,Rapide -QUICK_EFFECT_TEXT_LEVEL_%d,Reduce the growing time by %d,Réduit le temps de maturation de %d +QUICK_EFFECT_TEXT_LEVEL,Grants [b]{score_increase}[/b] garden points when mature but reduces the lifetime by [b]{lifetime_decrease}[/b],"Augmente le score mature de [b]{score_increase}[/b], mais réduit le temps de vie de [b]{lifetime_decrease}[/b]" SOCIABLE,Outgoing,Sociable -SOCIABLE_EFFECT_TEXT_LEVEL_%d,"When mature, grants [b]%d[/b] garden points if it is nearby %d other plants","Une fois mature, donne [b]%d[/b] points de jardin si elle est à côté de %d autres plantes" +SOCIABLE_EFFECT_TEXT_LEVEL,"When mature, grants [b]{near_amount}[/b] garden points every [b]{near_amount}[/b] nearby plant","Une fois mature, donne [b]1[/b] points de jardin toutes les [b]{near_amount}[/b] plantes autour" STRONG,Strong,Fort STRONG_EFFECT_TEXT_LEVEL_%d,Plus [b]%d[/b]%% of the score,Augmente le score de [b]%d[/b]%% TOUGH,Tough,Solide -TOUGH_EFFECT_TEXT_LEVEL_%d,Multiply the score by 2 but increase the growing time by [b]%d[/b] days,"Multiplie le score par 2, mais aumgent le temps de pousse de [b]%d[/b] jours" +TOUGH_EFFECT_TEXT_LEVEL_%d,Multiplies the score by [b]2[/b] but increases the growing time by [b]%d[/b] days,"Multiplie le score par [b]2[/b], mais aumgente le temps de pousse de [b]%d[/b] jours" +FERTILE,Fertile,Fertile +FERTILE_EFFECT_TEXT_LEVEL_%d,Increases the lifetime by [b]1[/b] every [b]%d[/b] nearby plant around,Augmente le temps de vie de [b]1[/b] toutes les [b]%d[/b] plante autour +EPHEMERAL,Ephemeral,Éphémère +EPHEMERAL_EFFECT_TEXT_LEVEL,Increases the number of seeds by [b]{seed_number}[/b] when gathered but reduces the lifetime by [b]{lifetime_change}[/b] days,"Augmente le nombre de graines de [b]{seed_number}[/b] à la récolte, mais réduis le temps de vie de [b]{lifetime_change}[/b]" +PURIFICATION,Purification,Épuration +PURIFICATION_EFFECT_TEXT_LEVEL_%d,"When mature, decontaminate around the plant in a radius of [b]%d[/b]","Une fois mature, décontamine autour de la plante dans un rayon de [b]%d[/b]" COST_%d_ENERGY,Cost %d energy,Coûte %d d’énergie ONE_TIME_USE,Single use,Usage unique BUILD_%s,Build %s,Construit %s