diff options
| author | Giuseppe Gadola <giusgadola@gmail.com> | 2023-03-05 17:14:15 +0100 |
|---|---|---|
| committer | Giuseppe Gadola <giusgadola@gmail.com> | 2023-03-06 20:47:10 +0100 |
| commit | de78f45c6e21393564a80d6190a9ce661926ca56 (patch) | |
| tree | 2f9661b84ef71d1246c8343772e86343da7614b4 /lua/pets/commands.lua | |
| parent | feat(pets): spawn pets at random columns instead of left (diff) | |
feat(pets): new pet: slime
Diffstat (limited to 'lua/pets/commands.lua')
| -rw-r--r-- | lua/pets/commands.lua | 9 |
1 files changed, 7 insertions, 2 deletions
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) |