mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
6.4 update (minus sprites)
This commit is contained in:
36
Data/Scripts/052_AddOns/TrainerGeneratorUtils.rb
Normal file
36
Data/Scripts/052_AddOns/TrainerGeneratorUtils.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
def pick_trainer_sprite(spriter_name)
|
||||
possible_types = "abcd"
|
||||
trainer_type_index = select_number_from_seed(spriter_name,0,3)
|
||||
path = _INTL("Graphics/Trainers/trainer116{1}",possible_types[trainer_type_index].to_s)
|
||||
return path
|
||||
end
|
||||
|
||||
def select_number_from_seed(seed, min_value, max_value)
|
||||
hash = 137
|
||||
seed.each_byte do |byte|
|
||||
hash = ((hash << 5) + hash) + byte
|
||||
end
|
||||
srand(hash)
|
||||
selected_number = rand(min_value..max_value)
|
||||
selected_number
|
||||
end
|
||||
|
||||
def pick_spriter_losing_dialog(spriter_name)
|
||||
possible_dialogs = [
|
||||
"Oh... I lost...",
|
||||
"I did my best!",
|
||||
"You're too strong!",
|
||||
"You win!",
|
||||
"What a fight!",
|
||||
"That was fun!",
|
||||
"Ohh, that's too bad",
|
||||
"I should've sprited some stronger Pokémon!",
|
||||
"So much for that!",
|
||||
"Should've seen that coming!",
|
||||
"I can't believe it!",
|
||||
"What a surprise!"
|
||||
]
|
||||
index = select_number_from_seed(spriter_name,0,possible_dialogs.size-1)
|
||||
return possible_dialogs[index]
|
||||
end
|
||||
Reference in New Issue
Block a user