1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-04-20 04:20:19 +02:00

add particles to replace defaults

This commit is contained in:
tenplus1 2025-04-09 15:11:47 +01:00
parent 99f4fc1768
commit 01a60d9a55
5 changed files with 16 additions and 13 deletions

26
api.lua
View File

@ -18,7 +18,7 @@ end
-- global table -- global table
mobs = { mobs = {
mod = "redo", version = "20250408", mod = "redo", version = "20250409",
spawning_mobs = {}, translate = S, spawning_mobs = {}, translate = S,
node_snow = has(minetest.registered_aliases["mapgen_snow"]) node_snow = has(minetest.registered_aliases["mapgen_snow"])
or has("mcl_core:snow") or has("default:snow") or "air", or has("mcl_core:snow") or has("default:snow") or "air",
@ -801,7 +801,7 @@ function mob_class:check_for_death(cmi_cause)
remove_mob(self, true) remove_mob(self, true)
effect(pos, 20, "tnt_smoke.png") effect(pos, 20, "mobs_tnt_smoke.png")
end end
return true return true
@ -919,7 +919,7 @@ function mob_class:do_env_damage()
self.health = self.health - self.water_damage self.health = self.health - self.water_damage
effect(py, 5, "bubble.png", nil, nil, 1, nil) effect(py, 5, "mobs_bubble_particle.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 return true end pos = pos, node = self.standing_in}) then return true end
@ -930,7 +930,7 @@ function mob_class:do_env_damage()
self.health = self.health - self.lava_damage self.health = self.health - self.lava_damage
effect(py, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true) effect(py, 15, "mobs_fire_particle.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 return true end node = self.standing_in, hot = true}) then return true end
@ -941,7 +941,7 @@ function mob_class:do_env_damage()
self.health = self.health - self.fire_damage self.health = self.health - self.fire_damage
effect(py, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true) effect(py, 15, "mobs_fire_particle.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 return true end node = self.standing_in, hot = true}) then return true end
@ -963,7 +963,7 @@ function mob_class:do_env_damage()
self.health = self.health - damage self.health = self.health - damage
if damage > 0 then effect(py, 5, "tnt_smoke.png") end if damage > 0 then effect(py, 5, "mobs_tnt_smoke.png") end
if self:check_for_death({type = "environment", if self:check_for_death({type = "environment",
pos = pos, node = self.standing_in}) then return true end pos = pos, node = self.standing_in}) then return true end
@ -974,7 +974,7 @@ function mob_class:do_env_damage()
self.health = self.health - self.air_damage self.health = self.health - self.air_damage
effect(py, 3, "bubble.png", 1, 1, 1, 0.2) effect(py, 3, "mobs_bubble_particle.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 return true end pos = pos, node = self.standing_in}) then return true end
@ -997,7 +997,7 @@ function mob_class:do_env_damage()
self.health = self.health - self.light_damage self.health = self.health - self.light_damage
effect(py, 5, "tnt_smoke.png") effect(py, 5, "mobs_tnt_smoke.png")
if self:check_for_death({type = "light"}) then return true end if self:check_for_death({type = "light"}) then return true end
end end
@ -2456,7 +2456,7 @@ function mob_class:falling(pos)
self.health = self.health - floor(damage) self.health = self.health - floor(damage)
effect(pos, 5, "tnt_smoke.png", 1, 2, 2, nil) effect(pos, 5, "mobs_tnt_smoke.png", 1, 2, 2, nil)
if self:check_for_death({type = "fall"}) then return true end if self:check_for_death({type = "fall"}) then return true end
end end
@ -3006,7 +3006,7 @@ function mob_class:mob_expire(pos, dtime)
-- minetest.log("action", "lifetimer expired, removed " .. self.name) -- minetest.log("action", "lifetimer expired, removed " .. self.name)
effect(pos, 15, "tnt_smoke.png", 2, 4, 2, 0) effect(pos, 15, "mobs_tnt_smoke.png", 2, 4, 2, 0)
remove_mob(self, true) ; return true remove_mob(self, true) ; return true
end end
@ -3474,7 +3474,7 @@ function mobs:add_mob(pos, def)
--print("[mobs] entity not found " .. def.name) --print("[mobs] entity not found " .. def.name)
return false return false
else else
effect(pos, 15, "tnt_smoke.png", 1, 2, 2, 15, 5) effect(pos, 15, "mobs_tnt_smoke.png", 1, 2, 2, 15, 5)
end end
-- use new texture if found -- use new texture if found
@ -3938,7 +3938,7 @@ end
function mobs:boom(self, pos, node_damage_radius, entity_radius, texture) function mobs:boom(self, pos, node_damage_radius, entity_radius, texture)
texture = texture or "tnt_smoke.png" texture = texture or "mobs_tnt_smoke.png"
if mobs_griefing and minetest.get_modpath("tnt") and tnt and tnt.boom if mobs_griefing and minetest.get_modpath("tnt") and tnt and tnt.boom
and not minetest.is_protected(pos, "") then and not minetest.is_protected(pos, "") then
@ -4441,7 +4441,7 @@ end
-- admin command to remove untamed mobs around players -- admin command to remove untamed mobs around players
minetest.register_chatcommand("clear_mobs", { minetest.register_chatcommand("clear_mobs", {
params = "<text>", params = "",
description = "Remove untamed mobs from around players.", description = "Remove untamed mobs from around players.",
privs = {server = true}, privs = {server = true},

View File

@ -20,6 +20,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
Textures borrowed from minetest_game (CC BY-SA 3.0):
mobs_tnt_smoke.png
mobs_bubble_particle.png
Textures under CC0 license by TenPlus1 Textures under CC0 license by TenPlus1

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

View File

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 202 B