30 lines
820 B
GDScript
30 lines
820 B
GDScript
extends PlantMutation
|
|
class_name QuickMutation
|
|
|
|
func get_icon() -> Texture:
|
|
return preload("res://common/icons/chevrons-up.svg")
|
|
|
|
func get_base_rarity() -> int:
|
|
return 0
|
|
|
|
func get_mutation_id() -> String:
|
|
return "QUICK"
|
|
|
|
func get_mutation_name() -> String:
|
|
return tr("QUICK")
|
|
|
|
func get_mutation_description() -> String:
|
|
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:
|
|
return score + level
|
|
|
|
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())
|