new mutations wip
This commit is contained in:
25
entities/plants/scripts/plant_mutation/cleaning_mutation.gd
Normal file
25
entities/plants/scripts/plant_mutation/cleaning_mutation.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
extends PlantMutation
|
||||
class_name CleaningMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/alert-triangle.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "CLEANING"
|
||||
|
||||
func get_mutation_name() -> String:
|
||||
return tr("CLEANING")
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("CLEANING_EFFECT_TEXT").format({
|
||||
"purification_radius": get_purification_radius()
|
||||
})
|
||||
|
||||
func _start_dead_effect(plant: Plant):
|
||||
plant.region.decontaminate(Math.get_tiles_in_circle(
|
||||
plant.global_position,
|
||||
get_purification_radius() * (Region.TILE_SIZE + Region.TILE_SIZE / 2.)
|
||||
))
|
||||
|
||||
func get_purification_radius() -> int:
|
||||
return level + 1 # one more than purification
|
||||
Reference in New Issue
Block a user