new mutations wip
This commit is contained in:
27
entities/plants/scripts/plant_mutation/ermit_mutation.gd
Normal file
27
entities/plants/scripts/plant_mutation/ermit_mutation.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends PlantMutation
|
||||
class_name ErmitMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/alert-triangle.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "ERMIT"
|
||||
|
||||
func get_mutation_name() -> String:
|
||||
return tr("ERMIT")
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("ERMIT_EFFECT_TEXT").format(
|
||||
{
|
||||
"score_increase": get_score_increase(),
|
||||
}
|
||||
)
|
||||
|
||||
func has_score(plant_data: PlantData) -> bool:
|
||||
return false if plant_data.nearby_plants.size() > 0 else true
|
||||
|
||||
func mutate_score(plant_data: PlantData, score: int) -> int:
|
||||
return score + get_score_increase() if plant_data.nearby_plants.size() == 0 else 0
|
||||
|
||||
func get_score_increase():
|
||||
return 2 * level
|
||||
Reference in New Issue
Block a user