31 lines
1.1 KiB
GDScript
31 lines
1.1 KiB
GDScript
@tool
|
|
extends Node
|
|
|
|
@export_tool_button("Test names", "Callable") var update_action = func(): print_random_names()
|
|
@export_tool_button("Test small mutate one name", "Callable") var test_small_mutation = func(): print_random_small_mutated_name()
|
|
@export_tool_button("Test big mutate one name", "Callable") var test_big_mutation = func(): print_random_big_mutated_name()
|
|
|
|
func _ready() -> void:
|
|
print_random_names()
|
|
|
|
func print_random_names(number: int = 10) -> void:
|
|
print("---------")
|
|
for i in range(number):
|
|
print(Random.generate_random_plant_name())
|
|
|
|
func print_random_small_mutated_name(n_mutations: int = 5) -> void:
|
|
print("---------")
|
|
var base := Random.generate_random_plant_name()
|
|
print("Base: ", base)
|
|
for i in range(n_mutations):
|
|
base = Random.small_mutate_plant_name(base)
|
|
print(i, ": ", base)
|
|
|
|
func print_random_big_mutated_name(n_mutations: int = 5) -> void:
|
|
print("---------")
|
|
var base := Random.generate_random_plant_name()
|
|
print("Base: ", base)
|
|
for i in range(n_mutations):
|
|
base = Random.big_mutate_plant_name(base)
|
|
print(i + 1, ": ", base)
|