master
runs 2019-10-27 18:07:05 +01:00
parent 81080e292f
commit c24d0cc928
53 changed files with 384 additions and 147 deletions

View File

@ -15,10 +15,14 @@ petz.create_pet = function(placer, itemstack, pet_name, pos)
return ent
end
function petz:register_egg(pet_name, desc, inv_img, no_creative)
function petz:register_egg(pet_name, desc, inv_img, tamed)
local grp = {spawn_egg = 1}
local description = S("@1", desc)
if tamed then
description = description .." ("..S("Tamed")..")"
end
minetest.register_craftitem(pet_name .. "_set", { -- register new spawn egg containing mob information
description = S("@1 (", desc)..S("Tamed")..")",
description = description,
inventory_image = inv_img,
groups = {spawn_egg = 2},
stack_max = 1,

View File

@ -48,6 +48,7 @@ petz.on_die = function(self)
if self.tamed == true then
petz.remove_petz_list_by_owner(self) --remove this petz from the list of the player pets
end
mobkit.make_sound(self, 'die')
mobkit.hq_die(self)
end

View File

@ -12,18 +12,18 @@ petz.calculate_damage = function(tool_capabilities)
end
petz.kick_back= function(self, dir)
local hvel = vector.multiply(vector.normalize({x=dir.x,y=0,z=dir.z}),4)
self.object:set_velocity({x=hvel.x,y=2,z=hvel.z})
local hvel = vector.multiply(vector.normalize({x=dir.x, y=0, z=dir.z}), 4)
self.object:set_velocity({x=hvel.x, y=2, z=hvel.z})
end
petz.lookat=function(self, pos2)
local pos1=self.object:get_pos()
local vec = {x=pos1.x-pos2.x, y=pos1.y-pos2.y, z=pos1.z-pos2.z}
local yaw = math.atan(vec.z/vec.x)-math.pi/2
local pos1 = self.object:get_pos()
local vec = {x = pos1.x - pos2.x, y = pos1.y - pos2.y, z = pos1.z - pos2.z}
local yaw = math.atan(vec.z / vec.x) - math.pi / 2
if pos1.x >= pos2.x then
yaw = yaw+math.pi
yaw = yaw + math.pi
end
self.object:set_yaw(yaw+math.pi)
self.object:set_yaw(yaw + math.pi)
end
petz.afraid= function(self, pos)

View File

@ -64,6 +64,7 @@ Infertile=Estéril
It breeds with=Se cría con
It is pregnant=Está preñada
It likes=Le gusta
Jack-o'-lantern=Calabaza iluminada
Kitty=Gatito
Lasso=Lazo
Lamb=Cordero
@ -74,6 +75,7 @@ Mini Lamb Chop=Chuletilla de cordero
Milk Bucket=Balde de leche
more to create the bobbin.=más para crear la bobina.
Moth=Polilla
Mr Pumpkin=Señor Calabaza
Name=Nombre
Nest=Nido
No room in your inventory for the silk bobbin.=No hay sitio en tu inventario para la bobina de seda.

View File

@ -63,7 +63,8 @@ Hungry=Голоден
Infertile=Бесплодие
It breeds with=Он разводится с
It is pregnant=Беременна ли она?
It likes=Ему нравится...
It likes=Ему нравится...
Jack-o'-lantern=Jack-o'-lantern
Kitty=Котёнок
Lasso=Лассо
Lamb=Ягнёнок
@ -74,6 +75,7 @@ Mini Lamb Chop=Отбивная из ягненка
Milk Bucket=Ведро с молоком
more to create the bobbin.=больше для создания катушки.
Moth=Мотылёк.
Mr Pumpkin=Mr Pumpkin
Name=Имя
Nest=Гнездо
No room in your inventory for the silk bobbin.=В вашем инвентаре нет места для шелковой катушки.

View File

@ -15,7 +15,6 @@ function petz.bh_runaway_from_predator(self, pos)
local predator = mobkit.get_closest_entity(self, predators[i]) -- look for predator
if predator then
local predator_pos = predator:get_pos()
if petz.is_pos_nan(predator_pos) == true then return end
if predator and vector.distance(pos, predator_pos) <= self.view_range then
mobkit.hq_runfrom(self, 18, predator)
return true
@ -31,7 +30,6 @@ function petz.bh_start_follow(self, pos, player, prty)
if player then
local wielded_item_name = player:get_wielded_item():get_name()
local player_pos = player:get_pos()
if petz.is_pos_nan(player_pos) == true then return end
if wielded_item_name == self.follow and vector.distance(pos, player_pos) <= self.view_range then
self.status = mobkit.remember(self, "status", "follow")
mobkit.hq_follow(self, prty, player)
@ -81,8 +79,7 @@ end
function petz.herbivore_brain(self)
local pos = self.object:get_pos()
if petz.is_pos_nan(pos) == true then return end
local pos = self.object:get_pos()
local die = false
@ -159,7 +156,6 @@ function petz.herbivore_brain(self)
if self.tamed == false then --if no tamed
if player then
local player_pos = player:get_pos()
if petz.is_pos_nan(player_pos) == true then return end
local wielded_item_name = player:get_wielded_item():get_name()
if self.is_pet == false and self.follow ~= wielded_item_name and vector.distance(pos, player_pos) <= self.view_range then
mobkit.hq_runfrom(self, 14, player)
@ -314,13 +310,12 @@ function petz.predator_brain(self)
local prty = mobkit.get_queue_priority(self)
if prty < 20 and self.isinliquid then
mobkit.hq_liquid_recovery(self, 20)
if prty < 40 and self.isinliquid then
mobkit.hq_liquid_recovery(self, 40)
return
end
local pos = self.object:get_pos() --pos of the petz
if petz.is_pos_nan(pos) == true then return end
local player = mobkit.get_nearby_player(self) --get the player close
@ -365,10 +360,9 @@ function petz.predator_brain(self)
if player then
if (self.tamed == false) or (self.tamed == true and self.status == "guard" and player:get_player_name() ~= self.owner) then
local player_pos = player:get_pos()
if petz.is_pos_nan(player_pos) == true then return end
if vector.distance(pos, player_pos) <= self.view_range then -- if player close
if self.warn_attack == true then --attack player
mobkit.hq_warn(self, 10, player) -- try to repel them
mobkit.hq_hunt(self, 10, player) -- try to repel them
return
else
mobkit.hq_runfrom(self, 10, player) -- run away from player
@ -396,13 +390,20 @@ function petz.predator_brain(self)
end
function petz.bee_brain(self)
self.object:set_acceleration({x=0, y=0, z=0})
local behive_exists = petz.behive_exists(self)
local meta, honey_count, bee_count
if behive_exists then
meta, honey_count, bee_count = petz.get_behive_stats(self.behive)
end
if (self.hp <= 0) or (not(self.queen) and not(petz.behive_exists(self))) then
petz.on_die(self) -- Die Behaviour
return
elseif (petz.is_night() and not(self.queen)) then --all the bees sleep in their beehive
if petz.behive_exists(self) then
local meta, honey_count, bee_count = petz.get_behive_stats(self.behive)
if behive_exists then
bee_count = bee_count + 1
meta:set_int("bee_count", bee_count)
if self.pollen == true and (honey_count < petz.settings.max_honey_behive) then
@ -417,49 +418,54 @@ function petz.bee_brain(self)
mobkit.check_ground_suffocation(self)
if mobkit.timer(self, 1) then
if mobkit.timer(self, 1) then
local prty = mobkit.get_queue_priority(self)
if prty < 20 and self.isinliquid then
mobkit.hq_liquid_recovery(self, 20)
if prty < 40 and self.isinliquid then
mobkit.hq_liquid_recovery(self, 40)
return
end
local pos = self.object:get_pos()
if petz.is_pos_nan(pos) == true then return end
local player = mobkit.get_nearby_player(self)
local meta, honey_count, bee_count = petz.get_behive_stats(self.behive)
if prty < 30 then
petz.bh_env_damage(self, 30) --enviromental damage: lava, fire...
end
--search for flowers
if prty < 20 and not(self.queen) and not(self.pollen) and (honey_count < petz.settings.max_honey_behive) then
local view_range = self.view_range
local nearby_flowers = minetest.find_nodes_in_area(
{x = pos.x - view_range, y = pos.y - view_range, z = pos.z - view_range},
{x = pos.x + view_range, y = pos.y + view_range, z = pos.z + view_range},
{"group:flower"})
if #nearby_flowers >= 1 then
local tpos = nearby_flowers[1] --the first match
mobkit.hq_gotopollen(self, 20, tpos)
end
end
if prty < 20 and behive_exists then
if not(self.queen) and not(self.pollen) and (honey_count < petz.settings.max_honey_behive) then
local view_range = self.view_range
local nearby_flowers = minetest.find_nodes_in_area(
{x = pos.x - view_range, y = pos.y - view_range, z = pos.z - view_range},
{x = pos.x + view_range, y = pos.y + view_range, z = pos.z + view_range},
{"group:flower"})
if #nearby_flowers >= 1 then
local tpos = nearby_flowers[1] --the first match
mobkit.hq_gotopollen(self, 20, tpos)
end
end
end
--search for the bee behive when pollen
if prty < 18 and not(self.queen) and self.pollen == true and (honey_count < petz.settings.max_honey_behive) then
if vector.distance(pos, self.behive) <= self.view_range then
mobkit.hq_gotobehive(self, 18, pos)
if prty < 18 and behive_exists then
if not(self.queen) and self.pollen == true and (honey_count < petz.settings.max_honey_behive) then
if vector.distance(pos, self.behive) <= self.view_range then
mobkit.hq_gotobehive(self, 18, pos)
end
end
end
--stay close behive
if prty < 15 and not(self.queen) then
if math.abs(pos.x - self.behive.x) > self.view_range and math.abs(pos.z - self.behive.z) > self.view_range then
mobkit.hq_approach_behive(self, pos, 15)
if prty < 15 and behive_exists then
if not(self.queen) then
--minetest.chat_send_player("singleplayer", "testx")
if math.abs(pos.x - self.behive.x) > self.view_range and math.abs(pos.z - self.behive.z) > self.view_range then
mobkit.hq_approach_behive(self, pos, 15)
end
end
end
@ -475,7 +481,7 @@ function petz.bee_brain(self)
petz.random_mob_sound(self)
--Roam default
if mobkit.is_queue_empty_high(self) and self.status == "" then
if mobkit.is_queue_empty_high(self) and self.status == "" then
mobkit.hq_wanderfly(self, 0)
end
@ -489,7 +495,6 @@ end
function petz.aquatic_brain(self)
local pos = self.object:get_pos()
if petz.is_pos_nan(pos) == true then return end
-- Die Behaviour
@ -517,8 +522,7 @@ function petz.aquatic_brain(self)
if prty < 10 then
if player then
if (self.tamed == false) or (self.tamed == true and self.status == "guard" and player:get_player_name() ~= self.owner) then
local player_pos = player:get_pos()
if petz.is_pos_nan(player_pos) == true then return end
local player_pos = player:get_pos()
if vector.distance(pos, player_pos) <= self.view_range then -- if player close
if self.warn_attack == true then --attack player
mobkit.clear_queue_high(self) -- abandon whatever they've been doing
@ -558,7 +562,6 @@ end
function petz.semiaquatic_brain(self)
local pos = self.object:get_pos()
if petz.is_pos_nan(pos) == true then return end
-- Die Behaviour
@ -583,14 +586,13 @@ function petz.semiaquatic_brain(self)
if player then
if (self.tamed == false) or (self.tamed == true and self.status == "guard" and player:get_player_name() ~= self.owner) then
local player_pos = player:get_pos()
if petz.is_pos_nan(player_pos) == true then return end
if vector.distance(pos, player_pos) <= self.view_range then -- if player close
if self.warn_attack == true then --attack player
mobkit.clear_queue_high(self) -- abandon whatever they've been doing
if self.isinliquid then
mobkit.hq_aqua_attack(self, 10, puncher, 6) -- get revenge
else
mobkit.hq_warn(self, 10, player)
mobkit.hq_hunt(self, 10, player)
end
end
end
@ -638,7 +640,6 @@ end
petz.aquatic_behaviour = function(self)
if self.is_mammal == false then --if not mammal, air suffocation
local pos = self.object:get_pos()
if petz.is_pos_nan(pos) == true then return end
local pos_under = {x = pos.x, y = pos.y - 0.75, z = pos.z, }
--Check if the aquatic animal is on water
local node_under = minetest.get_node_or_nil(pos_under)
@ -649,3 +650,84 @@ petz.aquatic_behaviour = function(self)
end
end
end
--
--Monster Behaviour
--
function petz.monster_brain(self)
if self.hp <= 0 then -- Die Behaviour
petz.on_die(self)
return
end
mobkit.check_ground_suffocation(self)
if mobkit.timer(self, 1) then
local prty = mobkit.get_queue_priority(self)
if prty < 40 and self.isinliquid then
mobkit.hq_liquid_recovery(self, 40)
return
end
local pos = self.object:get_pos() --pos of the petz
local player = mobkit.get_nearby_player(self) --get the player close
if prty < 30 then
petz.bh_env_damage(self, 30) --enviromental damage: lava, fire...
end
-- hunt a prey
if prty < 12 then -- if not busy with anything important
if self.tamed == false then
local preys_list = petz.settings[self.type.."_preys"]
if preys_list then
local preys = string.split(preys_list, ',')
for i = 1, #preys do --loop thru all preys
--minetest.chat_send_player("singleplayer", "preys list="..preys[i])
--minetest.chat_send_player("singleplayer", "node name="..node.name)
local prey = mobkit.get_closest_entity(self, preys[i]) -- look for prey
if prey then
self.max_speed = 2.5
--minetest.chat_send_player("singleplayer", "got it")
mobkit.hq_hunt(self, 12, prey) -- and chase it
return
end
end
end
end
end
if prty < 10 then
if player then
if (self.tamed == false) or (self.tamed == true and self.status == "guard" and player:get_player_name() ~= self.owner) then
local player_pos = player:get_pos()
if vector.distance(pos, player_pos) <= self.view_range then -- if player close
self.max_speed = 2.5
mobkit.hq_hunt(self, 10, player)
return
end
end
end
end
--Replace nodes by others
if prty < 6 then
petz.bh_replace(self)
end
-- Default Random Sound
petz.random_mob_sound(self)
--Roam default
if mobkit.is_queue_empty_high(self) then
self.max_speed = 1.5
mobkit.hq_roam(self, 0)
end
end
end

View File

@ -129,12 +129,7 @@ function mobkit.lq_dumbfly(self, speed_factor)
local status = "ascend"
speed_factor = speed_factor or 1
local func = function(self)
timer = timer - self.dtime
if self.fly_velocity then
mobkit.set_velocity(self, self.fly_velocity)
else
mobkit.set_velocity(self, {x = 0.0, y = 0.0, z = 0.0})
end
timer = timer - self.dtime
if timer < 0 then
--minetest.chat_send_player("singleplayer", tostring(timer))
local velocity = self.object:getvelocity()
@ -161,7 +156,7 @@ function mobkit.lq_dumbfly(self, speed_factor)
end
else --check if water below, if yes ascend
local node_name = mobkit.node_name_in(self, "below")
if minetest.get_item_group(node_name, "water") > 1 then
if minetest.get_item_group(node_name, "water") >= 1 then
status = "ascend"
end
end
@ -207,6 +202,12 @@ function mobkit.lq_dumbfly(self, speed_factor)
mobkit.set_velocity(self, velocity)
self.fly_velocity = velocity --save the velocity to set in each step, not only each x seconds
return true
else
if self.fly_velocity then
mobkit.set_velocity(self, self.fly_velocity)
else
mobkit.set_velocity(self, {x = 0.0, y = 0.0, z = 0.0})
end
end
end
mobkit.queue_low(self,func)
@ -254,7 +255,7 @@ function mobkit.hq_alight(self, prty)
local node_name = mobkit.node_name_in(self, "below")
if node_name == "air" then
mobkit.lq_alight(self)
elseif minetest.get_item_group(node_name, "water") > 1 then
elseif minetest.get_item_group(node_name, "water") >= 1 then
mobkit.hq_wanderfly(self, 0)
return true
else
@ -327,19 +328,13 @@ end
---
---Bee Brain
---
function mobkit.hq_gotopollen(self, prty, tpos)
local func = function(self)
if self.pollen == true then
--mobkit.clear_queue_low(self)
--mobkit.clear_queue_high(self)
return true
end
if mobkit.node_name_in(self, "front") ~= "air" then
if mobkit.node_name_in(self, "top") == "air" then
mobkit.set_velocity(self, {x= 0, y= 1.0, z= 0})
else
return true
end
end
mobkit.animate(self, "fly")
mobkit.lq_search_flower(self, tpos)
end
@ -347,19 +342,17 @@ function mobkit.hq_gotopollen(self, prty, tpos)
end
function mobkit.lq_search_flower(self, tpos)
local func = function(self)
if mobkit.drive_to_pos(self, tpos, 1.5, 6.28, 0.3) then
local pos = self.object:get_pos()
local y_distance = tpos.y - pos.y
--minetest.chat_send_player("singleplayer", tostring(y_distance))
if math.abs(y_distance) > 1 then
mobkit.set_velocity(self, {x= 0, y= y_distance, z= 0})
else
self.pollen = true
petz.do_particles_effect(self.object, self.object:get_pos(), "pollen")
--minetest.chat_send_player("singleplayer", "test")
return true
end
local func = function(self)
local pos = self.object:get_pos()
local y_distance = tpos.y - pos.y
local abs_y_distance = math.abs(y_distance)
if (abs_y_distance > 1) and (abs_y_distance < self.view_range) then
mobkit.set_velocity(self, {x= 0.0, y= y_distance, z= 0.0})
end
if mobkit.drive_to_pos(self, tpos, 1.5, 6.28, 0.5) then
self.pollen = true
petz.do_particles_effect(self.object, self.object:get_pos(), "pollen")
return true
end
end
mobkit.queue_low(self, func)
@ -367,32 +360,30 @@ end
function mobkit.hq_gotobehive(self, prty, pos)
local func = function(self)
if self.pollen == false then
if self.pollen == false or not(self.behive) then
return true
end
mobkit.animate(self, "fly")
if mobkit.node_name_in(self, "front") ~= "air" then
if mobkit.node_name_in(self, "top") == "air" then
mobkit.set_velocity(self, {x= 0, y= 1.0, z= 0})
else
return true
end
end
mobkit.lq_search_behive(self)
end
mobkit.queue_high(self, func, prty)
end
function mobkit.lq_search_behive(self)
local func = function(self)
local tpos = self.behive
if mobkit.drive_to_pos(self, tpos, 1.5, 6.28, 0.3) then
local pos = self.object:get_pos()
local y_distance = tpos.y - pos.y
if math.abs(y_distance) > 1 then
mobkit.set_velocity(self, {x= 0, y= y_distance, z= 0})
return true
else
local func = function(self)
local tpos
if self.behive then
tpos = self.behive
else
return true
end
local pos = self.object:get_pos()
local y_distance = tpos.y - pos.y
local abs_y_distance = math.abs(y_distance)
if (abs_y_distance > 1) and (abs_y_distance < self.view_range) then
mobkit.set_velocity(self, {x= 0.0, y= y_distance, z= 0.0})
end
if mobkit.drive_to_pos(self, tpos, 1.5, 6.28, 1.01) then
if petz.behive_exists(self) then
self.object:remove()
local meta, honey_count, bee_count = petz.get_behive_stats(self.behive)
@ -403,8 +394,7 @@ function mobkit.lq_search_behive(self)
petz.set_infotext_behive(meta, honey_count, bee_count)
self.pollen = false
end
end
end
end
end
mobkit.queue_low(self, func)
end
@ -412,16 +402,10 @@ end
function mobkit.hq_approach_behive(self, pos, prty)
local func = function(self)
if math.abs(pos.x - self.behive.x) <= (self.view_range / 2) or math.abs(pos.z - self.behive.z) <= (self.view_range / 2) then
mobkit.clear_queue_low(self)
mobkit.clear_queue_high(self)
return true
end
if mobkit.node_name_in(self, "front") ~= "air" then
if mobkit.node_name_in(self, "top") == "air" then
mobkit.set_velocity(self, {x= 0, y= 1.0, z= 0})
return true
else
return true
end
end
mobkit.lq_approach_behive(self)
end
mobkit.queue_high(self, func, prty)
@ -429,8 +413,17 @@ end
function mobkit.lq_approach_behive(self)
local func = function(self)
local tpos = self.behive
if mobkit.drive_to_pos(self, tpos, 1.5, 6.28, (self.view_range / 2) ) then
local tpos
if self.behive then
tpos = self.behive
else
return true
end
local pos = self.object:get_pos()
local y_distance = tpos.y - pos.y
local abs_y_distance = math.abs(y_distance)
if mobkit.drive_to_pos(self, tpos, 1.5, 6.28, (self.view_range / 4) ) then
mobkit.clear_queue_high(self)
return true
end
end

View File

@ -6,18 +6,18 @@ function mobkit.lq_dumbfly(self, dest, speed_factor)
local func=function(self)
mobkit.animate(self, 'fly')
timer = timer - self.dtime
if timer < 0 then return true end
if timer < 0 then
return true
end
local pos = mobkit.get_stand_pos(self)
local y = self.object:get_velocity().y
if not(self.isonground) then
mobkit.animate(self, 'fly')
local dir = vector.normalize(vector.direction({x=pos.x,y=0,z=pos.z},
{x=dest.x,y=0,z=dest.z}))
dir = vector.multiply(dir,self.max_speed*speed_factor)
-- self.object:set_yaw(minetest.dir_to_yaw(dir))
mobkit.turn2yaw(self,minetest.dir_to_yaw(dir))
local dir = vector.normalize(vector.direction(
{x=pos.x, y=0, z=pos.z},
{x=dest.x, y=0, z=dest.z}))
dir = vector.multiply(dir, self.max_speed*speed_factor)
mobkit.turn2yaw(self, minetest.dir_to_yaw(dir))
dir.y = y
self.object:set_velocity(dir)
end

View File

@ -436,3 +436,39 @@ minetest.register_craft({
{"petz:honeycomb", "petz:honeycomb", "petz:honeycomb"},
}
})
--Halloween Update
minetest.register_node("petz:jack_o_lantern", {
description = S("Jack-o'-lantern"),
groups = { snappy=3, flammable=3, oddly_breakable_by_hand=2 },
sounds = default.node_sound_wood_defaults({
dig = { name = "default_dig_oddly_breakable_by_hand" },
dug = { name = "default_dig_choppy" }
}),
paramtype = "light",
paramtype2 = "facedir",
light_source = 11,
sunlight_propagates = true,
tiles = {
"petz_jackolantern_top.png", "petz_jackolantern_bottom.png",
"petz_jackolantern_right.png", "petz_jackolantern_left.png",
"petz_jackolantern_back.png", "petz_jackolantern_front.png"
},
})
if minetest.get_modpath("farming") ~= nil and farming.mod == "redo" then
minetest.register_craft({
type = "shapeless",
output = "petz:jack_o_lantern",
recipe = {"farming:pumpkin", "petz:beeswax_candle"},
})
end
if minetest.get_modpath("crops") ~= nil then
minetest.register_craft({
type = "shapeless",
output = "petz:jack_o_lantern",
recipe = {"crops:pumpkin", "petz:beeswax_candle"},
})
end

View File

@ -1,5 +1,5 @@
name = petz
description = Cute mobs for Minetest
depends = default, mobkit, stairs, dye, farming, vessels, wool
optional_depends = bonemeal, 3d_armor
optional_depends = bonemeal, 3d_armor, crops
version = 5.1

View File

@ -302,3 +302,9 @@ toucan_follow = default:apple
toucan_spawn_chance = 0.8
toucan_spawn_nodes = default:dirt_with_rainforest_litter
toucan_spawn_biome = default
##Mr Pumpkin Specific
mr_pumpkin_follow = farming:pumpkin
mr_pumpkin_spawn_chance = 0.1
mr_pumpkin_spawn_nodes = default:dirt_with_grass
mr_pumpkin_spawn_biome = default

View File

@ -83,4 +83,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:bat", S("Bat"), "petz_spawnegg_bat.png", false)
petz:register_egg("petz:bat", S("Bat"), "petz_spawnegg_bat.png", true)

View File

@ -83,4 +83,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:beaver", S("Beaver"), "petz_spawnegg_beaver.png", 0)
petz:register_egg("petz:beaver", S("Beaver"), "petz_spawnegg_beaver.png", true)

View File

@ -94,4 +94,4 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:calf", S("Calf"), "petz_spawnegg_calf.png", 0)
petz:register_egg("petz:calf", S("Calf"), "petz_spawnegg_calf.png", true)

View File

@ -111,4 +111,4 @@ minetest.register_entity("petz:"..pet_name, {
end,
})
petz:register_egg("petz:camel", S("Camel"), "petz_spawnegg_camel.png", 0)
petz:register_egg("petz:camel", S("Camel"), "petz_spawnegg_camel.png", true)

View File

@ -84,4 +84,4 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:chicken", S("Chicken"), "petz_spawnegg_chicken.png", 0)
petz:register_egg("petz:chicken", S("Chicken"), "petz_spawnegg_chicken.png", true)

View File

@ -81,4 +81,4 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:chimp", S("Chimp"), "petz_spawnegg_chimp.png", 0)
petz:register_egg("petz:chimp", S("Chimp"), "petz_spawnegg_chimp.png", true)

View File

@ -71,7 +71,7 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:clownfish", S("Clownfish"), "petz_spawnegg_clownfish.png", 0)
petz:register_egg("petz:clownfish", S("Clownfish"), "petz_spawnegg_clownfish.png", true)
minetest.register_entity("petz:clownfish_entity_sprite", {
visual = "sprite",

View File

@ -79,4 +79,4 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:dolphin", S("Dolphin"), "petz_spawnegg_dolphin.png", 0)
petz:register_egg("petz:dolphin", S("Dolphin"), "petz_spawnegg_dolphin.png", true)

View File

@ -85,4 +85,4 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:ducky", S("Ducky"), "petz_spawnegg_ducky.png", 0)
petz:register_egg("petz:ducky", S("Ducky"), "petz_spawnegg_ducky.png", true)

View File

@ -122,5 +122,5 @@ for i=1, 2 do
petz.on_step(self, dtime)
end,
})
petz:register_egg("petz:"..pet_name, S(description), "petz_spawnegg_"..pet_name..".png", 0)
petz:register_egg("petz:"..pet_name, S(description), "petz_spawnegg_"..pet_name..".png", true)
end

View File

@ -78,4 +78,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:frog", S("Frog"), "petz_spawnegg_frog.png", 0)
petz:register_egg("petz:frog", S("Frog"), "petz_spawnegg_frog.png", true)

View File

@ -85,4 +85,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:grizzly", S("Grizzly"), "petz_spawnegg_grizzly.png", 0)
petz:register_egg("petz:grizzly", S("Grizzly"), "petz_spawnegg_grizzly.png", true)

View File

@ -92,4 +92,4 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:hamster", S("Hamster"), "petz_spawnegg_hamster.png", 0)
petz:register_egg("petz:hamster", S("Hamster"), "petz_spawnegg_hamster.png", true)

View File

@ -77,5 +77,5 @@ minetest.register_entity("petz:"..pet_name, {
end,
})
petz:register_egg("petz:kitty", S("Kitty"), "petz_spawnegg_kitty.png", 0)
petz:register_egg("petz:kitty", S("Kitty"), "petz_spawnegg_kitty.png", true)

View File

@ -105,4 +105,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:lamb", S("Lamb"), "petz_spawnegg_lamb.png", false)
petz:register_egg("petz:lamb", S("Lamb"), "petz_spawnegg_lamb.png", true)

View File

@ -85,4 +85,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:lion", S("Lion"), "petz_spawnegg_lion.png", 0)
petz:register_egg("petz:lion", S("Lion"), "petz_spawnegg_lion.png", true)

View File

@ -87,4 +87,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:moth", S("Moth"), "petz_spawnegg_moth.png", false)
petz:register_egg("petz:moth", S("Moth"), "petz_spawnegg_moth.png", true)

View File

@ -0,0 +1,88 @@
--
--MR_PUMPKIN
--
local S = ...
local pet_name = "mr_pumpkin"
local scale_model = 1.0
petz.mr_pumpkin = {}
local mesh = 'character.b3d'
local textures = {"petz_mr_pumpkin.png"}
local collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}
minetest.register_entity("petz:"..pet_name,{
--Petz specifics
type = "mr_pumpkin",
init_tamagochi_timer = false,
is_pet = false,
is_monster = true,
is_boss = true,
has_affinity = false,
is_wild = true,
attack_player = true,
give_orders = false,
can_be_brushed = false,
capture_item = nil,
follow = petz.settings.mr_pumpkin_follow,
drops = {
{name = "petz:jack_o_lantern", chance = 3, min = 1, max = 1,},
},
rotate = petz.settings.rotate,
physical = true,
stepheight = 0.1, --EVIL!
collide_with_objects = true,
collisionbox = collisionbox,
visual = petz.settings.visual,
mesh = mesh,
textures = textures,
visual_size = {x=1.0*scale_model, y=1.0*scale_model},
static_save = true,
get_staticdata = mobkit.statfunc,
-- api props
springiness= 0,
buoyancy = 0.5, -- portion of hitbox submerged
max_speed = 1.5,
jump_height = 1.5,
view_range = 20,
lung_capacity = 10, -- seconds
max_hp = 40,
attack={range=0.5, damage_groups={fleshy=9}},
animation = {
walk={range={x=168, y=187}, speed=30, loop=true},
stand={
{range={x=0, y=79}, speed=5, loop=true},
},
sit = {range={x=81, y=160}, speed=5, loop=false},
},
sounds = {
misc = "petz_monster_misc",
attack = "petz_zombie_noise",
laugh = "petz_monster_laugh",
die = "petz_monster_die",
},
--punch_start = 83, stand4_end = 95,
brainfunc = petz.monster_brain,
on_activate = function(self, staticdata, dtime_s) --on_activate, required
mobkit.actfunc(self, staticdata, dtime_s)
petz.set_initial_properties(self, staticdata, dtime_s)
end,
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
petz.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
end,
on_rightclick = function(self, clicker)
petz.on_rightclick(self, clicker)
end,
on_step = function(self, dtime)
mobkit.stepfunc(self, dtime) -- required
petz.on_step(self, dtime)
end,
})
petz:register_egg("petz:mr_pumpkin", S("Mr Pumpkin"), "petz_spawnegg_mr_pumpkin.png", false)

View File

@ -93,4 +93,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:panda", S("Panda"), "petz_spawnegg_panda.png", false)
petz:register_egg("petz:panda", S("Panda"), "petz_spawnegg_panda.png", true)

View File

@ -84,4 +84,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:parrot", S("Parrot"), "petz_spawnegg_parrot.png", false)
petz:register_egg("petz:parrot", S("Parrot"), "petz_spawnegg_parrot.png", true)

View File

@ -85,5 +85,5 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:pigeon", S("Pigeon"), "petz_spawnegg_pigeon.png", false)
petz:register_egg("petz:pigeon", S("Pigeon"), "petz_spawnegg_pigeon.png", true)

View File

@ -82,4 +82,4 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:piggy", S("Piggy"), "petz_spawnegg_piggy.png", 0)
petz:register_egg("petz:piggy", S("Piggy"), "petz_spawnegg_piggy.png", true)

View File

@ -111,4 +111,4 @@ minetest.register_entity("petz:"..pet_name, {
end,
})
petz:register_egg("petz:pony", S("Pony"), "petz_spawnegg_pony.png", 0)
petz:register_egg("petz:pony", S("Pony"), "petz_spawnegg_pony.png", true)

View File

@ -116,4 +116,4 @@ minetest.register_entity("petz:"..pet_name, {
end,
})
petz:register_egg("petz:puppy", S("Puppy"), "petz_spawnegg_puppy.png", 0)
petz:register_egg("petz:puppy", S("Puppy"), "petz_spawnegg_puppy.png", true)

View File

@ -81,4 +81,4 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:silkworm", S("Silkworm"), "petz_spawnegg_silkworm.png", 0)
petz:register_egg("petz:silkworm", S("Silkworm"), "petz_spawnegg_silkworm.png", true)

View File

@ -83,4 +83,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:toucan", S("Toucan"), "petz_spawnegg_toucan.png", false)
petz:register_egg("petz:toucan", S("Toucan"), "petz_spawnegg_toucan.png", true)

View File

@ -71,7 +71,7 @@ minetest.register_entity("petz:"..pet_name,{
end,
})
petz:register_egg("petz:tropicalfish", S("Tropicalfish"), "petz_spawnegg_tropicalfish.png", 0)
petz:register_egg("petz:tropicalfish", S("Tropicalfish"), "petz_spawnegg_tropicalfish.png", true)
minetest.register_entity("petz:tropicalfish_entity_sprite", {
visual = "sprite",

View File

@ -76,4 +76,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:turtle", S("Turtle"), "petz_spawnegg_turtle.png", 0)
petz:register_egg("petz:turtle", S("Turtle"), "petz_spawnegg_turtle.png", true)

View File

@ -82,4 +82,4 @@ minetest.register_entity("petz:"..pet_name,{
})
petz:register_egg("petz:wolf", S("Wolf"), "petz_spawnegg_wolf.png", 0)
petz:register_egg("petz:wolf", S("Wolf"), "petz_spawnegg_wolf.png", true)

View File

@ -208,3 +208,26 @@ Author: Zapsplat
https://www.zapsplat.com/music/close-humming-of-a-bee-fly-up-close-land/
License: https://www.zapsplat.com/license-type/standard-license/
--------------------------------------------
filenames: petz_monster_sound.ogg
Author: Alexander
http://www.orangefreesounds.com/monster-sound/
License: The sound effects. is permitted for non-commercial use
under license “Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)”
--------------------------------------------
filenames: petz_monster_laugh.ogg
Author: Alexander
http://www.orangefreesounds.com/monster-laugh/
The sound effect is permitted for non-commercial use
under license “Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)”
--------------------------------------------
filenames: petz_zombie_noise.ogg
Author: Alexander
http://www.orangefreesounds.com/zombie-noise/
License: The sound effect is permitted for commercial use
under license Creative Commons Attribution 4.0 International License
--------------------------------------------
filenames: petz_monster_die.ogg
Author: Alexander
http://www.orangefreesounds.com/monster-dying/
License: The sound effect is permitted for non-commercial use
under license “Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)”

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB