mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-23 02:20:30 +02:00
Compare commits
3 Commits
c06d071220
...
c023ecc36f
Author | SHA1 | Date | |
---|---|---|---|
c023ecc36f | |||
9be934ec25 | |||
f6e16a5503 |
25
api.lua
25
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210407",
|
version = "20210411",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -1070,7 +1070,11 @@ function mob_class:do_env_damage()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- particle appears at random mob height
|
-- particle appears at random mob height
|
||||||
pos.y = pos.y + random(self.collisionbox[2], self.collisionbox[5])
|
local py = {
|
||||||
|
x = pos.x,
|
||||||
|
y = pos.y + random(self.collisionbox[2], self.collisionbox[5]),
|
||||||
|
z = pos.z
|
||||||
|
}
|
||||||
|
|
||||||
local nodef = minetest.registered_nodes[self.standing_in]
|
local nodef = minetest.registered_nodes[self.standing_in]
|
||||||
|
|
||||||
@ -1080,7 +1084,7 @@ function mob_class:do_env_damage()
|
|||||||
|
|
||||||
self.health = self.health - self.water_damage
|
self.health = self.health - self.water_damage
|
||||||
|
|
||||||
effect(pos, 5, "bubble.png", nil, nil, 1, nil)
|
effect(py, 5, "bubble.png", nil, nil, 1, nil)
|
||||||
|
|
||||||
if self:check_for_death({type = "environment",
|
if self:check_for_death({type = "environment",
|
||||||
pos = pos, node = self.standing_in}) then
|
pos = pos, node = self.standing_in}) then
|
||||||
@ -1093,7 +1097,7 @@ function mob_class:do_env_damage()
|
|||||||
|
|
||||||
self.health = self.health - self.lava_damage
|
self.health = self.health - self.lava_damage
|
||||||
|
|
||||||
effect(pos, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true)
|
effect(py, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true)
|
||||||
|
|
||||||
if self:check_for_death({type = "environment", pos = pos,
|
if self:check_for_death({type = "environment", pos = pos,
|
||||||
node = self.standing_in, hot = true}) then
|
node = self.standing_in, hot = true}) then
|
||||||
@ -1106,7 +1110,7 @@ function mob_class:do_env_damage()
|
|||||||
|
|
||||||
self.health = self.health - self.fire_damage
|
self.health = self.health - self.fire_damage
|
||||||
|
|
||||||
effect(pos, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true)
|
effect(py, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true)
|
||||||
|
|
||||||
if self:check_for_death({type = "environment", pos = pos,
|
if self:check_for_death({type = "environment", pos = pos,
|
||||||
node = self.standing_in, hot = true}) then
|
node = self.standing_in, hot = true}) then
|
||||||
@ -1115,11 +1119,11 @@ function mob_class:do_env_damage()
|
|||||||
|
|
||||||
-- damage_per_second node check (not fire and lava)
|
-- damage_per_second node check (not fire and lava)
|
||||||
elseif nodef.damage_per_second ~= 0
|
elseif nodef.damage_per_second ~= 0
|
||||||
and nodef.groups.lava == 0 and nodef.groups.fire == 0 then
|
and nodef.groups.lava == nil and nodef.groups.fire == nil then
|
||||||
|
|
||||||
self.health = self.health - nodef.damage_per_second
|
self.health = self.health - nodef.damage_per_second
|
||||||
|
|
||||||
effect(pos, 5, "tnt_smoke.png")
|
effect(py, 5, "tnt_smoke.png")
|
||||||
|
|
||||||
if self:check_for_death({type = "environment",
|
if self:check_for_death({type = "environment",
|
||||||
pos = pos, node = self.standing_in}) then
|
pos = pos, node = self.standing_in}) then
|
||||||
@ -1132,7 +1136,7 @@ function mob_class:do_env_damage()
|
|||||||
|
|
||||||
self.health = self.health - self.air_damage
|
self.health = self.health - self.air_damage
|
||||||
|
|
||||||
effect(pos, 3, "bubble.png", 1, 1, 1, 0.2)
|
effect(py, 3, "bubble.png", 1, 1, 1, 0.2)
|
||||||
|
|
||||||
if self:check_for_death({type = "environment",
|
if self:check_for_death({type = "environment",
|
||||||
pos = pos, node = self.standing_in}) then
|
pos = pos, node = self.standing_in}) then
|
||||||
@ -1150,7 +1154,7 @@ function mob_class:do_env_damage()
|
|||||||
|
|
||||||
self.health = self.health - self.light_damage
|
self.health = self.health - self.light_damage
|
||||||
|
|
||||||
effect(pos, 5, "tnt_smoke.png")
|
effect(py, 5, "tnt_smoke.png")
|
||||||
|
|
||||||
if self:check_for_death({type = "light"}) then
|
if self:check_for_death({type = "light"}) then
|
||||||
return true
|
return true
|
||||||
@ -4614,7 +4618,8 @@ function mobs:protect(self, clicker)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.protected then
|
if (self.protected and tool_name == "mobs:protector")
|
||||||
|
or (self.protected == 2 and tool_name == "mobs:protector2") then
|
||||||
minetest.chat_send_player(name, S("Already protected!"))
|
minetest.chat_send_player(name, S("Already protected!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
12
crafts.lua
12
crafts.lua
@ -10,9 +10,9 @@ minetest.register_craftitem("mobs:nametag", {
|
|||||||
|
|
||||||
if minetest.get_modpath("dye") and minetest.get_modpath("farming") then
|
if minetest.get_modpath("dye") and minetest.get_modpath("farming") then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
-- type = "shapeless",
|
||||||
output = "mobs:nametag",
|
output = "mobs:nametag",
|
||||||
recipe = {"default:paper", "dye:black", "farming:string"}
|
recipe = {{"default:paper", "dye:black", "farming:string"}}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -362,10 +362,10 @@ minetest.register_node("mobs:meatblock", {
|
|||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "mobs:meatblock",
|
output = "mobs:meatblock",
|
||||||
type = "shapeless",
|
-- type = "shapeless",
|
||||||
recipe = {
|
recipe = {
|
||||||
"group:food_meat", "group:food_meat", "group:food_meat",
|
{"group:food_meat", "group:food_meat", "group:food_meat"},
|
||||||
"group:food_meat", "group:food_meat", "group:food_meat",
|
{"group:food_meat", "group:food_meat", "group:food_meat"},
|
||||||
"group:food_meat", "group:food_meat", "group:food_meat"
|
{"group:food_meat", "group:food_meat", "group:food_meat"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user