16 lines
453 B
GDScript
16 lines
453 B
GDScript
extends PlantEffect
|
|
class_name ProduceSeedsEffect
|
|
|
|
@export_file var produce_types_path : Array[String] = []
|
|
@export var produce_number : Array[int] = [1]
|
|
|
|
func effect(plant):
|
|
for _i in range(produce_number.pick_random()):
|
|
if len(produce_types_path):
|
|
var seed_plant_type = load(produce_types_path.pick_random())
|
|
plant.planet.drop_item(
|
|
Seed.new(seed_plant_type),
|
|
plant.global_position,
|
|
plant.HARVESTED_SEED_DISPLACEMENT_FACTOR,
|
|
)
|