mutation tooltips

This commit is contained in:
Altaezio
2026-02-27 16:34:07 +01:00
parent 46d6ea2340
commit d25d614c06
8 changed files with 53 additions and 27 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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())

View File

@@ -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

View File

@@ -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())

View File

@@ -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

View File

@@ -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)

View File

@@ -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
1 keys en fr
79 COST_%d_ENERGY FERTILE Cost %d energy Fertile Coûte %d d’énergie Fertile
80 ONE_TIME_USE FERTILE_EFFECT_TEXT_LEVEL_%d Single use Increases the lifetime by [b]1[/b] every [b]%d[/b] nearby plant around Usage unique Augmente le temps de vie de [b]1[/b] toutes les [b]%d[/b] plante autour
81 BUILD_%s EPHEMERAL Build %s Ephemeral Construit %s Éphémère
82 FORK EPHEMERAL_EFFECT_TEXT_LEVEL Fork Increases the number of seeds by [b]{seed_number}[/b] when gathered but reduces the lifetime by [b]{lifetime_change}[/b] days Fourche 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]
83 FORK_DESC_TEXT PURIFICATION Use it to [b]harvest mature plants[/b]. Purification Utilise-la pour [b]récolter les plantes mature[/b]. Épuration
84 DETECTOR PURIFICATION_EFFECT_TEXT_LEVEL_%d Detector When mature, decontaminate around the plant in a radius of [b]%d[/b] Détecteur Une fois mature, décontamine autour de la plante dans un rayon de [b]%d[/b]
85 DETECTOR_DESC_TEXT COST_%d_ENERGY Indicate [b]near signals[/b]. Cost %d energy Indique les [b]signaux proches[/b] Coûte %d d’énergie
86 DETECT_USE_TEXT ONE_TIME_USE Search near signals Single use Rechercher les signaux proches Usage unique
87 SHIP_TELEPORT BUILD_%s Ship Portal Build %s Portail vers le vaisseau Construit %s
88 SHIP_TELEPORT_DESC_TEXT FORK A mysterious technology that get you to the [b]Internode[/b]. Fork Une mystèrieuse technologie qui t'amène sur l'[b]Internode[/b] Fourche
89 FORK_DESC_TEXT Use it to [b]harvest mature plants[/b]. Utilise-la pour [b]récolter les plantes mature[/b].
90 DETECTOR Detector Détecteur
91 DETECTOR_DESC_TEXT Indicate [b]near signals[/b]. Indique les [b]signaux proches[/b]
92 DETECT_USE_TEXT Search near signals Rechercher les signaux proches
93 SHIP_TELEPORT Ship Portal Portail vers le vaisseau
94 SHIP_TELEPORT_DESC_TEXT A mysterious technology that get you to the [b]Internode[/b]. Une mystèrieuse technologie qui t'amène sur l'[b]Internode[/b]
95 SHIP_TELEPORT_USE_TEXT Teleport on the ship Téléportation sur le vaisseau
96 HARVEST Harvest Récolter
97 KNIFE Knife Couteau