37 lines
985 B
GDScript
37 lines
985 B
GDScript
extends PlantMutation
|
|
class_name QuickMutation
|
|
|
|
func get_icon() -> Texture:
|
|
return preload("res://common/icons/hourglass-empty.svg")
|
|
|
|
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").format(
|
|
{
|
|
"score_increase": get_score_increase(),
|
|
"lifetime_decrease": get_lifetime_change(),
|
|
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
|
|
"lifetime_icon": Text.bbcode_icon(Plant.LIFETIME_ICON)
|
|
}
|
|
)
|
|
|
|
func mutate_score(plant_data: PlantData, score: int) -> int:
|
|
if not plant_data.is_mature():
|
|
return score
|
|
|
|
return score + get_score_increase()
|
|
|
|
func mutate_lifetime(_plant_data: PlantData, lifetime: int) -> int:
|
|
return max(1, lifetime+get_lifetime_change())
|
|
|
|
func get_score_increase() -> int:
|
|
return level * 2
|
|
|
|
func get_lifetime_change() -> int:
|
|
return -3
|