From de78f45c6e21393564a80d6190a9ce661926ca56 Mon Sep 17 00:00:00 2001 From: Giuseppe Gadola Date: Sun, 5 Mar 2023 17:14:15 +0100 Subject: feat(pets): new pet: slime --- lua/pets/commands.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lua/pets/commands.lua') diff --git a/lua/pets/commands.lua b/lua/pets/commands.lua index da4490d..a240fc0 100644 --- a/lua/pets/commands.lua +++ b/lua/pets/commands.lua @@ -10,8 +10,13 @@ vim.api.nvim_create_user_command("PetsNew", function(input) end if pets.options.random then - local styles = utils.available_pets["dog"] - pet, style = "dog", styles[math.random(#styles)] + local pet_types = {} + for k in pairs(utils.available_pets) do + table.insert(pet_types, k) + end + pet = pet_types[math.random(#pet_types)] + local styles = utils.available_pets[pet] + style = styles[math.random(#styles)] end pets.create_pet(input.args, pet, style) -- cgit v1.3-2-g11bf