diff --git a/README.md b/README.md index 5f1fb14..d0bb794 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,3 @@ Cute kawaii mobs for Minetest. There are in a separate github repository: [Petz RAW](https://github.com/runsy/petz_raw) - - diff --git a/petz/api/api_init_prop.lua b/petz/api/api_init_prop.lua index ca2ecbd..2363085 100644 --- a/petz/api/api_init_prop.lua +++ b/petz/api/api_init_prop.lua @@ -261,6 +261,19 @@ function petz.set_initial_properties(self, staticdata, dtime_s) --2. ALREADY EXISTING MOBS -- elseif not captured_mob then + --Check if the petz was removed from the petz list in the settings + local remove_petz = true + for key, value in pairs(petz.settings["petz_list"]) do + if value == self.type then + minetest.chat_send_all(value) + remove_petz = false + break + end + end + if remove_petz then + self.object:remove() + return + end petz.load_vars(self) --Load memory variables -- --3. CAPTURED MOBS diff --git a/petz/init.lua b/petz/init.lua index 4dc663a..298036c 100644 --- a/petz/init.lua +++ b/petz/init.lua @@ -42,6 +42,22 @@ petz.file_exists = function(name) end end +if petz.settings["remove_list"] then + for i = 1, #petz.settings["remove_list"] do + local file_name = modpath .. "/petz/"..petz.settings["remove_list"][i].."_mobkit"..".lua" + if petz.file_exists(file_name) then + assert(loadfile(file_name))(S) + end + --Override the petz_list + for j = 1, #petz.settings["petz_list"] do --load all the petz.lua files + if petz.settings["remove_list"][i] == petz.settings["petz_list"][j] then + table.remove(petz.settings["petz_list"], j) + --mokapi.remove_table_by_key(petz.settings["petz_list"], j) + end + end + end +end + for i = 1, #petz.settings["petz_list"] do --load all the petz.lua files local file_name = modpath .. "/petz/"..petz.settings["petz_list"][i].."_mobkit"..".lua" if petz.file_exists(file_name) then diff --git a/petz/models/petz_wagon.b3d b/petz/models/petz_wagon.b3d index d5559ea..f795ecd 100644 Binary files a/petz/models/petz_wagon.b3d and b/petz/models/petz_wagon.b3d differ diff --git a/petz/petz.conf b/petz/petz.conf index 522ac76..fed7117 100644 --- a/petz/petz.conf +++ b/petz/petz.conf @@ -3,6 +3,10 @@ petz_list = kitty,puppy,ducky,lamb,lion,calf,panda,grizzly,pony,parrot,chicken,piggy,wolf,elephant,elephant_female,pigeon,moth,camel,clownfish,bat,silkworm,chimp,hamster,dolphin,tropicalfish,beaver,turtle,frog,toucan,bee,queen_bee,mr_pumpkin,foxy,penguin,polar_bear,santa_killer,werewolf,tarantula,butterfly,rat,goat,squirrel,leopard,snow_leopard,ant,warrior_ant,queen_ant,rooster,hen,bunny +#This list is to remove already existing entities in the game +##Note that overrides the petz_list +remove_list = + ##Tamagochi Mode (Take care of your pet: fed it...) tamagochi_mode = true ##check_time: default 2400 diff --git a/petz/settings.lua b/petz/settings.lua index 77f450b..77ffa4b 100644 --- a/petz/settings.lua +++ b/petz/settings.lua @@ -12,6 +12,12 @@ local settings_def = { default = "", }, { + name = "remove_list", + type = "string", + split = true, + default = "", + }, + { name = "disable_monsters", type = "boolean", default = false, @@ -441,7 +447,7 @@ for key, value in ipairs(settings_def) do value.default = '' end local str = user:get(value.name) or settings:get(value.name, value.default) - if value.split then + if str and value.split then str = string.split(str) end petz.settings[value.name] = str diff --git a/petz/textures/pet_wagon_chest.png b/petz/textures/pet_wagon_chest.png new file mode 100644 index 0000000..f50cab4 Binary files /dev/null and b/petz/textures/pet_wagon_chest.png differ diff --git a/petz/textures/petz_wagon.png b/petz/textures/petz_wagon.png index 3475f10..5d58d0b 100755 Binary files a/petz/textures/petz_wagon.png and b/petz/textures/petz_wagon.png differ