* Equilibrage de la difficulté (suite) * Correction du timing des dialogues de Demeter * Dev de la base astra (avec les logs) * Fix de bug de duplication d'objets * Fix de la mutation ancien * Ajout d'une mention de la propagation des mutations dans le tuto
35 lines
949 B
GDScript
35 lines
949 B
GDScript
@tool
|
|
extends PlantMutation
|
|
class_name AncientMutation
|
|
|
|
const DEFAULT_DAY_FACTOR = 3
|
|
|
|
func get_icon() -> Texture:
|
|
return preload("res://common/icons/wood.svg")
|
|
|
|
func get_mutation_id() -> String:
|
|
return "ANCIENT"
|
|
|
|
func get_mutation_name() -> String:
|
|
return tr("ANCIENT")
|
|
|
|
func get_mutation_description() -> String:
|
|
return tr("ANCIENT_EFFECT_TEXT").format(
|
|
{
|
|
"score_increase": get_score_increase(),
|
|
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
|
|
"day_factor": get_day_factor(),
|
|
"duration_icon": Text.bbcode_icon(Plant.DURATION_ICON),
|
|
}
|
|
)
|
|
|
|
func get_day_factor():
|
|
return max(1, DEFAULT_DAY_FACTOR - level)
|
|
|
|
func get_score_increase():
|
|
return max(1, level - DEFAULT_DAY_FACTOR + 2)
|
|
|
|
func mutate_score(data : PlantData, score) -> int:
|
|
if data.get_state() != PlantData.State.MATURE:
|
|
return score
|
|
return score + floori(data.day / get_day_factor()) |