Finished new weapons
This commit is contained in:
parent
3401f72c96
commit
433dc567b3
18
api.lua
18
api.lua
@ -1,4 +1,4 @@
|
|||||||
-- Mobs Api (19th March 2016) with NSSM modifications
|
-- nssm Api (19th March 2016) with NSSM modifications
|
||||||
nssm = {}
|
nssm = {}
|
||||||
nssm.mod = "redo"
|
nssm.mod = "redo"
|
||||||
|
|
||||||
@ -187,12 +187,12 @@ function line_of_sight_water(self, pos1, pos2, stepsize)
|
|||||||
|
|
||||||
local s, pos_w = minetest.line_of_sight(pos1, pos2, stepsize)
|
local s, pos_w = minetest.line_of_sight(pos1, pos2, stepsize)
|
||||||
|
|
||||||
-- normal walking and flying mobs can see you through air
|
-- normal walking and flying nssm can see you through air
|
||||||
if s == true then
|
if s == true then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- swimming mobs can see you through water
|
-- swimming nssm can see you through water
|
||||||
if s == false
|
if s == false
|
||||||
and self.fly
|
and self.fly
|
||||||
and self.fly_in == "default:water_source" then
|
and self.fly_in == "default:water_source" then
|
||||||
@ -777,7 +777,7 @@ function day_docile(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- path finding and smart mob routine by rnd
|
-- path finding and smart mob routine by rnd
|
||||||
function smart_mobs(self, s, p, dist, dtime)
|
function smart_nssm(self, s, p, dist, dtime)
|
||||||
|
|
||||||
local s1 = self.path.lastpos
|
local s1 = self.path.lastpos
|
||||||
|
|
||||||
@ -1805,7 +1805,7 @@ minetest.register_entity(name, {
|
|||||||
if self.pathfinding -- only if mob has pathfinding enabled
|
if self.pathfinding -- only if mob has pathfinding enabled
|
||||||
and enable_pathfinding then
|
and enable_pathfinding then
|
||||||
|
|
||||||
smart_mobs(self, s, p, dist, dtime)
|
smart_nssm(self, s, p, dist, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- jump attack
|
-- jump attack
|
||||||
@ -1884,7 +1884,7 @@ minetest.register_entity(name, {
|
|||||||
damage_groups = {fleshy = self.damage}
|
damage_groups = {fleshy = self.damage}
|
||||||
}, nil)
|
}, nil)
|
||||||
|
|
||||||
--NSSM Modifications for dogshoot mobs
|
--NSSM Modifications for dogshoot nssm
|
||||||
if (self.dogshoot_stop) then
|
if (self.dogshoot_stop) then
|
||||||
self.num_mele_attacks=self.num_mele_attacks+1
|
self.num_mele_attacks=self.num_mele_attacks+1
|
||||||
--minetest.chat_send_all("num_mele_attacks= "..self.num_mele_attacks)
|
--minetest.chat_send_all("num_mele_attacks= "..self.num_mele_attacks)
|
||||||
@ -1894,7 +1894,7 @@ minetest.register_entity(name, {
|
|||||||
self.direct_hit=false
|
self.direct_hit=false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--end of modifications for dogshoot mobs
|
--end of modifications for dogshoot nssm
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2623,7 +2623,7 @@ local c_chest = minetest.get_content_id("default:chest_locked")
|
|||||||
|
|
||||||
|
|
||||||
-- explosion (cannot break protected or unbreakable nodes)
|
-- explosion (cannot break protected or unbreakable nodes)
|
||||||
function mobs:explosion(pos, radius, fire, smoke, sound)
|
function nssm:explosion(pos, radius, fire, smoke, sound)
|
||||||
|
|
||||||
radius = radius or 0
|
radius = radius or 0
|
||||||
fire = fire or 0
|
fire = fire or 0
|
||||||
@ -2876,7 +2876,7 @@ function nssm:register_egg(mob, desc, background, addegg)
|
|||||||
local invimg = background
|
local invimg = background
|
||||||
|
|
||||||
if addegg == 1 then
|
if addegg == 1 then
|
||||||
invimg = "mobs_chicken_egg.png^(" .. invimg .. "^[mask:mobs_chicken_egg_overlay.png)"
|
invimg = "nssm_chicken_egg.png^(" .. invimg .. "^[mask:nssm_chicken_egg_overlay.png)"
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craftitem(mob, {
|
minetest.register_craftitem(mob, {
|
||||||
|
@ -50,7 +50,7 @@ end
|
|||||||
|
|
||||||
function nssm:explosion_particles(pos, exp_radius)
|
function nssm:explosion_particles(pos, exp_radius)
|
||||||
minetest.add_particlespawner(
|
minetest.add_particlespawner(
|
||||||
100*exp_radius, --amount
|
100*exp_radius/2, --amount
|
||||||
0.1, --time
|
0.1, --time
|
||||||
{x=pos.x-exp_radius, y=pos.y-exp_radius, z=pos.z-exp_radius}, --minpos
|
{x=pos.x-exp_radius, y=pos.y-exp_radius, z=pos.z-exp_radius}, --minpos
|
||||||
{x=pos.x+exp_radius, y=pos.y+exp_radius, z=pos.z+exp_radius}, --maxpos
|
{x=pos.x+exp_radius, y=pos.y+exp_radius, z=pos.z+exp_radius}, --maxpos
|
||||||
@ -59,7 +59,7 @@ function nssm:explosion_particles(pos, exp_radius)
|
|||||||
{x=-0.5,y=1,z=-0.5}, --minacc
|
{x=-0.5,y=1,z=-0.5}, --minacc
|
||||||
{x=0.5,y=1,z=0.5}, --maxacc
|
{x=0.5,y=1,z=0.5}, --maxacc
|
||||||
0.1, --minexptime
|
0.1, --minexptime
|
||||||
2, --maxexptime
|
4, --maxexptime
|
||||||
6, --minsize
|
6, --minsize
|
||||||
12, --maxsize
|
12, --maxsize
|
||||||
false, --collisiondetection
|
false, --collisiondetection
|
||||||
|
@ -240,9 +240,9 @@ nssm_register_weapon("kamehameha", {
|
|||||||
default_on_step(self, dtime, 10, 20, default_dir, 1, "stone", 25,0)
|
default_on_step(self, dtime, 10, 20, default_dir, 1, "stone", 25,0)
|
||||||
end,
|
end,
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
nssm:explosion(pos, 4, 1)
|
nssm:explosion(pos, 6, 1)
|
||||||
end,
|
end,
|
||||||
material = "default:stick",
|
material = "default:diamondblock",
|
||||||
description = "Kamehameha from DragonBall",
|
description = "Kamehameha from DragonBall",
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -254,7 +254,7 @@ nssm_register_weapon("kienzan", {
|
|||||||
end,
|
end,
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
end,
|
end,
|
||||||
material = "",
|
material = "nssm:king_duck_crown",
|
||||||
description = "Kienzan from DragonBall",
|
description = "Kienzan from DragonBall",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user