Move death particle to rp_textures
This commit is contained in:
parent
54760539ff
commit
06cee828c1
@ -1,5 +1,7 @@
|
|||||||
local S = minetest.get_translator("rp_mobs")
|
local S = minetest.get_translator("rp_mobs")
|
||||||
|
|
||||||
|
local mod_textures = minetest.get_modpath("rp_textures") ~= nil
|
||||||
|
|
||||||
-- If true, will write the task queues of mobs as their nametag
|
-- If true, will write the task queues of mobs as their nametag
|
||||||
local TASK_DEBUG = false
|
local TASK_DEBUG = false
|
||||||
local STATE_DEBUG = false
|
local STATE_DEBUG = false
|
||||||
@ -337,6 +339,7 @@ end
|
|||||||
rp_mobs.on_death_default = function(self, killer)
|
rp_mobs.on_death_default = function(self, killer)
|
||||||
local radius = get_mob_death_particle_radius(self)
|
local radius = get_mob_death_particle_radius(self)
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
|
if mod_textures then
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 16,
|
amount = 16,
|
||||||
time = 0.02,
|
time = 0.02,
|
||||||
@ -352,14 +355,14 @@ rp_mobs.on_death_default = function(self, killer)
|
|||||||
exptime = { min = 0.4, max = 0.8 },
|
exptime = { min = 0.4, max = 0.8 },
|
||||||
size = { min = 8, max = 12 },
|
size = { min = 8, max = 12 },
|
||||||
drag = vector.new(1,1,1),
|
drag = vector.new(1,1,1),
|
||||||
-- TODO: Move particle to particle mod
|
|
||||||
texture = {
|
texture = {
|
||||||
name = "rp_mobs_death_smoke_anim_1.png", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
name = "rp_textures_death_smoke_anim_1.png", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
||||||
name = "rp_mobs_death_smoke_anim_2.png", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
name = "rp_textures_death_smoke_anim_2.png", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
||||||
name = "rp_mobs_death_smoke_anim_1.png^[transformFX", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
name = "rp_textures_death_smoke_anim_1.png^[transformFX", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
||||||
name = "rp_mobs_death_smoke_anim_2.png^[transformFX", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
name = "rp_textures_death_smoke_anim_2.png^[transformFX", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
end
|
||||||
minetest.sound_play({name="rp_sounds_disappear", gain=0.4}, {pos=pos, max_hear_distance=12}, true)
|
minetest.sound_play({name="rp_sounds_disappear", gain=0.4}, {pos=pos, max_hear_distance=12}, true)
|
||||||
rp_mobs.drop_death_items(self)
|
rp_mobs.drop_death_items(self)
|
||||||
end
|
end
|
||||||
|
@ -2,4 +2,4 @@ name = rp_mobs
|
|||||||
title = Repixture Mobs API
|
title = Repixture Mobs API
|
||||||
description = Core logic for animals, monsters and other moving creatures
|
description = Core logic for animals, monsters and other moving creatures
|
||||||
depends = rp_default, rp_sounds, rp_achievements, rp_hud
|
depends = rp_default, rp_sounds, rp_achievements, rp_hud
|
||||||
optional_depends = rp_itemdef_defaults
|
optional_depends = rp_itemdef_defaults, rp_textures
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
name = rp_player
|
name = rp_player
|
||||||
optional_depends = rp_sounds, rp_achievements
|
optional_depends = rp_sounds, rp_achievements, rp_textures
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
local S = minetest.get_translator("rp_player")
|
local S = minetest.get_translator("rp_player")
|
||||||
|
|
||||||
|
local mod_textures = minetest.get_modpath("rp_textures") ~= nil
|
||||||
|
|
||||||
local player_soundspec = {}
|
local player_soundspec = {}
|
||||||
local player_lastsound = {}
|
local player_lastsound = {}
|
||||||
local player_health = {}
|
local player_health = {}
|
||||||
@ -153,6 +155,7 @@ end
|
|||||||
|
|
||||||
local function on_respawnplayer(player)
|
local function on_respawnplayer(player)
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
|
if mod_textures then
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 16,
|
amount = 16,
|
||||||
time = 0.02,
|
time = 0.02,
|
||||||
@ -168,14 +171,14 @@ local function on_respawnplayer(player)
|
|||||||
exptime = { min = 1.0, max = 1.5 },
|
exptime = { min = 1.0, max = 1.5 },
|
||||||
size = { min = 8, max = 12 },
|
size = { min = 8, max = 12 },
|
||||||
drag = vector.new(1,1,1),
|
drag = vector.new(1,1,1),
|
||||||
-- TODO: Move particle to particle mod
|
|
||||||
texture = {
|
texture = {
|
||||||
name = "rp_mobs_death_smoke_anim_1.png", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
name = "rp_textures_death_smoke_anim_1.png", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
||||||
name = "rp_mobs_death_smoke_anim_2.png", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
name = "rp_textures_death_smoke_anim_2.png", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
||||||
name = "rp_mobs_death_smoke_anim_1.png^[transformFX", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
name = "rp_textures_death_smoke_anim_1.png^[transformFX", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
||||||
name = "rp_mobs_death_smoke_anim_2.png^[transformFX", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
name = "rp_textures_death_smoke_anim_2.png^[transformFX", animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = -1 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
end
|
||||||
minetest.sound_play({name="rp_sounds_disappear", gain=0.4}, {pos=pos, max_hear_distance=12}, true)
|
minetest.sound_play({name="rp_sounds_disappear", gain=0.4}, {pos=pos, max_hear_distance=12}, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -213,9 +216,6 @@ end
|
|||||||
|
|
||||||
minetest.register_on_joinplayer(on_joinplayer)
|
minetest.register_on_joinplayer(on_joinplayer)
|
||||||
minetest.register_on_leaveplayer(on_leaveplayer)
|
minetest.register_on_leaveplayer(on_leaveplayer)
|
||||||
-- TODO: Remove mod requirement if particle moved to particle mod
|
minetest.register_on_respawnplayer(on_respawnplayer)
|
||||||
if minetest.get_modpath("rp_mobs") then
|
|
||||||
minetest.register_on_respawnplayer(on_respawnplayer)
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_globalstep(step)
|
minetest.register_globalstep(step)
|
||||||
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
Loading…
x
Reference in New Issue
Block a user