* ajout d'un fondu de musique au changement de phase * résolution de bugs en tout genre
29 lines
841 B
GDScript
29 lines
841 B
GDScript
extends PlantMutation
|
|
class_name ElitistMutation
|
|
|
|
func get_icon() -> Texture:
|
|
return preload("res://common/icons/copy.svg")
|
|
|
|
func get_base_rarity() -> int:
|
|
return 0
|
|
|
|
func get_mutation_name() -> String:
|
|
return tr("ELITIST")
|
|
|
|
func get_mutation_description() -> String:
|
|
return tr("ELITIST_EFFECT_TEXT_LEVEL_%d") % level
|
|
|
|
func mutate_score(plant_state : Plant.State, plant : Plant, score) -> int:
|
|
if plant.influence_zone == null:
|
|
return score
|
|
if plant_state != Plant.State.MATURE:
|
|
return score
|
|
var plant_count = 0
|
|
for area in plant.influence_zone.get_overlapping_areas():
|
|
if area is Plant and area != plant and area.plant_type.name == plant.plant_type.name:
|
|
plant_count += 1
|
|
|
|
if plant_count == 0:
|
|
return 0
|
|
else :
|
|
return score + level * plant_count |