new mutations + plant part data structure simplified
This commit is contained in:
23
entities/plants/scripts/plant_mutation/humide_mutation.gd
Normal file
23
entities/plants/scripts/plant_mutation/humide_mutation.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
extends PlantMutation
|
||||
class_name HumideMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/shield.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "HUMIDE"
|
||||
|
||||
func get_mutation_name() -> String:
|
||||
return tr("HUMIDE")
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("HUMIDE_EFFECT_TEXT").format({
|
||||
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
|
||||
"score_multiplier": get_score_multiplier() + 1.,
|
||||
})
|
||||
|
||||
func mutate_score_multiplier(_plant_data: PlantData, multiplier: float) -> float:
|
||||
return multiplier + (get_score_multiplier() if GameInfo.game_data.current_region_data.meteo_type == Meteo.Type.RAINY else 0.0)
|
||||
|
||||
func get_score_multiplier()->float:
|
||||
return 0.5 * level
|
||||
@@ -0,0 +1 @@
|
||||
uid://beualsis6xc8a
|
||||
22
entities/plants/scripts/plant_mutation/rhizome_mutation.gd
Normal file
22
entities/plants/scripts/plant_mutation/rhizome_mutation.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends PlantMutation
|
||||
class_name RhizomeMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/alert-triangle.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "RHIZOME"
|
||||
|
||||
func get_mutation_name() -> String:
|
||||
return tr("RHIZOME")
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("RHIZOME_EFFECT_TEXT").format({
|
||||
"digging_radius": get_digging_radius()
|
||||
})
|
||||
|
||||
func _start_maturation_effect(plant: Plant):
|
||||
plant.region.dig_hole(plant.global_position, get_digging_radius())
|
||||
|
||||
func get_digging_radius() -> int:
|
||||
return level
|
||||
@@ -0,0 +1 @@
|
||||
uid://k2qkq0rscbrc
|
||||
Reference in New Issue
Block a user