dynamic autogen entries

This commit is contained in:
infinitefusion
2024-12-25 14:13:03 -05:00
parent 0a59474542
commit 479cfd07fd
5 changed files with 42 additions and 25 deletions

View File

@@ -297,6 +297,27 @@ module GameData
return split_and_combine_text(body_entry, head_entry, ".")
end
def get_random_dex_entry()
begin
file_path = Settings::POKEDEX_ENTRIES_PATH
json_data = File.read(file_path)
all_body_entries = HTTPLite::JSON.parse(json_data)
body_entry = all_body_entries[@body_pokemon.id_number.to_s].sample
head_entry = all_body_entries[@head_pokemon.id_number.to_s].sample
rescue
@body_pokemon.real_pokedex_entry.gsub(@body_pokemon.real_name, @real_name)
head_entry = @head_pokemon.real_pokedex_entry.gsub(@head_pokemon.real_name, @real_name)
end
body_entry = clean_json_string(body_entry).gsub(@body_pokemon.real_name, @real_name)
head_entry = clean_json_string(head_entry).gsub(@head_pokemon.real_name, @real_name)
echoln body_entry
echoln head_entry
return split_and_combine_text(body_entry, head_entry, ".")
end
def calculate_egg_groups
body_egg_groups = @body_pokemon.egg_groups
head_egg_groups = @head_pokemon.egg_groups
@@ -343,7 +364,7 @@ module GameData
beginningText = beginingText_split[0]
endText = endText_split[1] && endText_split[1] != "" ? endText_split[1] : endText_split[0]
return beginningText + separator + endText
return beginningText + separator + " " + endText
end
def calculate_fused_stats(dominantStat, otherStat)